Index: /trunk/source/visualization/GNUmakefile
===================================================================
--- /trunk/source/visualization/GNUmakefile	(revision 941)
+++ /trunk/source/visualization/GNUmakefile	(revision 942)
@@ -26,5 +26,5 @@
 
 # For Debug mode
-# CPPFLAGS += -DG4DEBUG_VIS_OGL
+CPPFLAGS += -DG4DEBUG_VIS_OGL
 # CPPFLAGS += -DG4DEBUG_VIS_OI
 # CPPFLAGS += -DG4DEBUG_VIS_MANAGEMENT
Index: /trunk/source/visualization/OpenGL/GNUmakefile
===================================================================
--- /trunk/source/visualization/OpenGL/GNUmakefile	(revision 941)
+++ /trunk/source/visualization/OpenGL/GNUmakefile	(revision 942)
@@ -11,5 +11,5 @@
 
 # For debug mode
-# CPPFLAGS += -DG4DEBUG_VIS_OGL
+CPPFLAGS += -DG4DEBUG_VIS_OGL
 
 GLOBLIBS  = libG4vis_management.lib libG4modeling.lib
Index: /trunk/source/visualization/OpenGL/History
===================================================================
--- /trunk/source/visualization/OpenGL/History	(revision 941)
+++ /trunk/source/visualization/OpenGL/History	(revision 942)
@@ -51,5 +51,5 @@
 
 19th January 2009  Laurent Garnier
-- Change G4DEBUG defiition by G4DEBUG_VIS_OGL
+- Change G4DEBUG definition by G4DEBUG_VIS_OGL
 
 12th January 2009  John Allison
Index: /trunk/source/visualization/OpenGL/include/G4OpenGLStoredSceneHandler.hh
===================================================================
--- /trunk/source/visualization/OpenGL/include/G4OpenGLStoredSceneHandler.hh	(revision 941)
+++ /trunk/source/visualization/OpenGL/include/G4OpenGLStoredSceneHandler.hh	(revision 942)
@@ -108,5 +108,5 @@
 private:
   G4Polymarker fLastPolymarker ;
-  std::vector< G4Polymarker > fLastPolymarkers ;
+  std::vector<   std::vector< G4Polymarker> > fLastPolymarkers ;
   int nbDoublons;
 };
Index: /trunk/source/visualization/OpenGL/src/G4OpenGLStoredSceneHandler.cc
===================================================================
--- /trunk/source/visualization/OpenGL/src/G4OpenGLStoredSceneHandler.cc	(revision 941)
+++ /trunk/source/visualization/OpenGL/src/G4OpenGLStoredSceneHandler.cc	(revision 942)
@@ -221,15 +221,23 @@
   bool res = false;
   if (fLastPolymarkers.size() > 0 ) {
+
+    // Loop new poly to check
     for (unsigned int b=0; b< polymarker.size();b++) {
+      printf("check %d/%d\n",b,polymarker.size());
       res= false;
-      int size= fLastPolymarkers.size()-1;
       for (unsigned int a=0; a< fLastPolymarkers.size() ;a++) {
-        if (( fLastPolymarkers[size-a].GetPosition().x() == polymarker[b].x()) &&
-            ( fLastPolymarkers[size-a].GetPosition().y() == polymarker[b].y()) &&
-            ( fLastPolymarkers[size-a].GetPosition().z() == polymarker[b].z())) {
-          reste --;
-          res= true;
-          nbDoublons++;
-          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());
+        printf("against vect %d/%d\n",a,fLastPolymarker.size());
+        std::vector < G4Polymarker > storedPoly = fLastPolymarkers[a];
+        int size= storedPoly.size()-1;
+        for (unsigned int aPoly=0; aPoly< storedPoly[a].size() ;aPoly++) {
+          printf("against poly %d/%d\n",aPoly,storedPoly.size());
+          if (( storedPoly[size-aPoly].GetPosition().x() == polymarker[b].x()) &&
+              ( storedPoly[size-aPoly].GetPosition().y() == polymarker[b].y()) &&
+              ( storedPoly[size-aPoly].GetPosition().z() == polymarker[b].z())) {
+            reste --;
+            res= true;
+            nbDoublons++;
+            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());
+          }
         }
       }
@@ -238,6 +246,5 @@
         G4Polymarker tmp;
         tmp.SetPosition(polymarker[b]);
-        fLastPolymarkers.push_back(tmp);
-      poly.push_back(tmp);
+        poly.push_back(tmp);
       }
     }
