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