Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes
G4ReflectedSolid Class Reference

#include <G4ReflectedSolid.hh>

Inheritance diagram for G4ReflectedSolid:
G4VSolid

Public Member Functions

 G4ReflectedSolid (const G4String &pName, G4VSolid *pSolid, const G4Transform3D &transform)
 
virtual ~G4ReflectedSolid ()
 
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)
 
G4ThreeVector GetPointOnSurface () const
 
G4VSolidClone () const
 
virtual G4GeometryType GetEntityType () const
 
virtual const G4ReflectedSolidGetReflectedSolidPtr () const
 
virtual G4ReflectedSolidGetReflectedSolidPtr ()
 
G4VSolidGetConstituentMovedSolid () const
 
G4Transform3D GetTransform3D () const
 
void SetTransform3D (G4Transform3D &)
 
G4Transform3D GetDirectTransform3D () const
 
void SetDirectTransform3D (G4Transform3D &)
 
std::ostream & StreamInfo (std::ostream &os) const
 
 G4ReflectedSolid (const G4ReflectedSolid &rhs)
 
G4ReflectedSolidoperator= (const G4ReflectedSolid &rhs)
 
void DescribeYourselfTo (G4VGraphicsScene &scene) const
 
G4PolyhedronCreatePolyhedron () 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 G4double GetCubicVolume ()
 
virtual G4double GetSurfaceArea ()
 
void DumpInfo () const
 
virtual G4VisExtent GetExtent () 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 Member Functions

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 &)
 
- 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
 

Protected Attributes

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

Detailed Description

Definition at line 51 of file G4ReflectedSolid.hh.

Constructor & Destructor Documentation

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

Definition at line 56 of file G4ReflectedSolid.cc.

References fDirectTransform, fDirectTransform3D, fPtrSolid, fPtrTransform, fPtrTransform3D, HepGeom::Transform3D::getTranslation(), HepGeom::Transform3D::inverse(), and G4AffineTransform::Invert().

Referenced by Clone().

59  : G4VSolid(pName), fpPolyhedron(0)
60 {
61  fPtrSolid = pSolid ;
62  G4RotationMatrix rotMatrix ;
63 
65  new G4AffineTransform(rotMatrix, transform.getTranslation()) ;
67  new G4AffineTransform(rotMatrix, transform.getTranslation()) ;
68  fPtrTransform->Invert() ;
69 
70  fDirectTransform3D = new G4Transform3D(transform) ;
71  fPtrTransform3D = new G4Transform3D(transform.inverse()) ;
72 }
Transform3D inverse() const
Definition: Transform3D.cc:142
G4Transform3D * fDirectTransform3D
G4AffineTransform * fDirectTransform
G4AffineTransform & Invert()
G4Transform3D * fPtrTransform3D
HepGeom::Transform3D G4Transform3D
G4AffineTransform * fPtrTransform
G4Polyhedron * fpPolyhedron
G4VSolid(const G4String &name)
Definition: G4VSolid.cc:60
CLHEP::Hep3Vector getTranslation() const
G4ReflectedSolid::~G4ReflectedSolid ( )
virtual

Definition at line 77 of file G4ReflectedSolid.cc.

References fDirectTransform, fDirectTransform3D, fpPolyhedron, fPtrTransform, and fPtrTransform3D.

78 {
79  if(fPtrTransform)
80  {
81  delete fPtrTransform; fPtrTransform=0;
83  }
84  if(fPtrTransform3D)
85  {
88  }
89  delete fpPolyhedron;
90 }
G4Transform3D * fDirectTransform3D
G4AffineTransform * fDirectTransform
G4Transform3D * fPtrTransform3D
G4AffineTransform * fPtrTransform
G4Polyhedron * fpPolyhedron
G4ReflectedSolid::G4ReflectedSolid ( const G4ReflectedSolid rhs)

Definition at line 95 of file G4ReflectedSolid.cc.

References fDirectTransform, fDirectTransform3D, fPtrTransform, and fPtrTransform3D.

