45 fpDefaultVisAttributes (0),
48 fCullInvisible (false),
49 fDensityCulling (false),
50 fVisibleDensity (0.01 * g / cm3),
70 fpDefaultVisAttributes (pDefaultVisAttributes),
71 fDrawingStyle (drawingStyle),
73 fCullInvisible (isCullingInvisible),
74 fDensityCulling (isDensityCulling),
75 fVisibleDensity (visibleDensity),
76 fCullCovered (isCullingCovered),
78 fNoOfSides (noOfSides),
86 delete fpSectionSolid;
87 delete fpCutawaySolid;
93 const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& path):
94fVisAtts(visAtts), fSignifier(signifier)
97 typedef std::vector<PVNodeID> PVPath;
98 typedef PVPath::const_iterator PVPathConstIterator;
99 PVPathConstIterator i;
100 for (i = path.begin();
103 fPVNameCopyNoPath.push_back
105 (i->GetPhysicalVolume()->GetName(),
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;
117 if (fVisibleDensity > reasonableMaximum && fWarning) {
118 G4cout <<
"G4ModelingParameters::SetVisibleDensity: density > "
120 <<
" g / cm3 - did you mean this?"
123 fVisibleDensity = visibleDensity;
128 const G4int nSidesMin = 12;
129 if (nSides < nSidesMin) {
132 G4cout <<
"G4ModelingParameters::SetNoOfSides: attempt to set the"
133 "\nnumber of sides per circle < " << nSidesMin
134 <<
"; forced to" << nSides <<
G4endl;
142 delete fpSectionSolid;
143 fpSectionSolid = pSectionSolid;
148 delete fpCutawaySolid;
149 fpCutawaySolid = pCutawaySolid;
154 os <<
"Modeling parameters (warning ";
155 if (mp.fWarning) os <<
"true";
160 os <<
"\n Default vis. attributes: ";
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;
177 os <<
"\n Culling: ";
178 if (mp.fCulling) os <<
"on";
181 os <<
"\n Culling invisible objects: ";
182 if (mp.fCullInvisible) os <<
"on";
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";
192 os <<
"\n Culling daughters covered by opaque mothers: ";
193 if (mp.fCullCovered) os <<
"on";
196 os <<
"\n Explode factor: " << mp.fExplodeFactor
197 <<
" about centre: " << mp.fExplodeCentre;
199 os <<
"\n No. of sides used in circle polygon approximation: "
202 os <<
"\n Section (DCUT) shape (G4VSolid) pointer: ";
203 if (!mp.fpSectionSolid) os <<
"non-";
206 os <<
"\n Cutaway (DCUT) shape (G4VSolid) pointer: ";
207 if (!mp.fpCutawaySolid) os <<
"non-";
210 os <<
"\n Event pointer: " << mp.fpEvent;
212 os <<
"\n Vis attributes modifiers: ";
213 const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
214 mp.fVisAttributesModifiers;
228 (fWarning != mp.fWarning) ||
229 (*fpDefaultVisAttributes != *mp.fpDefaultVisAttributes) ||
230 (fCulling != mp.fCulling) ||
231 (fCullInvisible != mp.fCullInvisible) ||
232 (fDensityCulling != mp.fDensityCulling) ||
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)
243 if (fDensityCulling &&
244 (fVisibleDensity != mp.fVisibleDensity))
return true;
246 if (
VAMSNotEqual(fVisAttributesModifiers, mp.fVisAttributesModifiers))
256 if (path1.size() != path2.size())
return true;
257 if (path1.empty())
return false;
259 for (i1 = path1.begin(), i2 = path2.begin();
262 if (i1->GetName() != i2->GetName())
return true;
263 if (i1->GetCopyNo() != i2->GetCopyNo())
return true;
269(
const std::vector<G4ModelingParameters::VisAttributesModifier>& vams1,
270 const std::vector<G4ModelingParameters::VisAttributesModifier>& vams2)
272 if (vams1.size() != vams2.size())
return true;
273 if (vams1.empty())
return false;
274 std::vector<VisAttributesModifier>::const_iterator i1, i2;
275 for (i1 = vams1.begin(), i2 = vams2.begin();
281 if (i1->GetVisAttributesSignifier() != i2->GetVisAttributesSignifier())
287 switch (i1->GetVisAttributesSignifier()) {
334std::ostream&
operator <<
339 for (i = path.begin(); i != path.end(); ++i) {
340 if (i != path.begin()) {
343 os << i->GetName() <<
':' << i->GetCopyNo();
348std::ostream&
operator <<
350 const std::vector<G4ModelingParameters::VisAttributesModifier>& vams)
352 std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator
354 for (iModifier = vams.begin();
355 iModifier != vams.end();
358 iModifier->GetPVNameCopyNoPath();
359 os <<
'\n' << vamPath;
362 switch (iModifier->GetVisAttributesSignifier()) {
364 os <<
" visibility ";
372 os <<
" daughtersInvisible ";
380 os <<
" colour " << c;
401 os <<
" forceWireframe ";
411 os <<
" forceSolid ";
420 os <<
" forceAuxEdgeVisible ";
428 os <<
" lineSegmentsPerCircle "
G4DLLIMPORT std::ostream G4cout
VisAttributesModifier(const G4VisAttributes &visAtts, VisAttributesSignifier signifier, const PVNameCopyNoPath &path)
void SetCutawaySolid(G4VSolid *pCutawaySolid)
void SetSectionSolid(G4VSolid *pSectionSolid)
friend std::ostream & operator<<(std::ostream &os, const G4ModelingParameters &)
G4int SetNoOfSides(G4int)
PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator
std::vector< PVNameCopyNo > PVNameCopyNoPath
static G4bool PVNameCopyNoPathNotEqual(const PVNameCopyNoPath &, const PVNameCopyNoPath &)
static G4bool VAMSNotEqual(const std::vector< VisAttributesModifier > &, const std::vector< VisAttributesModifier > &)
@ VASForceLineSegmentsPerCircle
void SetVisibleDensity(G4double)
G4double GetLineWidth() const
G4bool IsDaughtersInvisible() const
G4int GetForcedLineSegmentsPerCircle() const
LineStyle GetLineStyle() const
const G4Colour & GetColour() const
G4bool IsForceAuxEdgeVisible() const
ForcedDrawingStyle GetForcedDrawingStyle() const
G4bool IsForceDrawingStyle() const