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 #ifndef G4OPENGLSTOREDSCENEHANDLER_HH
0033 #define G4OPENGLSTOREDSCENEHANDLER_HH
0034
0035 #include "globals.hh"
0036 #include "G4OpenGLSceneHandler.hh"
0037 #include "G4Text.hh"
0038 #include <map>
0039 #include <vector>
0040
0041 class G4OpenGLStored;
0042
0043 class G4OpenGLStoredSceneHandler: public G4OpenGLSceneHandler {
0044
0045 friend class G4OpenGLStoredViewer;
0046
0047 public:
0048
0049 G4OpenGLStoredSceneHandler (G4VGraphicsSystem& system, const G4String& name = "");
0050 virtual ~G4OpenGLStoredSceneHandler ();
0051 void BeginPrimitives (const G4Transform3D& objectTransformation);
0052 void EndPrimitives ();
0053 void BeginPrimitives2D (const G4Transform3D& objectTransformation);
0054 void EndPrimitives2D ();
0055 void BeginModeling ();
0056 void EndModeling ();
0057 using G4VSceneHandler::AddPrimitive;
0058 void AddPrimitive (const G4Polyline&);
0059 void AddPrimitive (const G4Polymarker&);
0060 void AddPrimitive (const G4Circle&);
0061 void AddPrimitive (const G4Square&);
0062 void AddPrimitive (const G4Text&);
0063 void AddPrimitive (const G4Polyhedron&);
0064 void ClearStore ();
0065 void ClearTransientStore ();
0066
0067 protected:
0068
0069 G4bool AddPrimitivePreamble(const G4VMarker& visible);
0070 G4bool AddPrimitivePreamble(const G4Polyline& visible);
0071 G4bool AddPrimitivePreamble(const G4Polyhedron& visible);
0072
0073
0074 void AddPrimitivePostamble();
0075
0076
0077
0078
0079
0080
0081
0082 virtual G4bool ExtraPOProcessing
0083 (const G4Visible&, size_t ) {return true;}
0084 virtual G4bool ExtraTOProcessing
0085 (const G4Visible&, size_t ) {return true;}
0086
0087 static G4int fSceneIdCount;
0088
0089
0090
0091 static G4int fDisplayListId;
0092
0093
0094
0095
0096
0097
0098 G4bool fDoNotUseDisplayList;
0099
0100
0101
0102
0103
0104 GLint fTopPODL;
0105
0106
0107 struct G4TextPlus {
0108 G4TextPlus(const G4Text& text): fG4Text(text), fProcessing2D(false) {}
0109 G4Text fG4Text;
0110 G4bool fProcessing2D;
0111 };
0112
0113
0114 struct PO {
0115 PO();
0116 PO(const PO&);
0117 PO(G4int id, const G4Transform3D& tr = G4Transform3D());
0118 ~PO();
0119 PO& operator= (const PO&);
0120 G4int fDisplayListId;
0121 G4Transform3D fTransform;
0122 GLuint fPickName;
0123 G4Colour fColour;
0124 G4TextPlus* fpG4TextPlus;
0125 G4bool fMarkerOrPolyline;
0126 };
0127 std::vector<PO> fPOList;
0128
0129
0130 struct TO {
0131 TO();
0132 TO(const TO&);
0133 TO(G4int id, const G4Transform3D& tr = G4Transform3D());
0134 ~TO();
0135 TO& operator= (const TO&);
0136 G4int fDisplayListId;
0137 G4Transform3D fTransform;
0138 GLuint fPickName;
0139 G4double fStartTime, fEndTime;
0140 G4Colour fColour;
0141 G4TextPlus* fpG4TextPlus;
0142 G4bool fMarkerOrPolyline;
0143 };
0144 std::vector<TO> fTOList;
0145
0146
0147
0148 std::map <const G4VSolid*, G4int, std::less <const G4VSolid*> > fSolidMap;
0149
0150 private:
0151 bool AddPrimitivePreambleInternal(const G4Visible& visible, bool isMarker, bool isPolyline);
0152
0153 };
0154
0155 #endif