Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DisplacedSolid Class Reference

#include <G4DisplacedSolid.hh>

+ Inheritance diagram for G4DisplacedSolid:

Public Member Functions

 G4DisplacedSolid (const G4String &pName, G4VSolid *pSolid, G4RotationMatrix *rotMatrix, const G4ThreeVector &transVector)
 
 G4DisplacedSolid (const G4String &pName, G4VSolid *pSolid, const G4Transform3D &transform)
 
 G4DisplacedSolid (const G4String &pName, G4VSolid *pSolid, const G4AffineTransform directTransform)
 
virtual ~G4DisplacedSolid ()
 
EInside Inside (const G4ThreeVector &p) const
 
G4bool CalculateExtent (const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
 
G4ThreeVector SurfaceNormal (const G4ThreeVector &p) const
 
G4double DistanceToIn (const G4ThreeVector &p, const G4ThreeVector &v) const
 
G4double DistanceToIn (const G4ThreeVector &p) const
 
G4double DistanceToOut (const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const
 
G4double DistanceToOut (const G4ThreeVector &p) const
 
void ComputeDimensions (G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
 
void CleanTransformations ()
 
G4ThreeVector GetPointOnSurface () const
 
G4GeometryType GetEntityType () const
 
G4VSolidClone () const
 
const G4DisplacedSolidGetDisplacedSolidPtr () const
 
G4DisplacedSolidGetDisplacedSolidPtr ()
 
G4VSolidGetConstituentMovedSolid () const
 
G4AffineTransform GetTransform () const
 
void SetTransform (G4AffineTransform &)
 
G4AffineTransform GetDirectTransform () const
 
void SetDirectTransform (G4AffineTransform &)
 
G4RotationMatrix GetFrameRotation () const
 
void SetFrameRotation (const G4RotationMatrix &)
 
G4ThreeVector GetFrameTranslation () const
 
void SetFrameTranslation (const G4ThreeVector &)
 
G4RotationMatrix GetObjectRotation () const
 
void SetObjectRotation (const G4RotationMatrix &)
 
G4ThreeVector GetObjectTranslation () const
 
void SetObjectTranslation (const G4ThreeVector &)
 
std::ostream & StreamInfo (std::ostream &os) const
 
 G4DisplacedSolid (__void__ &)
 
 G4DisplacedSolid (const G4DisplacedSolid &rhs)
 
G4DisplacedSolidoperator= (const G4DisplacedSolid &rhs)
 
void DescribeYourselfTo (G4VGraphicsScene &scene) const
 
G4PolyhedronCreatePolyhedron () const
 
G4NURBSCreateNURBS () const
 
G4PolyhedronGetPolyhedron () const
 
- Public Member Functions inherited from G4VSolid
 G4VSolid (const G4String &name)
 
virtual ~G4VSolid ()
 
G4bool operator== (const G4VSolid &s) const
 
G4String GetName () const
 
void SetName (const G4String &name)
 
G4double GetTolerance () const
 
virtual G4bool CalculateExtent (const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
 
virtual EInside Inside (const G4ThreeVector &p) const =0
 
virtual G4ThreeVector SurfaceNormal (const G4ThreeVector &p) const =0
 
virtual G4double DistanceToIn (const G4ThreeVector &p, const G4ThreeVector &v) const =0
 
virtual G4double DistanceToIn (const G4ThreeVector &p) const =0
 
virtual G4double DistanceToOut (const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
 
virtual G4double DistanceToOut (const G4ThreeVector &p) const =0
 
virtual void ComputeDimensions (G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
 
virtual G4double GetCubicVolume ()
 
virtual G4double GetSurfaceArea ()
 
virtual G4GeometryType GetEntityType () const =0
 
virtual G4ThreeVector GetPointOnSurface () const
 
virtual G4VSolidClone () const
 
virtual std::ostream & StreamInfo (std::ostream &os) const =0
 
void DumpInfo () const
 
virtual void DescribeYourselfTo (G4VGraphicsScene &scene) const =0
 
virtual G4VisExtent GetExtent () const
 
virtual G4PolyhedronCreatePolyhedron () const
 
virtual G4NURBSCreateNURBS () const
 
virtual G4PolyhedronGetPolyhedron () const
 
virtual const G4VSolidGetConstituentSolid (G4int no) const
 
virtual G4VSolidGetConstituentSolid (G4int no)
 
virtual const G4DisplacedSolidGetDisplacedSolidPtr () const
 
virtual G4DisplacedSolidGetDisplacedSolidPtr ()
 
 G4VSolid (__void__ &)
 
 G4VSolid (const G4VSolid &rhs)
 
G4VSolidoperator= (const G4VSolid &rhs)
 

Protected Attributes

G4VSolidfPtrSolid
 
G4AffineTransformfPtrTransform
 
G4AffineTransformfDirectTransform
 
G4PolyhedronfpPolyhedron
 
- Protected Attributes inherited from G4VSolid
G4double kCarTolerance
 

Additional Inherited Members

- Protected Member Functions inherited from G4VSolid
void CalculateClippedPolygonExtent (G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
 
void ClipCrossSection (G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
 
void ClipBetweenSections (G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
 
void ClipPolygon (G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis) const
 
G4double EstimateCubicVolume (G4int nStat, G4double epsilon) const
 
G4double EstimateSurfaceArea (G4int nStat, G4double ell) const
 

Detailed Description

Definition at line 53 of file G4DisplacedSolid.hh.

Constructor & Destructor Documentation

◆ G4DisplacedSolid() [1/5]

G4DisplacedSolid::G4DisplacedSolid ( const G4String pName,
G4VSolid pSolid,
G4RotationMatrix rotMatrix,
const G4ThreeVector transVector 
)

Definition at line 56 of file G4DisplacedSolid.cc.

60 : G4VSolid(pName), fpPolyhedron(0)
61{
62 fPtrSolid = pSolid ;
63 fPtrTransform = new G4AffineTransform(rotMatrix,transVector) ;
65 fDirectTransform = new G4AffineTransform(rotMatrix,transVector) ;
66}
G4AffineTransform & Invert()
G4Polyhedron * fpPolyhedron
G4AffineTransform * fPtrTransform
G4AffineTransform * fDirectTransform

◆ G4DisplacedSolid() [2/5]

G4DisplacedSolid::G4DisplacedSolid ( const G4String pName,
G4VSolid pSolid,
const G4Transform3D transform 
)

Definition at line 72 of file G4DisplacedSolid.cc.

75 : G4VSolid(pName), fpPolyhedron(0)
76{
77 fPtrSolid = pSolid ;
79 transform.getTranslation()) ;
80
82 transform.getTranslation()) ;
84}
HepRotation inverse() const
CLHEP::HepRotation getRotation() const
CLHEP::Hep3Vector getTranslation() const

◆ G4DisplacedSolid() [3/5]

G4DisplacedSolid::G4DisplacedSolid ( const G4String pName,
G4VSolid pSolid,
const G4AffineTransform  directTransform 
)

Definition at line 91 of file G4DisplacedSolid.cc.

94 : G4VSolid(pName), fpPolyhedron(0)
95{
96 fPtrSolid = pSolid ;
97 fDirectTransform = new G4AffineTransform( directTransform );
98 fPtrTransform = new G4AffineTransform( directTransform.Inverse() ) ;
99}
G4AffineTransform Inverse() const

◆ ~G4DisplacedSolid()

G4DisplacedSolid::~G4DisplacedSolid ( )
virtual

Definition at line 116 of file G4DisplacedSolid.cc.

117{
119 delete fpPolyhedron;
120}

◆ G4DisplacedSolid() [4/5]

G4DisplacedSolid::G4DisplacedSolid ( __void__ &  a)

Definition at line 106 of file G4DisplacedSolid.cc.

107 : G4VSolid(a), fPtrSolid(0), fPtrTransform(0),
109{
110}

◆ G4DisplacedSolid() [5/5]

G4DisplacedSolid::G4DisplacedSolid ( const G4DisplacedSolid rhs)

Definition at line 126 of file G4DisplacedSolid.cc.

Member Function Documentation

◆ CalculateExtent()

G4bool G4DisplacedSolid::CalculateExtent ( const EAxis  pAxis,
const G4VoxelLimits pVoxelLimit,
const G4AffineTransform pTransform,
G4double pMin,
G4double pMax 
) const
virtual

Implements G4VSolid.

Definition at line 269 of file G4DisplacedSolid.cc.

274{
275 G4AffineTransform sumTransform ;
276 sumTransform.Product(*fDirectTransform,pTransform) ;
277 return fPtrSolid->CalculateExtent(pAxis,pVoxelLimit,sumTransform,pMin,pMax) ;
278}
G4AffineTransform & Product(const G4AffineTransform &tf1, const G4AffineTransform &tf2)
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0

◆ CleanTransformations()

void G4DisplacedSolid::CleanTransformations ( )

Definition at line 158 of file G4DisplacedSolid.cc.

159{
160 if(fPtrTransform)
161 {
164 }
165}

Referenced by ~G4DisplacedSolid().

◆ Clone()

G4VSolid * G4DisplacedSolid::Clone ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 401 of file G4DisplacedSolid.cc.

402{
403 return new G4DisplacedSolid(*this);
404}

◆ ComputeDimensions()

void G4DisplacedSolid::ComputeDimensions ( G4VPVParameterisation p,
const G4int  n,
const G4VPhysicalVolume pRep 
)
virtual

Reimplemented from G4VSolid.

Definition at line 366 of file G4DisplacedSolid.cc.

369{
370 DumpInfo();
371 G4Exception("G4DisplacedSolid::ComputeDimensions()",
372 "GeomSolids0001", FatalException,
373 "Method not applicable in this context!");
374}
@ FatalException
void DumpInfo() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ CreateNURBS()

G4NURBS * G4DisplacedSolid::CreateNURBS ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 460 of file G4DisplacedSolid.cc.

461{
462 // Take into account local transformation - see CreatePolyhedron.
463 // return fPtrSolid->CreateNURBS() ;
464 return 0;
465}

◆ CreatePolyhedron()

G4Polyhedron * G4DisplacedSolid::CreatePolyhedron ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 447 of file G4DisplacedSolid.cc.

448{
449 G4Polyhedron* polyhedron = fPtrSolid->CreatePolyhedron();
450 polyhedron
452 return polyhedron;
453}
HepGeom::Transform3D G4Transform3D
G4RotationMatrix GetObjectRotation() const
G4ThreeVector GetObjectTranslation() const
virtual G4Polyhedron * CreatePolyhedron() const
Definition: G4VSolid.cc:637
HepPolyhedron & Transform(const G4Transform3D &t)

Referenced by GetPolyhedron().

◆ DescribeYourselfTo()

void G4DisplacedSolid::DescribeYourselfTo ( G4VGraphicsScene scene) const
virtual

Implements G4VSolid.

Definition at line 437 of file G4DisplacedSolid.cc.

438{
439 scene.AddSolid (*this);
440}
virtual void AddSolid(const G4Box &)=0

◆ DistanceToIn() [1/2]

G4double G4DisplacedSolid::DistanceToIn ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 321 of file G4DisplacedSolid.cc.

322{
324 return fPtrSolid->DistanceToIn(newPoint) ;
325}
G4ThreeVector TransformPoint(const G4ThreeVector &vec) const
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0

◆ DistanceToIn() [2/2]

G4double G4DisplacedSolid::DistanceToIn ( const G4ThreeVector p,
const G4ThreeVector v 
) const
virtual

Implements G4VSolid.

Definition at line 307 of file G4DisplacedSolid.cc.

309{
311 G4ThreeVector newDirection = fPtrTransform->TransformAxis(v) ;
312 return fPtrSolid->DistanceToIn(newPoint,newDirection) ;
313}
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const

◆ DistanceToOut() [1/2]

G4double G4DisplacedSolid::DistanceToOut ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 355 of file G4DisplacedSolid.cc.

356{
358 return fPtrSolid->DistanceToOut(newPoint) ;
359}
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0

◆ DistanceToOut() [2/2]

G4double G4DisplacedSolid::DistanceToOut ( const G4ThreeVector p,
const G4ThreeVector v,
const G4bool  calcNorm = false,
G4bool validNorm = 0,
G4ThreeVector n = 0 
) const
virtual

Implements G4VSolid.

Definition at line 332 of file G4DisplacedSolid.cc.

337{
338 G4ThreeVector solNorm ;
340 G4ThreeVector newDirection = fPtrTransform->TransformAxis(v) ;
341 G4double dist = fPtrSolid->DistanceToOut(newPoint,newDirection,
342 calcNorm,validNorm,&solNorm) ;
343 if(calcNorm)
344 {
345 *n = fDirectTransform->TransformAxis(solNorm) ;
346 }
347 return dist ;
348}
double G4double
Definition: G4Types.hh:64

◆ GetConstituentMovedSolid()

G4VSolid * G4DisplacedSolid::GetConstituentMovedSolid ( ) const

Definition at line 177 of file G4DisplacedSolid.cc.

178{
179 return fPtrSolid;
180}

Referenced by G4tgbGeometryDumper::DumpBooleanVolume().

◆ GetDirectTransform()

G4AffineTransform G4DisplacedSolid::GetDirectTransform ( ) const

Definition at line 198 of file G4DisplacedSolid.cc.

199{
201 return aTransform;
202}

◆ GetDisplacedSolidPtr() [1/2]

G4DisplacedSolid * G4DisplacedSolid::GetDisplacedSolidPtr ( )
virtual

Reimplemented from G4VSolid.

Definition at line 172 of file G4DisplacedSolid.cc.

173{
174 return this;
175}

◆ GetDisplacedSolidPtr() [2/2]

const G4DisplacedSolid * G4DisplacedSolid::GetDisplacedSolidPtr ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 167 of file G4DisplacedSolid.cc.

168{
169 return this;
170}

◆ GetEntityType()

G4GeometryType G4DisplacedSolid::GetEntityType ( ) const
virtual

Implements G4VSolid.

Definition at line 392 of file G4DisplacedSolid.cc.

393{
394 return G4String("G4DisplacedSolid");
395}

Referenced by StreamInfo().

◆ GetFrameRotation()

G4RotationMatrix G4DisplacedSolid::GetFrameRotation ( ) const

Definition at line 212 of file G4DisplacedSolid.cc.

213{
215 return InvRotation;
216}
G4RotationMatrix NetRotation() const

◆ GetFrameTranslation()

G4ThreeVector G4DisplacedSolid::GetFrameTranslation ( ) const

Definition at line 226 of file G4DisplacedSolid.cc.

227{
229}
G4ThreeVector NetTranslation() const

◆ GetObjectRotation()

G4RotationMatrix G4DisplacedSolid::GetObjectRotation ( ) const

Definition at line 239 of file G4DisplacedSolid.cc.

240{
242 return Rotation;
243}

Referenced by CreatePolyhedron().

◆ GetObjectTranslation()

G4ThreeVector G4DisplacedSolid::GetObjectTranslation ( ) const

Definition at line 253 of file G4DisplacedSolid.cc.

254{
256}

Referenced by CreatePolyhedron(), and G4tgbGeometryDumper::DumpBooleanVolume().

◆ GetPointOnSurface()

G4ThreeVector G4DisplacedSolid::GetPointOnSurface ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 382 of file G4DisplacedSolid.cc.

383{
386}
virtual G4ThreeVector GetPointOnSurface() const
Definition: G4VSolid.cc:152

◆ GetPolyhedron()

G4Polyhedron * G4DisplacedSolid::GetPolyhedron ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 471 of file G4DisplacedSolid.cc.

472{
473 if (!fpPolyhedron ||
476 {
477 delete fpPolyhedron;
479 }
480 return fpPolyhedron;
481}
G4Polyhedron * CreatePolyhedron() const
G4int GetNumberOfRotationStepsAtTimeOfCreation() const
static G4int GetNumberOfRotationSteps()

◆ GetTransform()

G4AffineTransform G4DisplacedSolid::GetTransform ( ) const

Definition at line 184 of file G4DisplacedSolid.cc.

185{
186 G4AffineTransform aTransform = *fPtrTransform;
187 return aTransform;
188}

◆ Inside()

EInside G4DisplacedSolid::Inside ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 284 of file G4DisplacedSolid.cc.

285{
287 return fPtrSolid->Inside(newPoint) ;
288}
virtual EInside Inside(const G4ThreeVector &p) const =0

◆ operator=()

G4DisplacedSolid & G4DisplacedSolid::operator= ( const G4DisplacedSolid rhs)

Definition at line 137 of file G4DisplacedSolid.cc.

138{
139 // Check assignment to self
140 //
141 if (this == &rhs) { return *this; }
142
143 // Copy base class data
144 //
146
147 // Copy data
148 //
149 fPtrSolid = rhs.fPtrSolid;
150 delete fPtrTransform; delete fDirectTransform;
153 delete fpPolyhedron; fpPolyhedron= 0;
154
155 return *this;
156}
G4VSolid & operator=(const G4VSolid &rhs)
Definition: G4VSolid.cc:110

◆ SetDirectTransform()

void G4DisplacedSolid::SetDirectTransform ( G4AffineTransform transform)

Definition at line 204 of file G4DisplacedSolid.cc.

205{
206 fDirectTransform = &transform ;
207 fpPolyhedron = 0;
208}

◆ SetFrameRotation()

void G4DisplacedSolid::SetFrameRotation ( const G4RotationMatrix matrix)

Definition at line 218 of file G4DisplacedSolid.cc.

219{
221 fpPolyhedron = 0;
222}
void SetNetRotation(const G4RotationMatrix &rot)

◆ SetFrameTranslation()

void G4DisplacedSolid::SetFrameTranslation ( const G4ThreeVector vector)

Definition at line 231 of file G4DisplacedSolid.cc.

232{
234 fpPolyhedron = 0;
235}
void SetNetTranslation(const G4ThreeVector &tlate)

◆ SetObjectRotation()

void G4DisplacedSolid::SetObjectRotation ( const G4RotationMatrix matrix)

Definition at line 245 of file G4DisplacedSolid.cc.

246{
248 fpPolyhedron = 0;
249}

◆ SetObjectTranslation()

void G4DisplacedSolid::SetObjectTranslation ( const G4ThreeVector vector)

Definition at line 258 of file G4DisplacedSolid.cc.

259{
261 fpPolyhedron = 0;
262}

◆ SetTransform()

void G4DisplacedSolid::SetTransform ( G4AffineTransform transform)

Definition at line 190 of file G4DisplacedSolid.cc.

191{
192 fPtrTransform = &transform ;
193 fpPolyhedron = 0;
194}

◆ StreamInfo()

std::ostream & G4DisplacedSolid::StreamInfo ( std::ostream &  os) const
virtual

Implements G4VSolid.

Definition at line 410 of file G4DisplacedSolid.cc.

411{
412 os << "-----------------------------------------------------------\n"
413 << " *** Dump for Displaced solid - " << GetName() << " ***\n"
414 << " ===================================================\n"
415 << " Solid type: " << GetEntityType() << "\n"
416 << " Parameters of constituent solid: \n"
417 << "===========================================================\n";
419 os << "===========================================================\n"
420 << " Transformations: \n"
421 << " Direct transformation - translation : \n"
422 << " " << fDirectTransform->NetTranslation() << "\n"
423 << " - rotation : \n"
424 << " ";
426 os << "\n"
427 << "===========================================================\n";
428
429 return os;
430}
std::ostream & print(std::ostream &os) const
Definition: RotationIO.cc:21
G4GeometryType GetEntityType() const
G4String GetName() const
virtual std::ostream & StreamInfo(std::ostream &os) const =0

◆ SurfaceNormal()

G4ThreeVector G4DisplacedSolid::SurfaceNormal ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 295 of file G4DisplacedSolid.cc.

296{
298 G4ThreeVector normal = fPtrSolid->SurfaceNormal(newPoint) ;
299 return fDirectTransform->TransformAxis(normal) ;
300}
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const =0

Member Data Documentation

◆ fDirectTransform

◆ fpPolyhedron

◆ fPtrSolid

◆ fPtrTransform


The documentation for this class was generated from the following files: