G4OpenInventorSceneHandler.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 // $Id$
00028 //
00029 // 
00030 // J Kallenbach  27th Aug 1996
00031 // OpenInventor scene handler - creates OpenInventor Display lists.
00032 // 20 dec 1996  jck  Add HEPVis primitives - trd, box, etc.
00033 
00034 #ifndef G4OPENINVENTORSCENEHANDLER_HH
00035 #define G4OPENINVENTORSCENEHANDLER_HH
00036 
00037 #ifdef G4VIS_BUILD_OI_DRIVER
00038 
00039 // Inheritance :
00040 #include "G4VSceneHandler.hh"
00041 
00042 #include "G4PhysicalVolumeModel.hh"
00043 
00044 #include <map>
00045 
00046 class G4OpenInventor;
00047 class SoSeparator;
00048 class Geant4_SoStyleCache;
00049 class G4VisAttributes;
00050 
00051 // Base class for various OpenInventorScene classes.
00052 class G4OpenInventorSceneHandler: public G4VSceneHandler {
00053 
00054 friend class G4OpenInventorViewer;
00055 
00056 public:
00057 
00058   G4OpenInventorSceneHandler (G4OpenInventor& system, const G4String& name = "");
00059   virtual ~G4OpenInventorSceneHandler ();
00060   void AddPrimitive (const G4Polyline& line);
00061   void AddPrimitive (const G4Text&);
00062   void AddPrimitive (const G4Circle&);
00063   void AddPrimitive (const G4Square&);
00064   void AddPrimitive (const G4Polyhedron& p);
00065   void AddPrimitive (const G4NURBS& nurb);
00066   void AddPrimitive (const G4Polymarker&);
00068   // Explicitly invoke base class methods to avoid warnings about
00069   // hiding of base class methods.
00070   void AddPrimitive (const G4Scale& scale) {
00071     G4VSceneHandler::AddPrimitive (scale);
00072   }
00074   // Other inherited functions.
00075   void          ClearStore ();
00076   void          ClearTransientStore ();
00077   
00078   //
00079   // Primitives for use of HEPVis
00080   //
00081   void PreAddSolid (const G4Transform3D& objectTransformation,
00082                     const G4VisAttributes& visAttribs);
00083   void BeginPrimitives (const G4Transform3D& objectTransformation);
00084 
00085 private:
00086 
00087   static G4int fSceneIdCount;   // static counter for OpenInventor scenes.
00088   enum G4OIMarker {G4OICircle, G4OISquare};
00089   void AddCircleSquare (G4OIMarker markerType, const G4VMarker&);
00090   void GeneratePrerequisites();
00091   void AddProperties(const G4VisAttributes*);
00092   // AddTransform takes fObjectTransformation and "adds" a translation.
00093   void AddTransform(const G4Point3D& translation = G4Point3D());
00094   std::map <G4LogicalVolume*, SoSeparator*,
00095     std::less <G4LogicalVolume*> > fSeparatorMap;
00096   SoSeparator* fRoot;
00097   SoSeparator* fDetectorRoot;
00098   SoSeparator* fTransientRoot;
00099   SoSeparator* fCurrentSeparator;
00100   G4bool fModelingSolid;
00101   G4bool fReducedWireFrame;
00102   Geant4_SoStyleCache* fStyleCache;
00103   bool fPreviewAndFull;
00104 };
00105 
00106 #endif
00107 
00108 #endif

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