G4OpenInventorViewer.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 
00028 #ifndef G4OPENINVENTORVIEWER_HH
00029 #define G4OPENINVENTORVIEWER_HH
00030 
00031 #ifdef G4VIS_BUILD_OI_DRIVER
00032 
00033 // Inheritance :
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 // Base class for various OpenInventorView classes.
00050 //
00051 class G4OpenInventorViewer: public G4VViewer {
00052 public: //G4VViewer
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   //static void SelectionCB(void*,SoPath*);
00081   //static void DeselectionCB(void*,SoPath*);
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;  // Memory for making kernel visit decisions.
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

Generated on Mon May 27 17:49:12 2013 for Geant4 by  doxygen 1.4.7