File indexing completed on 2025-01-18 09:58:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #ifndef G4OPENGLSCENEHANDLER_HH
0034 #define G4OPENGLSCENEHANDLER_HH
0035
0036 #include "globals.hh"
0037
0038 #include "G4VSceneHandler.hh"
0039 #include "G4OpenGL.hh"
0040
0041 #include <map>
0042
0043 class G4AttHolder;
0044
0045
0046 class G4OpenGLSceneHandler: public G4VSceneHandler {
0047
0048 friend class G4OpenGLViewer;
0049
0050 public:
0051 virtual void BeginPrimitives (const G4Transform3D& objectTransformation);
0052 virtual void EndPrimitives ();
0053 virtual void BeginPrimitives2D (const G4Transform3D& objectTransformation);
0054 virtual void EndPrimitives2D ();
0055 using G4VSceneHandler::AddPrimitive;
0056 void AddPrimitive (const G4Polyline&);
0057 void AddPrimitive (const G4Polymarker&);
0058 void AddPrimitive (const G4Text&);
0059 void AddPrimitive (const G4Circle&);
0060 void AddPrimitive (const G4Square&);
0061 void AddPrimitivesCircle (const std::vector <G4VMarker>&);
0062 void AddPrimitivesSquare (const std::vector <G4VMarker>&);
0063 void AddPrimitive (const G4Polyhedron&);
0064
0065 void PreAddSolid (const G4Transform3D& objectTransformation,
0066 const G4VisAttributes&);
0067 void AddSolid (const G4Box&);
0068 void AddSolid (const G4Cons&);
0069 void AddSolid (const G4Tubs&);
0070 void AddSolid (const G4Trd&);
0071 void AddSolid (const G4Trap&);
0072 void AddSolid (const G4Sphere&);
0073 void AddSolid (const G4Para&);
0074 void AddSolid (const G4Torus&);
0075 void AddSolid (const G4Polycone&);
0076 void AddSolid (const G4Polyhedra&);
0077 void AddSolid (const G4Orb&);
0078 void AddSolid (const G4Ellipsoid&);
0079 void AddSolid (const G4TessellatedSolid&);
0080 void AddSolid (const G4VSolid&);
0081 void AddCompound (const G4VTrajectory&);
0082 void AddCompound (const G4VHit&);
0083 void AddCompound (const G4VDigi&);
0084 void AddCompound (const G4THitsMap<G4double>&);
0085 void AddCompound (const G4THitsMap<G4StatDouble>&);
0086 void AddCompound (const G4Mesh&);
0087
0088
0089 enum FlushAction {
0090 endOfEvent,
0091 endOfRun,
0092 eachPrimitive,
0093 NthPrimitive,
0094 NthEvent,
0095 never
0096 };
0097 static G4int GetEntitiesFlushInterval()
0098 {return fEntitiesFlushInterval;}
0099 static FlushAction GetFlushAction()
0100 {return fFlushAction;}
0101 static void SetEntitiesFlushInterval(G4int interval)
0102 {fEntitiesFlushInterval = interval;}
0103 static void SetFlushAction(FlushAction action)
0104 {fFlushAction = action;}
0105
0106 protected:
0107
0108 G4OpenGLSceneHandler (G4VGraphicsSystem& system,
0109 G4int id,
0110 const G4String& name = "");
0111 virtual ~G4OpenGLSceneHandler ();
0112
0113 void ProcessScene();
0114 G4DisplacedSolid* CreateSectionSolid ();
0115 G4DisplacedSolid* CreateCutawaySolid ();
0116
0117 void ClearAndDestroyAtts();
0118
0119 GLuint fPickName;
0120 std::map<GLuint, G4AttHolder*> fPickMap;
0121
0122
0123 void ScaledFlush () ;
0124
0125 static FlushAction fFlushAction;
0126
0127 static G4int fEntitiesFlushInterval;
0128
0129
0130 G4bool fThreePassCapable;
0131
0132 G4bool fSecondPassForTransparencyRequested;
0133 G4bool fSecondPassForTransparency;
0134
0135 G4bool fThirdPassForNonHiddenMarkersRequested;
0136 G4bool fThirdPassForNonHiddenMarkers;
0137
0138 static const GLubyte fStippleMaskHashed [128];
0139 bool fEdgeFlag;
0140 };
0141
0142 #include "G4OpenGLSceneHandler.icc"
0143
0144 #endif