Geant4 10.7.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
65 // enums and nested class for communicating a modification to the vis
66 // attributes for a specfic touchable defined by PVNameCopyNoPath.
79 };
80
82 public:
83 // Normal constructor
85 : fName(name), fCopyNo(copyNo) {}
86 const G4String& GetName() const {return fName;}
87 G4int GetCopyNo() const {return fCopyNo;}
88 G4bool operator!=(const PVNameCopyNo&) const;
89 G4bool operator==(const PVNameCopyNo& rhs) const {return !operator!=(rhs);}
90 private:
91 G4String fName;
92 G4int fCopyNo;
93 };
94 typedef std::vector<PVNameCopyNo> PVNameCopyNoPath;
95 typedef PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator;
96
98 public:
99 // Normal constructor
101 : fpPV(pPV), fCopyNo(copyNo) {}
102 const G4String& GetName() const;
103 const G4VPhysicalVolume* GetPVPointer() const {return fpPV;}
104 G4int GetCopyNo() const {return fCopyNo;}
105 G4bool operator!=(const PVPointerCopyNo&) const;
106 G4bool operator==(const PVPointerCopyNo& rhs) const {return !operator!=(rhs);}
107 private:
108 G4VPhysicalVolume* fpPV;
109 G4int fCopyNo;
110 };
111 typedef std::vector<PVPointerCopyNo> PVPointerCopyNoPath;
112 typedef PVPointerCopyNoPath::const_iterator PVPointerCopyNoPathConstIterator;
113
115 public:
117 (const G4VisAttributes& visAtts,
118 VisAttributesSignifier signifier,
119 const PVNameCopyNoPath& path):
120 fVisAtts(visAtts), fSignifier(signifier), fPVNameCopyNoPath(path) {}
122 {return fVisAtts;}
124 {return fSignifier;}
126 {return fPVNameCopyNoPath;}
128 {fVisAtts = visAtts;}
130 {fSignifier = signifier;}
132 {fPVNameCopyNoPath = PVNameCopyNoPath;}
135 {return !operator!=(rhs);}
136 private:
137 G4VisAttributes fVisAtts;
138 VisAttributesSignifier fSignifier;
139 PVNameCopyNoPath fPVNameCopyNoPath;
140 };
141
143
144 G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes,
145 DrawingStyle drawingStyle,
146 G4bool isCulling,
147 G4bool isCullingInvisible,
148 G4bool isDensityCulling,
149 G4double visibleDensity,
150 G4bool isCullingCovered,
151 G4int noOfSides);
152 // Culling and clipping policy for G4PhysicalVolumeModel.
153
155
156 // Note: uses default assignment operator and copy constructor.
157
159
160 // Get and Is functions...
171 const std::vector<G4double>& GetCBDParameters () const;
178 const G4Event* GetEvent () const;
179 const std::vector<VisAttributesModifier>& GetVisAttributesModifiers() const;
180
181 // Set functions...
183 void SetDefaultVisAttributes (const G4VisAttributes* pDefaultVisAttributes);
192 void SetCBDParameters (const std::vector<G4double>&);
193 void SetExplodeFactor (G4double explodeFactor);
194 void SetExplodeCentre (const G4Point3D& explodeCentre);
195 G4int SetNoOfSides (G4int); // Returns actual number set.
196 void SetSectionSolid (G4DisplacedSolid* pSectionSolid);
197 void SetCutawaySolid (G4DisplacedSolid* pCutawaySolid);
198 void SetEvent (const G4Event* pEvent);
199 void SetVisAttributesModifiers(const std::vector<VisAttributesModifier>&);
200
201 friend std::ostream& operator <<
202 (std::ostream& os, const G4ModelingParameters&);
203
204 friend std::ostream& operator <<
205 (std::ostream& os, const PVNameCopyNoPath&);
206
207 friend std::ostream& operator <<
208 (std::ostream& os, const PVPointerCopyNoPath&);
209
210 friend std::ostream& operator <<
211 (std::ostream& os,
212 const std::vector<VisAttributesModifier>&);
213
214private:
215
216 // Data members...
217 G4bool fWarning; // Print warnings if true.
218 const G4VisAttributes* fpDefaultVisAttributes;
219 DrawingStyle fDrawingStyle; // Drawing style.
220 G4int fNumberOfCloudPoints; // For drawing in cloud style.
221 // <= 0 means use viewer default.
222 G4bool fCulling; // Culling requested.
223 G4bool fCullInvisible; // Cull (don't Draw) invisible objects.
224 G4bool fDensityCulling; // Density culling requested. If so...
225 G4double fVisibleDensity; // ...density lower than this not drawn.
226 G4bool fCullCovered; // Cull daughters covered by opaque mothers.
227 G4int fCBDAlgorithmNumber; // Colour by density algorithm number.
228 std::vector<G4double> fCBDParameters; // Colour by density parameters.
229 G4double fExplodeFactor; // Explode along radius by this factor...
230 G4Point3D fExplodeCentre; // ...about this centre.
231 G4int fNoOfSides; // ...if polygon approximates circle.
232 G4DisplacedSolid* fpSectionSolid; // For generic section (DCUT).
233 G4DisplacedSolid* fpCutawaySolid; // For generic cutaways.
234 const G4Event* fpEvent; // Event being processed.
235 std::vector<VisAttributesModifier> fVisAttributesModifiers;
236};
237
238std::ostream& operator <<
239(std::ostream& os, const G4ModelingParameters&);
240
241std::ostream& operator <<
242(std::ostream& os, const G4ModelingParameters::PVNameCopyNoPath&);
243
244std::ostream& operator <<
245(std::ostream& os, const G4ModelingParameters::PVPointerCopyNoPath&);
246
247std::ostream& operator <<
248(std::ostream& os,
249 const std::vector<G4ModelingParameters::VisAttributesModifier>&);
250
251#include "G4ModelingParameters.icc"
252
253#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
const G4Event * GetEvent() const
void SetWarning(G4bool)
const G4Point3D & GetExplodeCentre() const
PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator
void SetNumberOfCloudPoints(G4int)
PVPointerCopyNoPath::const_iterator PVPointerCopyNoPathConstIterator
std::vector< PVNameCopyNo > PVNameCopyNoPath
G4int GetNumberOfCloudPoints() const
G4double GetVisibleDensity() const
G4bool IsCullingInvisible() 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
const std::vector< G4double > & GetCBDParameters() const
G4int GetNoOfSides() const
G4bool IsDensityCulling() const
void SetDefaultVisAttributes(const G4VisAttributes *pDefaultVisAttributes)
void SetCutawaySolid(G4DisplacedSolid *pCutawaySolid)
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 SetVisibleDensity(G4double)
void SetDensityCulling(G4bool)