Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4ModelingParameters.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: G4ModelingParameters.hh 109510 2018-04-26 07:15:57Z gcosmo $
28 //
29 //
30 // John Allison 31st December 1997.
31 //
32 // Class Description:
33 //
34 // Parameters associated with the modeling of GEANT4 objects.
35 
36 #ifndef G4MODELINGPARAMETERS_HH
37 #define G4MODELINGPARAMETERS_HH
38 
39 #include "globals.hh"
40 #include "G4VisExtent.hh"
41 #include "G4VisAttributes.hh"
42 #include "G4VPhysicalVolume.hh"
43 #include "G4PhysicalVolumeModel.hh"
44 
45 #include <vector>
46 #include <utility>
47 
48 class G4LogicalVolume;
49 class G4VisAttributes;
50 class G4VSolid;
51 class G4Event;
52 
54 
55 public: // With description
56 
57  // Currently requested drawing style.
58  enum DrawingStyle {
59  wf, // Draw edges - no hidden line removal (wireframe).
60  hlr, // Draw edges - hidden lines removed.
61  hsr, // Draw surfaces - hidden surfaces removed.
62  hlhsr // Draw surfaces and edges - hidden removed.
63  };
64 
65  // enums and nested class for communicating a modification to the vis
66  // attributes for a specfic touchable defined by PVNameCopyNoPath.
77  };
78 
79  class PVNameCopyNo {
80  public:
81  // Normal constructor
83  : fName(name), fCopyNo(copyNo) {}
84  // Constructor from G4PhysicalVolumeModel::G4PhysicalVolumeNodeID
87  : fName(nodeID.GetPhysicalVolume()->GetName())
88  , fCopyNo(nodeID.GetCopyNo()) {}
89  const G4String& GetName() const {return fName;}
90  G4int GetCopyNo() const {return fCopyNo;}
91  G4bool operator!=(const PVNameCopyNo&) const;
92  G4bool operator==(const PVNameCopyNo& rhs) const {return !operator!=(rhs);}
93  private:
96  };
97  typedef std::vector<PVNameCopyNo> PVNameCopyNoPath;
98  typedef PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator;
99 
101  public:
102  // Normal constructor
104  : fpPV(pPV), fCopyNo(copyNo) {}
105  // Constructor from G4PhysicalVolumeModel::G4PhysicalVolumeNodeID
108  : fpPV(nodeID.GetPhysicalVolume())
109  , fCopyNo(nodeID.GetCopyNo()) {}
110  const G4String& GetName() const;
111  const G4VPhysicalVolume* GetPVPointer() const {return fpPV;}
112  G4int GetCopyNo() const {return fCopyNo;}
113  G4bool operator!=(const PVPointerCopyNo&) const;
114  G4bool operator==(const PVPointerCopyNo& rhs) const {return !operator!=(rhs);}
115  private:
118  };
119  typedef std::vector<PVPointerCopyNo> PVPointerCopyNoPath;
120  typedef PVPointerCopyNoPath::const_iterator PVPointerCopyNoPathConstIterator;
121 
123  public:
125  (const G4VisAttributes& visAtts,
126  VisAttributesSignifier signifier,
127  const PVNameCopyNoPath& path):
128  fVisAtts(visAtts), fSignifier(signifier), fPVNameCopyNoPath(path) {}
130  (const G4VisAttributes& visAtts,
131  VisAttributesSignifier signifier,
132  const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& path);
134  {return fVisAtts;}
136  {return fSignifier;}
138  {return fPVNameCopyNoPath;}
139  void SetVisAttributes(const G4VisAttributes& visAtts)
140  {fVisAtts = visAtts;}
142  {fSignifier = signifier;}
147  {return !operator!=(rhs);}
148  private:
152  };
153 
155 
156  G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes,
157  DrawingStyle drawingStyle,
158  G4bool isCulling,
159  G4bool isCullingInvisible,
160  G4bool isDensityCulling,
161  G4double visibleDensity,
162  G4bool isCullingCovered,
163  G4int noOfSides);
164  // Culling and clipping policy for G4PhysicalVolumeModel.
165 
167 
168  // Note: uses default assignment operator and copy constructor.
169 
171 
172  // Get and Is functions...
173  G4bool IsWarning () const;
175  DrawingStyle GetDrawingStyle () const;
176  G4bool IsCulling () const;
177  G4bool IsCullingInvisible () const;
178  G4bool IsDensityCulling () const;
179  G4double GetVisibleDensity () const;
180  G4bool IsCullingCovered () const;
181  G4int GetCBDAlgorithmNumber () const;
182  const std::vector<G4double>& GetCBDParameters () const;
183  G4bool IsExplode () const;
184  G4double GetExplodeFactor () const;
185  const G4Point3D& GetExplodeCentre () const;
186  G4int GetNoOfSides () const;
187  G4VSolid* GetSectionSolid () const;
188  G4VSolid* GetCutawaySolid () const;
189  const G4Event* GetEvent () const;
190  const std::vector<VisAttributesModifier>& GetVisAttributesModifiers() const;
191 
192  // Set functions...
193  void SetWarning (G4bool);
194  void SetDefaultVisAttributes (const G4VisAttributes* pDefaultVisAttributes);
196  void SetCulling (G4bool);
198  void SetDensityCulling (G4bool);
200  void SetCullingCovered (G4bool);
202  void SetCBDParameters (const std::vector<G4double>&);
203  void SetExplodeFactor (G4double explodeFactor);
204  void SetExplodeCentre (const G4Point3D& explodeCentre);
205  G4int SetNoOfSides (G4int); // Returns actual number set.
206  void SetSectionSolid (G4VSolid* pSectionSolid);
207  void SetCutawaySolid (G4VSolid* pCutawaySolid);
208  void SetEvent (const G4Event* pEvent);
209  void SetVisAttributesModifiers(const std::vector<VisAttributesModifier>&);
210 
211  friend std::ostream& operator <<
212  (std::ostream& os, const G4ModelingParameters&);
213 
214  friend std::ostream& operator <<
215  (std::ostream& os, const PVNameCopyNoPath&);
216 
217  friend std::ostream& operator <<
218  (std::ostream& os, const PVPointerCopyNoPath&);
219 
220  friend std::ostream& operator <<
221  (std::ostream& os,
222  const std::vector<VisAttributesModifier>&);
223 
224 private:
225 
226  // Data members...
227  G4bool fWarning; // Print warnings if true.
229  DrawingStyle fDrawingStyle; // Drawing style.
230  G4bool fCulling; // Culling requested.
231  G4bool fCullInvisible; // Cull (don't Draw) invisible objects.
232  G4bool fDensityCulling; // Density culling requested. If so...
233  G4double fVisibleDensity; // ...density lower than this not drawn.
234  G4bool fCullCovered; // Cull daughters covered by opaque mothers.
235  G4int fCBDAlgorithmNumber; // Colour by density algorithm number.
236  std::vector<G4double> fCBDParameters; // Colour by density parameters.
237  G4double fExplodeFactor; // Explode along radius by this factor...
238  G4Point3D fExplodeCentre; // ...about this centre.
239  G4int fNoOfSides; // ...if polygon approximates circle.
240  G4VSolid* fpSectionSolid; // For generic section (DCUT).
241  G4VSolid* fpCutawaySolid; // For generic cutaways.
242  const G4Event* fpEvent; // Event being processed.
243  std::vector<VisAttributesModifier> fVisAttributesModifiers;
244 };
245 
246 std::ostream& operator <<
247 (std::ostream& os, const G4ModelingParameters&);
248 
249 std::ostream& operator <<
250 (std::ostream& os, const G4ModelingParameters::PVNameCopyNoPath&);
251 
252 std::ostream& operator <<
253 (std::ostream& os, const G4ModelingParameters::PVPointerCopyNoPath&);
254 
255 std::ostream& operator <<
256 (std::ostream& os,
257  const std::vector<G4ModelingParameters::VisAttributesModifier>&);
258 
259 #include "G4ModelingParameters.icc"
260 
261 #endif
std::vector< PVNameCopyNo > PVNameCopyNoPath
void SetDefaultVisAttributes(const G4VisAttributes *pDefaultVisAttributes)
const XML_Char * name
Definition: expat.h:151
G4bool IsDensityCulling() const
DrawingStyle GetDrawingStyle() const
G4bool operator!=(const PVPointerCopyNo &) const
void SetDrawingStyle(DrawingStyle)
void SetExplodeCentre(const G4Point3D &explodeCentre)
void SetVisAttributes(const G4VisAttributes &visAtts)
PVPointerCopyNo(G4VPhysicalVolume *pPV, G4int copyNo)
G4double GetVisibleDensity() const
void SetPVNameCopyNoPath(const PVNameCopyNoPath &PVNameCopyNoPath)
void SetCBDParameters(const std::vector< G4double > &)
PVNameCopyNo(G4String name, G4int copyNo)
G4bool IsExplode() const
G4bool operator==(const VisAttributesModifier &rhs) const
void SetEvent(const G4Event *pEvent)
const std::vector< VisAttributesModifier > & GetVisAttributesModifiers() const
const G4VPhysicalVolume * GetPVPointer() const
G4bool operator==(const PVNameCopyNo &rhs) const
PVPointerCopyNoPath::const_iterator PVPointerCopyNoPathConstIterator
VisAttributesModifier(const G4VisAttributes &visAtts, VisAttributesSignifier signifier, const PVNameCopyNoPath &path)
G4int GetCBDAlgorithmNumber() const
G4bool operator!=(const VisAttributesModifier &) const
void SetSectionSolid(G4VSolid *pSectionSolid)
G4bool operator!=(const PVNameCopyNo &) const
void SetExplodeFactor(G4double explodeFactor)
void SetCullingCovered(G4bool)
void SetDensityCulling(G4bool)
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
G4bool operator==(const PVPointerCopyNo &rhs) const
void SetVisAttributesSignifier(VisAttributesSignifier signifier)
G4bool IsWarning() const
const G4Point3D & GetExplodeCentre() const
G4bool IsCullingInvisible() const
G4bool operator!=(const G4ModelingParameters &) const
const PVNameCopyNoPath & GetPVNameCopyNoPath() const
G4bool IsCullingCovered() const
void SetVisAttributesModifiers(const std::vector< VisAttributesModifier > &)
const G4VisAttributes * GetDefaultVisAttributes() const
std::vector< PVPointerCopyNo > PVPointerCopyNoPath
std::vector< VisAttributesModifier > fVisAttributesModifiers
G4int GetNoOfSides() const
int G4int
Definition: G4Types.hh:78
const std::vector< G4double > & GetCBDParameters() const
VisAttributesSignifier GetVisAttributesSignifier() const
const G4Event * GetEvent() const
const G4VisAttributes * fpDefaultVisAttributes
G4VSolid * GetSectionSolid() const
const G4VisAttributes & GetVisAttributes() const
G4VSolid * GetCutawaySolid() const
void SetWarning(G4bool)
void SetCutawaySolid(G4VSolid *pCutawaySolid)
void SetCBDAlgorithmNumber(G4int)
void SetVisibleDensity(G4double)
G4bool IsCulling() const
void SetCulling(G4bool)
PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator
G4double GetExplodeFactor() const
const G4String & GetName() const
void SetCullingInvisible(G4bool)
std::vector< G4double > fCBDParameters