00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef G4OPENINVENTORVIEWER_HH
00029 #define G4OPENINVENTORVIEWER_HH
00030
00031 #ifdef G4VIS_BUILD_OI_DRIVER
00032
00033
00034 #include "G4VViewer.hh"
00035
00036 class SoSelection;
00037 class SoPath;
00038 class SoCamera;
00039 class SoSensor;
00040 class SoNodeSensor;
00041
00042 class Geant4_SoImageWriter;
00043 class Geant4_SoGL2PSAction;
00044 class G4OpenInventorSceneHandler;
00045 class G4VInteractorManager;
00046 class SbVec3f;
00047
00048
00049
00050
00051 class G4OpenInventorViewer: public G4VViewer {
00052 public:
00053 virtual void DrawView();
00054 virtual void ShowView();
00055 virtual void ClearView();
00056 virtual void SetView();
00057 virtual void KernelVisitDecision();
00058 public:
00059 G4OpenInventorViewer(G4OpenInventorSceneHandler& scene,
00060 const G4String& name = "");
00061 virtual ~G4OpenInventorViewer();
00062 protected:
00063 virtual void ViewerRender() = 0;
00064 virtual SoCamera* GetCamera() = 0;
00065 void Escape();
00066 void WritePostScript(const G4String& file = "g4out.ps");
00067 void WritePixmapPostScript(const G4String& file = "g4out.ps");
00068 void WriteInventor(const G4String& file = "g4out.iv");
00069 void SceneGraphStatistics();
00070 void EraseDetector();
00071 void EraseEvent();
00072 void SetPreviewAndFull();
00073 void SetPreview();
00074 void SetSolid();
00075 void SetWireFrame();
00076 void SetReducedWireFrame(bool);
00077 void UpdateScene();
00078 G4String Help(const G4String& topic = "controls");
00079 private:
00080
00081
00082 static void GroupCameraSensorCB(void*,SoSensor*);
00083 static void CameraSensorCB(void*,SoSensor*);
00084 static void pointAt(SoCamera*,const SbVec3f & targetpoint, const SbVec3f & upvector);
00085 static void lookAt(SoCamera*,const SbVec3f & dir, const SbVec3f & up);
00086 static void lookedAt(SoCamera*,SbVec3f & dir, SbVec3f & up);
00087 private:
00088 G4bool CompareForKernelVisit(G4ViewParameters&);
00089 void DrawDetector();
00090 private:
00091 G4ViewParameters fLastVP;
00092 protected:
00093 static void SelectionCB(void*,SoPath*);
00094 G4OpenInventorSceneHandler& fG4OpenInventorSceneHandler;
00095 G4VInteractorManager* fInteractorManager;
00096 SoSelection* fSoSelection;
00097 Geant4_SoImageWriter* fSoImageWriter;
00098 Geant4_SoGL2PSAction* fGL2PSAction;
00099 SoNodeSensor* fGroupCameraSensor;
00100 SoNodeSensor* fCameraSensor;
00101 };
00102
00103 #endif
00104
00105 #endif