source: trunk/source/geometry/management/include/G4ReflectedSolid.hh @ 1340

Last change on this file since 1340 was 1340, checked in by garnier, 14 years ago

update ti head

File size: 6.0 KB
Line 
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.6 2010/10/19 15:20:18 gcosmo Exp $
28// GEANT4 tag $Name: geommng-V09-03-05 $
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
52class 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    G4VSolid* Clone() const;
97
98  public:  // with description
99
100    virtual G4GeometryType  GetEntityType() const;
101
102    virtual const G4ReflectedSolid* GetReflectedSolidPtr() const;
103    virtual       G4ReflectedSolid* GetReflectedSolidPtr();
104      // If the Solid is a "G4ReflectedSolid",
105      // return a self pointer else return 0.
106
107    G4VSolid*                GetConstituentMovedSolid() const;
108
109    G4Transform3D        GetTransform3D() const; 
110    void       SetTransform3D(G4Transform3D&);
111    G4Transform3D        GetDirectTransform3D() const; 
112    void       SetDirectTransform3D(G4Transform3D&);
113      // Accessors methods.
114
115    std::ostream& StreamInfo(std::ostream& os) const;
116
117  public:  // without description
118
119    G4ReflectedSolid(const G4ReflectedSolid& rhs);
120    G4ReflectedSolid& operator=(const G4ReflectedSolid& rhs);
121      // Copy constructor and assignment operator.
122
123    void DescribeYourselfTo ( G4VGraphicsScene& scene ) const ;
124    G4Polyhedron* CreatePolyhedron () const ;
125    G4NURBS*      CreateNURBS      () const ;
126    G4Polyhedron* GetPolyhedron    () const;
127      // For creating graphical representations (ie for visualisation).
128
129  protected:
130
131    G4AffineTransform        GetTransform() const; 
132    void       SetTransform(G4AffineTransform&);
133    G4AffineTransform        GetDirectTransform() const; 
134    void       SetDirectTransform(G4AffineTransform&);
135    G4RotationMatrix         GetFrameRotation() const;
136    void  SetFrameRotation(const G4RotationMatrix&);
137    G4ThreeVector            GetFrameTranslation() const; 
138    void  SetFrameTranslation(const G4ThreeVector&); 
139      // Get/Set the rotation/translation, as applied to the
140      // frame of reference.
141
142    G4RotationMatrix         GetObjectRotation() const;
143    void  SetObjectRotation(const G4RotationMatrix&);
144    G4ThreeVector            GetObjectTranslation() const; 
145    void  SetObjectTranslation(const G4ThreeVector&); 
146      // Get/Set the rotation/translation, as applied to the object.
147
148    G4VSolid*          fPtrSolid        ;
149    G4AffineTransform* fPtrTransform    ;
150    G4AffineTransform* fDirectTransform ;
151
152    G4Transform3D*     fPtrTransform3D    ;
153    G4Transform3D*     fDirectTransform3D ;
154
155    mutable G4Polyhedron* fpPolyhedron;  // Caches reflected G4Polyhedron.
156
157} ;
158
159#endif
Note: See TracBrowser for help on using the repository browser.