46 fpDefaultVisAttributes (0),
48 fNumberOfCloudPoints (10000),
50 fCullInvisible (false),
51 fDensityCulling (false),
52 fVisibleDensity (0.01 * g / cm3),
54 fCBDAlgorithmNumber (0),
73 fpDefaultVisAttributes (pDefaultVisAttributes),
74 fDrawingStyle (drawingStyle),
75 fNumberOfCloudPoints (10000),
77 fCullInvisible (isCullingInvisible),
78 fDensityCulling (isDensityCulling),
79 fVisibleDensity (visibleDensity),
80 fCullCovered (isCullingCovered),
81 fCBDAlgorithmNumber (0),
83 fNoOfSides (noOfSides),
91 delete fpSectionSolid;
92 delete fpCutawaySolid;
116 const G4double reasonableMaximum = 10.0 * g / cm3;
117 if (visibleDensity < 0 && fWarning) {
118 G4cout <<
"G4ModelingParameters::SetVisibleDensity: attempt to set negative "
119 "density - ignored." <<
G4endl;
122 if (fVisibleDensity > reasonableMaximum && fWarning) {
123 G4cout <<
"G4ModelingParameters::SetVisibleDensity: density > "
125 <<
" g / cm3 - did you mean this?"
128 fVisibleDensity = visibleDensity;
134 if (nSides < nSidesMin) {
137 G4cout <<
"G4ModelingParameters::SetNoOfSides: attempt to set the"
138 "\nnumber of sides per circle < " << nSidesMin
139 <<
"; forced to" << nSides <<
G4endl;
147 delete fpSectionSolid;
148 fpSectionSolid = pSectionSolid;
153 delete fpCutawaySolid;
154 fpCutawaySolid = pCutawaySolid;
159 os <<
"Modeling parameters (warning ";
160 if (mp.fWarning) os <<
"true";
165 os <<
"\n Default vis. attributes: ";
169 os <<
"\n Current requested drawing style: ";
170 switch (mp.fDrawingStyle) {
172 os <<
"wireframe";
break;
174 os <<
"hidden line removal (hlr)";
break;
176 os <<
"surface (hsr)";
break;
178 os <<
"surface and edges (hlhsr)";
break;
180 os <<
"cloud";
break;
181 default: os <<
"unrecognised";
break;
184 os <<
"\n Number of cloud points: " << mp.fNumberOfCloudPoints;
186 os <<
"\n Culling: ";
187 if (mp.fCulling) os <<
"on";
190 os <<
"\n Culling invisible objects: ";
191 if (mp.fCullInvisible) os <<
"on";
194 os <<
"\n Density culling: ";
195 if (mp.fDensityCulling) {
196 os <<
"on - invisible if density less than "
197 << mp.fVisibleDensity / (1. * g / cm3) <<
" g cm^-3";
201 os <<
"\n Culling daughters covered by opaque mothers: ";
202 if (mp.fCullCovered) os <<
"on";
205 os <<
"\n Colour by density: ";
206 if (mp.fCBDAlgorithmNumber <= 0) {
209 os <<
"Algorithm " << mp.fCBDAlgorithmNumber <<
", Parameters:";
210 for (
auto p: mp.fCBDParameters) {
215 os <<
"\n Explode factor: " << mp.fExplodeFactor
216 <<
" about centre: " << mp.fExplodeCentre;
218 os <<
"\n No. of sides used in circle polygon approximation: "
221 os <<
"\n Section (DCUT) shape (G4DisplacedSolid) pointer: ";
222 if (!mp.fpSectionSolid) os <<
"non-";
225 os <<
"\n Cutaway (DCUT) shape (G4DisplacedSolid) pointer: ";
226 if (!mp.fpCutawaySolid) os <<
"non-";
229 os <<
"\n Event pointer: " << mp.fpEvent;
231 os <<
"\n Vis attributes modifiers: ";
232 const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
233 mp.fVisAttributesModifiers;
247 (fWarning != mp.fWarning) ||
248 (*fpDefaultVisAttributes != *mp.fpDefaultVisAttributes) ||
249 (fDrawingStyle != mp.fDrawingStyle) ||
250 (fNumberOfCloudPoints != mp.fNumberOfCloudPoints) ||
251 (fCulling != mp.fCulling) ||
252 (fCullInvisible != mp.fCullInvisible) ||
253 (fDensityCulling != mp.fDensityCulling) ||
254 (fCullCovered != mp.fCullCovered) ||
255 (fCBDAlgorithmNumber != mp.fCBDAlgorithmNumber) ||
256 (fExplodeFactor != mp.fExplodeFactor) ||
257 (fExplodeCentre != mp.fExplodeCentre) ||
258 (fNoOfSides != mp.fNoOfSides) ||
259 (fpSectionSolid != mp.fpSectionSolid) ||
260 (fpCutawaySolid != mp.fpCutawaySolid) ||
261 (fpEvent != mp.fpEvent)
265 if (fDensityCulling &&
266 (fVisibleDensity != mp.fVisibleDensity))
return true;
268 if (fCBDAlgorithmNumber > 0) {
269 if (fCBDParameters.size() != mp.fCBDParameters.size())
return true;
270 else if (fCBDParameters != mp.fCBDParameters)
return true;
273 if (fVisAttributesModifiers != mp.fVisAttributesModifiers)
279G4bool G4ModelingParameters::VisAttributesModifier::operator!=
282 if (fSignifier != rhs.fSignifier)
return true;
283 if (fPVNameCopyNoPath != rhs.fPVNameCopyNoPath)
return true;
284 switch (fSignifier) {
286 if (fVisAtts.IsVisible() != rhs.fVisAtts.IsVisible())
290 if (fVisAtts.IsDaughtersInvisible() !=
291 rhs.fVisAtts.IsDaughtersInvisible())
295 if (fVisAtts.GetColour() != rhs.fVisAtts.GetColour())
299 if (fVisAtts.GetLineStyle() != rhs.fVisAtts.GetLineStyle())
303 if (fVisAtts.GetLineWidth() != rhs.fVisAtts.GetLineWidth())
309 if (fVisAtts.GetForcedDrawingStyle() !=
310 rhs.fVisAtts.GetForcedDrawingStyle())
314 if (fVisAtts.GetForcedNumberOfCloudPoints() !=
315 rhs.fVisAtts.GetForcedNumberOfCloudPoints())
319 if (fVisAtts.IsForceAuxEdgeVisible() !=
320 rhs.fVisAtts.IsForceAuxEdgeVisible() ||
321 fVisAtts.IsForcedAuxEdgeVisible() !=
322 rhs.fVisAtts.IsForcedAuxEdgeVisible())
326 if (fVisAtts.GetForcedLineSegmentsPerCircle() !=
327 rhs.fVisAtts.GetForcedLineSegmentsPerCircle())
334G4bool G4ModelingParameters::PVNameCopyNo::operator!=
337 if (fName != rhs.fName)
return true;
338 if (fCopyNo != rhs.fCopyNo)
return true;
342std::ostream&
operator <<
345 os <<
"Touchable path: ";
349 os <<
"physical-volume-name:copy-number pairs:\n ";
351 for (i = path.begin(); i != path.end(); ++i) {
352 if (i != path.begin()) {
355 os << i->GetName() <<
':' << i->GetCopyNo();
366G4bool G4ModelingParameters::PVPointerCopyNo::operator!=
369 if (fpPV != rhs.fpPV)
return true;
370 if (fCopyNo != rhs.fCopyNo)
return true;
374std::ostream&
operator <<
377 os <<
"Touchable path: physical-volume-pointer:copy-number pairs:\n ";
379 for (i = path.begin(); i != path.end(); ++i) {
380 if (i != path.begin()) {
383 os <<
'(' << (
void*)(i->GetPVPointer()) <<
')' << i->GetName() <<
':' << i->GetCopyNo();
388std::ostream&
operator <<
390 const std::vector<G4ModelingParameters::VisAttributesModifier>& vams)
392 std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator
394 for (iModifier = vams.begin();
395 iModifier != vams.end();
398 iModifier->GetPVNameCopyNoPath();
399 os <<
'\n' << vamPath;
402 switch (iModifier->GetVisAttributesSignifier()) {
404 os <<
" visibility ";
412 os <<
" daughtersInvisible ";
420 os <<
" colour " << c;
441 os <<
" forceWireframe ";
451 os <<
" forceSolid ";
461 os <<
" forceCloud ";
470 os <<
" numberOfCloudPoints "
474 os <<
" forceAuxEdgeVisible: ";
489 os <<
" lineSegmentsPerCircle "
std::ostream & operator<<(std::ostream &os, const G4ModelingParameters &mp)
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
G4int SetNoOfSides(G4int)
PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator
PVPointerCopyNoPath::const_iterator PVPointerCopyNoPathConstIterator
std::vector< PVNameCopyNo > PVNameCopyNoPath
std::vector< PVPointerCopyNo > PVPointerCopyNoPath
@ VASForceNumberOfCloudPoints
@ VASForceLineSegmentsPerCircle
void SetCutawaySolid(G4DisplacedSolid *pCutawaySolid)
void SetSectionSolid(G4DisplacedSolid *pSectionSolid)
void SetVisibleDensity(G4double)
const G4String & GetName() const
G4int GetForcedNumberOfCloudPoints() const
G4double GetLineWidth() const
G4bool IsDaughtersInvisible() const
G4int GetForcedLineSegmentsPerCircle() const
LineStyle GetLineStyle() const
const G4Colour & GetColour() const
G4bool IsForceAuxEdgeVisible() const
G4bool IsForcedAuxEdgeVisible() const
ForcedDrawingStyle GetForcedDrawingStyle() const
static G4int GetMinLineSegmentsPerCircle()
G4bool IsForceDrawingStyle() const