Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ModelingParameters.hh
Go to the documentation of this file.
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//
28//
29// John Allison 31st December 1997.
30//
31// Class Description:
32//
33// Parameters associated with the modeling of GEANT4 objects.
34
35#ifndef G4MODELINGPARAMETERS_HH
36#define G4MODELINGPARAMETERS_HH
37
38#include "globals.hh"
39#include "G4VisExtent.hh"
40#include "G4VisAttributes.hh"
41#include "G4VPhysicalVolume.hh"
42
43#include <vector>
44#include <utility>
45
46class G4LogicalVolume;
47class G4VisAttributes;
48class G4VSolid;
50class G4Event;
51
53
54public: // With description
55
56 // Currently requested drawing style.
58 wf, // Draw edges - no hidden line removal (wireframe).
59 hlr, // Draw edges - hidden lines removed.
60 hsr, // Draw surfaces - hidden surfaces removed.
61 hlhsr, // Draw surfaces and edges - hidden removed.
62 cloud // Draw as a cloud of points
63 };
64
66 cutawayUnion, // Union (addition) of result of each cutaway plane.
67 cutawayIntersection // Intersection (multiplication).
68 };
69
70 // enums and nested class for communicating a modification to the vis
71 // attributes for a specfic touchable defined by PVNameCopyNoPath.
85
87 public:
88 // Normal constructor
90 : fName(name), fCopyNo(copyNo) {}
91 const G4String& GetName() const {return fName;}
92 G4int GetCopyNo() const {return fCopyNo;}
93 G4bool operator!=(const PVNameCopyNo&) const;
94 G4bool operator==(const PVNameCopyNo& rhs) const {return !operator!=(rhs);}
95 private:
96 G4String fName;
97 G4int fCopyNo;
98 };
99 typedef std::vector<PVNameCopyNo> PVNameCopyNoPath;
100 typedef PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator;
101
103 public:
104 // Normal constructor
106 : fpPV(pPV), fCopyNo(copyNo) {}
107 const G4String& GetName() const;
108 const G4VPhysicalVolume* GetPVPointer() const {return fpPV;}
109 G4int GetCopyNo() const {return fCopyNo;}
110 G4bool operator!=(const PVPointerCopyNo&) const;
111 G4bool operator==(const PVPointerCopyNo& rhs) const {return !operator!=(rhs);}
112 private:
113 G4VPhysicalVolume* fpPV;
114 G4int fCopyNo;
115 };
116 typedef std::vector<PVPointerCopyNo> PVPointerCopyNoPath;
117 typedef PVPointerCopyNoPath::const_iterator PVPointerCopyNoPathConstIterator;
118
120 public:
122 (const G4VisAttributes& visAtts,
123 VisAttributesSignifier signifier,
124 const PVNameCopyNoPath& path):
125 fVisAtts(visAtts), fSignifier(signifier), fPVNameCopyNoPath(path) {}
127 {return fVisAtts;}
129 {return fSignifier;}
131 {return fPVNameCopyNoPath;}
133 {fVisAtts = visAtts;}
135 {fSignifier = signifier;}
140 {return !operator!=(rhs);}
141 private:
142 G4VisAttributes fVisAtts;
143 VisAttributesSignifier fSignifier;
144 PVNameCopyNoPath fPVNameCopyNoPath;
145 };
146
148
149 G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes,
150 DrawingStyle drawingStyle,
151 G4bool isCulling,
152 G4bool isCullingInvisible,
153 G4bool isDensityCulling,
154 G4double visibleDensity,
155 G4bool isCullingCovered,
156 G4int noOfSides);
157 // Culling and clipping policy for G4PhysicalVolumeModel.
158
160
161 // Note: uses default assignment operator and copy constructor.
162
164
165 // Get and Is functions...
176 const std::vector<G4double>& GetCBDParameters () const;
184 const G4Event* GetEvent () const;
185 const std::vector<VisAttributesModifier>& GetVisAttributesModifiers() const;
187 const std::vector<PVNameCopyNo>& GetSpecialMeshVolumes() const;
188
189 // Set functions...
191 void SetDefaultVisAttributes (const G4VisAttributes* pDefaultVisAttributes);
200 void SetCBDParameters (const std::vector<G4double>&);
201 void SetExplodeFactor (G4double explodeFactor);
202 void SetExplodeCentre (const G4Point3D& explodeCentre);
203 G4int SetNoOfSides (G4int); // Returns actual number set.
204 void SetSectionSolid (G4DisplacedSolid* pSectionSolid);
206 void SetCutawaySolid (G4DisplacedSolid* pCutawaySolid);
207 void SetEvent (const G4Event* pEvent);
208 void SetVisAttributesModifiers(const std::vector<VisAttributesModifier>&);
210 void SetSpecialMeshVolumes (const std::vector<PVNameCopyNo>&);
211
212 friend std::ostream& operator <<
213 (std::ostream& os, const G4ModelingParameters&);
214
215 friend std::ostream& operator <<
216 (std::ostream& os, const PVNameCopyNoPath&);
217
218 friend std::ostream& operator <<
219 (std::ostream& os, const PVPointerCopyNoPath&);
220
221 friend std::ostream& operator <<
222 (std::ostream& os,
223 const std::vector<VisAttributesModifier>&);
224
225private:
226
227 // Data members...
228 G4bool fWarning; // Print warnings if true.
229 const G4VisAttributes* fpDefaultVisAttributes;
230 DrawingStyle fDrawingStyle; // Drawing style.
231 G4int fNumberOfCloudPoints; // For drawing in cloud style.
232 // <= 0 means use viewer default.
233 G4bool fCulling; // Culling requested.
234 G4bool fCullInvisible; // Cull (don't Draw) invisible objects.
235 G4bool fDensityCulling; // Density culling requested. If so...
236 G4double fVisibleDensity; // ...density lower than this not drawn.
237 G4bool fCullCovered; // Cull daughters covered by opaque mothers.
238 G4int fCBDAlgorithmNumber; // Colour by density algorithm number.
239 std::vector<G4double> fCBDParameters; // Colour by density parameters.
240 G4double fExplodeFactor; // Explode along radius by this factor...
241 G4Point3D fExplodeCentre; // ...about this centre.
242 G4int fNoOfSides; // ...if polygon approximates circle.
243 G4DisplacedSolid* fpSectionSolid; // For generic section (DCUT).
244 CutawayMode fCutawayMode; // Cutaway mode.
245 G4DisplacedSolid* fpCutawaySolid; // For generic cutaways.
246 const G4Event* fpEvent; // Event being processed.
247 std::vector<VisAttributesModifier> fVisAttributesModifiers;
248 G4bool fSpecialMeshRendering; // Request special rendering of parameterised volumes
249 std::vector<PVNameCopyNo> fSpecialMeshVolumes; // If empty, all meshes.
250};
251
252std::ostream& operator <<
253(std::ostream& os, const G4ModelingParameters&);
254
255std::ostream& operator <<
256(std::ostream& os, const G4ModelingParameters::PVNameCopyNoPath&);
257
258std::ostream& operator <<
259(std::ostream& os, const G4ModelingParameters::PVPointerCopyNoPath&);
260
261std::ostream& operator <<
262(std::ostream& os,
263 const std::vector<G4ModelingParameters::VisAttributesModifier>&);
264
265#include "G4ModelingParameters.icc"
266
267#endif
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4bool operator==(const PVNameCopyNo &rhs) const
PVNameCopyNo(G4String name, G4int copyNo)
G4bool operator!=(const PVNameCopyNo &) const
G4bool operator!=(const PVPointerCopyNo &) const
PVPointerCopyNo(G4VPhysicalVolume *pPV, G4int copyNo)
const G4VPhysicalVolume * GetPVPointer() const
G4bool operator==(const PVPointerCopyNo &rhs) const
G4bool operator==(const VisAttributesModifier &rhs) const
const PVNameCopyNoPath & GetPVNameCopyNoPath() const
void SetVisAttributes(const G4VisAttributes &visAtts)
VisAttributesModifier(const G4VisAttributes &visAtts, VisAttributesSignifier signifier, const PVNameCopyNoPath &path)
void SetPVNameCopyNoPath(const PVNameCopyNoPath &PVNameCopyNoPath)
VisAttributesSignifier GetVisAttributesSignifier() const
const G4VisAttributes & GetVisAttributes() const
void SetVisAttributesSignifier(VisAttributesSignifier signifier)
G4bool operator!=(const VisAttributesModifier &) const
G4bool IsWarning() const
void SetCBDParameters(const std::vector< G4double > &)
const G4VisAttributes * GetDefaultVisAttributes() const
const std::vector< VisAttributesModifier > & GetVisAttributesModifiers() const
std::vector< PVNameCopyNo > PVNameCopyNoPath
CutawayMode GetCutawayMode() const
std::vector< PVPointerCopyNo > PVPointerCopyNoPath
const G4Event * GetEvent() const
void SetWarning(G4bool)
const G4Point3D & GetExplodeCentre() const
void SetNumberOfCloudPoints(G4int)
G4int GetNumberOfCloudPoints() const
G4double GetVisibleDensity() const
G4bool IsCullingInvisible() const
const std::vector< PVNameCopyNo > & GetSpecialMeshVolumes() const
void SetCBDAlgorithmNumber(G4int)
void SetExplodeFactor(G4double explodeFactor)
void SetDrawingStyle(DrawingStyle)
void SetVisAttributesModifiers(const std::vector< VisAttributesModifier > &)
void SetExplodeCentre(const G4Point3D &explodeCentre)
void SetCullingCovered(G4bool)
G4bool IsExplode() const
G4bool IsCulling() const
void SetCutawayMode(CutawayMode)
const std::vector< G4double > & GetCBDParameters() const
G4int GetNoOfSides() const
PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator
G4bool IsDensityCulling() const
G4bool IsSpecialMeshRendering() const
void SetDefaultVisAttributes(const G4VisAttributes *pDefaultVisAttributes)
void SetCutawaySolid(G4DisplacedSolid *pCutawaySolid)
PVPointerCopyNoPath::const_iterator PVPointerCopyNoPathConstIterator
DrawingStyle GetDrawingStyle() const
void SetCulling(G4bool)
G4DisplacedSolid * GetSectionSolid() const
G4double GetExplodeFactor() const
void SetSectionSolid(G4DisplacedSolid *pSectionSolid)
void SetEvent(const G4Event *pEvent)
G4bool operator!=(const G4ModelingParameters &) const
G4DisplacedSolid * GetCutawaySolid() const
G4bool IsCullingCovered() const
void SetCullingInvisible(G4bool)
G4int GetCBDAlgorithmNumber() const
void SetSpecialMeshVolumes(const std::vector< PVNameCopyNo > &)
void SetSpecialMeshRendering(G4bool)
void SetDensityCulling(G4bool)