Changeset 1238


Ignore:
Timestamp:
Mar 3, 2010, 5:51:36 PM (14 years ago)
Author:
garnier
Message:

otpimisations

Location:
trunk/source/visualization
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/OpenGL/History

    r1228 r1238  
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     193rd March 2010 Laurent Garnier
     20- G4OpenGLViewer : Add protection against null pointer scene
    1921
    20226th January 2010  Laurent Garnier (needs interfaces-V09-02-07 + laurent-QtUI_with_tabs_v1)
  • trunk/source/visualization/OpenGL/src/G4OpenGLImmediateSceneHandler.cc

    r1125 r1238  
    157157
    158158  // See all primitives immediately...
    159   glFlush ();
     159  //  glFlush ();
    160160
    161161  G4OpenGLSceneHandler::EndPrimitives ();
     
    216216void G4OpenGLImmediateSceneHandler::RequestPrimitives (const G4VSolid& solid)
    217217{
     218#ifdef G4DEBUG_VIS_OGL
     219  printf("G4OpenGLImmediateSceneHandler::RequestPrimitives \n");
     220#endif
    218221  if (fReadyForTransients) {
    219222    // Always draw transient solids, e.g., hits represented as solids.
     
    251254  // Else invoke base class method...
    252255  G4VSceneHandler::RequestPrimitives (solid);
     256#ifdef G4DEBUG_VIS_OGL
     257  printf("G4OpenGLImmediateSceneHandler::RequestPrimitives END\n");
     258#endif
    253259}
    254260
  • trunk/source/visualization/OpenGL/src/G4OpenGLSceneHandler.cc

    r1196 r1238  
    199199{
    200200#ifdef G4DEBUG_VIS_OGL
    201   printf("G4OpenGLSceneHandler::AddPrimitive polymarker");
     201// printf("G4OpenGLSceneHandler::AddPrimitive polymarker");
    202202#endif
    203203  G4int nPoints = polymarker.size ();
     
    218218    {
    219219#ifdef G4DEBUG_VIS_OGL
    220   printf(" dots ");
     220// printf(" dots ");
    221221#endif
    222222      for (size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
     
    232232    {
    233233#ifdef G4DEBUG_VIS_OGL
    234   printf(" circle ");
     234// printf(" circle ");
    235235#endif
    236236      for (size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
     
    244244    {
    245245#ifdef G4DEBUG_VIS_OGL
    246   printf(" square ");
     246// printf(" square ");
    247247#endif
    248248      for (size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
     
    256256
    257257#ifdef G4DEBUG_VIS_OGL
    258   printf(" \n");
     258// printf(" \n");
    259259#endif
    260260  fProcessingPolymarker = false;
     
    336336  if (fpViewer -> GetViewParameters ().IsMarkerNotHidden ()) {
    337337#ifdef G4DEBUG_VIS_OGL
    338     printf("+");
     338    //    printf("+");
    339339#endif
    340340    glDisable (GL_DEPTH_TEST);
    341341  } else {
    342342#ifdef G4DEBUG_VIS_OGL
    343     printf("-");
     343    //    printf("-");
    344344#endif
    345345    glEnable (GL_DEPTH_TEST); glDepthFunc (GL_LESS);}
  • trunk/source/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc

    r1235 r1238  
    113113  // And we loose the redraw of things !
    114114 
    115   ComputeView();
    116 #ifdef G4DEBUG_VIS_OGL
    117   printf("G4OpenGLStoredQtViewer::DrawView  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n");
    118 #endif
     115  //  ComputeView();
     116#ifdef G4DEBUG_VIS_OGL
     117  printf("G4OpenGLStoredQtViewer::DrawView  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ llllllllllllllllllllllllllllllll\n");
     118#endif
     119  updateQWidget();
    119120}
    120121
     
    218219{
    219220#ifdef G4DEBUG_VIS_OGL
    220   printf("G4OpenGLStoredQtViewer::paintGL ready:%d fHasTo:%d??\n",fReadyToPaint,fHasToRepaint);
     221  printf("G4OpenGLStoredQtViewer::paintGL ready:%d fHasTo:%d?? context:%d\n",fReadyToPaint,fHasToRepaint,context());
    221222#endif
    222223  if (!fReadyToPaint) {
     
    252253
    253254  SetView();
    254          
     255
    255256  ClearView (); //ok, put the background correct
    256257  ComputeView();
     
    264265
    265266void G4OpenGLStoredQtViewer::paintEvent(QPaintEvent *event) {
    266   //  fHasToRepaint= false;
    267 #ifdef G4DEBUG_VIS_OGL
    268   printf("\n\nG4OpenGLStoredQtViewer::paintEvent VVVVVVVVV %d\n",fHasToRepaint);
     267#ifdef G4DEBUG_VIS_OGL
     268  printf("\n\nG4OpenGLStoredQtViewer::paintEvent VVVVVVVVV %d context : %d\n",fHasToRepaint,context());
    269269#endif
    270270  if ( fHasToRepaint) {
  • trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc

    r1233 r1238  
    100100  //  glDisable (GL_LINE_SMOOTH);
    101101  //  glDisable (GL_POLYGON_SMOOTH);
    102 
    103102}
    104103
     
    238237
    239238  if (!fSceneHandler.GetScene()) {
    240     G4cerr << "G4OpenGLStoredViewer: Creating a Viewer without a scene is not allowed. \nPlease use /vis/scene/create before /vis/open/.... "
    241            << G4endl;
    242239    return;
    243240  }
     
    782779GLdouble G4OpenGLViewer::getSceneNearWidth()
    783780{
     781  if (!fSceneHandler.GetScene()) {
     782    return 0;
     783  }
    784784  const G4Point3D targetPoint
    785785    = fSceneHandler.GetScene()->GetStandardTargetPoint()
     
    794794GLdouble G4OpenGLViewer::getSceneFarWidth()
    795795{
     796  if (!fSceneHandler.GetScene()) {
     797    return 0;
     798  }
    796799  const G4Point3D targetPoint
    797800    = fSceneHandler.GetScene()->GetStandardTargetPoint()
     
    808811GLdouble G4OpenGLViewer::getSceneDepth()
    809812{
     813  if (!fSceneHandler.GetScene()) {
     814    return 0;
     815  }
    810816  const G4Point3D targetPoint
    811817    = fSceneHandler.GetScene()->GetStandardTargetPoint()
  • trunk/source/visualization/management/GNUmakefile

    r1170 r1238  
    1010
    1111# For debug mode
    12 CPPFLAGS += -DG4DEBUG_VIS_MANAGEMENT
     12# CPPFLAGS += -DG4DEBUG_VIS_MANAGEMENT
    1313
    1414GLOBLIBS  = libG4modeling.lib
  • trunk/source/visualization/management/src/G4VSceneHandler.cc

    r1168 r1238  
    471471
    472472void G4VSceneHandler::RequestPrimitives (const G4VSolid& solid) {
     473#ifdef G4DEBUG_VIS_MANAGEMENT
     474  printf("G4VSceneHandler::RequestPrimitives\n");
     475#endif
    473476  BeginPrimitives (*fpObjectTransformation);
    474477  G4NURBS* pNURBS = 0;
     
    517520    break;
    518521  }
     522#ifdef G4DEBUG_VIS_MANAGEMENT
     523  printf("G4VSceneHandler::RequestPrimitives BEFORE END\n");
     524#endif
    519525  EndPrimitives ();
     526#ifdef G4DEBUG_VIS_MANAGEMENT
     527  printf("G4VSceneHandler::RequestPrimitives END\n");
     528#endif
    520529}
    521530
    522531void G4VSceneHandler::ProcessScene (G4VViewer&) {
     532#ifdef G4DEBUG_VIS_MANAGEMENT
     533  printf("G4VSceneHandler::ProcessScene\n");
     534#endif
    523535
    524536  if (!fpScene) return;
     
    655667
    656668  fMarkForClearingTransientStore = tmpMarkForClearingTransientStore;
     669#ifdef G4DEBUG_VIS_MANAGEMENT
     670  printf("G4VSceneHandler::ProcessScene END\n");
     671#endif
    657672}
    658673
Note: See TracChangeset for help on using the changeset viewer.