Ignore:
Timestamp:
Oct 2, 2008, 10:29:48 AM (16 years ago)
Author:
garnier
Message:

protection against no scene + Qapp could be now get on external app

Location:
trunk/source/visualization/OpenGL/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r857 r858  
    317317
    318318  // launch Qt if not
    319   G4Qt* interactorManager = G4Qt::getInstance ();
     319  G4Qt::getInstance ();
    320320
    321321  fLastPos3 = QPoint(-1,-1);   
     
    689689#if QT_VERSION < 0x040000
    690690#if QT_VERSION < 0x030200
    691   QAction *movieParameters =  new QAction("&Movie parameters...","&Make movie ...",CTRL+Key_M,mActions,0,true);
    692 #else
    693   QAction *movieParameters =  new QAction("&Movie parameters...",CTRL+Key_M,mActions);
     691  QAction *movieParameters =  new QAction("&Make Movie...","&Make movie ...",CTRL+Key_M,mActions,0,true);
     692#else
     693  QAction *movieParameters =  new QAction("&Make Movie...",CTRL+Key_M,mActions);
    694694#endif
    695695  movieParameters->addTo(mActions);
     
    17101710  printf("should rescale \n");
    17111711#endif
    1712   GLfloat* feedback_buffer;
    1713   GLint returned;
    1714   FILE* file;
     1712  //  GLfloat* feedback_buffer;
     1713  //  GLint returned;
     1714  //  FILE* file;
    17151715 
    17161716//   feedback_buffer = new GLfloat[size];
  • trunk/source/visualization/OpenGL/src/G4OpenGLStoredQt.cc

    r850 r858  
    6262
    6363G4VViewer* G4OpenGLStoredQt::CreateViewer
    64 (G4VSceneHandler& scene, const G4String& name) {
    6564#ifdef GEANT4_QT_DEBUG
    6665  printf("G4OpenGLStoredQt::CreateViewer \n");
    6766#endif
     67(G4VSceneHandler& scene, const G4String& name) {
    6868  G4VViewer* pView =
    6969    new G4OpenGLStoredQtViewer
  • trunk/source/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc

    r850 r858  
    5858  nbPaint =0;
    5959  hasToRepaint =false;
     60
     61  // if no scene...
     62  if (fSceneHandler.GetScene() == 0) {
     63    G4cerr << "G4OpenGLStoredQtViewer: Creating a Viewer without a scene is not allowed. \nPlease use /vis/scene/create before /vis/open/.... "
     64           << G4endl;
     65    return;
     66  }
    6067  if (fViewId < 0) return;  // In case error in base class instantiation.
    6168}
     
    7683void G4OpenGLStoredQtViewer::Initialise() {
    7784#ifdef GEANT4_QT_DEBUG
    78   printf("GLWidget::Initialise \n");
     85  printf("G4OpenGLStoredQtViewer::Initialise 1\n");
    7986#endif
    8087  readyToPaint = false;
  • trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc

    r850 r858  
    150150
    151151void G4OpenGLViewer::SetView () {
    152  
     152
     153  if (!fSceneHandler.GetScene()) {
     154    G4cerr << "G4OpenGLStoredQtViewer: Creating a Viewer without a scene is not allowed. \nPlease use /vis/scene/create before /vis/open/.... "
     155           << G4endl;
     156    return;
     157  }
    153158  // Calculates view representation based on extent of object being
    154159  // viewed and (initial) viewpoint.  (Note: it can change later due
Note: See TracChangeset for help on using the changeset viewer.