Geant4 11.4.0
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
89 PVNameCopyNo(const G4String& name, G4int copyNo)
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 G4double fStartTime = -G4VisAttributes::fVeryLongTime; // ) Start and end time of drawn range,
149 G4double fEndTime = G4VisAttributes::fVeryLongTime; // ) e.g., for trajectory steps.
150 G4double fFadeFactor = 1.; // 0: no fade; 1: maximum fade with time within range.
151 G4bool fDisplayHeadTime = false; // Display head time (fEndTime) in 2D text.
152 G4double fDisplayHeadTimeX = 0.0; // ) 2D screen coords of head time,
153 G4double fDisplayHeadTimeY = -0.9; // ) bottom-middle of view.
154 G4double fDisplayHeadTimeSize = 24.; // Screen size (pixels) of the head time writing.
156 G4double fDisplayHeadTimeGreen = 1.; // ) Default colour of head time writing (cyan)
158 G4bool fDisplayLightFront = false; // Display light front at head time originating at...
160 G4double fDisplayLightFrontY = 0.; // ) ...default coordinates and time of origin
161 G4double fDisplayLightFrontZ = 0.; // ) of light front drawing...
164 G4double fDisplayLightFrontGreen = 1.; // ) ...in this default colour (green)
188 };
189
191
192 G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes,
193 DrawingStyle drawingStyle,
194 G4bool isCulling,
195 G4bool isCullingInvisible,
196 G4bool isDensityCulling,
197 G4double visibleDensity,
198 G4bool isCullingCovered,
199 G4int noOfSides);
200 // Culling and clipping policy for G4PhysicalVolumeModel.
201
203
204 // Note: uses default assignment operator and copy constructor.
205
207
208 // Get and Is functions...
219 const std::vector<G4double>& GetCBDParameters () const;
227 const G4Event* GetEvent () const;
228 const std::vector<VisAttributesModifier>& GetVisAttributesModifiers() const;
231 const std::vector<PVNameCopyNo>& GetSpecialMeshVolumes () const;
234
235 // Set functions...
237 void SetDefaultVisAttributes (const G4VisAttributes* pDefaultVisAttributes);
246 void SetCBDParameters (const std::vector<G4double>&);
247 void SetExplodeFactor (G4double explodeFactor);
248 void SetExplodeCentre (const G4Point3D& explodeCentre);
249 G4int SetNoOfSides (G4int); // Returns actual number set.
250 void SetSectionSolid (G4DisplacedSolid* pSectionSolid);
252 void SetCutawaySolid (G4DisplacedSolid* pCutawaySolid);
253 void SetEvent (const G4Event* pEvent);
254 void SetVisAttributesModifiers(const std::vector<VisAttributesModifier>&);
257 void SetSpecialMeshVolumes (const std::vector<PVNameCopyNo>&);
260
261 friend std::ostream& operator <<
262 (std::ostream& os, const G4ModelingParameters&);
263
264 friend std::ostream& operator <<
265 (std::ostream& os, const PVNameCopyNoPath&);
266
267 friend std::ostream& operator <<
268 (std::ostream& os, const PVPointerCopyNoPath&);
269
270 friend std::ostream& operator <<
271 (std::ostream& os,
272 const std::vector<VisAttributesModifier>&);
273
274private:
275
276 // Data members...
277 G4bool fWarning; // Print warnings if true.
278 const G4VisAttributes* fpDefaultVisAttributes;
279 DrawingStyle fDrawingStyle; // Drawing style.
280 G4int fNumberOfCloudPoints; // For drawing in cloud style.
281 // <= 0 means use viewer default.
282 G4bool fCulling; // Culling requested.
283 G4bool fCullInvisible; // Cull (don't Draw) invisible objects.
284 G4bool fDensityCulling; // Density culling requested. If so...
285 G4double fVisibleDensity; // ...density lower than this not drawn.
286 G4bool fCullCovered; // Cull daughters covered by opaque mothers.
287 G4int fCBDAlgorithmNumber; // Colour by density algorithm number.
288 std::vector<G4double> fCBDParameters; // Colour by density parameters.
289 G4double fExplodeFactor; // Explode along radius by this factor...
290 G4Point3D fExplodeCentre; // ...about this centre.
291 G4int fNoOfSides; // ...if polygon approximates circle.
292 G4DisplacedSolid* fpSectionSolid; // For generic section (DCUT).
293 CutawayMode fCutawayMode; // Cutaway mode.
294 G4DisplacedSolid* fpCutawaySolid; // For generic cutaways.
295 const G4Event* fpEvent; // Event being processed.
296 std::vector<VisAttributesModifier> fVisAttributesModifiers;
297 TimeParameters fTimeParameters; // Time parameters (for time-slicing).
298 G4bool fSpecialMeshRendering; // Request special rendering of parameterised volumes
299 std::vector<PVNameCopyNo> fSpecialMeshVolumes; // If empty, all meshes.
300 G4double fTransparencyByDepth; // Transparency ~= (geometry depth) - fTransparencyByDepth
301 G4int fTransparencyByDepthOption; // Its option
302};
303
304std::ostream& operator <<
305(std::ostream& os, const G4ModelingParameters&);
306
307std::ostream& operator <<
308(std::ostream& os, const G4ModelingParameters::PVNameCopyNoPath&);
309
310std::ostream& operator <<
311(std::ostream& os, const G4ModelingParameters::PVPointerCopyNoPath&);
312
313std::ostream& operator <<
314(std::ostream& os,
315 const std::vector<G4ModelingParameters::VisAttributesModifier>&);
316
317#include "G4ModelingParameters.icc"
318
319#endif
HepGeom::Point3D< G4double > G4Point3D
Definition G4Point3D.hh:34
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4DisplacedSolid is a solid that has been shifted from its original frame of reference to a new one....
G4LogicalVolume represents a leaf node or unpositioned subtree in the geometry hierarchy....
PVNameCopyNo(const G4String &name, G4int copyNo)
G4bool operator==(const PVNameCopyNo &rhs) const
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
CutawayMode GetCutawayMode() const
const G4Event * GetEvent() const
void SetWarning(G4bool)
const G4Point3D & GetExplodeCentre() const
PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator
void SetTransparencyByDepth(G4double)
void SetNumberOfCloudPoints(G4int)
PVPointerCopyNoPath::const_iterator PVPointerCopyNoPathConstIterator
std::vector< PVNameCopyNo > PVNameCopyNoPath
G4int GetNumberOfCloudPoints() const
G4double GetVisibleDensity() const
G4bool IsCullingInvisible() const
const std::vector< PVNameCopyNo > & GetSpecialMeshVolumes() const
G4int GetTransparencyByDepthOption() const
std::vector< PVPointerCopyNo > PVPointerCopyNoPath
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
G4double GetTransparencyByDepth() const
void SetCutawayMode(CutawayMode)
const std::vector< G4double > & GetCBDParameters() const
G4int GetNoOfSides() const
G4bool IsDensityCulling() const
G4bool IsSpecialMeshRendering() const
void SetDefaultVisAttributes(const G4VisAttributes *pDefaultVisAttributes)
void SetCutawaySolid(G4DisplacedSolid *pCutawaySolid)
DrawingStyle GetDrawingStyle() const
void SetTimeParameters(const TimeParameters &)
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)
const TimeParameters & GetTimeParameters() const
void SetDensityCulling(G4bool)
void SetTransparencyByDepthOption(G4int)
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
G4VSolid is an abstract base class for solids, physical shapes that can be tracked through....
Definition G4VSolid.hh:80
static constexpr G4double fVeryLongTime
G4bool operator!=(const TimeParameters &rhs) const