Geant4  10.02.p03
G4ModelingParameters Class Reference

#include <G4ModelingParameters.hh>

Collaboration diagram for G4ModelingParameters:

Classes

class  PVNameCopyNo
 
class  VisAttributesModifier
 

Public Types

enum  DrawingStyle { wf, hlr, hsr, hlhsr }
 
enum  VisAttributesSignifier {
  VASVisibility, VASDaughtersInvisible, VASColour, VASLineStyle,
  VASLineWidth, VASForceWireframe, VASForceSolid, VASForceAuxEdgeVisible,
  VASForceLineSegmentsPerCircle
}
 
typedef std::vector< PVNameCopyNoPVNameCopyNoPath
 
typedef PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator
 

Public Member Functions

 G4ModelingParameters ()
 
 G4ModelingParameters (const G4VisAttributes *pDefaultVisAttributes, DrawingStyle drawingStyle, G4bool isCulling, G4bool isCullingInvisible, G4bool isDensityCulling, G4double visibleDensity, G4bool isCullingCovered, G4int noOfSides)
 
 ~G4ModelingParameters ()
 
G4bool operator!= (const G4ModelingParameters &) const
 
G4bool IsWarning () const
 
const G4VisAttributesGetDefaultVisAttributes () const
 
DrawingStyle GetDrawingStyle () const
 
G4bool IsCulling () const
 
G4bool IsCullingInvisible () const
 
G4bool IsDensityCulling () const
 
G4double GetVisibleDensity () const
 
G4bool IsCullingCovered () const
 
G4bool IsExplode () const
 
G4double GetExplodeFactor () const
 
const G4Point3DGetExplodeCentre () const
 
G4int GetNoOfSides () const
 
G4VSolidGetSectionSolid () const
 
G4VSolidGetCutawaySolid () const
 
const G4EventGetEvent () const
 
const std::vector< VisAttributesModifier > & GetVisAttributesModifiers () const
 
void SetWarning (G4bool)
 
void SetDefaultVisAttributes (const G4VisAttributes *pDefaultVisAttributes)
 
void SetDrawingStyle (DrawingStyle)
 
void SetCulling (G4bool)
 
void SetCullingInvisible (G4bool)
 
void SetDensityCulling (G4bool)
 
void SetVisibleDensity (G4double)
 
void SetCullingCovered (G4bool)
 
void SetExplodeFactor (G4double explodeFactor)
 
void SetExplodeCentre (const G4Point3D &explodeCentre)
 
G4int SetNoOfSides (G4int)
 
void SetSectionSolid (G4VSolid *pSectionSolid)
 
void SetCutawaySolid (G4VSolid *pCutawaySolid)
 
void SetEvent (const G4Event *pEvent)
 
void SetVisAttributesModifiers (const std::vector< VisAttributesModifier > &)
 

Private Attributes

G4bool fWarning
 
const G4VisAttributesfpDefaultVisAttributes
 
DrawingStyle fDrawingStyle
 
G4bool fCulling
 
G4bool fCullInvisible
 
G4bool fDensityCulling
 
G4double fVisibleDensity
 
G4bool fCullCovered
 
G4double fExplodeFactor
 
G4Point3D fExplodeCentre
 
G4int fNoOfSides
 
G4VSolidfpSectionSolid
 
G4VSolidfpCutawaySolid
 
const G4EventfpEvent
 
std::vector< VisAttributesModifierfVisAttributesModifiers
 

Friends

std::ostream & operator<< (std::ostream &os, const G4ModelingParameters &)
 
std::ostream & operator<< (std::ostream &os, const PVNameCopyNoPath &)
 
std::ostream & operator<< (std::ostream &os, const std::vector< VisAttributesModifier > &)
 

Detailed Description

Definition at line 52 of file G4ModelingParameters.hh.

Member Typedef Documentation

◆ PVNameCopyNoPath

Definition at line 90 of file G4ModelingParameters.hh.

◆ PVNameCopyNoPathConstIterator

typedef PVNameCopyNoPath::const_iterator G4ModelingParameters::PVNameCopyNoPathConstIterator

Definition at line 91 of file G4ModelingParameters.hh.

Member Enumeration Documentation

◆ DrawingStyle

Enumerator
wf 
hlr 
hsr 
hlhsr 

Definition at line 57 of file G4ModelingParameters.hh.

57  {
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  };

