Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4XXXSGSceneHandler.hh
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4XXXSGSceneHandler.hh 99152 2016-09-07 08:04:30Z gcosmo $
28 //
29 //
30 // John Allison 10th March 2006
31 // A template for a sophisticated graphics driver with a scene graph.
32 //?? Lines beginning like this require specialisation for your driver.
33 
34 #ifndef G4XXXSGSCENEHANDLER_HH
35 #define G4XXXSGSCENEHANDLER_HH
36 
37 #include "G4VSceneHandler.hh"
38 
39 #include "G4PhysicalVolumeModel.hh"
40 #include <iostream>
41 
42 namespace JA {
43  // Ad hoc tree class and utilities.
44 
46  typedef std::vector<PVNodeID> PVPath;
47 
48  struct Node {
49  Node(PVNodeID pvNodeID = PVNodeID(), G4int index = -1):
50  fPVNodeID(pvNodeID), fIndex(index) {}
53  std::vector<Node*> fDaughters;
54  };
55 
56  void Insert(const PVNodeID* pvPath, size_t pathLength,
57  G4int index, Node* node);
58 
59  void PrintTree(std::ostream&, Node*);
60 
61  void Clear(Node*);
62 }
63 
65 
67 
68  friend class G4XXXSGViewer;
69 
70 public:
72  const G4String& name);
73  virtual ~G4XXXSGSceneHandler();
74 
76  // Optional virtual functions...
77  void AddSolid(const G4Box&);
78  // Further optional AddSolid functions. Explicitly invoke base
79  // class methods if not otherwise defined to avoid warnings about
80  // hiding of base class methods.
81  void AddSolid(const G4Cons& cons)
83  void AddSolid(const G4Tubs& tubs)
85  void AddSolid(const G4Trd& trd)
87  void AddSolid(const G4Trap& trap)
89  void AddSolid(const G4Sphere& sphere)
90  {G4VSceneHandler::AddSolid(sphere);}
91  void AddSolid(const G4Para& para)
93  void AddSolid(const G4Torus& torus)
95  void AddSolid(const G4Polycone& polycone)
96  {G4VSceneHandler::AddSolid(polycone);}
97  void AddSolid(const G4Polyhedra& polyhedra)
98  {G4VSceneHandler::AddSolid(polyhedra);}
99  void AddSolid(const G4Orb& orb)
101  void AddSolid(const G4Ellipsoid& ellipsoid)
102  {G4VSceneHandler::AddSolid(ellipsoid);}
103  void AddSolid(const G4VSolid& solid)
104  {G4VSceneHandler::AddSolid(solid);}
105  // More optional functions...
106  // void AddCompound(const G4VTrajectory&);
107  // void AddCompound(const G4VHit&);
108  // void AddCompound(const G4THitsMap<G4double>&);
109  // void AddCompound(const G4THitsMap<G4StatDouble>&);
110  void PreAddSolid(const G4Transform3D& objectTransformation,
111  const G4VisAttributes&);
112  void PostAddSolid();
113 
115  // Required implementation of pure virtual functions...
116 
117  void AddPrimitive(const G4Polyline&);
118  void AddPrimitive(const G4Text&);
119  void AddPrimitive(const G4Circle&);
120  void AddPrimitive(const G4Square&);
121  void AddPrimitive(const G4Polyhedron&);
122  // Further optional AddPrimitive methods. Explicitly invoke base
123  // class methods if not otherwise defined to avoid warnings about
124  // hiding of base class methods.
125  void AddPrimitive(const G4Polymarker& polymarker)
126  {G4VSceneHandler::AddPrimitive (polymarker);}
129  // Further related optional virtual functions...
130  void BeginPrimitives(const G4Transform3D& objectTransformation);
131  void EndPrimitives();
132 
134  // Further optional virtual functions...
135 
136  // void BeginModeling();
137  // void EndModeling();
138 
140  // Administration functions.
141 
142  void ClearStore ();
143  void ClearTransientStore ();
144 
145 protected:
146 
147  static G4int fSceneIdCount; // Counter for XXXSG scene handlers.
148 
149  // Utility for PreAddSolid and BeginPrimitives.
150  void CreateCurrentItem(const G4String&);
151 
152  //?? Define the scene graph. (For emulation, use an ad hoc tree class.)
153  SceneGraph fSceneGraph;
154 
155 private:
156 
157 #ifdef G4XXXFileDEBUG
158  void PrintThings();
159 #endif
160 
161 };
162 
163 #endif
PVNodeID fPVNodeID
void AddSolid(const G4Orb &orb)
void AddSolid(const G4Tubs &tubs)
const XML_Char * name
Definition: expat.h:151
std::vector< Node * > fDaughters
void PrintTree(std::ostream &, Node *)
system("rm -rf microbeam.root")
void Clear(Node *)
Definition: G4Tubs.hh:85
void AddSolid(const G4Polyhedra &polyhedra)
void AddSolid(const G4Para &para)
void CreateCurrentItem(const G4String &)
Double_t scale
void AddSolid(const G4VSolid &solid)
Definition: G4Text.hh:73
Definition: G4Cons.hh:83
std::vector< PVNodeID > PVPath
Definition: G4Box.hh:64
Node(PVNodeID pvNodeID=PVNodeID(), G4int index=-1)
Definition: G4Orb.hh:62
void AddSolid(const G4Torus &torus)
void BeginPrimitives(const G4Transform3D &objectTransformation)
void AddSolid(const G4Trap &trap)
virtual void AddSolid(const G4Box &)
void AddSolid(const G4Cons &cons)
G4XXXSGSceneHandler(G4VGraphicsSystem &system, const G4String &name)
void AddPrimitive(const G4Scale &scale)
int G4int
Definition: G4Types.hh:78
void AddSolid(const G4Box &)
void AddSolid(const G4Trd &trd)
JA::Node SceneGraph
virtual void AddPrimitive(const G4Polyline &)=0
void AddPrimitive(const G4Polyline &)
Definition: G4Trd.hh:72
G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID
void PreAddSolid(const G4Transform3D &objectTransformation, const G4VisAttributes &)
Definition: G4Para.hh:86
void AddSolid(const G4Ellipsoid &ellipsoid)
void Insert(const PVNodeID *pvPath, size_t pathLength, G4int index, Node *node)
void AddPrimitive(const G4Polymarker &polymarker)
void AddSolid(const G4Sphere &sphere)
void AddSolid(const G4Polycone &polycone)