@@ -246,8 +253,8 @@
       G4Polymarker tmp;
       tmp.SetPosition(polymarker[b]);
-      fLastPolymarkers.push_back(tmp);
       poly.push_back(tmp);
     }
   }
+  fLastPolymarkers.push_back(poly);
 #define TEST_MARKER 1
 #ifdef TEST_MARKER 
Index: /trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc
===================================================================
--- /trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc	(revision 941)
+++ /trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc	(revision 942)
@@ -54,34 +54,4 @@
 
 #include <sstream>
-
-static const char* gouraudtriangleEPS[] =
-{
-  "/bd{bind def}bind def /triangle { aload pop   setrgbcolor  aload pop 5 3",
-  "roll 4 2 roll 3 2 roll exch moveto lineto lineto closepath fill } bd",
-  "/computediff1 { 2 copy sub abs threshold ge {pop pop pop true} { exch 2",
-  "index sub abs threshold ge { pop pop true} { sub abs threshold ge } ifelse",
-  "} ifelse } bd /computediff3 { 3 copy 0 get 3 1 roll 0 get 3 1 roll 0 get",
-  "computediff1 {true} { 3 copy 1 get 3 1 roll 1 get 3 1 roll 1 get",
-  "computediff1 {true} { 3 copy 2 get 3 1 roll  2 get 3 1 roll 2 get",
-  "computediff1 } ifelse } ifelse } bd /middlecolor { aload pop 4 -1 roll",
-  "aload pop 4 -1 roll add 2 div 5 1 roll 3 -1 roll add 2 div 3 1 roll add 2",
-  "div 3 1 roll exch 3 array astore } bd /gouraudtriangle { computediff3 { 4",
-  "-1 roll aload 7 1 roll 6 -1 roll pop 3 -1 roll pop add 2 div 3 1 roll add",
-  "2 div exch 3 -1 roll aload 7 1 roll exch pop 4 -1 roll pop add 2 div 3 1",
-  "roll add 2 div exch 3 -1 roll aload 7 1 roll pop 3 -1 roll pop add 2 div 3",
-  "1 roll add 2 div exch 7 3 roll 10 -3 roll dup 3 index middlecolor 4 1 roll",
-  "2 copy middlecolor 4 1 roll 3 copy pop middlecolor 4 1 roll 13 -1 roll",
-  "aload pop 17 index 6 index 15 index 19 index 6 index 17 index 6 array",
-  "astore 10 index 10 index 14 index gouraudtriangle 17 index 5 index 17",
-  "index 19 index 5 index 19 index 6 array astore 10 index 9 index 13 index",
-  "gouraudtriangle 13 index 16 index 5 index 15 index 18 index 5 index 6",
-  "array astore 12 index 12 index 9 index gouraudtriangle 17 index 16 index",
-  "15 index 19 index 18 index 17 index 6 array astore 10 index 12 index 14",
-  "index gouraudtriangle 18 {pop} repeat } { aload pop 5 3 roll aload pop 7 3",
-  "roll aload pop 9 3 roll 4 index 6 index 4 index add add 3 div 10 1 roll 7",
-  "index 5 index 3 index add add 3 div 10 1 roll 6 index 4 index 2 index add",
-  "add 3 div 10 1 roll 9 {pop} repeat 3 array astore triangle } ifelse } bd",
-  NULL
-};
 
 G4OpenGLViewer::G4OpenGLViewer (G4OpenGLSceneHandler& scene):
