[831] | 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: G4ReflectedSolid.hh,v 1.5 2006/06/29 18:31:03 gunter Exp $ |
---|
| 28 | // GEANT4 tag $Name: $ |
---|
| 29 | // |
---|
| 30 | // |
---|
| 31 | // class G4ReflectedSolid |
---|
| 32 | // |
---|
| 33 | // Class description: |
---|
| 34 | // |
---|
| 35 | // A Reflected solid is a solid that has been shifted from its original |
---|
| 36 | // frame of reference to a new one. |
---|
| 37 | |
---|
| 38 | // History: |
---|
| 39 | // |
---|
| 40 | // 23.07.01 V.Grichine: created |
---|
| 41 | // 15.02.02 V.Grichine: get/set methods for fPtr(Direct)Transform3D |
---|
| 42 | // -------------------------------------------------------------------- |
---|
| 43 | #ifndef G4ReflectedSolid_HH |
---|
| 44 | #define G4ReflectedSolid_HH |
---|
| 45 | |
---|
| 46 | #include "G4VSolid.hh" |
---|
| 47 | #include "G4RotationMatrix.hh" |
---|
| 48 | #include "G4ThreeVector.hh" |
---|
| 49 | #include "G4Transform3D.hh" |
---|
| 50 | #include "G4AffineTransform.hh" |
---|
| 51 | |
---|
| 52 | class G4ReflectedSolid : public G4VSolid |
---|
| 53 | { |
---|
| 54 | public: // with description |
---|
| 55 | |
---|
| 56 | G4ReflectedSolid( const G4String& pName, |
---|
| 57 | G4VSolid* pSolid , |
---|
| 58 | const G4Transform3D& transform ) ; |
---|
| 59 | // For use in instantiating a transient instance. |
---|
| 60 | |
---|
| 61 | virtual ~G4ReflectedSolid() ; |
---|
| 62 | // Virtual destructor. |
---|
| 63 | |
---|
| 64 | public: // without description |
---|
| 65 | |
---|
| 66 | // Includes all the methods that a solid requires. |
---|
| 67 | |
---|
| 68 | EInside Inside( const G4ThreeVector& p ) const; |
---|
| 69 | |
---|
| 70 | G4bool CalculateExtent( const EAxis pAxis, |
---|
| 71 | const G4VoxelLimits& pVoxelLimit, |
---|
| 72 | const G4AffineTransform& pTransform, |
---|
| 73 | G4double& pMin, G4double& pMax) const; |
---|
| 74 | |
---|
| 75 | G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const; |
---|
| 76 | |
---|
| 77 | G4double DistanceToIn( const G4ThreeVector& p, |
---|
| 78 | const G4ThreeVector& v ) const; |
---|
| 79 | |
---|
| 80 | G4double DistanceToIn( const G4ThreeVector& p) const; |
---|
| 81 | |
---|
| 82 | G4double DistanceToOut( const G4ThreeVector& p, |
---|
| 83 | const G4ThreeVector& v, |
---|
| 84 | const G4bool calcNorm=false, |
---|
| 85 | G4bool *validNorm=0, |
---|
| 86 | G4ThreeVector *n=0 ) const; |
---|
| 87 | |
---|
| 88 | G4double DistanceToOut( const G4ThreeVector& p ) const ; |
---|
| 89 | |
---|
| 90 | void ComputeDimensions( G4VPVParameterisation* p, |
---|
| 91 | const G4int n, |
---|
| 92 | const G4VPhysicalVolume* pRep ); |
---|
| 93 | |
---|
| 94 | G4ThreeVector GetPointOnSurface() const; |
---|
| 95 | |
---|
| 96 | public: // with description |
---|
| 97 | |
---|
| 98 | virtual G4GeometryType GetEntityType() const; |
---|
| 99 | |
---|
| 100 | virtual const G4ReflectedSolid* GetReflectedSolidPtr() const; |
---|
| 101 | virtual G4ReflectedSolid* GetReflectedSolidPtr(); |
---|
| 102 | // If the Solid is a "G4ReflectedSolid", |
---|
| 103 | // return a self pointer else return 0. |
---|
| 104 | |
---|
| 105 | G4VSolid* GetConstituentMovedSolid() const; |
---|
| 106 | |
---|
| 107 | G4Transform3D GetTransform3D() const; |
---|
| 108 | void SetTransform3D(G4Transform3D&); |
---|
| 109 | G4Transform3D GetDirectTransform3D() const; |
---|
| 110 | void SetDirectTransform3D(G4Transform3D&); |
---|
| 111 | // Accessors methods. |
---|
| 112 | |
---|
| 113 | std::ostream& StreamInfo(std::ostream& os) const; |
---|
| 114 | |
---|
| 115 | public: // without description |
---|
| 116 | |
---|
| 117 | void DescribeYourselfTo ( G4VGraphicsScene& scene ) const ; |
---|
| 118 | G4Polyhedron* CreatePolyhedron () const ; |
---|
| 119 | G4NURBS* CreateNURBS () const ; |
---|
| 120 | G4Polyhedron* GetPolyhedron () const; |
---|
| 121 | // For creating graphical representations (ie for visualisation). |
---|
| 122 | |
---|
| 123 | protected: |
---|
| 124 | |
---|
| 125 | G4AffineTransform GetTransform() const; |
---|
| 126 | void SetTransform(G4AffineTransform&); |
---|
| 127 | G4AffineTransform GetDirectTransform() const; |
---|
| 128 | void SetDirectTransform(G4AffineTransform&); |
---|
| 129 | G4RotationMatrix GetFrameRotation() const; |
---|
| 130 | void SetFrameRotation(const G4RotationMatrix&); |
---|
| 131 | G4ThreeVector GetFrameTranslation() const; |
---|
| 132 | void SetFrameTranslation(const G4ThreeVector&); |
---|
| 133 | // Get/Set the rotation/translation, as applied to the |
---|
| 134 | // frame of reference. |
---|
| 135 | |
---|
| 136 | G4RotationMatrix GetObjectRotation() const; |
---|
| 137 | void SetObjectRotation(const G4RotationMatrix&); |
---|
| 138 | G4ThreeVector GetObjectTranslation() const; |
---|
| 139 | void SetObjectTranslation(const G4ThreeVector&); |
---|
| 140 | // Get/Set the rotation/translation, as applied to the object. |
---|
| 141 | |
---|
| 142 | G4VSolid* fPtrSolid ; |
---|
| 143 | G4AffineTransform* fPtrTransform ; |
---|
| 144 | G4AffineTransform* fDirectTransform ; |
---|
| 145 | |
---|
| 146 | G4Transform3D* fPtrTransform3D ; |
---|
| 147 | G4Transform3D* fDirectTransform3D ; |
---|
| 148 | |
---|
| 149 | mutable G4Polyhedron* fpPolyhedron; // Caches reflected G4Polyhedron. |
---|
| 150 | |
---|
| 151 | private: |
---|
| 152 | |
---|
| 153 | G4ReflectedSolid(const G4ReflectedSolid&); |
---|
| 154 | G4ReflectedSolid& operator=(const G4ReflectedSolid&); |
---|
| 155 | // Private copy constructor and assignment operator. |
---|
| 156 | } ; |
---|
| 157 | |
---|
| 158 | #endif |
---|