File indexing completed on 2025-01-18 09:58:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef G4MODELINGPARAMETERS_HH
0036 #define G4MODELINGPARAMETERS_HH
0037
0038 #include "globals.hh"
0039 #include "G4VisExtent.hh"
0040 #include "G4VisAttributes.hh"
0041 #include "G4VPhysicalVolume.hh"
0042
0043 #include <vector>
0044 #include <utility>
0045
0046 class G4LogicalVolume;
0047 class G4VisAttributes;
0048 class G4VSolid;
0049 class G4DisplacedSolid;
0050 class G4Event;
0051
0052 class G4ModelingParameters {
0053
0054 public:
0055
0056
0057 enum DrawingStyle {
0058 wf,
0059 hlr,
0060 hsr,
0061 hlhsr,
0062 cloud
0063 };
0064
0065 enum CutawayMode {
0066 cutawayUnion,
0067 cutawayIntersection
0068 };
0069
0070
0071
0072 enum VisAttributesSignifier {
0073 VASVisibility,
0074 VASDaughtersInvisible,
0075 VASColour,
0076 VASLineStyle,
0077 VASLineWidth,
0078 VASForceWireframe,
0079 VASForceSolid,
0080 VASForceCloud,
0081 VASForceNumberOfCloudPoints,
0082 VASForceAuxEdgeVisible,
0083 VASForceLineSegmentsPerCircle
0084 };
0085
0086 class PVNameCopyNo {
0087 public:
0088
0089 PVNameCopyNo(G4String name, G4int copyNo)
0090 : fName(name), fCopyNo(copyNo) {}
0091 const G4String& GetName() const {return fName;}
0092 G4int GetCopyNo() const {return fCopyNo;}
0093 G4bool operator!=(const PVNameCopyNo&) const;
0094 G4bool operator==(const PVNameCopyNo& rhs) const {return !operator!=(rhs);}
0095 private:
0096 G4String fName;
0097 G4int fCopyNo;
0098 };
0099 typedef std::vector<PVNameCopyNo> PVNameCopyNoPath;
0100 typedef PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator;
0101
0102 class PVPointerCopyNo {
0103 public:
0104
0105 PVPointerCopyNo(G4VPhysicalVolume* pPV, G4int copyNo)
0106 : fpPV(pPV), fCopyNo(copyNo) {}
0107 const G4String& GetName() const;
0108 const G4VPhysicalVolume* GetPVPointer() const {return fpPV;}
0109 G4int GetCopyNo() const {return fCopyNo;}
0110 G4bool operator!=(const PVPointerCopyNo&) const;
0111 G4bool operator==(const PVPointerCopyNo& rhs) const {return !operator!=(rhs);}
0112 private:
0113 G4VPhysicalVolume* fpPV;
0114 G4int fCopyNo;
0115 };
0116 typedef std::vector<PVPointerCopyNo> PVPointerCopyNoPath;
0117 typedef PVPointerCopyNoPath::const_iterator PVPointerCopyNoPathConstIterator;
0118
0119 class VisAttributesModifier {
0120 public:
0121 VisAttributesModifier
0122 (const G4VisAttributes& visAtts,
0123 VisAttributesSignifier signifier,
0124 const PVNameCopyNoPath& path):
0125 fVisAtts(visAtts), fSignifier(signifier), fPVNameCopyNoPath(path) {}
0126 const G4VisAttributes& GetVisAttributes() const
0127 {return fVisAtts;}
0128 VisAttributesSignifier GetVisAttributesSignifier() const
0129 {return fSignifier;}
0130 const PVNameCopyNoPath& GetPVNameCopyNoPath() const
0131 {return fPVNameCopyNoPath;}
0132 void SetVisAttributes(const G4VisAttributes& visAtts)
0133 {fVisAtts = visAtts;}
0134 void SetVisAttributesSignifier(VisAttributesSignifier signifier)
0135 {fSignifier = signifier;}
0136 void SetPVNameCopyNoPath(const PVNameCopyNoPath& PVNameCopyNoPath)
0137 {fPVNameCopyNoPath = PVNameCopyNoPath;}
0138 G4bool operator!=(const VisAttributesModifier&) const;
0139 G4bool operator==(const VisAttributesModifier& rhs) const
0140 {return !operator!=(rhs);}
0141 private:
0142 G4VisAttributes fVisAtts;
0143 VisAttributesSignifier fSignifier;
0144 PVNameCopyNoPath fPVNameCopyNoPath;
0145 };
0146
0147 G4ModelingParameters ();
0148
0149 G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes,
0150 DrawingStyle drawingStyle,
0151 G4bool isCulling,
0152 G4bool isCullingInvisible,
0153 G4bool isDensityCulling,
0154 G4double visibleDensity,
0155 G4bool isCullingCovered,
0156 G4int noOfSides);
0157
0158
0159 ~G4ModelingParameters ();
0160
0161
0162
0163 G4bool operator != (const G4ModelingParameters&) const;
0164
0165
0166 G4bool IsWarning () const;
0167 const G4VisAttributes* GetDefaultVisAttributes () const;
0168 DrawingStyle GetDrawingStyle () const;
0169 G4int GetNumberOfCloudPoints () const;
0170 G4bool IsCulling () const;
0171 G4bool IsCullingInvisible () const;
0172 G4bool IsDensityCulling () const;
0173 G4double GetVisibleDensity () const;
0174 G4bool IsCullingCovered () const;
0175 G4int GetCBDAlgorithmNumber () const;
0176 const std::vector<G4double>& GetCBDParameters () const;
0177 G4bool IsExplode () const;
0178 G4double GetExplodeFactor () const;
0179 const G4Point3D& GetExplodeCentre () const;
0180 G4int GetNoOfSides () const;
0181 G4DisplacedSolid* GetSectionSolid () const;
0182 CutawayMode GetCutawayMode () const;
0183 G4DisplacedSolid* GetCutawaySolid () const;
0184 const G4Event* GetEvent () const;
0185 const std::vector<VisAttributesModifier>& GetVisAttributesModifiers() const;
0186 G4bool IsSpecialMeshRendering () const;
0187 const std::vector<PVNameCopyNo>& GetSpecialMeshVolumes() const;
0188
0189
0190 void SetWarning (G4bool);
0191 void SetDefaultVisAttributes (const G4VisAttributes* pDefaultVisAttributes);
0192 void SetDrawingStyle (DrawingStyle);
0193 void SetNumberOfCloudPoints (G4int);
0194 void SetCulling (G4bool);
0195 void SetCullingInvisible (G4bool);
0196 void SetDensityCulling (G4bool);
0197 void SetVisibleDensity (G4double);
0198 void SetCullingCovered (G4bool);
0199 void SetCBDAlgorithmNumber (G4int);
0200 void SetCBDParameters (const std::vector<G4double>&);
0201 void SetExplodeFactor (G4double explodeFactor);
0202 void SetExplodeCentre (const G4Point3D& explodeCentre);
0203 G4int SetNoOfSides (G4int);
0204 void SetSectionSolid (G4DisplacedSolid* pSectionSolid);
0205 void SetCutawayMode (CutawayMode);
0206 void SetCutawaySolid (G4DisplacedSolid* pCutawaySolid);
0207 void SetEvent (const G4Event* pEvent);
0208 void SetVisAttributesModifiers(const std::vector<VisAttributesModifier>&);
0209 void SetSpecialMeshRendering (G4bool);
0210 void SetSpecialMeshVolumes (const std::vector<PVNameCopyNo>&);
0211
0212 friend std::ostream& operator <<
0213 (std::ostream& os, const G4ModelingParameters&);
0214
0215 friend std::ostream& operator <<
0216 (std::ostream& os, const PVNameCopyNoPath&);
0217
0218 friend std::ostream& operator <<
0219 (std::ostream& os, const PVPointerCopyNoPath&);
0220
0221 friend std::ostream& operator <<
0222 (std::ostream& os,
0223 const std::vector<VisAttributesModifier>&);
0224
0225 private:
0226
0227
0228 G4bool fWarning;
0229 const G4VisAttributes* fpDefaultVisAttributes;
0230 DrawingStyle fDrawingStyle;
0231 G4int fNumberOfCloudPoints;
0232
0233 G4bool fCulling;
0234 G4bool fCullInvisible;
0235 G4bool fDensityCulling;
0236 G4double fVisibleDensity;
0237 G4bool fCullCovered;
0238 G4int fCBDAlgorithmNumber;
0239 std::vector<G4double> fCBDParameters;
0240 G4double fExplodeFactor;
0241 G4Point3D fExplodeCentre;
0242 G4int fNoOfSides;
0243 G4DisplacedSolid* fpSectionSolid;
0244 CutawayMode fCutawayMode;
0245 G4DisplacedSolid* fpCutawaySolid;
0246 const G4Event* fpEvent;
0247 std::vector<VisAttributesModifier> fVisAttributesModifiers;
0248 G4bool fSpecialMeshRendering;
0249 std::vector<PVNameCopyNo> fSpecialMeshVolumes;
0250 };
0251
0252 std::ostream& operator <<
0253 (std::ostream& os, const G4ModelingParameters&);
0254
0255 std::ostream& operator <<
0256 (std::ostream& os, const G4ModelingParameters::PVNameCopyNoPath&);
0257
0258 std::ostream& operator <<
0259 (std::ostream& os, const G4ModelingParameters::PVPointerCopyNoPath&);
0260
0261 std::ostream& operator <<
0262 (std::ostream& os,
0263 const std::vector<G4ModelingParameters::VisAttributesModifier>&);
0264
0265 #include "G4ModelingParameters.icc"
0266
0267 #endif