Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ScaledSolid.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:$
28 //
29 //
30 // class G4ScaledSolid
31 //
32 // Class description:
33 //
34 // A scaled solid is a solid that has been scaled in dimensions
35 // in X, Y or Z, from its original description.
36 
37 // History:
38 //
39 // 27.10.15 G.Cosmo: created
40 //
41 // --------------------------------------------------------------------
42 #ifndef G4ScaledSolid_HH
43 #define G4ScaledSolid_HH
44 
45 #include "G4VSolid.hh"
46 #include "G4ThreeVector.hh"
47 #include "G4Transform3D.hh"
48 #include "G4AffineTransform.hh"
49 
50 class G4ScaleTransform;
51 
52 class G4ScaledSolid : public G4VSolid
53 {
54  public: // with description
55 
56  G4ScaledSolid( const G4String& pName,
57  G4VSolid* pSolid ,
58  const G4Scale3D& pScale );
59 
60  virtual ~G4ScaledSolid();
61 
62  EInside Inside( const G4ThreeVector& p ) const;
63 
64  void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
65 
66  G4bool CalculateExtent(const EAxis pAxis,
67  const G4VoxelLimits& pVoxelLimit,
68  const G4AffineTransform& pTransform,
69  G4double& pMin, G4double& pMax) const;
70 
71  G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
72 
74  const G4ThreeVector& v ) const;
75 
76  G4double DistanceToIn( const G4ThreeVector& p) const;
77 
79  const G4ThreeVector& v,
80  const G4bool calcNorm=false,
81  G4bool *validNorm=0,
82  G4ThreeVector *n=0 ) const;
83 
84  G4double DistanceToOut( const G4ThreeVector& p ) const;
85 
87  const G4int n,
88  const G4VPhysicalVolume* pRep );
89 
90  void CleanTransformations();
91 
93 
95  void SetScaleTransform(const G4Scale3D& scale);
96 
97  G4VSolid* GetUnscaledSolid() const;
98 
100  G4VSolid* Clone() const;
101 
102  std::ostream& StreamInfo(std::ostream& os) const;
103 
104  public: // without description
105 
106  G4ScaledSolid(__void__&);
107  // Fake default constructor for usage restricted to direct object
108  // persistency for clients requiring preallocation of memory for
109  // persistifiable objects.
110 
111  G4ScaledSolid(const G4ScaledSolid& rhs);
113  // Copy constructor and assignment operator.
114 
115  void DescribeYourselfTo ( G4VGraphicsScene& scene ) const;
116  G4Polyhedron* CreatePolyhedron () const;
117  G4Polyhedron* GetPolyhedron () const;
118  // For creating graphical representations (i.e. for visualisation).
119 
120  private:
121 
122  G4VSolid* fPtrSolid;
123  G4ScaleTransform* fScale;
124  mutable G4bool fRebuildPolyhedron;
125  mutable G4Polyhedron* fpPolyhedron;
126 } ;
127 
128 #endif
G4ScaledSolid & operator=(const G4ScaledSolid &rhs)
G4ThreeVector GetPointOnSurface() const
G4VSolid * Clone() const
G4Scale3D GetScaleTransform() const
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
const char * p
Definition: xmltok.h:285
int G4int
Definition: G4Types.hh:78
virtual ~G4ScaledSolid()
G4Polyhedron * CreatePolyhedron() const
bool G4bool
Definition: G4Types.hh:79
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
EInside Inside(const G4ThreeVector &p) const
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const
G4Polyhedron * GetPolyhedron() const
void DescribeYourselfTo(G4VGraphicsScene &scene) const
void CleanTransformations()
EInside
Definition: geomdefs.hh:58
EAxis
Definition: geomdefs.hh:54
void SetScaleTransform(const G4Scale3D &scale)
G4VSolid * GetUnscaledSolid() const
std::ostream & StreamInfo(std::ostream &os) const
void Extent(G4ThreeVector &pMin, G4ThreeVector &pMax) const
double G4double
Definition: G4Types.hh:76
G4ScaledSolid(const G4String &pName, G4VSolid *pSolid, const G4Scale3D &pScale)
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
G4GeometryType GetEntityType() const