◆ VisAttributesSignifier

Constructor & Destructor Documentation

◆ G4ModelingParameters() [1/2]

G4ModelingParameters::G4ModelingParameters ( )

Definition at line 43 of file G4ModelingParameters.cc.

43  :
44  fWarning (true),
46  fDrawingStyle (wf),
47  fCulling (false),
48  fCullInvisible (false),
49  fDensityCulling (false),
50  fVisibleDensity (0.01 * g / cm3),
51  fCullCovered (false),
52  fExplodeFactor (1.),
53  fNoOfSides (24),
54  fpSectionSolid (0),
55  fpCutawaySolid (0),
56  fpEvent (0)
57 {}
const G4VisAttributes * fpDefaultVisAttributes
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
static const double cm3
Definition: G4SIunits.hh:120

◆ G4ModelingParameters() [2/2]

G4ModelingParameters::G4ModelingParameters ( const G4VisAttributes pDefaultVisAttributes,
G4ModelingParameters::DrawingStyle  drawingStyle,
G4bool  isCulling,
G4bool  isCullingInvisible,
G4bool  isDensityCulling,
G4double  visibleDensity,
G4bool  isCullingCovered,
G4int  noOfSides 
)

Definition at line 60 of file G4ModelingParameters.cc.

68  :
69  fWarning (true),
70  fpDefaultVisAttributes (pDefaultVisAttributes),
71  fDrawingStyle (drawingStyle),
72  fCulling (isCulling),
73  fCullInvisible (isCullingInvisible),
74  fDensityCulling (isDensityCulling),
75  fVisibleDensity (visibleDensity),
76  fCullCovered (isCullingCovered),
77  fExplodeFactor (1.),
78  fNoOfSides (noOfSides),
79  fpSectionSolid (0),
80  fpCutawaySolid (0),
81  fpEvent (0)
82 {}
const G4VisAttributes * fpDefaultVisAttributes

◆ ~G4ModelingParameters()

G4ModelingParameters::~G4ModelingParameters ( )

Definition at line 84 of file G4ModelingParameters.cc.

85 {
86  delete fpSectionSolid;
87  delete fpCutawaySolid;
88 }
Here is the call graph for this function:

Member Function Documentation

◆ GetCutawaySolid()

G4VSolid* G4ModelingParameters::GetCutawaySolid ( ) const
Here is the caller graph for this function:

◆ GetDefaultVisAttributes()

const G4VisAttributes* G4ModelingParameters::GetDefaultVisAttributes ( ) const
Here is the caller graph for this function:

◆ GetDrawingStyle()

DrawingStyle G4ModelingParameters::GetDrawingStyle ( ) const
Here is the caller graph for this function:

◆ GetEvent()

const G4Event* G4ModelingParameters::GetEvent ( ) const
Here is the caller graph for this function:

◆ GetExplodeCentre()

const G4Point3D& G4ModelingParameters::GetExplodeCentre ( ) const
Here is the caller graph for this function:

◆ GetExplodeFactor()

G4double G4ModelingParameters::GetExplodeFactor ( ) const
Here is the caller graph for this function:

◆ GetNoOfSides()

G4int G4ModelingParameters::GetNoOfSides ( ) const
Here is the caller graph for this function:

◆ GetSectionSolid()

G4VSolid* G4ModelingParameters::GetSectionSolid ( ) const
Here is the caller graph for this function:

◆ GetVisAttributesModifiers()

const std::vector<VisAttributesModifier>& G4ModelingParameters::GetVisAttributesModifiers ( ) const
Here is the caller graph for this function:

◆ GetVisibleDensity()

G4double G4ModelingParameters::GetVisibleDensity ( ) const

◆ IsCulling()

G4bool G4ModelingParameters::IsCulling ( ) const
Here is the caller graph for this function:

◆ IsCullingCovered()

G4bool G4ModelingParameters::IsCullingCovered ( ) const
Here is the caller graph for this function:

◆ IsCullingInvisible()

G4bool G4ModelingParameters::IsCullingInvisible ( ) const
Here is the caller graph for this function:

◆ IsDensityCulling()

G4bool G4ModelingParameters::IsDensityCulling ( ) const
Here is the caller graph for this function:

◆ IsExplode()

G4bool G4ModelingParameters::IsExplode ( ) const
Here is the caller graph for this function:

◆ IsWarning()

