Geant4 Cross Reference |
>> 1 // This code implementation is the intellectual property of >> 2 // the GEANT4 collaboration. 1 // 3 // 2 // ******************************************* << 4 // By copying, distributing or modifying the Program (or any work 3 // * License and Disclaimer << 5 // based on the Program) you indicate your acceptance of this statement, 4 // * << 6 // and all its terms. 5 // * The Geant4 software is copyright of th << 6 // * the Geant4 Collaboration. It is provided << 7 // * conditions of the Geant4 Software License << 8 // * LICENSE and available at http://cern.ch/ << 9 // * include a list of copyright holders. << 10 // * << 11 // * Neither the authors of this software syst << 12 // * institutes,nor the agencies providing fin << 13 // * work make any representation or warran << 14 // * regarding this software system or assum << 15 // * use. Please see the license in the file << 16 // * for the full disclaimer and the limitatio << 17 // * << 18 // * This code implementation is the result << 19 // * technical work of the GEANT4 collaboratio << 20 // * By using, copying, modifying or distri << 21 // * any work based on the software) you ag << 22 // * use in resulting scientific publicati << 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* << 25 // << 26 // 7 // >> 8 // $Id: G4ModelingParameters.hh,v 1.5 1999/12/15 14:54:30 gunter Exp $ >> 9 // GEANT4 tag $Name: geant4-02-00 $ 27 // 10 // 28 // 11 // 29 // John Allison 31st December 1997. 12 // John Allison 31st December 1997. 30 // 13 // 31 // Class Description: 14 // Class Description: 32 // 15 // 33 // Parameters associated with the modeling of 16 // Parameters associated with the modeling of GEANT4 objects. 34 17 35 #ifndef G4MODELINGPARAMETERS_HH 18 #ifndef G4MODELINGPARAMETERS_HH 36 #define G4MODELINGPARAMETERS_HH 19 #define G4MODELINGPARAMETERS_HH 37 20 38 #include "globals.hh" 21 #include "globals.hh" 39 #include "G4VisExtent.hh" 22 #include "G4VisExtent.hh" 40 #include "G4VisAttributes.hh" << 41 #include "G4VPhysicalVolume.hh" << 42 << 43 #include <vector> << 44 #include <utility> << 45 23 46 class G4LogicalVolume; 24 class G4LogicalVolume; >> 25 class G4VPhysicalVolume; 47 class G4VisAttributes; 26 class G4VisAttributes; 48 class G4VSolid; << 49 class G4DisplacedSolid; << 50 class G4Event; << 51 27 52 class G4ModelingParameters { 28 class G4ModelingParameters { 53 29 54 public: // With description 30 public: // With description 55 31 56 // Currently requested drawing style. << 32 friend G4std::ostream& operator << (G4std::ostream& os, const G4ModelingParameters&); 57 enum DrawingStyle { << 58 wf, // Draw edges - no hidden l << 59 hlr, // Draw edges - hidden line << 60 hsr, // Draw surfaces - hidden surf << 61 hlhsr, // Draw surfaces and edges - h << 62 cloud // Draw as a cloud of points << 63 }; << 64 << 65 enum CutawayMode { << 66 cutawayUnion, // Union (addition) of << 67 cutawayIntersection // Intersection (multi << 68 }; << 69 << 70 // enums and nested class for communicating << 71 // attributes for a specfic touchable define << 72 enum VisAttributesSignifier { << 73 VASVisibility, << 74 VASDaughtersInvisible, << 75 VASColour, << 76 VASLineStyle, << 77 VASLineWidth, << 78 VASForceWireframe, << 79 VASForceSolid, << 80 VASForceCloud, << 81 VASForceNumberOfCloudPoints, << 82 VASForceAuxEdgeVisible, << 83 VASForceLineSegmentsPerCircle << 84 }; << 85 << 86 class PVNameCopyNo { << 87 public: << 88 // Normal constructor << 89 PVNameCopyNo(const G4String& name, G4int c << 90 : fName(name), fCopyNo(copyNo) {} << 91 const G4String& GetName() const {return fN << 92 G4int GetCopyNo() const {return fCopyNo;} << 93 G4bool operator!=(const PVNameCopyNo&) con << 94 G4bool operator==(const PVNameCopyNo& rhs) << 95 private: << 96 G4String fName; << 97 G4int fCopyNo; << 98 }; << 99 typedef std::vector<PVNameCopyNo> PVNameCopy << 100 typedef PVNameCopyNoPath::const_iterator PVN << 101 33 102 class PVPointerCopyNo { << 34 enum RepStyle { 103 public: << 35 wireframe, // Use G4Wireframe. 104 // Normal constructor << 36 polyhedron, // Use G4Polyhedron. 105 PVPointerCopyNo(G4VPhysicalVolume* pPV, G4 << 37 nurbs, // Use G4NURBS. 106 : fpPV(pPV), fCopyNo(copyNo) {} << 38 hierarchy // Draw as geometry hierarchy (DTREE in GEANT3 language!). 107 const G4String& GetName() const; << 108 const G4VPhysicalVolume* GetPVPointer() co << 109 G4int GetCopyNo() const {return fCopyNo;} << 110 G4bool operator!=(const PVPointerCopyNo&) << 111 G4bool operator==(const PVPointerCopyNo& r << 112 private: << 113 G4VPhysicalVolume* fpPV; << 114 G4int fCopyNo; << 115 }; << 116 typedef std::vector<PVPointerCopyNo> PVPoint << 117 typedef PVPointerCopyNoPath::const_iterator << 118 << 119 class VisAttributesModifier { << 120 public: << 121 VisAttributesModifier << 122 (const G4VisAttributes& visAtts, << 123 VisAttributesSignifier signifier, << 124 const PVNameCopyNoPath& path): << 125 fVisAtts(visAtts), fSignifier(signifier), << 126 const G4VisAttributes& GetVisAttributes() << 127 {return fVisAtts;} << 128 VisAttributesSignifier GetVisAttributesSig << 129 {return fSignifier;} << 130 const PVNameCopyNoPath& GetPVNameCopyNoPat << 131 {return fPVNameCopyNoPath;} << 132 void SetVisAttributes(const G4VisAttribute << 133 {fVisAtts = visAtts;} << 134 void SetVisAttributesSignifier(VisAttribut << 135 {fSignifier = signifier;} << 136 void SetPVNameCopyNoPath(const PVNameCopyN << 137 {fPVNameCopyNoPath = PVNameCopyNoPath;} << 138 G4bool operator!=(const VisAttributesModif << 139 G4bool operator==(const VisAttributesModif << 140 {return !operator!=(rhs);} << 141 private: << 142 G4VisAttributes fVisAtts; << 143 VisAttributesSignifier fSignifier; << 144 PVNameCopyNoPath fPVNameCopyNoPath; << 145 }; 39 }; >> 40 // RepStyle is used to determine which graphics_reps classes to use, >> 41 // if required. 146 42 147 G4ModelingParameters (); 43 G4ModelingParameters (); 148 44 149 G4ModelingParameters (const G4VisAttributes* 45 G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes, 150 DrawingStyle drawingSt << 46 RepStyle repStyle, 151 G4bool isCulling, 47 G4bool isCulling, 152 G4bool isCullingInvisible, 48 G4bool isCullingInvisible, 153 G4bool isDensityCulling, 49 G4bool isDensityCulling, 154 G4double visibleDensity, 50 G4double visibleDensity, 155 G4bool isCullingCovered, 51 G4bool isCullingCovered, 156 G4int noOfSides); 52 G4int noOfSides); 157 // Culling and clipping policy for G4Physica << 53 // noOfSides is suggested no. of sides per circle in case a >> 54 // polygonal representation is produced. >> 55 >> 56 G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes, >> 57 RepStyle repStyle, >> 58 G4bool isCulling, >> 59 G4bool isCullingInvisible, >> 60 G4bool isDensityCulling, >> 61 G4double visibleDensity, >> 62 G4bool isCullingCovered, >> 63 G4int noOfSides, >> 64 G4bool isViewGeom, >> 65 G4bool isViewHits, >> 66 G4bool isViewDigis); >> 67 // noOfSides is suggested no. of sides per circle in case a >> 68 // polygonal representation is produced. 158 69 159 ~G4ModelingParameters (); 70 ~G4ModelingParameters (); 160 71 161 // Note: uses default assignment operator an 72 // Note: uses default assignment operator and copy constructor. 162 73 163 G4bool operator != (const G4ModelingParamete 74 G4bool operator != (const G4ModelingParameters&) const; 164 75 165 // Get and Is functions... 76 // Get and Is functions... 166 G4bool IsWarning << 167 const G4VisAttributes* GetDefaultVisAttribut 77 const G4VisAttributes* GetDefaultVisAttributes () const; 168 DrawingStyle GetDrawingStyle << 78 RepStyle GetRepStyle () const; 169 G4int GetNumberOfCloudPoints << 170 G4bool IsCulling 79 G4bool IsCulling () const; 171 G4bool IsCullingInvisible 80 G4bool IsCullingInvisible () const; 172 G4bool IsDensityCulling 81 G4bool IsDensityCulling () const; 173 G4double GetVisibleDensity 82 G4double GetVisibleDensity () const; 174 G4bool IsCullingCovered 83 G4bool IsCullingCovered () const; 175 G4int GetCBDAlgorithmNumber << 176 const std::vector<G4double>& GetCBDParameter << 177 G4bool IsExplode << 178 G4double GetExplodeFactor << 179 const G4Point3D& GetExplodeCentre << 180 G4int GetNoOfSides 84 G4int GetNoOfSides () const; 181 G4DisplacedSolid* GetSectionSolid << 85 G4bool IsViewGeom () const; 182 CutawayMode GetCutawayMode << 86 G4bool IsViewHits () const; 183 G4DisplacedSolid* GetCutawaySolid << 87 G4bool IsViewDigis () const; 184 const G4Event* GetEvent << 185 const std::vector<VisAttributesModifier>& Ge << 186 G4bool IsSpecialMeshRendering << 187 const std::vector<PVNameCopyNo>& GetSpecialM << 188 88 189 // Set functions... 89 // Set functions... 190 void SetWarning (G4bool); << 191 void SetDefaultVisAttributes (const G4VisAtt 90 void SetDefaultVisAttributes (const G4VisAttributes* pDefaultVisAttributes); 192 void SetDrawingStyle (DrawingStyle); << 91 void SetRepStyle (RepStyle); 193 void SetNumberOfCloudPoints (G4int); << 194 void SetCulling (G4bool); 92 void SetCulling (G4bool); 195 void SetCullingInvisible (G4bool); 93 void SetCullingInvisible (G4bool); 196 void SetDensityCulling (G4bool); 94 void SetDensityCulling (G4bool); 197 void SetVisibleDensity (G4double); 95 void SetVisibleDensity (G4double); 198 void SetCullingCovered (G4bool); 96 void SetCullingCovered (G4bool); 199 void SetCBDAlgorithmNumber (G4int); << 97 void SetNoOfSides (G4int); 200 void SetCBDParameters (const std::vec << 98 void SetViewGeom (); 201 void SetExplodeFactor (G4double explo << 99 void UnsetViewGeom (); 202 void SetExplodeCentre (const G4Point3 << 100 void SetViewHits (); 203 G4int SetNoOfSides (G4int); // Re << 101 void UnsetViewHits (); 204 void SetSectionSolid (G4DisplacedSol << 102 void SetViewDigis (); 205 void SetCutawayMode (CutawayMode); << 103 void UnsetViewDigis (); 206 void SetCutawaySolid (G4DisplacedSol << 104 207 void SetEvent (const G4Event* << 105 // Other functions... 208 void SetVisAttributesModifiers(const std::ve << 106 void PrintDifferences (const G4ModelingParameters& that) const; 209 void SetSpecialMeshRendering (G4bool); << 210 void SetSpecialMeshVolumes (const std::vec << 211 << 212 friend std::ostream& operator << << 213 (std::ostream& os, const G4ModelingParameter << 214 << 215 friend std::ostream& operator << << 216 (std::ostream& os, const PVNameCopyNoPath&); << 217 << 218 friend std::ostream& operator << << 219 (std::ostream& os, const PVPointerCopyNoPath << 220 << 221 friend std::ostream& operator << << 222 (std::ostream& os, << 223 const std::vector<VisAttributesModifier>&); << 224 107 225 private: 108 private: 226 109 227 // Data members... 110 // Data members... 228 G4bool fWarning; // Print warn << 229 const G4VisAttributes* fpDefaultVisAttribute 111 const G4VisAttributes* fpDefaultVisAttributes; 230 DrawingStyle fDrawingStyle; // Drawing st << 112 RepStyle fRepStyle; // Representation style. 231 G4int fNumberOfCloudPoints; // For d << 113 G4bool fCulling; // Culling requested. 232 // <= 0 << 114 G4bool fCullInvisible; // Cull (don't Draw) invisible objects. 233 G4bool fCulling; // Culling re << 115 G4bool fDensityCulling; // Density culling requested. If so... 234 G4bool fCullInvisible; // Cull (don' << 116 G4double fVisibleDensity; // ...density lower than this not drawn. 235 G4bool fDensityCulling; // Density cu << 117 G4bool fCullCovered; // Cull daughters covered by opaque mothers. 236 G4double fVisibleDensity; // ...density << 118 G4int fNoOfSides; // ...if polygon approximates circle. 237 G4bool fCullCovered; // Cull daugh << 119 G4bool fViewGeom; // View geometry objects. 238 G4int fCBDAlgorithmNumber; // Colour << 120 G4bool fViewHits; // View hits, if any. 239 std::vector<G4double> fCBDParameters; // Col << 121 G4bool fViewDigis; // View digis, if any. 240 G4double fExplodeFactor; // Explode al << 241 G4Point3D fExplodeCentre; // ...about t << 242 G4int fNoOfSides; // ...if poly << 243 G4DisplacedSolid* fpSectionSolid; // For ge << 244 CutawayMode fCutawayMode; // Cutaway mo << 245 G4DisplacedSolid* fpCutawaySolid; // For ge << 246 const G4Event* fpEvent; // Event bein << 247 std::vector<VisAttributesModifier> fVisAttri << 248 G4bool fSpecialMeshRendering; // Requ << 249 std::vector<PVNameCopyNo> fSpecialMeshVolume << 250 }; << 251 << 252 std::ostream& operator << << 253 (std::ostream& os, const G4ModelingParameters& << 254 122 255 std::ostream& operator << << 123 }; 256 (std::ostream& os, const G4ModelingParameters: << 257 << 258 std::ostream& operator << << 259 (std::ostream& os, const G4ModelingParameters: << 260 << 261 std::ostream& operator << << 262 (std::ostream& os, << 263 const std::vector<G4ModelingParameters::VisAt << 264 124 265 #include "G4ModelingParameters.icc" 125 #include "G4ModelingParameters.icc" 266 126 267 #endif 127 #endif 268 128