ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ReflectedSolid.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4ReflectedSolid.hh
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 // G4ReflectedSolid
27 //
28 // Class description:
29 //
30 // A Reflected solid is a solid that has been shifted from its original
31 // frame of reference to a new one.
32 
33 // 23.07.01, V.Grichine - created
34 // --------------------------------------------------------------------
35 #ifndef G4ReflectedSolid_HH
36 #define G4ReflectedSolid_HH
37 
38 #include "G4VSolid.hh"
39 #include "G4ThreeVector.hh"
40 #include "G4Transform3D.hh"
41 
42 class G4ReflectedSolid : public G4VSolid
43 {
44  public: // with description
45 
46  G4ReflectedSolid( const G4String& pName,
47  G4VSolid* pSolid ,
48  const G4Transform3D& transform ) ;
49  // For use in instantiating a transient instance.
50 
51  virtual ~G4ReflectedSolid();
52  // Virtual destructor.
53 
54  public: // without description
55 
56  // Includes all the methods that a solid requires.
57 
58  EInside Inside( const G4ThreeVector& p ) const;
59 
61 
62  G4bool CalculateExtent( const EAxis pAxis,
63  const G4VoxelLimits& pVoxelLimit,
64  const G4AffineTransform& pTransform,
65  G4double& pMin, G4double& pMax) const;
66 
67  G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
68 
70  const G4ThreeVector& v ) const;
71 
72  G4double DistanceToIn( const G4ThreeVector& p) const;
73 
75  const G4ThreeVector& v,
76  const G4bool calcNorm = false,
77  G4bool* validNorm = nullptr,
78  G4ThreeVector* n = nullptr ) const;
79 
80  G4double DistanceToOut( const G4ThreeVector& p ) const;
81 
83  const G4int n,
84  const G4VPhysicalVolume* pRep );
85 
87 
88  G4VSolid* Clone() const;
89 
90  public: // with description
91 
92  virtual G4GeometryType GetEntityType() const;
93 
94  virtual const G4ReflectedSolid* GetReflectedSolidPtr() const;
96  // If the Solid is a "G4ReflectedSolid",
97  // return a self pointer else return nullptr.
98 
100 
101  G4Transform3D GetTransform3D() const;
104  // Accessors methods.
105 
106  std::ostream& StreamInfo(std::ostream& os) const;
107 
108  public: // without description
109 
112  // Copy constructor and assignment operator.
113 
114  void DescribeYourselfTo ( G4VGraphicsScene& scene ) const;
115  G4Polyhedron* CreatePolyhedron () const;
116  G4Polyhedron* GetPolyhedron () const;
117  // For creating graphical representations (i.e. for visualisation).
118 
119  protected:
120 
121  G4VSolid* fPtrSolid = nullptr;
123 
124  mutable G4bool fRebuildPolyhedron = false;
125  mutable G4Polyhedron* fpPolyhedron = nullptr;
126  // Caches reflected G4Polyhedron.
127 };
128 
129 #endif