G4bool G4ModelingParameters::IsWarning ( ) const
Here is the caller graph for this function:

◆ operator!=()

G4bool G4ModelingParameters::operator!= ( const G4ModelingParameters mp) const

Definition at line 225 of file G4ModelingParameters.cc.

225  {
226 
227  if (
228  (fWarning != mp.fWarning) ||
230  (fCulling != mp.fCulling) ||
231  (fCullInvisible != mp.fCullInvisible) ||
233  (fCullCovered != mp.fCullCovered) ||
234  (fExplodeFactor != mp.fExplodeFactor) ||
235  (fExplodeCentre != mp.fExplodeCentre) ||
236  (fNoOfSides != mp.fNoOfSides) ||
237  (fpSectionSolid != mp.fpSectionSolid) ||
238  (fpCutawaySolid != mp.fpCutawaySolid) ||
239  (fpEvent != mp.fpEvent)
240  )
241  return true;
242 
243  if (fDensityCulling &&
244  (fVisibleDensity != mp.fVisibleDensity)) return true;
245 
247  return true;
248 
249  return false;
250 }
const G4VisAttributes * fpDefaultVisAttributes
std::vector< VisAttributesModifier > fVisAttributesModifiers

◆ SetCulling()

void G4ModelingParameters::SetCulling ( G4bool  )
Here is the caller graph for this function:

◆ SetCullingCovered()

void G4ModelingParameters::SetCullingCovered ( G4bool  )

◆ SetCullingInvisible()

void G4ModelingParameters::SetCullingInvisible ( G4bool  )

◆ SetCutawaySolid()

void G4ModelingParameters::SetCutawaySolid ( G4VSolid pCutawaySolid)

Definition at line 147 of file G4ModelingParameters.cc.

147  {
148  delete fpCutawaySolid;
149  fpCutawaySolid = pCutawaySolid;
150 }
Here is the caller graph for this function:

◆ SetDefaultVisAttributes()

void G4ModelingParameters::SetDefaultVisAttributes ( const G4VisAttributes pDefaultVisAttributes)
Here is the caller graph for this function:

◆ SetDensityCulling()

void G4ModelingParameters::SetDensityCulling ( G4bool  )

◆ SetDrawingStyle()

void G4ModelingParameters::SetDrawingStyle ( DrawingStyle  )

◆ SetEvent()

void G4ModelingParameters::SetEvent ( const G4Event pEvent)
Here is the caller graph for this function:

◆ SetExplodeCentre()

void G4ModelingParameters::SetExplodeCentre ( const G4Point3D explodeCentre)
Here is the caller graph for this function:

◆ SetExplodeFactor()

void G4ModelingParameters::SetExplodeFactor ( G4double  explodeFactor)
Here is the caller graph for this function:

◆ SetNoOfSides()

G4int G4ModelingParameters::SetNoOfSides ( G4int  nSides)

Definition at line 127 of file G4ModelingParameters.cc.

127  {
129  if (nSides < nSidesMin) {
130  nSides = nSidesMin;
131  if (fWarning)
132  G4cout << "G4ModelingParameters::SetNoOfSides: attempt to set the"
133  "\nnumber of sides per circle < " << nSidesMin
134  << "; forced to" << nSides << G4endl;
135  }
136  fNoOfSides = nSides;
137  return fNoOfSides;
138 }
int G4int
Definition: G4Types.hh:78
const G4VisAttributes * fpDefaultVisAttributes
G4GLOB_DLL std::ostream G4cout
static G4int GetMinLineSegmentsPerCircle()
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ SetSectionSolid()

void G4ModelingParameters::SetSectionSolid ( G4VSolid pSectionSolid)

Definition at line 141 of file G4ModelingParameters.cc.

