Changeset 942


Ignore:
Timestamp:
Mar 10, 2009, 3:30:40 PM (15 years ago)
Author:
garnier
Message:

en test

Location:
trunk/source/visualization
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/GNUmakefile

    r940 r942  
    2626
    2727# For Debug mode
    28 # CPPFLAGS += -DG4DEBUG_VIS_OGL
     28CPPFLAGS += -DG4DEBUG_VIS_OGL
    2929# CPPFLAGS += -DG4DEBUG_VIS_OI
    3030# CPPFLAGS += -DG4DEBUG_VIS_MANAGEMENT
  • trunk/source/visualization/OpenGL/GNUmakefile

    r940 r942  
    1111
    1212# For debug mode
    13 # CPPFLAGS += -DG4DEBUG_VIS_OGL
     13CPPFLAGS += -DG4DEBUG_VIS_OGL
    1414
    1515GLOBLIBS  = libG4vis_management.lib libG4modeling.lib
  • trunk/source/visualization/OpenGL/History

    r941 r942  
    5151
    525219th January 2009  Laurent Garnier
    53 - Change G4DEBUG defiition by G4DEBUG_VIS_OGL
     53- Change G4DEBUG definition by G4DEBUG_VIS_OGL
    5454
    555512th January 2009  John Allison
  • trunk/source/visualization/OpenGL/include/G4OpenGLStoredSceneHandler.hh

    r938 r942  
    108108private:
    109109  G4Polymarker fLastPolymarker ;
    110   std::vector< G4Polymarker > fLastPolymarkers ;
     110  std::vector<   std::vector< G4Polymarker> > fLastPolymarkers ;
    111111  int nbDoublons;
    112112};
  • trunk/source/visualization/OpenGL/src/G4OpenGLStoredSceneHandler.cc

    r938 r942  
    221221  bool res = false;
    222222  if (fLastPolymarkers.size() > 0 ) {
     223
     224    // Loop new poly to check
    223225    for (unsigned int b=0; b< polymarker.size();b++) {
     226      printf("check %d/%d\n",b,polymarker.size());
    224227      res= false;
    225       int size= fLastPolymarkers.size()-1;
    226228      for (unsigned int a=0; a< fLastPolymarkers.size() ;a++) {
    227         if (( fLastPolymarkers[size-a].GetPosition().x() == polymarker[b].x()) &&
    228             ( fLastPolymarkers[size-a].GetPosition().y() == polymarker[b].y()) &&
    229             ( fLastPolymarkers[size-a].GetPosition().z() == polymarker[b].z())) {
    230           reste --;
    231           res= true;
    232           nbDoublons++;
    233           printf("G4OpenGLStoredSceneHandler::AddPrimitive  DOUBLON %d total:%d et pos %d reste %d ----------- point %f %f %f\n",size-a,nbDoublons,b,reste,polymarker[b].x(),polymarker[b].y(),polymarker[b].z());
     229        printf("against vect %d/%d\n",a,fLastPolymarker.size());
     230        std::vector < G4Polymarker > storedPoly = fLastPolymarkers[a];
     231        int size= storedPoly.size()-1;
     232        for (unsigned int aPoly=0; aPoly< storedPoly[a].size() ;aPoly++) {
     233          printf("against poly %d/%d\n",aPoly,storedPoly.size());
     234          if (( storedPoly[size-aPoly].GetPosition().x() == polymarker[b].x()) &&
     235              ( storedPoly[size-aPoly].GetPosition().y() == polymarker[b].y()) &&
     236              ( storedPoly[size-aPoly].GetPosition().z() == polymarker[b].z())) {
     237            reste --;
     238            res= true;
     239            nbDoublons++;
     240            printf("G4OpenGLStoredSceneHandler::AddPrimitive  PT %d/%d ALREADY FOUND TOT:%d. OLD pos %d/%d in %d PolyMarkerList STILL %d Marker in list. Point is %f %f %f\n",b,polymarker.size(),  nbDoublons,  aPoly,storedPoly[a].size(),a   ,reste,polymarker[b].x(),polymarker[b].y(),polymarker[b].z());
     241          }
    234242        }
    235243      }
     
    238246        G4Polymarker tmp;
    239247        tmp.SetPosition(polymarker[b]);
    240         fLastPolymarkers.push_back(tmp);
    241       poly.push_back(tmp);
     248        poly.push_back(tmp);
    242249      }
    243250    }
     
    246253      G4Polymarker tmp;
    247254      tmp.SetPosition(polymarker[b]);
    248       fLastPolymarkers.push_back(tmp);
    249255      poly.push_back(tmp);
    250256    }
    251257  }
     258  fLastPolymarkers.push_back(poly);
    252259#define TEST_MARKER 1
    253260#ifdef TEST_MARKER
  • trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc

    r941 r942  
    5454
    5555#include <sstream>
    56 
    57 static const char* gouraudtriangleEPS[] =
    58 {
    59   "/bd{bind def}bind def /triangle { aload pop   setrgbcolor  aload pop 5 3",
    60   "roll 4 2 roll 3 2 roll exch moveto lineto lineto closepath fill } bd",
    61   "/computediff1 { 2 copy sub abs threshold ge {pop pop pop true} { exch 2",
    62   "index sub abs threshold ge { pop pop true} { sub abs threshold ge } ifelse",
    63   "} ifelse } bd /computediff3 { 3 copy 0 get 3 1 roll 0 get 3 1 roll 0 get",
    64   "computediff1 {true} { 3 copy 1 get 3 1 roll 1 get 3 1 roll 1 get",
    65   "computediff1 {true} { 3 copy 2 get 3 1 roll  2 get 3 1 roll 2 get",
    66   "computediff1 } ifelse } ifelse } bd /middlecolor { aload pop 4 -1 roll",
    67   "aload pop 4 -1 roll add 2 div 5 1 roll 3 -1 roll add 2 div 3 1 roll add 2",
    68   "div 3 1 roll exch 3 array astore } bd /gouraudtriangle { computediff3 { 4",
    69   "-1 roll aload 7 1 roll 6 -1 roll pop 3 -1 roll pop add 2 div 3 1 roll add",
    70   "2 div exch 3 -1 roll aload 7 1 roll exch pop 4 -1 roll pop add 2 div 3 1",
    71   "roll add 2 div exch 3 -1 roll aload 7 1 roll pop 3 -1 roll pop add 2 div 3",
    72   "1 roll add 2 div exch 7 3 roll 10 -3 roll dup 3 index middlecolor 4 1 roll",
    73   "2 copy middlecolor 4 1 roll 3 copy pop middlecolor 4 1 roll 13 -1 roll",
    74   "aload pop 17 index 6 index 15 index 19 index 6 index 17 index 6 array",
    75   "astore 10 index 10 index 14 index gouraudtriangle 17 index 5 index 17",
    76   "index 19 index 5 index 19 index 6 array astore 10 index 9 index 13 index",
    77   "gouraudtriangle 13 index 16 index 5 index 15 index 18 index 5 index 6",
    78   "array astore 12 index 12 index 9 index gouraudtriangle 17 index 16 index",
    79   "15 index 19 index 18 index 17 index 6 array astore 10 index 12 index 14",
    80   "index gouraudtriangle 18 {pop} repeat } { aload pop 5 3 roll aload pop 7 3",
    81   "roll aload pop 9 3 roll 4 index 6 index 4 index add add 3 div 10 1 roll 7",
    82   "index 5 index 3 index add add 3 div 10 1 roll 6 index 4 index 2 index add",
    83   "add 3 div 10 1 roll 9 {pop} repeat 3 array astore triangle } ifelse } bd",
    84   NULL
    85 };
    8656
    8757G4OpenGLViewer::G4OpenGLViewer (G4OpenGLSceneHandler& scene):
     
    453423void G4OpenGLViewer::printEPS() {
    454424  bool res;
     425#ifdef G4DEBUG_VIS_OGL
     426  printf("G4OpenGLViewer::printEPS file:%s Vec:%d\n",fPrintFilename.c_str(),fVectoredPs);
     427#endif
    455428  if (fVectoredPs) {
    456429    res = printVectoredEPS();
     
    485458  }
    486459
     460#ifdef G4DEBUG_VIS_OGL
     461  printf("G4OpenGLViewer::printNonVectoredEPS file:%s Vec:%d X:%d Y:%d col:%d\n",fPrintFilename.c_str(),fVectoredPs,width,height,fPrintColour);
     462#endif
    487463  FILE* fp;
    488464  GLubyte* pixels;
  • trunk/source/visualization/OpenGL/src/G4OpenGLXViewer.cc

    r941 r942  
    415415  //cout << "print_col_callback requested with file name: " << fPrintFilename << G4endl;
    416416 
     417#ifdef G4DEBUG_VIS_OGL
     418  printf("G4OpenGLXViewer::print \n");
     419#endif
    417420  if (fVectoredPs) {
    418421    printEPS();   
    419422  } else {
     423    //    printEPS ();
     424    //    return;
    420425
    421426    XVisualInfo* pvi;
  • trunk/source/visualization/modeling/src/G4TrajectoryDrawerUtils.cc

    r940 r942  
    242242
    243243    //
    244     for (size_t iPoint = 0; iPoint < trajectoryLine.size (); iPoint++) {
    245       printf("DrawLineAndPoints trajectory i:%d/%d center:%f,%f,%f\n",iPoint,trajectoryLine.size (),trajectoryLine[iPoint].x(),trajectoryLine[iPoint].y(),trajectoryLine[iPoint].z());
    246     }
    247     for (size_t iPoint = 0; iPoint < auxiliaryPoints.size (); iPoint++) {
    248       printf("DrawLineAndPoints aux i:%d/%d center:%f,%f,%f\n",iPoint,auxiliaryPoints.size (),auxiliaryPoints[iPoint].x(),auxiliaryPoints[iPoint].y(),auxiliaryPoints[iPoint].z());
    249     }
    250     for (size_t iPoint = 0; iPoint < stepPoints.size (); iPoint++) {
    251       printf("DrawLineAndPoints step i:%d/%d center:%f,%f,%f\n",iPoint,stepPoints.size (),stepPoints[iPoint].x(),stepPoints[iPoint].y(),stepPoints[iPoint].z());
    252     }
     244//     for (size_t iPoint = 0; iPoint < trajectoryLine.size (); iPoint++) {
     245//       printf("DrawLineAndPoints trajectory i:%d/%d center:%f,%f,%f\n",iPoint,trajectoryLine.size (),trajectoryLine[iPoint].x(),trajectoryLine[iPoint].y(),trajectoryLine[iPoint].z());
     246//     }
     247//     for (size_t iPoint = 0; iPoint < auxiliaryPoints.size (); iPoint++) {
     248//       printf("DrawLineAndPoints aux i:%d/%d center:%f,%f,%f\n",iPoint,auxiliaryPoints.size (),auxiliaryPoints[iPoint].x(),auxiliaryPoints[iPoint].y(),auxiliaryPoints[iPoint].z());
     249//     }
     250//     for (size_t iPoint = 0; iPoint < stepPoints.size (); iPoint++) {
     251//       printf("DrawLineAndPoints step i:%d/%d center:%f,%f,%f\n",iPoint,stepPoints.size (),stepPoints[iPoint].x(),stepPoints[iPoint].y(),stepPoints[iPoint].z());
     252//     }
    253253    //   
    254254    G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
Note: See TracChangeset for help on using the changeset viewer.