Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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// $Id$
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"
43
44#include <vector>
45#include <utility>
46
47class G4LogicalVolume;
48class G4VisAttributes;
49class 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 };
63
64 // enums and nested class for communicating a modification to the vis
65 // attributes for a specfic touchable defined by PVNameCopyNoPath.
76 };
78 public:
80 fName(name), fCopyNo(copyNo) {}
81 const G4String& GetName() const {return fName;}
82 G4int GetCopyNo() const {return fCopyNo;}
83 private:
84 G4String fName;
85 G4int fCopyNo;
86 };
87 typedef std::vector<PVNameCopyNo> PVNameCopyNoPath;
88 typedef PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator;
90 public:
92 (const G4VisAttributes& visAtts,
93 VisAttributesSignifier signifier,
94 const PVNameCopyNoPath& path):
95 fVisAtts(visAtts), fSignifier(signifier), fPVNameCopyNoPath(path) {}
97 (const G4VisAttributes& visAtts,
98 VisAttributesSignifier signifier,
99 const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& path);
101 {return fVisAtts;}
103 {return fSignifier;}
105 {return fPVNameCopyNoPath;}
106 private:
107 G4VisAttributes fVisAtts;
108 VisAttributesSignifier fSignifier;
109 PVNameCopyNoPath fPVNameCopyNoPath;
110 };
111
113
114 G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes,
115 DrawingStyle drawingStyle,
116 G4bool isCulling,
117 G4bool isCullingInvisible,
118 G4bool isDensityCulling,
119 G4double visibleDensity,
120 G4bool isCullingCovered,
121 G4int noOfSides);
122 // Culling and clipping policy for G4PhysicalVolumeModel.
123
125
126 // Note: uses default assignment operator and copy constructor.
127
129
130 // Get and Is functions...
145 const G4Event* GetEvent () const;
146 const std::vector<VisAttributesModifier>& GetVisAttributesModifiers() const;
147
148 // Set functions...
150 void SetDefaultVisAttributes (const G4VisAttributes* pDefaultVisAttributes);
157 void SetExplodeFactor (G4double explodeFactor);
158 void SetExplodeCentre (const G4Point3D& explodeCentre);
159 G4int SetNoOfSides (G4int); // Returns actual number set.
160 void SetSectionSolid (G4VSolid* pSectionSolid);
161 void SetCutawaySolid (G4VSolid* pCutawaySolid);
162 void SetEvent (const G4Event* pEvent);
163 void SetVisAttributesModifiers(const std::vector<VisAttributesModifier>);
164
166 (const PVNameCopyNoPath&,
167 const PVNameCopyNoPath&);
168
169 static G4bool VAMSNotEqual
170 (const std::vector<VisAttributesModifier>&,
171 const std::vector<VisAttributesModifier>&);
172
173 friend std::ostream& operator <<
174 (std::ostream& os, const G4ModelingParameters&);
175
176 friend std::ostream& operator <<
177 (std::ostream& os, const PVNameCopyNoPath&);
178
179 friend std::ostream& operator <<
180 (std::ostream& os,
181 const std::vector<VisAttributesModifier>&);
182
183private:
184
185 // Data members...
186 G4bool fWarning; // Print warnings if true.
187 const G4VisAttributes* fpDefaultVisAttributes;
188 DrawingStyle fDrawingStyle; // Drawing style.
189 G4bool fCulling; // Culling requested.
190 G4bool fCullInvisible; // Cull (don't Draw) invisible objects.
191 G4bool fDensityCulling; // Density culling requested. If so...
192 G4double fVisibleDensity; // ...density lower than this not drawn.
193 G4bool fCullCovered; // Cull daughters covered by opaque mothers.
194 G4double fExplodeFactor; // Explode along radius by this factor...
195 G4Point3D fExplodeCentre; // ...about this centre.
196 G4int fNoOfSides; // ...if polygon approximates circle.
197 G4VSolid* fpSectionSolid; // For generic section (DCUT).
198 G4VSolid* fpCutawaySolid; // For generic cutaways.
199 const G4Event* fpEvent; // Event being processed.
200 std::vector<VisAttributesModifier> fVisAttributesModifiers;
201};
202
203std::ostream& operator <<
204(std::ostream& os, const G4ModelingParameters&);
205
206std::ostream& operator <<
207(std::ostream& os, const G4ModelingParameters::PVNameCopyNoPath&);
208
209std::ostream& operator <<
210(std::ostream& os,
211 const std::vector<G4ModelingParameters::VisAttributesModifier>&);
212
213#include "G4ModelingParameters.icc"
214
215#endif
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
PVNameCopyNo(G4String name, G4int copyNo)
const PVNameCopyNoPath & GetPVNameCopyNoPath() const
VisAttributesModifier(const G4VisAttributes &visAtts, VisAttributesSignifier signifier, const PVNameCopyNoPath &path)
VisAttributesSignifier GetVisAttributesSignifier() const
const G4VisAttributes & GetVisAttributes() const
G4bool IsWarning() const
const G4VisAttributes * GetDefaultVisAttributes() const
G4VSolid * GetCutawaySolid() const
const std::vector< VisAttributesModifier > & GetVisAttributesModifiers() const
void SetVisAttributesModifiers(const std::vector< VisAttributesModifier >)
void SetCutawaySolid(G4VSolid *pCutawaySolid)
const G4Event * GetEvent() const
void SetSectionSolid(G4VSolid *pSectionSolid)
void SetWarning(G4bool)
const G4Point3D & GetExplodeCentre() const
PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator
std::vector< PVNameCopyNo > PVNameCopyNoPath
static G4bool PVNameCopyNoPathNotEqual(const PVNameCopyNoPath &, const PVNameCopyNoPath &)
G4double GetVisibleDensity() const
G4bool IsCullingInvisible() const
void SetExplodeFactor(G4double explodeFactor)
void SetDrawingStyle(DrawingStyle)
void SetExplodeCentre(const G4Point3D &explodeCentre)
void SetCullingCovered(G4bool)
G4bool IsExplode() const
static G4bool VAMSNotEqual(const std::vector< VisAttributesModifier > &, const std::vector< VisAttributesModifier > &)
G4bool IsCulling() const
G4int GetNoOfSides() const
G4bool IsDensityCulling() const
void SetDefaultVisAttributes(const G4VisAttributes *pDefaultVisAttributes)
DrawingStyle GetDrawingStyle() const
void SetCulling(G4bool)
G4double GetExplodeFactor() const
void SetEvent(const G4Event *pEvent)
G4bool operator!=(const G4ModelingParameters &) const
G4bool IsCullingCovered() const
void SetCullingInvisible(G4bool)
void SetVisibleDensity(G4double)
void SetDensityCulling(G4bool)
G4VSolid * GetSectionSolid() const