96  : G4VSolid(rhs), fPtrSolid(rhs.fPtrSolid), fpPolyhedron(0)
97 {
102 }
G4Transform3D * fDirectTransform3D
G4AffineTransform * fDirectTransform
G4Transform3D * fPtrTransform3D
HepGeom::Transform3D G4Transform3D
G4AffineTransform * fPtrTransform
G4Polyhedron * fpPolyhedron
G4VSolid(const G4String &name)
Definition: G4VSolid.cc:60

Member Function Documentation

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

Implements G4VSolid.

Definition at line 266 of file G4ReflectedSolid.cc.

References G4VSolid::CalculateExtent(), G4VSolid::ClipBetweenSections(), G4VSolid::ClipCrossSection(), G4VSolid::DumpInfo(), FatalException, fPtrSolid, G4Exception(), G4VoxelLimits::GetMaxExtent(), G4VoxelLimits::GetMaxXExtent(), G4VoxelLimits::GetMaxYExtent(), G4VoxelLimits::GetMaxZExtent(), G4VoxelLimits::GetMinExtent(), G4VoxelLimits::GetMinXExtent(), G4VoxelLimits::GetMinYExtent(), G4VoxelLimits::GetMinZExtent(), Inside(), CLHEP::HepRotation::inverse(), G4VoxelLimits::IsLimited(), G4VSolid::kCarTolerance, kOutside, kXAxis, kYAxis, kZAxis, G4AffineTransform::NetRotation(), G4AffineTransform::NetTranslation(), HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