141  {
142  delete fpSectionSolid;
143  fpSectionSolid = pSectionSolid;
144 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetVisAttributesModifiers()

void G4ModelingParameters::SetVisAttributesModifiers ( const std::vector< VisAttributesModifier > &  )
Here is the caller graph for this function:

◆ SetVisibleDensity()

void G4ModelingParameters::SetVisibleDensity ( G4double  visibleDensity)

Definition at line 110 of file G4ModelingParameters.cc.

110  {
111  const G4double reasonableMaximum = 10.0 * g / cm3;
112  if (visibleDensity < 0 && fWarning) {
113  G4cout << "G4ModelingParameters::SetVisibleDensity: attempt to set negative "
114  "density - ignored." << G4endl;
115  }
116  else {
117  if (fVisibleDensity > reasonableMaximum && fWarning) {
118  G4cout << "G4ModelingParameters::SetVisibleDensity: density > "
119  << reasonableMaximum
120  << " g / cm3 - did you mean this?"
121  << G4endl;
122  }
123  fVisibleDensity = visibleDensity;
124  }
125 }
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
G4GLOB_DLL std::ostream G4cout
static const double cm3
Definition: G4SIunits.hh:120
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ SetWarning()

void G4ModelingParameters::SetWarning ( G4bool  )
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<< [1/3]

std::ostream& operator<< ( std::ostream &  os,
const G4ModelingParameters mp 
)
friend

Definition at line 152 of file G4ModelingParameters.cc.

153 {
154  os << "Modeling parameters (warning ";
155  if (mp.fWarning) os << "true";
156  else os << "false";
157  os << "):";
158 
160  os << "\n Default vis. attributes: ";
161  if (va) os << *va;
162  else os << "none";
163 
164  os << "\n Current requested drawing style: ";
165  switch (mp.fDrawingStyle) {
167  os << "wireframe"; break;
169  os << "hidden line removal (hlr)"; break;
171  os << "surface (hsr)"; break;
173  os << "surface and edges (hlhsr)"; break;
174  default: os << "unrecognised"; break;
175  }
176 
177  os << "\n Culling: ";
178  if (mp.fCulling) os << "on";
179  else os << "off";
180 
181  os << "\n Culling invisible objects: ";
182  if (mp.fCullInvisible) os << "on";
183  else os << "off";
184 
185  os << "\n Density culling: ";
186  if (mp.fDensityCulling) {
187  os << "on - invisible if density less than "
188  << mp.fVisibleDensity / (1. * g / cm3) << " g cm^-3";
189  }
190  else os << "off";
191 
192  os << "\n Culling daughters covered by opaque mothers: ";
193  if (mp.fCullCovered) os << "on";
194  else os << "off";
195 
196  os << "\n Explode factor: " << mp.fExplodeFactor
197  << " about centre: " << mp.fExplodeCentre;
198 
199  os << "\n No. of sides used in circle polygon approximation: "
200  << mp.fNoOfSides;
201 
202  os << "\n Section (DCUT) shape (G4VSolid) pointer: ";
203  if (!mp.fpSectionSolid) os << "non-";
204  os << "null";
205 
206  os << "\n Cutaway (DCUT) shape (G4VSolid) pointer: ";
207  if (!mp.fpCutawaySolid) os << "non-";
208  os << "null";
209 
210  os << "\n Event pointer: " << mp.fpEvent;
211 
212  os << "\n Vis attributes modifiers: ";
213  const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
215  if (vams.empty()) {
216  os << "None";
217  } else {
218  os << vams;
219  }
220 
221  return os;
222 }
const G4VisAttributes * fpDefaultVisAttributes
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
std::vector< VisAttributesModifier > fVisAttributesModifiers
static const double cm3
Definition: G4SIunits.hh:120

◆ operator<< [2/3]

std::ostream& operator<< ( std::ostream &  os,
const PVNameCopyNoPath path 
)
friend

Definition at line 312 of file G4ModelingParameters.cc.

313 {
314 // os << "Touchable path: physical-volume-name:copy-number pairs:\n ";
316  for (i = path.begin(); i != path.end(); ++i) {
317  if (i != path.begin()) {
318  os << ", ";
319  }
320  os << i->GetName() << ':' << i->GetCopyNo();
321  }
322  return os;
323 }
PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator

◆ operator<< [3/3]

std::ostream& operator<< ( std::ostream &  os,
const std::vector< VisAttributesModifier > &  vams 
)
friend

Definition at line 326 of file G4ModelingParameters.cc.

328 {
329  std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator
330  iModifier;
331  for (iModifier = vams.begin();
332  iModifier != vams.end();
333  ++iModifier) {
335  iModifier->GetPVNameCopyNoPath();
336  os << '\n' << vamPath;
337  const G4VisAttributes& vamVisAtts = iModifier->GetVisAttributes();
338  const G4Colour& c = vamVisAtts.GetColour();
339  switch (iModifier->GetVisAttributesSignifier()) {
341  os << " visibility ";
342  if (vamVisAtts.IsVisible()) {
343  os << "true";
344  } else {
345  os << "false";
346  }
347  break;
349  os << " daughtersInvisible ";
350  if (vamVisAtts.IsDaughtersInvisible()) {
351  os << "true";
352  } else {
353  os << "false";
354  }
355  break;
357  os << " colour " << c;
358  break;
360  os << " lineStyle ";
361  switch (vamVisAtts.GetLineStyle()) {
363  os << "unbroken";
364  break;
366  os << "dashed";
367  break;
369  os << "dotted";
370  }
371  break;
373  os << " lineWidth "
374  << vamVisAtts.GetLineWidth();
375  break;
378  os << " forceWireframe ";
379  if (vamVisAtts.IsForceDrawingStyle()) {
380  os << "true";
381  } else {
382  os << "false";
383  }
384  }
385  break;
387  if (vamVisAtts.GetForcedDrawingStyle() == G4VisAttributes::solid) {
388  os << " forceSolid ";
389  if (vamVisAtts.IsForceDrawingStyle()) {
390  os << "true";
391  } else {
392  os << "false";
393  }
394  }
395  break;
397  os << " forceAuxEdgeVisible ";
398  if (vamVisAtts.IsForceAuxEdgeVisible()) {
399  os << "true";
400  } else {
401  os << "false";
402  }
403  break;
405  os << " lineSegmentsPerCircle "
406  << vamVisAtts.GetForcedLineSegmentsPerCircle();
407  break;
408  }
409  }
410 
411  return os;
412 }
ForcedDrawingStyle GetForcedDrawingStyle() const
G4bool IsForceAuxEdgeVisible() const
G4bool IsForceDrawingStyle() const
G4bool IsDaughtersInvisible() const
std::vector< PVNameCopyNo > PVNameCopyNoPath
G4double GetLineWidth() const
LineStyle GetLineStyle() const
G4bool IsVisible() const
G4int GetForcedLineSegmentsPerCircle() const
const G4Colour & GetColour() const

