Geant4 Cross Reference |
>> 1 // This code implementation is the intellectual property of >> 2 // the GEANT4 collaboration. 1 // 3 // 2 // ******************************************* << 4 // By copying, distributing or modifying the Program (or any work 3 // * License and Disclaimer << 5 // based on the Program) you indicate your acceptance of this statement, 4 // * << 6 // and all its terms. 5 // * The Geant4 software is copyright of th << 6 // * the Geant4 Collaboration. It is provided << 7 // * conditions of the Geant4 Software License << 8 // * LICENSE and available at http://cern.ch/ << 9 // * include a list of copyright holders. << 10 // * << 11 // * Neither the authors of this software syst << 12 // * institutes,nor the agencies providing fin << 13 // * work make any representation or warran << 14 // * regarding this software system or assum << 15 // * use. Please see the license in the file << 16 // * for the full disclaimer and the limitatio << 17 // * << 18 // * This code implementation is the result << 19 // * technical work of the GEANT4 collaboratio << 20 // * By using, copying, modifying or distri << 21 // * any work based on the software) you ag << 22 // * use in resulting scientific publicati << 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* << 25 // << 26 // 7 // >> 8 // $Id: G4OpenGLImmediateXm.cc,v 1.5 2000/08/19 18:34:31 johna Exp $ >> 9 // GEANT4 tag $Name: geant4-03-00 $ 27 // 10 // 28 // 11 // 29 // Andrew Walkden 10th February 1997 12 // Andrew Walkden 10th February 1997 30 // OpenGL graphics system factory. 13 // OpenGL graphics system factory. 31 14 >> 15 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER >> 16 >> 17 #include <GL/gl.h> >> 18 #include <GL/glx.h> >> 19 #include <GL/glu.h> >> 20 32 #include "G4VisFeaturesOfOpenGL.hh" 21 #include "G4VisFeaturesOfOpenGL.hh" 33 #include "G4VSceneHandler.hh" 22 #include "G4VSceneHandler.hh" 34 #include "G4OpenGLSceneHandler.hh" 23 #include "G4OpenGLSceneHandler.hh" 35 #include "G4OpenGLViewer.hh" 24 #include "G4OpenGLViewer.hh" 36 #include "G4OpenGLImmediateXm.hh" 25 #include "G4OpenGLImmediateXm.hh" 37 #include "G4OpenGLImmediateXmViewer.hh" 26 #include "G4OpenGLImmediateXmViewer.hh" 38 #include "G4OpenGLViewerMessenger.hh" << 39 #include "G4OpenGLXmViewerMessenger.hh" << 40 #include "G4OpenGLImmediateSceneHandler.hh" << 41 27 42 G4OpenGLImmediateXm::G4OpenGLImmediateXm (): 28 G4OpenGLImmediateXm::G4OpenGLImmediateXm (): 43 G4OpenGLXm ("OpenGLImmediateXm", << 29 G4VGraphicsSystem ("OpenGLImmediateXm", 44 "OGLIXm", << 30 "OGLIXm", 45 G4VisFeaturesOfOpenGLIXm (), << 31 G4VisFeaturesOfOpenGLIXm (), 46 G4VGraphicsSystem::threeD) << 32 G4VGraphicsSystem::threeD) {} 47 { << 48 G4OpenGLViewerMessenger::GetInstance(); << 49 G4OpenGLXmViewerMessenger::GetInstance(); << 50 } << 51 << 52 G4OpenGLImmediateXm::~G4OpenGLImmediateXm () { << 53 33 54 G4VSceneHandler* G4OpenGLImmediateXm::CreateSc 34 G4VSceneHandler* G4OpenGLImmediateXm::CreateSceneHandler (const G4String& name) { 55 G4VSceneHandler* pScene = new G4OpenGLImmedi 35 G4VSceneHandler* pScene = new G4OpenGLImmediateSceneHandler (*this, name); >> 36 G4cout << G4OpenGLImmediateSceneHandler::GetSceneCount () >> 37 << ' ' << fName << " scene handlers extanct." << G4endl; 56 return pScene; 38 return pScene; 57 } 39 } 58 40 59 G4VViewer* G4OpenGLImmediateXm::CreateViewer ( 41 G4VViewer* G4OpenGLImmediateXm::CreateViewer (G4VSceneHandler& scene, 60 const G4String& name) { 42 const G4String& name) { 61 G4VViewer* pView = 43 G4VViewer* pView = 62 new G4OpenGLImmediateXmViewer ((G4OpenGLIm 44 new G4OpenGLImmediateXmViewer ((G4OpenGLImmediateSceneHandler&) scene, name); 63 if (pView) { 45 if (pView) { 64 if (pView -> GetViewId () < 0) { 46 if (pView -> GetViewId () < 0) { 65 G4cerr << "G4OpenGLImmediateXm::CreateVi 47 G4cerr << "G4OpenGLImmediateXm::CreateViewer: error flagged by" 66 " negative view id in G4OpenGLImmediateXmVie 48 " negative view id in G4OpenGLImmediateXmViewer creation." 67 "\n Destroying view and returning null point 49 "\n Destroying view and returning null pointer." << G4endl; 68 delete pView; 50 delete pView; 69 pView = 0; 51 pView = 0; 70 } 52 } 71 } 53 } 72 else { 54 else { 73 G4cerr << "G4OpenGLImmediateXm::CreateView 55 G4cerr << "G4OpenGLImmediateXm::CreateViewer: null pointer on" 74 " new G4OpenGLImmediateXmViewer." << G4e 56 " new G4OpenGLImmediateXmViewer." << G4endl; 75 } 57 } 76 return pView; 58 return pView; 77 } 59 } >> 60 >> 61 #endif 78 62