| 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | //
|
|---|
| 27 | // $Id: G4ModelingParameters.hh,v 1.18 2010/05/11 11:13:35 allison Exp $
|
|---|
| 28 | // GEANT4 tag $Name: geant4-09-04-beta-01 $
|
|---|
| 29 | //
|
|---|
| 30 | //
|
|---|
| 31 | // John Allison 31st December 1997.
|
|---|
| 32 | //
|
|---|
| 33 | // Class Description:
|
|---|
| 34 | //
|
|---|
| 35 | // Parameters associated with the modeling of GEANT4 objects.
|
|---|
| 36 |
|
|---|
| 37 | #ifndef G4MODELINGPARAMETERS_HH
|
|---|
| 38 | #define G4MODELINGPARAMETERS_HH
|
|---|
| 39 |
|
|---|
| 40 | #include "globals.hh"
|
|---|
| 41 | #include "G4VisExtent.hh"
|
|---|
| 42 |
|
|---|
| 43 | class G4LogicalVolume;
|
|---|
| 44 | class G4VPhysicalVolume;
|
|---|
| 45 | class G4VisAttributes;
|
|---|
| 46 | class G4VSolid;
|
|---|
| 47 | class G4Event;
|
|---|
| 48 |
|
|---|
| 49 | class G4ModelingParameters {
|
|---|
| 50 |
|
|---|
| 51 | public: // With description
|
|---|
| 52 |
|
|---|
| 53 | friend std::ostream& operator << (std::ostream& os, const G4ModelingParameters&);
|
|---|
| 54 |
|
|---|
| 55 | enum DrawingStyle {
|
|---|
| 56 | wf, // Draw edges - no hidden line removal (wireframe).
|
|---|
| 57 | hlr, // Draw edges - hidden lines removed.
|
|---|
| 58 | hsr, // Draw surfaces - hidden surfaces removed.
|
|---|
| 59 | hlhsr // Draw surfaces and edges - hidden removed.
|
|---|
| 60 | };
|
|---|
| 61 | // Currently requested drawing style.
|
|---|
| 62 |
|
|---|
| 63 | G4ModelingParameters ();
|
|---|
| 64 |
|
|---|
| 65 | G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes,
|
|---|
| 66 | DrawingStyle drawingStyle,
|
|---|
| 67 | G4bool isCulling,
|
|---|
| 68 | G4bool isCullingInvisible,
|
|---|
| 69 | G4bool isDensityCulling,
|
|---|
| 70 | G4double visibleDensity,
|
|---|
| 71 | G4bool isCullingCovered,
|
|---|
| 72 | G4int noOfSides);
|
|---|
| 73 | // Culling and clipping policy for G4PhysicalVolumeModel.
|
|---|
| 74 |
|
|---|
| 75 | ~G4ModelingParameters ();
|
|---|
| 76 |
|
|---|
| 77 | // Note: uses default assignment operator and copy constructor.
|
|---|
| 78 |
|
|---|
| 79 | G4bool operator != (const G4ModelingParameters&) const;
|
|---|
| 80 |
|
|---|
| 81 | // Get and Is functions...
|
|---|
| 82 | G4bool IsWarning () const;
|
|---|
| 83 | const G4VisAttributes* GetDefaultVisAttributes () const;
|
|---|
| 84 | DrawingStyle GetDrawingStyle () const;
|
|---|
| 85 | G4bool IsCulling () const;
|
|---|
| 86 | G4bool IsCullingInvisible () const;
|
|---|
| 87 | G4bool IsDensityCulling () const;
|
|---|
| 88 | G4double GetVisibleDensity () const;
|
|---|
| 89 | G4bool IsCullingCovered () const;
|
|---|
| 90 | G4bool IsExplode () const;
|
|---|
| 91 | G4double GetExplodeFactor () const;
|
|---|
| 92 | const G4Point3D& GetExplodeCentre () const;
|
|---|
| 93 | G4int GetNoOfSides () const;
|
|---|
| 94 | G4VSolid* GetSectionSolid () const;
|
|---|
| 95 | G4VSolid* GetCutawaySolid () const;
|
|---|
| 96 | const G4Event* GetEvent () const;
|
|---|
| 97 |
|
|---|
| 98 | // Set functions...
|
|---|
| 99 | void SetWarning (G4bool);
|
|---|
| 100 | void SetDefaultVisAttributes (const G4VisAttributes* pDefaultVisAttributes);
|
|---|
| 101 | void SetDrawingStyle (DrawingStyle);
|
|---|
| 102 | void SetCulling (G4bool);
|
|---|
| 103 | void SetCullingInvisible (G4bool);
|
|---|
| 104 | void SetDensityCulling (G4bool);
|
|---|
| 105 | void SetVisibleDensity (G4double);
|
|---|
| 106 | void SetCullingCovered (G4bool);
|
|---|
| 107 | void SetExplodeFactor (G4double explodeFactor);
|
|---|
| 108 | void SetExplodeCentre (const G4Point3D& explodeCentre);
|
|---|
| 109 | G4int SetNoOfSides (G4int); // Returns actual number set.
|
|---|
| 110 | void SetSectionSolid (G4VSolid* pSectionSolid);
|
|---|
| 111 | void SetCutawaySolid (G4VSolid* pCutawaySolid);
|
|---|
| 112 | void SetEvent (const G4Event* pEvent);
|
|---|
| 113 |
|
|---|
| 114 | private:
|
|---|
| 115 |
|
|---|
| 116 | // Data members...
|
|---|
| 117 | G4bool fWarning; // Print warnings if true.
|
|---|
| 118 | const G4VisAttributes* fpDefaultVisAttributes;
|
|---|
| 119 | DrawingStyle fDrawingStyle; // Drawing style.
|
|---|
| 120 | G4bool fCulling; // Culling requested.
|
|---|
| 121 | G4bool fCullInvisible; // Cull (don't Draw) invisible objects.
|
|---|
| 122 | G4bool fDensityCulling; // Density culling requested. If so...
|
|---|
| 123 | G4double fVisibleDensity; // ...density lower than this not drawn.
|
|---|
| 124 | G4bool fCullCovered; // Cull daughters covered by opaque mothers.
|
|---|
| 125 | G4double fExplodeFactor; // Explode along radius by this factor...
|
|---|
| 126 | G4Point3D fExplodeCentre; // ...about this centre.
|
|---|
| 127 | G4int fNoOfSides; // ...if polygon approximates circle.
|
|---|
| 128 | G4VSolid* fpSectionSolid; // For generic section (DCUT).
|
|---|
| 129 | G4VSolid* fpCutawaySolid; // For generic cutaways.
|
|---|
| 130 | const G4Event* fpEvent; // Event being processed.
|
|---|
| 131 | };
|
|---|
| 132 |
|
|---|
| 133 | #include "G4ModelingParameters.icc"
|
|---|
| 134 |
|
|---|
| 135 | #endif
|
|---|