Member Data Documentation

◆ fCullCovered

G4bool G4ModelingParameters::fCullCovered
private

Definition at line 192 of file G4ModelingParameters.hh.

◆ fCulling

G4bool G4ModelingParameters::fCulling
private

Definition at line 188 of file G4ModelingParameters.hh.

◆ fCullInvisible

G4bool G4ModelingParameters::fCullInvisible
private

Definition at line 189 of file G4ModelingParameters.hh.

◆ fDensityCulling

G4bool G4ModelingParameters::fDensityCulling
private

Definition at line 190 of file G4ModelingParameters.hh.

◆ fDrawingStyle

DrawingStyle G4ModelingParameters::fDrawingStyle
private

Definition at line 187 of file G4ModelingParameters.hh.

◆ fExplodeCentre

G4Point3D G4ModelingParameters::fExplodeCentre
private

Definition at line 194 of file G4ModelingParameters.hh.

◆ fExplodeFactor

G4double G4ModelingParameters::fExplodeFactor
private

Definition at line 193 of file G4ModelingParameters.hh.

◆ fNoOfSides

G4int G4ModelingParameters::fNoOfSides
private

Definition at line 195 of file G4ModelingParameters.hh.

◆ fpCutawaySolid

G4VSolid* G4ModelingParameters::fpCutawaySolid
private

Definition at line 197 of file G4ModelingParameters.hh.

◆ fpDefaultVisAttributes

const G4VisAttributes* G4ModelingParameters::fpDefaultVisAttributes
private

Definition at line 186 of file G4ModelingParameters.hh.

◆ fpEvent

const G4Event* G4ModelingParameters::fpEvent
private

Definition at line 198 of file G4ModelingParameters.hh.

◆ fpSectionSolid

G4VSolid* G4ModelingParameters::fpSectionSolid
private

Definition at line 196 of file G4ModelingParameters.hh.

◆ fVisAttributesModifiers

std::vector<VisAttributesModifier> G4ModelingParameters::fVisAttributesModifiers
private

Definition at line 199 of file G4ModelingParameters.hh.

◆ fVisibleDensity

G4double G4ModelingParameters::fVisibleDensity
private

Definition at line 191 of file G4ModelingParameters.hh.

◆ fWarning

G4bool G4ModelingParameters::fWarning
private

Definition at line 185 of file G4ModelingParameters.hh.


The documentation for this class was generated from the following files: