00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef G4DisplacedSolid_HH
00045 #define G4DisplacedSolid_HH
00046
00047 #include "G4VSolid.hh"
00048 #include "G4RotationMatrix.hh"
00049 #include "G4ThreeVector.hh"
00050 #include "G4Transform3D.hh"
00051 #include "G4AffineTransform.hh"
00052
00053 class G4DisplacedSolid : public G4VSolid
00054 {
00055 public:
00056
00057 G4DisplacedSolid( const G4String& pName,
00058 G4VSolid* pSolid ,
00059 G4RotationMatrix* rotMatrix,
00060 const G4ThreeVector& transVector ) ;
00061
00062 G4DisplacedSolid( const G4String& pName,
00063 G4VSolid* pSolid ,
00064 const G4Transform3D& transform ) ;
00065
00066 G4DisplacedSolid( const G4String& pName,
00067 G4VSolid* pSolid ,
00068 const G4AffineTransform directTransform );
00069
00070
00071 virtual ~G4DisplacedSolid() ;
00072
00073 public:
00074
00075
00076
00077 EInside Inside( const G4ThreeVector& p ) const ;
00078
00079 G4bool CalculateExtent(const EAxis pAxis,
00080 const G4VoxelLimits& pVoxelLimit,
00081 const G4AffineTransform& pTransform,
00082 G4double& pMin, G4double& pMax) const ;
00083
00084 G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const ;
00085
00086 G4double DistanceToIn( const G4ThreeVector& p,
00087 const G4ThreeVector& v ) const ;
00088
00089 G4double DistanceToIn( const G4ThreeVector& p) const ;
00090
00091 G4double DistanceToOut( const G4ThreeVector& p,
00092 const G4ThreeVector& v,
00093 const G4bool calcNorm=false,
00094 G4bool *validNorm=0,
00095 G4ThreeVector *n=0 ) const ;
00096
00097 G4double DistanceToOut( const G4ThreeVector& p ) const ;
00098
00099
00100 void ComputeDimensions( G4VPVParameterisation* p,
00101 const G4int n,
00102 const G4VPhysicalVolume* pRep ) ;
00103
00104 void CleanTransformations();
00105
00106 G4ThreeVector GetPointOnSurface() const;
00107
00108 public:
00109
00110 G4GeometryType GetEntityType() const;
00111 G4VSolid* Clone() const;
00112
00113 const G4DisplacedSolid* GetDisplacedSolidPtr() const;
00114 G4DisplacedSolid* GetDisplacedSolidPtr();
00115
00116
00117
00118 G4VSolid* GetConstituentMovedSolid() const;
00119
00120 G4AffineTransform GetTransform() const;
00121 void SetTransform(G4AffineTransform& );
00122
00123 G4AffineTransform GetDirectTransform() const;
00124 void SetDirectTransform(G4AffineTransform&);
00125
00126
00127 G4RotationMatrix GetFrameRotation() const;
00128 void SetFrameRotation(const G4RotationMatrix&);
00129
00130 G4ThreeVector GetFrameTranslation() const;
00131 void SetFrameTranslation(const G4ThreeVector&);
00132
00133
00134 G4RotationMatrix GetObjectRotation() const;
00135 void SetObjectRotation(const G4RotationMatrix&);
00136
00137 G4ThreeVector GetObjectTranslation() const;
00138 void SetObjectTranslation(const G4ThreeVector&);
00139
00140
00141 std::ostream& StreamInfo(std::ostream& os) const;
00142
00143 public:
00144
00145 G4DisplacedSolid(__void__&);
00146
00147
00148
00149
00150 G4DisplacedSolid(const G4DisplacedSolid& rhs);
00151 G4DisplacedSolid& operator=(const G4DisplacedSolid& rhs);
00152
00153
00154 void DescribeYourselfTo ( G4VGraphicsScene& scene ) const ;
00155 G4Polyhedron* CreatePolyhedron () const ;
00156 G4NURBS* CreateNURBS () const ;
00157 G4Polyhedron* GetPolyhedron () const ;
00158
00159
00160 protected:
00161
00162 G4VSolid* fPtrSolid ;
00163 G4AffineTransform* fPtrTransform ;
00164 G4AffineTransform* fDirectTransform ;
00165 mutable G4Polyhedron* fpPolyhedron;
00166 } ;
00167
00168 #endif