@@ -453,4 +423,7 @@
 void G4OpenGLViewer::printEPS() {
   bool res;
+#ifdef G4DEBUG_VIS_OGL
+  printf("G4OpenGLViewer::printEPS file:%s Vec:%d\n",fPrintFilename.c_str(),fVectoredPs);
+#endif
   if (fVectoredPs) {
     res = printVectoredEPS();
@@ -485,4 +458,7 @@
   }
 
+#ifdef G4DEBUG_VIS_OGL
+  printf("G4OpenGLViewer::printNonVectoredEPS file:%s Vec:%d X:%d Y:%d col:%d\n",fPrintFilename.c_str(),fVectoredPs,width,height,fPrintColour);
+#endif
   FILE* fp;
   GLubyte* pixels;
Index: /trunk/source/visualization/OpenGL/src/G4OpenGLXViewer.cc
===================================================================
--- /trunk/source/visualization/OpenGL/src/G4OpenGLXViewer.cc	(revision 941)
+++ /trunk/source/visualization/OpenGL/src/G4OpenGLXViewer.cc	(revision 942)
@@ -415,7 +415,12 @@
   //cout << "print_col_callback requested with file name: " << fPrintFilename << G4endl;
   
+#ifdef G4DEBUG_VIS_OGL
+  printf("G4OpenGLXViewer::print \n");
+#endif
   if (fVectoredPs) {
     printEPS();    
   } else {
+    //    printEPS ();
+    //    return;
 
     XVisualInfo* pvi;
Index: /trunk/source/visualization/modeling/src/G4TrajectoryDrawerUtils.cc
===================================================================
--- /trunk/source/visualization/modeling/src/G4TrajectoryDrawerUtils.cc	(revision 941)
+++ /trunk/source/visualization/modeling/src/G4TrajectoryDrawerUtils.cc	(revision 942)
@@ -242,13 +242,13 @@
 
     //
-    for (size_t iPoint = 0; iPoint < trajectoryLine.size (); iPoint++) {
-      printf("DrawLineAndPoints trajectory i:%d/%d center:%f,%f,%f\n",iPoint,trajectoryLine.size (),trajectoryLine[iPoint].x(),trajectoryLine[iPoint].y(),trajectoryLine[iPoint].z());
-    }
-    for (size_t iPoint = 0; iPoint < auxiliaryPoints.size (); iPoint++) {
-      printf("DrawLineAndPoints aux i:%d/%d center:%f,%f,%f\n",iPoint,auxiliaryPoints.size (),auxiliaryPoints[iPoint].x(),auxiliaryPoints[iPoint].y(),auxiliaryPoints[iPoint].z());
-    }
-    for (size_t iPoint = 0; iPoint < stepPoints.size (); iPoint++) {
-      printf("DrawLineAndPoints step i:%d/%d center:%f,%f,%f\n",iPoint,stepPoints.size (),stepPoints[iPoint].x(),stepPoints[iPoint].y(),stepPoints[iPoint].z());
-    }
+//     for (size_t iPoint = 0; iPoint < trajectoryLine.size (); iPoint++) {
+//       printf("DrawLineAndPoints trajectory i:%d/%d center:%f,%f,%f\n",iPoint,trajectoryLine.size (),trajectoryLine[iPoint].x(),trajectoryLine[iPoint].y(),trajectoryLine[iPoint].z());
+//     }
+//     for (size_t iPoint = 0; iPoint < auxiliaryPoints.size (); iPoint++) {
+//       printf("DrawLineAndPoints aux i:%d/%d center:%f,%f,%f\n",iPoint,auxiliaryPoints.size (),auxiliaryPoints[iPoint].x(),auxiliaryPoints[iPoint].y(),auxiliaryPoints[iPoint].z());
+//     }
+//     for (size_t iPoint = 0; iPoint < stepPoints.size (); iPoint++) {
+//       printf("DrawLineAndPoints step i:%d/%d center:%f,%f,%f\n",iPoint,stepPoints.size (),stepPoints[iPoint].x(),stepPoints[iPoint].y(),stepPoints[iPoint].z());
+//     }
     //    
     G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
