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