1 | #ifndef G4Lab_SoG4Trajectories_h |
---|
2 | #define G4Lab_SoG4Trajectories_h |
---|
3 | |
---|
4 | // Inheritance : |
---|
5 | #include <Inventor/nodes/SoShape.h> |
---|
6 | |
---|
7 | #include <Inventor/fields/SoSFEnum.h> |
---|
8 | #include <Inventor/fields/SoSFFloat.h> |
---|
9 | #include <Inventor/fields/SoSFInt32.h> |
---|
10 | #include <Inventor/fields/SoSFBool.h> |
---|
11 | #include <Inventor/fields/SoSFNode.h> |
---|
12 | |
---|
13 | #include <vector> |
---|
14 | |
---|
15 | class G4TrajectoryContainer; |
---|
16 | class G4RunManager; |
---|
17 | |
---|
18 | class SoSensor; |
---|
19 | class SoFieldSensor; |
---|
20 | |
---|
21 | class PointIdentifier { |
---|
22 | public: |
---|
23 | PointIdentifier(int aTrajectory,int aPoint) |
---|
24 | :fTrajectory(aTrajectory),fPoint(aPoint){} |
---|
25 | public: |
---|
26 | int fTrajectory; |
---|
27 | int fPoint; |
---|
28 | }; |
---|
29 | |
---|
30 | class SoG4Trajectories : public SoShape { |
---|
31 | SO_NODE_HEADER(SoG4Trajectories); |
---|
32 | public: |
---|
33 | enum Model { |
---|
34 | ALL, |
---|
35 | TIMED |
---|
36 | }; |
---|
37 | SoSFEnum model; |
---|
38 | |
---|
39 | SoSFFloat timeStart; |
---|
40 | SoSFFloat timeInterval; |
---|
41 | SoSFInt32 timeSteps; |
---|
42 | SoSFInt32 timeIndex; |
---|
43 | |
---|
44 | // Info nodes : |
---|
45 | SoSFFloat timeMin; |
---|
46 | SoSFFloat timeMax; |
---|
47 | SoSFBool verbose; |
---|
48 | |
---|
49 | SoSFNode alternateRep; |
---|
50 | public: |
---|
51 | SoG4Trajectories(); |
---|
52 | SoG4Trajectories(G4RunManager*); |
---|
53 | virtual void generateAlternateRep(); |
---|
54 | virtual void clearAlternateRep(); |
---|
55 | public: |
---|
56 | static void initClass(); |
---|
57 | protected: |
---|
58 | virtual void GLRender(SoGLRenderAction*); |
---|
59 | virtual void rayPick(SoRayPickAction*); |
---|
60 | virtual void computeBBox(SoAction*,SbBox3f&,SbVec3f&); |
---|
61 | virtual void generatePrimitives(SoAction*); |
---|
62 | virtual void doAction(SoAction*); |
---|
63 | protected: |
---|
64 | virtual ~SoG4Trajectories(); |
---|
65 | private: |
---|
66 | void flush(); |
---|
67 | static void sensorCB(void*,SoSensor*); |
---|
68 | void timeOrder(G4TrajectoryContainer*); |
---|
69 | private: |
---|
70 | G4RunManager* fRunManager; |
---|
71 | G4TrajectoryContainer* fContainer; |
---|
72 | std::vector< std::vector<PointIdentifier> > fTimeOrderedPoints; |
---|
73 | SoFieldSensor* fSensor; |
---|
74 | }; |
---|
75 | |
---|
76 | #endif |
---|