271 {
272 
273  G4VoxelLimits unLimit;
274  G4AffineTransform unTransform;
275 
276  G4double x1 = -kInfinity, x2 = kInfinity,
277  y1 = -kInfinity, y2 = kInfinity,
278  z1 = -kInfinity, z2 = kInfinity;
279 
280  G4bool existsAfterClip = false ;
281  existsAfterClip =
282  fPtrSolid->CalculateExtent(kXAxis,unLimit,unTransform,x1,x2);
283  existsAfterClip =
284  fPtrSolid->CalculateExtent(kYAxis,unLimit,unTransform,y1,y2);
285  existsAfterClip =
286  fPtrSolid->CalculateExtent(kZAxis,unLimit,unTransform,z1,z2);
287 
288  existsAfterClip = false;
289  pMin = +kInfinity ;
290  pMax = -kInfinity ;
291 
292  G4Transform3D pTransform3D = G4Transform3D(pTransform.NetRotation().inverse(),
293  pTransform.NetTranslation());
294 
295  G4Transform3D transform3D = pTransform3D*(*fDirectTransform3D);
296 
297  G4Point3D tmpPoint;
298 
299  // Calculate rotated vertex coordinates
300 
301  G4ThreeVectorList* vertices = new G4ThreeVectorList();
302 
303  if (vertices)
304  {
305  vertices->reserve(8);
306 
307  G4ThreeVector vertex0(x1,y1,z1) ;
308  tmpPoint = transform3D*G4Point3D(vertex0);
309  vertex0 = G4ThreeVector(tmpPoint.x(),tmpPoint.y(),tmpPoint.z());
310  vertices->push_back(vertex0);
311 
312  G4ThreeVector vertex1(x2,y1,z1) ;
313  tmpPoint = transform3D*G4Point3D(vertex1);
314  vertex1 = G4ThreeVector(tmpPoint.x(),tmpPoint.y(),tmpPoint.z());
315  vertices->push_back(vertex1);
316 
317  G4ThreeVector vertex2(x2,y2,z1) ;
318  tmpPoint = transform3D*G4Point3D(vertex2);
319  vertex2 = G4ThreeVector(tmpPoint.x(),tmpPoint.y(),tmpPoint.z());
320  vertices->push_back(vertex2);
321 
322  G4ThreeVector vertex3(x1,y2,z1) ;
323  tmpPoint = transform3D*G4Point3D(vertex3);
324  vertex3 = G4ThreeVector(tmpPoint.x(),tmpPoint.y(),tmpPoint.z());
325  vertices->push_back(vertex3);
326 
327  G4ThreeVector vertex4(x1,y1,z2) ;
328  tmpPoint = transform3D*G4Point3D(vertex4);
329  vertex4 = G4ThreeVector(tmpPoint.x(),tmpPoint.y(),tmpPoint.z());
330  vertices->push_back(vertex4);
331 
332  G4ThreeVector vertex5(x2,y1,z2) ;
333  tmpPoint = transform3D*G4Point3D(vertex5);
334  vertex5 = G4ThreeVector(tmpPoint.x(),tmpPoint.y(),tmpPoint.z());
335  vertices->push_back(vertex5);
336 
337  G4ThreeVector vertex6(x2,y2,z2) ;
338  tmpPoint = transform3D*G4Point3D(vertex6);
339  vertex6 = G4ThreeVector(tmpPoint.x(),tmpPoint.y(),tmpPoint.z());
340  vertices->push_back(vertex6);
341 
342  G4ThreeVector vertex7(x1,y2,z2) ;
343  tmpPoint = transform3D*G4Point3D(vertex7);
344  vertex7 = G4ThreeVector(tmpPoint.x(),tmpPoint.y(),tmpPoint.z());
345  vertices->push_back(vertex7);
346  }
347  else
348  {
349  DumpInfo();
350  G4Exception("G4ReflectedSolid::CalculateExtent()",
351  "GeomMgt0003", FatalException,
352  "Error in allocation of vertices. Out of memory !");
353  }
354 
355  ClipCrossSection(vertices,0,pVoxelLimit,pAxis,pMin,pMax) ;
356  ClipCrossSection(vertices,4,pVoxelLimit,pAxis,pMin,pMax) ;
357  ClipBetweenSections(vertices,0,pVoxelLimit,pAxis,pMin,pMax) ;
358 
359  if (pVoxelLimit.IsLimited(pAxis) == false)
360  {
361  if ( pMin != kInfinity || pMax != -kInfinity )
362  {
363  existsAfterClip = true ;
364 
365  // Add 2*tolerance to avoid precision troubles
366 
367  pMin -= kCarTolerance;
368  pMax += kCarTolerance;
369  }
370  }
371  else
372  {
373  G4ThreeVector clipCentre(
374  ( pVoxelLimit.GetMinXExtent()+pVoxelLimit.GetMaxXExtent())*0.5,
375  ( pVoxelLimit.GetMinYExtent()+pVoxelLimit.GetMaxYExtent())*0.5,
376  ( pVoxelLimit.GetMinZExtent()+pVoxelLimit.GetMaxZExtent())*0.5);
377 
378  if ( pMin != kInfinity || pMax != -kInfinity )
379  {
380  existsAfterClip = true ;
381 
382 
383  // Check to see if endpoints are in the solid
384 
385  clipCentre(pAxis) = pVoxelLimit.GetMinExtent(pAxis);
386 
387  if (Inside(transform3D.inverse()*G4Point3D(clipCentre)) != kOutside)
388  {
389  pMin = pVoxelLimit.GetMinExtent(pAxis);
390  }
391  else
392  {
393  pMin -= kCarTolerance;
394  }
395  clipCentre(pAxis) = pVoxelLimit.GetMaxExtent(pAxis);
396 
397  if (Inside(transform3D.inverse()*G4Point3D(clipCentre)) != kOutside)
398  {
399  pMax = pVoxelLimit.GetMaxExtent(pAxis);
400  }
401  else
402  {
403  pMax += kCarTolerance;
404  }
405  }
406  // Check for case where completely enveloping clipping volume
407  // If point inside then we are confident that the solid completely
408  // envelopes the clipping volume. Hence set min/max extents according
409  // to clipping volume extents along the specified axis.
410 
411  else if (Inside(transform3D.inverse()*G4Point3D(clipCentre)) != kOutside)
412  {
413  existsAfterClip = true ;
414  pMin = pVoxelLimit.GetMinExtent(pAxis) ;
415  pMax = pVoxelLimit.GetMaxExtent(pAxis) ;
416  }
417  }
418  delete vertices;
419  return existsAfterClip;
420 }
void ClipCrossSection(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
Definition: G4VSolid.cc:347
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
G4double GetMinYExtent() const
CLHEP::Hep3Vector G4ThreeVector
EInside Inside(const G4ThreeVector &p) const
G4ThreeVector NetTranslation() const
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
HepRotation inverse() const
void DumpInfo() const
G4double GetMaxXExtent() const
G4double GetMinZExtent() const
G4bool IsLimited() const
bool G4bool
Definition: G4Types.hh:79
std::vector< G4ThreeVector > G4ThreeVectorList
Definition: G4VSolid.hh:79
HepGeom::Transform3D G4Transform3D
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4RotationMatrix NetRotation() const
G4double GetMinXExtent() const
G4double GetMaxZExtent() const
G4double GetMaxYExtent() const
G4double kCarTolerance
Definition: G4VSolid.hh:305
double G4double
Definition: G4Types.hh:76
G4double GetMaxExtent(const EAxis pAxis) const
void ClipBetweenSections(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
Definition: G4VSolid.cc:378
G4double GetMinExtent(const EAxis pAxis) const
G4VSolid * G4ReflectedSolid::Clone ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 559 of file G4ReflectedSolid.cc.

References G4ReflectedSolid().

560 {
561  return new G4ReflectedSolid(*this);
562 }
G4ReflectedSolid(const G4String &pName, G4VSolid *pSolid, const G4Transform3D &transform)
void G4ReflectedSolid::ComputeDimensions ( G4VPVParameterisation p,
const G4int  n,
const G4VPhysicalVolume pRep 
)
virtual

Reimplemented from G4VSolid.

Definition at line 532 of file G4ReflectedSolid.cc.

References G4VSolid::DumpInfo(), FatalException, and G4Exception().

535 {
536  DumpInfo();
537  G4Exception("G4ReflectedSolid::ComputeDimensions()",
538  "GeomMgt0001", FatalException,
539  "Method not applicable in this context!");
540 }
void DumpInfo() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4Polyhedron * G4ReflectedSolid::CreatePolyhedron ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 606 of file G4ReflectedSolid.cc.

References G4VSolid::CreatePolyhedron(), fDirectTransform3D, fPtrSolid, G4endl, G4Exception(), G4VSolid::GetName(), JustWarning, and HepPolyhedron::Transform().

Referenced by GetPolyhedron().

607 {
608  G4Polyhedron* polyhedron = fPtrSolid->CreatePolyhedron();
609  if (polyhedron)
610  {
611  polyhedron->Transform(*fDirectTransform3D);
612  return polyhedron;
613  }
614  else
615  {
616  std::ostringstream message;
617  message << "Solid - " << GetName()
618  << " - original solid has no" << G4endl
619  << "corresponding polyhedron. Returning NULL!";
620  G4Exception("G4ReflectedSolid::CreatePolyhedron()",
621  "GeomMgt1001", JustWarning, message);
622  return 0;
623  }
624 }
G4String GetName() const
HepPolyhedron & Transform(const G4Transform3D &t)
G4Transform3D * fDirectTransform3D
virtual G4Polyhedron * CreatePolyhedron() const
Definition: G4VSolid.cc:639
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
void G4ReflectedSolid::DescribeYourselfTo ( G4VGraphicsScene scene) const
virtual

Implements G4VSolid.

Definition at line 596 of file G4ReflectedSolid.cc.

References G4VGraphicsScene::AddSolid().

597 {
598  scene.AddSolid (*this);
599 }
virtual void AddSolid(const G4Box &)=0
G4double G4ReflectedSolid::DistanceToIn ( const G4ThreeVector p,
const G4ThreeVector v 
) const
virtual

Implements G4VSolid.

Definition at line 460 of file G4ReflectedSolid.cc.

References G4VSolid::DistanceToIn(), fPtrSolid, HepGeom::BasicVector3D< T >::unit(), HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

462 {
463  G4Point3D newPoint = (*fDirectTransform3D)*G4Point3D(p) ;
464  G4Point3D newDirection = (*fDirectTransform3D)*G4Point3D(v) ;
465  newDirection.unit() ;
466  return fPtrSolid->DistanceToIn(
467  G4ThreeVector(newPoint.x(),newPoint.y(),newPoint.z()),
468  G4ThreeVector(newDirection.x(),newDirection.y(),newDirection.z())) ;
469 }
CLHEP::Hep3Vector G4ThreeVector
BasicVector3D< T > unit() const
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
G4double G4ReflectedSolid::DistanceToIn ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 477 of file G4ReflectedSolid.cc.

References G4VSolid::DistanceToIn(), fPtrSolid, HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

478 {
479  G4Point3D newPoint = (*fDirectTransform3D)*G4Point3D(p) ;
480  return fPtrSolid->DistanceToIn(
481  G4ThreeVector(newPoint.x(),newPoint.y(),newPoint.z())) ;
482 }
CLHEP::Hep3Vector G4ThreeVector
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
G4double G4ReflectedSolid::DistanceToOut ( const G4ThreeVector p,
const G4ThreeVector v,
const G4bool  calcNorm = false,
G4bool validNorm = 0,
G4ThreeVector n = 0 
) const
virtual

Implements G4VSolid.

Definition at line 489 of file G4ReflectedSolid.cc.

References G4VSolid::DistanceToOut(), fPtrSolid, HepGeom::BasicVector3D< T >::unit(), HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

494 {
495  G4ThreeVector solNorm ;
496 
497  G4Point3D newPoint = (*fDirectTransform3D)*G4Point3D(p) ;
498  G4Point3D newDirection = (*fDirectTransform3D)*G4Point3D(v);
499  newDirection.unit() ;
500 
501  G4double dist =
503  G4ThreeVector(newPoint.x(),newPoint.y(),newPoint.z()),
504  G4ThreeVector(newDirection.x(),newDirection.y(),newDirection.z()),
505  calcNorm, validNorm, &solNorm) ;
506  if(calcNorm)
507  {
508  G4Point3D newN = (*fDirectTransform3D)*G4Point3D(solNorm);
509  newN.unit() ;
510  *n = G4ThreeVector(newN.x(),newN.y(),newN.z());
511  }
512  return dist ;
513 }
CLHEP::Hep3Vector G4ThreeVector
BasicVector3D< T > unit() const
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
double G4double
Definition: G4Types.hh:76
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
G4double G4ReflectedSolid::DistanceToOut ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 520 of file G4ReflectedSolid.cc.

References G4VSolid::DistanceToOut(), fPtrSolid, HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

521 {
522  G4Point3D newPoint = (*fDirectTransform3D)*G4Point3D(p);
523  return fPtrSolid->DistanceToOut(
524  G4ThreeVector(newPoint.x(),newPoint.y(),newPoint.z()));
525 }
CLHEP::Hep3Vector G4ThreeVector
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
G4VSolid * G4ReflectedSolid::GetConstituentMovedSolid ( ) const

Definition at line 150 of file G4ReflectedSolid.cc.

References fPtrSolid.

Referenced by G4tgbGeometryDumper::DumpSolid().

151 {
152  return fPtrSolid;
153 }
G4AffineTransform G4ReflectedSolid::GetDirectTransform ( ) const
protected

Definition at line 171 of file G4ReflectedSolid.cc.

References fDirectTransform.

172 {
173  G4AffineTransform aTransform= *fDirectTransform;
174  return aTransform;
175 }
G4AffineTransform * fDirectTransform
G4Transform3D G4ReflectedSolid::GetDirectTransform3D ( ) const

Definition at line 199 of file G4ReflectedSolid.cc.

References fDirectTransform3D.

200 {
201  G4Transform3D aTransform= *fDirectTransform3D;
202  return aTransform;
203 }
G4Transform3D * fDirectTransform3D
G4GeometryType G4ReflectedSolid::GetEntityType ( ) const
virtual

Implements G4VSolid.

Definition at line 135 of file G4ReflectedSolid.cc.

Referenced by StreamInfo().

136 {
137  return G4String("G4ReflectedSolid");
138 }
G4RotationMatrix G4ReflectedSolid::GetFrameRotation ( ) const
protected

Definition at line 213 of file G4ReflectedSolid.cc.

References fDirectTransform, and G4AffineTransform::NetRotation().

214 {
216  return InvRotation;
217 }
G4AffineTransform * fDirectTransform
G4RotationMatrix NetRotation() const
G4ThreeVector G4ReflectedSolid::GetFrameTranslation ( ) const
protected

Definition at line 226 of file G4ReflectedSolid.cc.

References fPtrTransform, and G4AffineTransform::NetTranslation().

227 {
228  return fPtrTransform->NetTranslation();
229 }
G4ThreeVector NetTranslation() const
G4AffineTransform * fPtrTransform
G4RotationMatrix G4ReflectedSolid::GetObjectRotation ( ) const
protected

Definition at line 238 of file G4ReflectedSolid.cc.

References fPtrTransform, and G4AffineTransform::NetRotation().

239 {
241  return Rotation;
242 }
G4RotationMatrix NetRotation() const
G4AffineTransform * fPtrTransform
G4ThreeVector G4ReflectedSolid::GetObjectTranslation ( ) const
protected

Definition at line 251 of file G4ReflectedSolid.cc.

References fDirectTransform, and G4AffineTransform::NetTranslation().

252 {
254 }
G4ThreeVector NetTranslation() const
G4AffineTransform * fDirectTransform
G4ThreeVector G4ReflectedSolid::GetPointOnSurface ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 547 of file G4ReflectedSolid.cc.

References fPtrSolid, G4VSolid::GetPointOnSurface(), HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

548 {
550  G4Point3D newPoint = (*fDirectTransform3D)*G4Point3D(p);
551 
552  return G4ThreeVector(newPoint.x(),newPoint.y(),newPoint.z());
553 }
CLHEP::Hep3Vector G4ThreeVector
const char * p
Definition: xmltok.h:285
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
virtual G4ThreeVector GetPointOnSurface() const
Definition: G4VSolid.cc:152
G4Polyhedron * G4ReflectedSolid::GetPolyhedron ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 631 of file G4ReflectedSolid.cc.

References CreatePolyhedron(), fpPolyhedron, HepPolyhedron::GetNumberOfRotationSteps(), and G4Polyhedron::GetNumberOfRotationStepsAtTimeOfCreation().

632 {
633  if (!fpPolyhedron ||
636  {
637  delete fpPolyhedron;
639  }
640  return fpPolyhedron;
641 }
static G4int GetNumberOfRotationSteps()
G4Polyhedron * fpPolyhedron
G4int GetNumberOfRotationStepsAtTimeOfCreation() const
G4Polyhedron * CreatePolyhedron() const
const G4ReflectedSolid * G4ReflectedSolid::GetReflectedSolidPtr ( ) const
virtual

Definition at line 140 of file G4ReflectedSolid.cc.

141 {
142  return this;
143 }
G4ReflectedSolid * G4ReflectedSolid::GetReflectedSolidPtr ( )
virtual

Definition at line 145 of file G4ReflectedSolid.cc.

146 {
147  return this;
148 }
G4AffineTransform G4ReflectedSolid::GetTransform ( ) const
protected

Definition at line 157 of file G4ReflectedSolid.cc.

References fPtrTransform.

158 {
159  G4AffineTransform aTransform = *fPtrTransform;
160  return aTransform;
161 }
G4AffineTransform * fPtrTransform
G4Transform3D G4ReflectedSolid::GetTransform3D ( ) const

Definition at line 185 of file G4ReflectedSolid.cc.

References fPtrTransform3D.

186 {
187  G4Transform3D aTransform = *fPtrTransform3D;
188  return aTransform;
189 }
G4Transform3D * fPtrTransform3D
EInside G4ReflectedSolid::Inside ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 426 of file G4ReflectedSolid.cc.

References fPtrSolid, G4VSolid::Inside(), HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

Referenced by CalculateExtent().

427 {
428 
429  G4Point3D newPoint = (*fDirectTransform3D)*G4Point3D(p) ;
430  // G4Point3D newPoint = (*fPtrTransform3D)*G4Point3D(p) ;
431 
432  return fPtrSolid->Inside(G4ThreeVector(newPoint.x(),
433  newPoint.y(),
434  newPoint.z())) ;
435 }
CLHEP::Hep3Vector G4ThreeVector
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
virtual EInside Inside(const G4ThreeVector &p) const =0
G4ReflectedSolid & G4ReflectedSolid::operator= ( const G4ReflectedSolid rhs)

Definition at line 107 of file G4ReflectedSolid.cc.

References fDirectTransform, fDirectTransform3D, fpPolyhedron, fPtrSolid, fPtrTransform, fPtrTransform3D, and G4VSolid::operator=().

108 {
109  // Check assignment to self
110  //
111  if (this == &rhs) { return *this; }
112 
113  // Copy base class data
114  //
115  G4VSolid::operator=(rhs);
116 
117  // Copy data
118  //
120  delete fPtrTransform;
122  delete fDirectTransform;
124  delete fPtrTransform3D;
126  delete fDirectTransform3D;
128 
129  return *this;
130 }
G4Transform3D * fDirectTransform3D
G4AffineTransform * fDirectTransform
G4Transform3D * fPtrTransform3D
HepGeom::Transform3D G4Transform3D
G4AffineTransform * fPtrTransform
G4Polyhedron * fpPolyhedron
G4VSolid & operator=(const G4VSolid &rhs)
Definition: G4VSolid.cc:110
void G4ReflectedSolid::SetDirectTransform ( G4AffineTransform transform)
protected

Definition at line 177 of file G4ReflectedSolid.cc.

References fDirectTransform, and fpPolyhedron.

178 {
179  fDirectTransform = &transform ;
180  fpPolyhedron = 0;
181 }
G4AffineTransform * fDirectTransform
G4Polyhedron * fpPolyhedron
void G4ReflectedSolid::SetDirectTransform3D ( G4Transform3D transform)

Definition at line 205 of file G4ReflectedSolid.cc.

References fDirectTransform3D, and fpPolyhedron.

206 {
207  fDirectTransform3D = &transform ;
208  fpPolyhedron = 0;
209 }
G4Transform3D * fDirectTransform3D
G4Polyhedron * fpPolyhedron
void G4ReflectedSolid::SetFrameRotation ( const G4RotationMatrix matrix)
protected

Definition at line 219 of file G4ReflectedSolid.cc.

References fDirectTransform, and G4AffineTransform::SetNetRotation().

220 {
222 }
G4AffineTransform * fDirectTransform
void SetNetRotation(const G4RotationMatrix &rot)
void G4ReflectedSolid::SetFrameTranslation ( const G4ThreeVector vector)
protected

Definition at line 231 of file G4ReflectedSolid.cc.

References fPtrTransform, and G4AffineTransform::SetNetTranslation().

232 {
234 }
void SetNetTranslation(const G4ThreeVector &tlate)
G4AffineTransform * fPtrTransform
void G4ReflectedSolid::SetObjectRotation ( const G4RotationMatrix matrix)
protected

Definition at line 244 of file G4ReflectedSolid.cc.

References fPtrTransform, and G4AffineTransform::SetNetRotation().

245 {
246  fPtrTransform->SetNetRotation(matrix);
247 }
void SetNetRotation(const G4RotationMatrix &rot)
G4AffineTransform * fPtrTransform
void G4ReflectedSolid::SetObjectTranslation ( const G4ThreeVector vector)
protected

Definition at line 256 of file G4ReflectedSolid.cc.

References fDirectTransform, and G4AffineTransform::SetNetTranslation().

257 {
259 }
G4AffineTransform * fDirectTransform
void SetNetTranslation(const G4ThreeVector &tlate)
void G4ReflectedSolid::SetTransform ( G4AffineTransform transform)
protected

Definition at line 163 of file G4ReflectedSolid.cc.

References fpPolyhedron, and fPtrTransform.

164 {
165  fPtrTransform = &transform ;
166  fpPolyhedron = 0;
167 }
G4AffineTransform * fPtrTransform
G4Polyhedron * fpPolyhedron
void G4ReflectedSolid::SetTransform3D ( G4Transform3D transform)

Definition at line 191 of file G4ReflectedSolid.cc.

References fpPolyhedron, and fPtrTransform3D.

192 {
193  fPtrTransform3D = &transform ;
194  fpPolyhedron = 0;
195 }
G4Transform3D * fPtrTransform3D
G4Polyhedron * fpPolyhedron
std::ostream & G4ReflectedSolid::StreamInfo ( std::ostream &  os) const
virtual

Implements G4VSolid.

Definition at line 569 of file G4ReflectedSolid.cc.

References fDirectTransform, fPtrSolid, GetEntityType(), G4VSolid::GetName(), G4AffineTransform::NetRotation(), G4AffineTransform::NetTranslation(), CLHEP::HepRotation::print(), and G4VSolid::StreamInfo().

570 {
571  os << "-----------------------------------------------------------\n"
572  << " *** Dump for Reflected solid - " << GetName() << " ***\n"
573  << " ===================================================\n"
574  << " Solid type: " << GetEntityType() << "\n"
575  << " Parameters of constituent solid: \n"
576  << "===========================================================\n";
577  fPtrSolid->StreamInfo(os);
578  os << "===========================================================\n"
579  << " Transformations: \n"
580  << " Direct transformation - translation : \n"
581  << " " << fDirectTransform->NetTranslation() << "\n"
582  << " - rotation : \n"
583  << " ";
585  os << "\n"
586  << "===========================================================\n";
587 
588  return os;
589 }
G4String GetName() const
std::ostream & print(std::ostream &os) const
Definition: RotationIO.cc:21
G4ThreeVector NetTranslation() const
G4AffineTransform * fDirectTransform
virtual std::ostream & StreamInfo(std::ostream &os) const =0
virtual G4GeometryType GetEntityType() const
G4RotationMatrix NetRotation() const
G4ThreeVector G4ReflectedSolid::SurfaceNormal ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 442 of file G4ReflectedSolid.cc.

References fPtrSolid, G4VSolid::SurfaceNormal(), HepGeom::BasicVector3D< T >::unit(), HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

443 {
444  G4Point3D newPoint = (*fDirectTransform3D)*G4Point3D(p) ;
445  G4ThreeVector normal =
447  newPoint.y(),
448  newPoint.z() ) ) ;
449  G4Point3D newN = (*fDirectTransform3D)*G4Point3D(normal) ;
450  newN.unit() ;
451 
452  return G4ThreeVector(newN.x(),newN.y(),newN.z()) ;
453 }
CLHEP::Hep3Vector G4ThreeVector
BasicVector3D< T > unit() const
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const =0

Field Documentation

G4AffineTransform* G4ReflectedSolid::fDirectTransform
protected
G4Transform3D* G4ReflectedSolid::fDirectTransform3D
protected
G4Polyhedron* G4ReflectedSolid::fpPolyhedron
mutableprotected
G4VSolid* G4ReflectedSolid::fPtrSolid
protected
G4AffineTransform* G4ReflectedSolid::fPtrTransform
protected
G4Transform3D* G4ReflectedSolid::fPtrTransform3D
protected

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