source: snovis/trunk/source/G4Lab/SoG4Trajectories.h @ 288

Last change on this file since 288 was 288, checked in by barrand, 17 years ago
  • Property svn:eol-style set to native
File size: 1.6 KB
Line 
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
15class G4TrajectoryContainer;
16class G4RunManager;
17
18class SoSensor;
19class SoFieldSensor;
20
21class PointIdentifier {
22public:
23  PointIdentifier(int aTrajectory,int aPoint)
24    :fTrajectory(aTrajectory),fPoint(aPoint){}
25public:
26  int fTrajectory;
27  int fPoint;
28};
29
30class SoG4Trajectories : public SoShape {
31  SO_NODE_HEADER(SoG4Trajectories);
32public:
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;
50public:
51  SoG4Trajectories();
52  SoG4Trajectories(G4RunManager*);
53  virtual void generateAlternateRep();
54  virtual void clearAlternateRep();
55public:
56  static void initClass();
57protected:
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*);
63protected:
64  virtual ~SoG4Trajectories();
65private:
66  void flush();
67  static void sensorCB(void*,SoSensor*);
68  void timeOrder(G4TrajectoryContainer*);
69private:
70  G4RunManager* fRunManager;
71  G4TrajectoryContainer* fContainer;
72  std::vector< std::vector<PointIdentifier> > fTimeOrderedPoints;
73  SoFieldSensor* fSensor;
74};
75
76#endif
Note: See TracBrowser for help on using the repository browser.