65  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   66  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   67  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   68  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   69  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   70  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   71  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   72  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   73  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   74  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   75  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   76  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   77  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   78  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   79  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
 
   80  0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55
 
   87#ifdef G4OPENGL_VERSION_2
 
   88fEmulate_GL_QUADS(false),
 
   91fThreePassCapable(false),
 
   92fSecondPassForTransparencyRequested(false),
 
   93fSecondPassForTransparency(false),
 
   94fThirdPassForNonHiddenMarkersRequested(false),
 
   95fThirdPassForNonHiddenMarkers(false),
 
  107  std::map<GLuint, G4AttHolder*>::iterator i;
 
  135    if (!modelingParameters) {
 
  174          static G4int lastEventID = 0;
 
  175          if (thisEventID != lastEventID) {
 
  177            lastEventID = thisEventID;
 
  188          static G4int lastRunID = 0;
 
  189          if (thisRunID != lastRunID) {
 
  191            lastRunID = thisRunID;
 
  201        static G4int primitivesWaitingToBeFlushed = 0;
 
  202        primitivesWaitingToBeFlushed++;
 
  205        primitivesWaitingToBeFlushed = 0;
 
  213          static G4int lastEventID = 0;
 
  214          if (thisEventID != lastEventID) {
 
  215            static G4int eventsWaitingToBeFlushed = 0;
 
  216            eventsWaitingToBeFlushed++;
 
  219            eventsWaitingToBeFlushed = 0;
 
  220            lastEventID = thisEventID;
 
  255        static G4int primitivesWaitingToBeFlushed = 0;
 
  256        primitivesWaitingToBeFlushed++;
 
  259        primitivesWaitingToBeFlushed = 0;
 
  347  G4int nPoints = line.size ();
 
  348  if (nPoints <= 0) 
return;
 
  352#ifndef G4OPENGL_VERSION_2 
  353  glDisable (GL_LIGHTING);
 
  365#ifndef G4OPENGL_VERSION_2 
  366  glBegin (GL_LINE_STRIP);
 
  371  for (
G4int iPoint = 0; iPoint < nPoints; iPoint++) {
 
  373    x = line[iPoint].x(); 
 
  374    y = line[iPoint].y();
 
  375    z = line[iPoint].z();
 
  376    glVertex3d (x, y, z);
 
  380  glBeginVBO(GL_LINE_STRIP);
 
  382  for (
G4int iPoint = 0; iPoint < nPoints; iPoint++) {
 
  383    fOglVertex.push_back(line[iPoint].x());
 
  384    fOglVertex.push_back(line[iPoint].y());
 
  385    fOglVertex.push_back(line[iPoint].z());
 
  387    fOglVertex.push_back(0);
 
  388    fOglVertex.push_back(0);
 
  389    fOglVertex.push_back(1);
 
  398  if (polymarker.size() == 0) {
 
  404#ifndef G4OPENGL_VERSION_2 
  405  glDisable (GL_LIGHTING);
 
  416  if (!pGLViewer) 
return;
 
  418  if (sizeType == 
world) {  
 
  425    static G4bool hashedWarned = 
false;
 
  429        glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
 
  430        glEdgeFlag (GL_TRUE);
 
  435          G4cout << 
"Hashed fill style in G4OpenGLSceneHandler." 
  436          << 
"\n  Not implemented.  Using G4VMarker::filled." 
  444        glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
 
  451  if (sizeType == 
world) {  
 
  471      fpViewer -> GetViewParameters().GetViewpointDirection();
 
  478    for (
size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
 
  480#ifndef G4OPENGL_VERSION_2 
  481      glBegin (GL_POLYGON);
 
  482      for (i = 0, phi = startPhi; i < nSides; i++, phi += dPhi) {
 
  485    glVertex3d (p.
x(), p.
y(), p.
z());
 
  489      glBeginVBO (GL_TRIANGLE_STRIP);
 
  490      for (i = 0, phi = startPhi; i < nSides; i++, phi += dPhi) {
 
  494        fOglVertex.push_back(p.
x());
 
  495        fOglVertex.push_back(p.
y());
 
  496        fOglVertex.push_back(p.
z());
 
  498        fOglVertex.push_back(0);
 
  499        fOglVertex.push_back(0);
 
  500        fOglVertex.push_back(1);
 
  511#ifndef G4OPENGL_VERSION_2 
  516      glEnable (GL_POINT_SMOOTH); 
break;
 
  518      glDisable (GL_POINT_SMOOTH); 
break;
 
  521#ifndef G4OPENGL_VERSION_2 
  523    for (
size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
 
  525      glVertex3d(centre.
x(),centre.
y(),centre.
z());
 
  529    glBeginVBO(GL_POINTS);
 
  531    for (
size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
 
  532      fOglVertex.push_back(polymarker[iPoint].x());
 
  533      fOglVertex.push_back(polymarker[iPoint].y());
 
  534      fOglVertex.push_back(polymarker[iPoint].z());
 
  535      fOglVertex.push_back(0);
 
  536      fOglVertex.push_back(0);
 
  537      fOglVertex.push_back(1);
 
  547#ifdef G4OPENGL_VERSION_2 
  551  if (pGLViewer) pGLViewer->
DrawText(text);
 
  581  if (!pGLViewer) 
return;
 
  591  GLfloat* painting_colour;
 
  592  GLfloat clear_colour[4];
 
  593  GLfloat current_colour[4];
 
  594  glGetFloatv (GL_CURRENT_COLOR, current_colour);
 
  596  G4bool isTransparent = 
false;
 
  597  if (current_colour[3] < 1.) {  
 
  598    isTransparent = 
true;
 
  603    glGetFloatv (GL_COLOR_CLEAR_VALUE, clear_colour);
 
  604    painting_colour = clear_colour;
 
  606    painting_colour = current_colour;
 
  617#ifndef G4OPENGL_VERSION_2 
  618  glDisable (GL_LIGHTING);
 
  621  switch (drawing_style) {
 
  625    glEnable (GL_STENCIL_TEST);
 
  628    glStencilFunc (GL_ALWAYS, 0, 1);
 
  629    glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT);
 
  630    glEnable (GL_DEPTH_TEST);
 
  631    glDepthFunc (GL_LEQUAL);
 
  634      glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
 
  635      glEnable(GL_COLOR_MATERIAL);
 
  637      glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
 
  641        glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
 
  642        glEnable(GL_COLOR_MATERIAL);
 
  644    glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
 
  646        glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
 
  647        glEnable(GL_COLOR_MATERIAL);
 
  650    glPolygonMode (GL_FRONT, GL_LINE);
 
  655    glEnable (GL_DEPTH_TEST);
 
  656    glDepthFunc (GL_LEQUAL);    
 
  659      glDepthMask (GL_FALSE);  
 
  660      glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
 
  661#ifndef G4OPENGL_VERSION_2 
  662      glEnable(GL_COLOR_MATERIAL);
 
  665      glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
 
  668      glDepthMask (GL_TRUE);  
 
  670        glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
 
  671        glEnable(GL_COLOR_MATERIAL);
 
  673    glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
 
  675        glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
 
  676#ifndef G4OPENGL_VERSION_2 
  677        glEnable(GL_COLOR_MATERIAL);
 
  681    glPolygonMode (GL_FRONT, GL_FILL);
 
  684#ifndef G4OPENGL_VERSION_2 
  690    glEnable (GL_DEPTH_TEST);
 
  691    glDepthFunc (GL_LEQUAL);    
 
  693    glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
 
  699#ifndef G4OPENGL_VERSION_2 
  701  glEdgeFlag (GL_TRUE);
 
  703  fEmulate_GL_QUADS = 
true;
 
  704  glBeginVBO(GL_TRIANGLE_STRIP);
 
  714    notLastFace = polyhedron.
GetNextFacet(nEdges, vertex, edgeFlag, normals);
 
  717    for(
G4int edgeCount = 0; edgeCount < nEdges; ++edgeCount) {
 
  719      if (isAuxEdgeVisible) {
 
  720    edgeFlag[edgeCount] = 1;
 
  722#ifndef G4OPENGL_VERSION_2 
  723      if (edgeFlag[edgeCount] > 0) {
 
  725          glEdgeFlag (GL_TRUE);
 
  730          glEdgeFlag (GL_FALSE);
 
  734      glNormal3d (normals[edgeCount].x(),
 
  735          normals[edgeCount].y(),
 
  736          normals[edgeCount].z());
 
  737      glVertex3d (vertex[edgeCount].x(), 
 
  738          vertex[edgeCount].y(),
 
  739          vertex[edgeCount].z());
 
  742      fOglVertex.push_back(vertex[edgeCount].x());
 
  743      fOglVertex.push_back(vertex[edgeCount].y());
 
  744      fOglVertex.push_back(vertex[edgeCount].z());
 
  746      fOglVertex.push_back(normals[edgeCount].x());
 
  747      fOglVertex.push_back(normals[edgeCount].y());
 
  748      fOglVertex.push_back(normals[edgeCount].z());
 
  758      normals[edgeCount] = normals[0];
 
  759      vertex[edgeCount] = vertex[0];
 
  760#ifndef G4OPENGL_VERSION_2 
  761      edgeFlag[edgeCount] = -1;
 
  763        glEdgeFlag (GL_FALSE);
 
  767      glNormal3d (normals[edgeCount].x(),
 
  768          normals[edgeCount].y(), 
 
  769          normals[edgeCount].z());
 
  770      glVertex3d (vertex[edgeCount].x(),
 
  771          vertex[edgeCount].y(), 
 
  772          vertex[edgeCount].z());
 
  774      fOglVertex.push_back(vertex[edgeCount].x());
 
  775      fOglVertex.push_back(vertex[edgeCount].y());
 
  776      fOglVertex.push_back(vertex[edgeCount].z());
 
  778      fOglVertex.push_back(normals[edgeCount].x());
 
  779      fOglVertex.push_back(normals[edgeCount].y());
 
  780      fOglVertex.push_back(normals[edgeCount].z());
 
  787    "G4OpenGLSceneHandler::AddPrimitive(G4Polyhedron): WARNING" 
  788    "\n   G4Polyhedron facet with " << nEdges << 
" edges" << 
G4endl;
 
  796#ifndef G4OPENGL_VERSION_2 
  797      glDisable(GL_COLOR_MATERIAL); 
 
  800#ifndef G4OPENGL_VERSION_2 
  810      glDisable (GL_LIGHTING);
 
  813      glStencilFunc (GL_EQUAL, 0, 1);
 
  814      glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP);
 
  818      glEnable (GL_DEPTH_TEST);
 
  819      glDepthFunc (GL_LEQUAL);    
 
  822    glDepthMask (GL_FALSE);  
 
  824    glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
 
  827    glDepthMask (GL_TRUE);  
 
  830      glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
 
  834      glPolygonMode (GL_FRONT, GL_FILL);
 
  840      goto end_of_drawing_through_stencil;
 
  845    glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, painting_colour);
 
  848    glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, painting_colour);
 
  850      glColor4fv (painting_colour);
 
  851#ifndef G4OPENGL_VERSION_2 
  853      glEdgeFlag (GL_TRUE);
 
  856      fEmulate_GL_QUADS = 
true;
 
  857      glBeginVBO(GL_TRIANGLE_STRIP);
 
  860      for (
int edgeCount = 0; edgeCount < 4; ++edgeCount) {
 
  861#ifndef G4OPENGL_VERSION_2 
  862        if (edgeFlag[edgeCount] > 0) {
 
  864            glEdgeFlag (GL_TRUE);
 
  869            glEdgeFlag (GL_FALSE);
 
  873        glNormal3d (normals[edgeCount].x(),
 
  874                    normals[edgeCount].y(),
 
  875                    normals[edgeCount].z());
 
  876        glVertex3d (vertex[edgeCount].x(),
 
  877                    vertex[edgeCount].y(),
 
  878                    vertex[edgeCount].z());
 
  880        fOglVertex.push_back(vertex[edgeCount].x());
 
  881        fOglVertex.push_back(vertex[edgeCount].y());
 
  882        fOglVertex.push_back(vertex[edgeCount].z());
 
  884        fOglVertex.push_back(normals[edgeCount].x());
 
  885        fOglVertex.push_back(normals[edgeCount].y());
 
  886        fOglVertex.push_back(normals[edgeCount].z());
 
  890#ifndef G4OPENGL_VERSION_2 
  895    end_of_drawing_through_stencil:
 
  898      glStencilFunc (GL_ALWAYS, 0, 1);
 
  899      glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT);
 
  900      glDepthFunc (GL_LEQUAL);  
 
  904    glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
 
  909      glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
 
  913      glPolygonMode (GL_FRONT, GL_LINE);
 
  916      glDisable (GL_LIGHTING);
 
  917      glColor4fv (current_colour);
 
  919#ifndef G4OPENGL_VERSION_2 
  921      glEdgeFlag (GL_TRUE);
 
  924      fEmulate_GL_QUADS = 
true;
 
  925      glBeginVBO(GL_TRIANGLE_STRIP);
 
  927      for (
int edgeCount = 0; edgeCount < 4; ++edgeCount) {
 
  928#ifndef G4OPENGL_VERSION_2 
  929        if (edgeFlag[edgeCount] > 0) {
 
  931            glEdgeFlag (GL_TRUE);
 
  936            glEdgeFlag (GL_FALSE);
 
  940        glNormal3d (normals[edgeCount].x(),
 
  941                    normals[edgeCount].y(),
 
  942                    normals[edgeCount].z());
 
  943        glVertex3d (vertex[edgeCount].x(),
 
  944                    vertex[edgeCount].y(),
 
  945                    vertex[edgeCount].z());
 
  947                fOglVertex.push_back(vertex[edgeCount].x());
 
  948        fOglVertex.push_back(vertex[edgeCount].y());
 
  949        fOglVertex.push_back(vertex[edgeCount].z());
 
  951        fOglVertex.push_back(normals[edgeCount].x());
 
  952        fOglVertex.push_back(normals[edgeCount].y());
 
  953        fOglVertex.push_back(normals[edgeCount].z());
 
  957#ifndef G4OPENGL_VERSION_2 
  963      glDepthFunc (GL_LEQUAL);   
 
  965#ifndef G4OPENGL_VERSION_2 
  967      glEdgeFlag (GL_TRUE);
 
  973      fEmulate_GL_QUADS = 
true;
 
  974      glBeginVBO(GL_TRIANGLE_STRIP);
 
  977  } 
while (notLastFace);  
 
  979#ifndef G4OPENGL_VERSION_2 
  987  GLenum oldDrawArrayType = fDrawArrayType;
 
  996  fDrawArrayType = oldDrawArrayType;
 
  999  glDisable (GL_STENCIL_TEST);  
 
 1000  glDepthMask (GL_TRUE);        
 
 1001#ifndef G4OPENGL_VERSION_2 
 1002  glDisable (GL_LIGHTING);      
 
 1037  static G4bool firstPrint = 
true;
 
 1043    << 
"Special case drawing of G4VNestedParameterisation in G4OpenGLSceneHandler" 
 1052  const G4bool useFullExtent = 
true;  
 
 1062  std::multimap<const G4Colour,G4ThreeVector> positionByColour;
 
 1063  G4double halfX = 0., halfY = 0., halfZ = 0.;
 
 1067     , std::multimap<const G4Colour,G4ThreeVector>& positionByColour
 
 1069    : fpPVModel(pvModel)
 
 1070    , fPositionByColour(positionByColour)
 
 1071    , fHalfX(halfX), fHalfY(halfY), fHalfZ(halfZ)
 
 1075      const G4Colour& colour = fpPVModel->GetCurrentLV()->GetVisAttributes()->
GetColour();
 
 1077      fPositionByColour.insert(std::make_pair(colour,
position));
 
 1083    std::multimap<const G4Colour,G4ThreeVector>& fPositionByColour;
 
 1084    G4double &fHalfX, &fHalfY, &fHalfZ;
 
 1086  pseudoScene(&tmpPVModel,positionByColour,halfX,halfY,halfZ);
 
 1092  std::set<G4Colour> setOfColours;
 
 1093  for (
const auto& entry: positionByColour) {
 
 1094    setOfColours.insert(entry.first);
 
 1098    for (
const auto& colour: setOfColours) {
 
 1105  G4int nDotsTotal = 0;
 
 1106  for (
const auto& colour: setOfColours) {
 
 1112    dots.
SetInfo(container->GetName());
 
 1113    const auto range = positionByColour.equal_range(colour);
 
 1114    for (
auto posByCol = range.first; posByCol != range.second; ++posByCol) {
 
 1124      << 
"Number of dots for colour " << colour
 
 1125      << 
": " << nDots << 
G4endl;
 
 1127    nDotsTotal += nDots;
 
 1130    G4cout << 
"Total number of dots: " << nDotsTotal << 
G4endl;
 
 1139#ifdef G4OPENGL_VERSION_2 
 1142void G4OpenGLSceneHandler::OptimizeVBOForTrd(){
 
 1147   std::vector<double> vertices;
 
 1148  vertices.insert (vertices.end(),fOglVertex.begin(),fOglVertex.begin()+6*6); 
 
 1149  vertices.insert (vertices.end(),fOglVertex.begin()+9*6,fOglVertex.begin()+9*6+6); 
 
 1150  vertices.insert (vertices.end(),fOglVertex.begin()+13*6,fOglVertex.begin()+13*6+6); 
 
 1151  fOglVertex = vertices;
 
 1154    3,2,0,1,4,5,7,6, 6,0,4,3,7,2,6,1,5
 
 1156  fOglIndices.insert(fOglIndices.begin(), myarray, myarray+17);
 
 1158  fDrawArrayType = GL_TRIANGLE_STRIP;
 
 1162void G4OpenGLSceneHandler::OptimizeVBOForCons(
G4int aNoFaces){
 
 1186  std::vector<double> vertices;
 
 1190  vertices.insert (vertices.end(),fOglVertex.begin()+ (aNoFaces*4)*6,fOglVertex.begin()+(aNoFaces*4)*6+6); 
 
 1191  vertices.insert (vertices.end(),fOglVertex.begin()+ (aNoFaces*8+1)*6,fOglVertex.begin()+(aNoFaces*8+1)*6+6); 
 
 1195  for (
G4int a = 0; a<aNoFaces; a++) {
 
 1196    posInVertice = a*4*6;
 
 1197    vertices.insert (vertices.end(),fOglVertex.begin()+posInVertice,fOglVertex.begin()+posInVertice+1*6+6); 
 
 1199  vertices.insert (vertices.end(),fOglVertex.begin(),fOglVertex.begin()+1*6*6); 
 
 1200  fOglVertex = vertices;
 
 1205  for (
G4int a=0; a<aNoFaces; a++) {
 
 1206    fOglIndices.push_back(0);
 
 1207    fOglIndices.push_back(a*2+2);
 
 1210  fOglIndices.push_back(0);
 
 1211  fOglIndices.push_back(2);
 
 1214  for (
G4int a = 0; a<aNoFaces; a++) {
 
 1215    fOglIndices.push_back(a*2+2);
 
 1216    fOglIndices.push_back(a*2+1+2);
 
 1218  fOglIndices.push_back(2);
 
 1219  fOglIndices.push_back(2+1);
 
 1223  for (
G4int a=0; a<aNoFaces; a++) {
 
 1224    fOglIndices.push_back(a*2+3);
 
 1225    fOglIndices.push_back(1);
 
 1228  fOglIndices.push_back(0+3);
 
 1230  fDrawArrayType = GL_TRIANGLE_STRIP;
 
 1231  fEmulate_GL_QUADS = 
false;
 
 1234void G4OpenGLSceneHandler::glBeginVBO(GLenum type)  {
 
 1235  fDrawArrayType = type;
 
 1236  glGenBuffers(1,&fVertexBufferObject);
 
 1237  glGenBuffers(1,&fIndicesBufferObject);
 
 1241  fOglIndices.clear();
 
 1250void G4OpenGLSceneHandler::glEndVBO()  {
 
 1251  if (fOglIndices.size() == 0) {
 
 1254    std::vector<double> vertices;
 
 1256    if (fEmulate_GL_QUADS == 
true) {
 
 1257      fEmulate_GL_QUADS = 
false;
 
 1274      for (
unsigned int a=0; a<fOglVertex.size(); a+=6*4) {
 
 1275        vertices.insert (vertices.end(),fOglVertex.begin()+a,fOglVertex.begin()+a+1*6+6); 
 
 1278        if (a+4*6+5 < fOglVertex.size()) {
 
 1279          if ((fOglVertex[a+2*6+0] != fOglVertex[a+5*6+0]) || 
 
 1280              (fOglVertex[a+2*6+1] != fOglVertex[a+5*6+1]) || 
 
 1281              (fOglVertex[a+2*6+2] != fOglVertex[a+5*6+2]) || 
 
 1282              (fOglVertex[a+2*6+3] != fOglVertex[a+5*6+3]) || 
 
 1283              (fOglVertex[a+2*6+4] != fOglVertex[a+5*6+4]) || 
 
 1284              (fOglVertex[a+2*6+5] != fOglVertex[a+5*6+5]) || 
 
 1286              (fOglVertex[a+3*6+0] != fOglVertex[a+4*6+0]) || 
 
 1287              (fOglVertex[a+3*6+1] != fOglVertex[a+4*6+1]) || 
 
 1288              (fOglVertex[a+3*6+2] != fOglVertex[a+4*6+2]) || 
 
 1289              (fOglVertex[a+3*6+3] != fOglVertex[a+4*6+3]) || 
 
 1290              (fOglVertex[a+3*6+4] != fOglVertex[a+4*6+4]) || 
 
 1291              (fOglVertex[a+3*6+5] != fOglVertex[a+4*6+5])) { 
 
 1293            vertices.insert (vertices.end(),fOglVertex.begin()+a+3*6,fOglVertex.begin()+a+3*6+6); 
 
 1294            vertices.insert (vertices.end(),fOglVertex.begin()+a+2*6,fOglVertex.begin()+a+2*6+6); 
 
 1296            drawVBOArray(vertices);
 
 1300          vertices.insert (vertices.end(),fOglVertex.begin()+a+3*6,fOglVertex.begin()+a+3*6+6); 
 
 1301          vertices.insert (vertices.end(),fOglVertex.begin()+a+2*6,fOglVertex.begin()+a+2*6+6); 
 
 1304      fOglVertex = vertices;
 
 1307    drawVBOArray(fOglVertex);
 
 1312    glBindBuffer(GL_ARRAY_BUFFER, fVertexBufferObject);
 
 1315    int sizeV = fOglVertex.size();
 
 1318    glBufferData(GL_ARRAY_BUFFER, 
sizeof(
double)*sizeV, &fOglVertex[0], GL_STATIC_DRAW);
 
 1321    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, fIndicesBufferObject);
 
 1324    int sizeI = fOglIndices.size();
 
 1325    glBufferData(GL_ELEMENT_ARRAY_BUFFER,
sizeof(
int)*sizeI, &fOglIndices[0], GL_STATIC_DRAW);
 
 1330    glBindBuffer(GL_ARRAY_BUFFER, fVertexBufferObject);
 
 1331    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, fIndicesBufferObject);
 
 1336      glEnableVertexAttribArray(pGLViewer->fVertexPositionAttribute);
 
 1338      glVertexAttribPointer(pGLViewer->fVertexPositionAttribute,
 
 1350    glBindBuffer(GL_ARRAY_BUFFER, fVertexBufferObject);
 
 1351    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, fIndicesBufferObject);
 
 1353    glDrawElements(fDrawArrayType, fOglIndices.size(), GL_UNSIGNED_SHORT, 0);
 
 1356      glDisableVertexAttribArray(pGLViewer->fVertexPositionAttribute);
 
 1360    glDeleteBuffers(1,&fVertexBufferObject);
 
 1364void G4OpenGLSceneHandler::drawVBOArray(std::vector<double> vertices)  {
 
 1365  glGenBuffers(1,&fVertexBufferObject);
 
 1366  glGenBuffers(1,&fIndicesBufferObject);
 
 1369  glBindBuffer(GL_ARRAY_BUFFER, fVertexBufferObject);
 
 1371  int s = vertices.size();
 
 1372  glBufferData(GL_ARRAY_BUFFER, 
sizeof(
double)*
s, &vertices[0], GL_STATIC_DRAW);
 
 1377  glBindBuffer(GL_ARRAY_BUFFER, fVertexBufferObject);
 
 1382    glEnableVertexAttribArray(pGLViewer->fVertexPositionAttribute);
 
 1392    glVertexAttribPointer(pGLViewer->fVertexPositionAttribute,
 
 1403  glDrawArrays(fDrawArrayType, 
 
 1404               0, vertices.size()/6);
 
 1406    glDisableClientState( GL_VERTEX_ARRAY );
 
 1410  glDeleteBuffers(1,&fVertexBufferObject);
 
static constexpr double twopi
static constexpr double s
static constexpr double pi
CLHEP::Hep3Vector G4ThreeVector
void print(G4double elem)
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4double GetYHalfLength() const
G4double GetZHalfLength() const
G4double GetXHalfLength() const
static G4bool GetColour(const G4String &key, G4Colour &result)
MeshType GetMeshType() const
G4VPhysicalVolume * GetContainerVolume() const
const G4Transform3D & GetTransform() const
G4int GetMeshDepth() const
const G4Event * GetEvent() const
void SetCullingInvisible(G4bool)
G4DisplacedSolid * CreateCutawaySolid()
virtual void EndPrimitives()
G4bool fThirdPassForNonHiddenMarkersRequested
void ClearAndDestroyAtts()
virtual void BeginPrimitives2D(const G4Transform3D &objectTransformation)
G4bool fThirdPassForNonHiddenMarkers
static FlushAction fFlushAction
static G4int fEntitiesFlushInterval
void PreAddSolid(const G4Transform3D &objectTransformation, const G4VisAttributes &)
void AddPrimitive(const G4Polyline &)
void AddCompound(const G4VTrajectory &)
virtual void EndPrimitives2D()
virtual void BeginPrimitives(const G4Transform3D &objectTransformation)
static const GLubyte fStippleMaskHashed[128]
G4bool fSecondPassForTransparency
virtual ~G4OpenGLSceneHandler()
void AddSolid(const G4Box &)
G4DisplacedSolid * CreateSectionSolid()
G4OpenGLSceneHandler(G4VGraphicsSystem &system, G4int id, const G4String &name="")
std::map< GLuint, G4AttHolder * > fPickMap
G4bool fSecondPassForTransparencyRequested
void ChangeLineWidth(G4double width)
virtual void DrawText(const G4Text &)
void ChangePointSize(G4double size)
void DescribeYourselfTo(G4VGraphicsScene &)
void SetMarkerType(MarkerType)
MarkerType GetMarkerType() const
void AddSolid(const G4Box &solid)
static G4RunManager * GetMasterRunManager()
const G4Run * GetCurrentRun() const
G4bool GetRefreshAtEndOfEvent() const
G4bool GetRefreshAtEndOfRun() const
virtual void SetInfo(const G4String &info)
FillStyle GetFillStyle() const
void SetSize(SizeType, G4double)
G4Point3D GetPosition() const
const G4ModelingParameters * GetModelingParameters() const
G4int GetNoOfSides(const G4VisAttributes *)
virtual void EndPrimitives()
virtual G4DisplacedSolid * CreateSectionSolid()
virtual void ProcessScene()
G4double GetMarkerSize(const G4VMarker &, MarkerSizeType &)
virtual void PreAddSolid(const G4Transform3D &objectTransformation, const G4VisAttributes &)
virtual void EndPrimitives2D()
const G4VisAttributes * fpVisAttribs
virtual void BeginPrimitives2D(const G4Transform3D &objectTransformation=G4Transform3D())
G4bool fReadyForTransients
G4ViewParameters::DrawingStyle GetDrawingStyle(const G4VisAttributes *)
virtual void BeginPrimitives(const G4Transform3D &objectTransformation=G4Transform3D())
G4double GetLineWidth(const G4VisAttributes *)
virtual void ClearStore()
virtual void AddCompound(const G4VTrajectory &)
G4bool GetAuxEdgeVisible(const G4VisAttributes *)
const G4ViewParameters & GetViewParameters() const
const G4Vector3D & GetUpVector() const
static Verbosity GetVerbosity()
void SetVisAttributes(const G4VisAttributes *)
BasicVector3D< T > cross(const BasicVector3D< T > &v) const
BasicVector3D< T > & rotate(T a, const BasicVector3D< T > &v)
G4int GetNoFacets() const
G4bool GetNextFacet(G4int &n, G4Point3D *nodes, G4int *edgeFlags=0, G4Normal3D *normals=0) const
const char * name(G4int ptype)