Changeset 942 for trunk/source/visualization/OpenGL
- Timestamp:
- Mar 10, 2009, 3:30:40 PM (16 years ago)
- Location:
- trunk/source/visualization/OpenGL
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/OpenGL/GNUmakefile
r940 r942 11 11 12 12 # For debug mode 13 #CPPFLAGS += -DG4DEBUG_VIS_OGL13 CPPFLAGS += -DG4DEBUG_VIS_OGL 14 14 15 15 GLOBLIBS = libG4vis_management.lib libG4modeling.lib -
trunk/source/visualization/OpenGL/History
r941 r942 51 51 52 52 19th January 2009 Laurent Garnier 53 - Change G4DEBUG defi ition by G4DEBUG_VIS_OGL53 - Change G4DEBUG definition by G4DEBUG_VIS_OGL 54 54 55 55 12th January 2009 John Allison -
trunk/source/visualization/OpenGL/include/G4OpenGLStoredSceneHandler.hh
r938 r942 108 108 private: 109 109 G4Polymarker fLastPolymarker ; 110 std::vector< G4Polymarker> fLastPolymarkers ;110 std::vector< std::vector< G4Polymarker> > fLastPolymarkers ; 111 111 int nbDoublons; 112 112 }; -
trunk/source/visualization/OpenGL/src/G4OpenGLStoredSceneHandler.cc
r938 r942 221 221 bool res = false; 222 222 if (fLastPolymarkers.size() > 0 ) { 223 224 // Loop new poly to check 223 225 for (unsigned int b=0; b< polymarker.size();b++) { 226 printf("check %d/%d\n",b,polymarker.size()); 224 227 res= false; 225 int size= fLastPolymarkers.size()-1;226 228 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 } 234 242 } 235 243 } … … 238 246 G4Polymarker tmp; 239 247 tmp.SetPosition(polymarker[b]); 240 fLastPolymarkers.push_back(tmp); 241 poly.push_back(tmp); 248 poly.push_back(tmp); 242 249 } 243 250 } … … 246 253 G4Polymarker tmp; 247 254 tmp.SetPosition(polymarker[b]); 248 fLastPolymarkers.push_back(tmp);249 255 poly.push_back(tmp); 250 256 } 251 257 } 258 fLastPolymarkers.push_back(poly); 252 259 #define TEST_MARKER 1 253 260 #ifdef TEST_MARKER -
trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc
r941 r942 54 54 55 55 #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 NULL85 };86 56 87 57 G4OpenGLViewer::G4OpenGLViewer (G4OpenGLSceneHandler& scene): … … 453 423 void G4OpenGLViewer::printEPS() { 454 424 bool res; 425 #ifdef G4DEBUG_VIS_OGL 426 printf("G4OpenGLViewer::printEPS file:%s Vec:%d\n",fPrintFilename.c_str(),fVectoredPs); 427 #endif 455 428 if (fVectoredPs) { 456 429 res = printVectoredEPS(); … … 485 458 } 486 459 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 487 463 FILE* fp; 488 464 GLubyte* pixels; -
trunk/source/visualization/OpenGL/src/G4OpenGLXViewer.cc
r941 r942 415 415 //cout << "print_col_callback requested with file name: " << fPrintFilename << G4endl; 416 416 417 #ifdef G4DEBUG_VIS_OGL 418 printf("G4OpenGLXViewer::print \n"); 419 #endif 417 420 if (fVectoredPs) { 418 421 printEPS(); 419 422 } else { 423 // printEPS (); 424 // return; 420 425 421 426 XVisualInfo* pvi;
Note: See TracChangeset
for help on using the changeset viewer.