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

#include <G4CircularCurve.hh>

+ Inheritance diagram for G4CircularCurve:

Public Member Functions

 G4CircularCurve ()
 
virtual ~G4CircularCurve ()
 
 G4CircularCurve (const G4CircularCurve &right)
 
G4CircularCurveoperator= (const G4CircularCurve &right)
 
virtual G4CurveProject (const G4Transform3D &tr=G4Transform3D::Identity)
 
virtual G4bool Tangent (G4CurvePoint &cp, G4Vector3D &v)
 
virtual G4double GetPMax () const
 
virtual G4Point3D GetPoint (G4double param) const
 
virtual G4double GetPPoint (const G4Point3D &p) const
 
G4double GetRadius () const
 
void Init (const G4Axis2Placement3D &position0, G4double radius0)
 
virtual G4int IntersectRay2D (const G4Ray &ray)
 
- Public Member Functions inherited from G4Conic
 G4Conic ()
 
virtual ~G4Conic ()
 
 G4Conic (const G4Conic &right)
 
G4Conicoperator= (const G4Conic &right)
 
const G4Axis2Placement3DGetPosition () const
 
G4double GetPShift () const
 
void SetPShift (G4double pShift0)
 
- Public Member Functions inherited from G4Curve
 G4Curve ()
 
virtual ~G4Curve ()
 
 G4Curve (const G4Curve &c)
 
G4Curveoperator= (const G4Curve &c)
 
G4bool operator== (const G4Curve &right) const
 
virtual G4String GetEntityType () const
 
virtual G4CurveProject (const G4Transform3D &tr=G4Transform3D::Identity)=0
 
virtual G4bool Tangent (G4CurvePoint &cp, G4Vector3D &v)=0
 
virtual G4int IntersectRay2D (const G4Ray &ray)=0
 
const G4Point3DGetStart () const
 
const G4Point3DGetEnd () const
 
G4double GetPStart () const
 
G4double GetPEnd () const
 
void SetBounds (G4double p1, G4double p2)
 
void SetBounds (G4double p1, const G4Point3D &p2)
 
void SetBounds (const G4Point3D &p1, G4double p2)
 
void SetBounds (const G4Point3D &p1, const G4Point3D &p2)
 
G4bool IsBounded () const
 
G4bool IsPOn (G4double param) const
 
void SetSameSense (G4int sameSense0)
 
G4int GetSameSense () const
 
virtual G4double GetPMax () const =0
 
virtual G4Point3D GetPoint (G4double param) const =0
 
virtual G4double GetPPoint (const G4Point3D &p) const =0
 
const G4BoundingBox3DBBox () const
 
virtual const char * Name () const
 
virtual void SetParentSrfPtr (const G4Surface *)
 

Protected Member Functions

virtual void InitBounded ()
 
virtual void InitBounded ()=0
 

Additional Inherited Members

- Protected Attributes inherited from G4Conic
G4Axis2Placement3D position
 
G4double pShift
 
- Protected Attributes inherited from G4Curve
G4BoundingBox3D bBox
 
G4Point3D start
 
G4Point3D end
 
G4double pStart
 
G4double pEnd
 
G4double pRange
 
G4bool bounded
 
G4int sameSense
 
G4double kCarTolerance
 

Detailed Description

Definition at line 44 of file G4CircularCurve.hh.

Constructor & Destructor Documentation

◆ G4CircularCurve() [1/2]

G4CircularCurve::G4CircularCurve ( )

Definition at line 41 of file G4CircularCurve.cc.

41: radius(0.) {}

◆ ~G4CircularCurve()

G4CircularCurve::~G4CircularCurve ( )
virtual

Definition at line 42 of file G4CircularCurve.cc.

42{}

◆ G4CircularCurve() [2/2]

G4CircularCurve::G4CircularCurve ( const G4CircularCurve right)

Definition at line 44 of file G4CircularCurve.cc.

45 : G4Conic(), radius(right.radius)
46{
47 pShift = right.pShift;
48 position = right.position;
49 bBox = right.bBox;
50 start = right.start;
51 end = right.end;
52 pStart = right.pStart;
53 pEnd = right.pEnd;
54 pRange = right.pRange;
55 bounded = right.bounded;
56 sameSense = right.sameSense;
57}
G4Axis2Placement3D position
Definition: G4Conic.hh:74
G4double pShift
Definition: G4Conic.hh:77
G4Conic()
Definition: G4Conic.cc:38
G4bool bounded
Definition: G4Curve.hh:166
G4double pStart
Definition: G4Curve.hh:163
G4int sameSense
Definition: G4Curve.hh:167
G4Point3D end
Definition: G4Curve.hh:162
G4BoundingBox3D bBox
Definition: G4Curve.hh:160
G4double pRange
Definition: G4Curve.hh:165
G4Point3D start
Definition: G4Curve.hh:161
G4double pEnd
Definition: G4Curve.hh:164

Member Function Documentation

◆ GetPMax()

G4double G4CircularCurve::GetPMax ( ) const
virtual

Implements G4Curve.

Definition at line 128 of file G4CircularCurve.cc.

129{
130 return twopi;
131}

◆ GetPoint()

G4Point3D G4CircularCurve::GetPoint ( G4double  param) const
virtual

Implements G4Curve.

Definition at line 133 of file G4CircularCurve.cc.

134{
135 return G4Point3D( position.GetLocation()+radius*
136 ( std::cos(param)*position.GetPX() + std::sin(param)*position.GetPY() ) );
137}
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35

Referenced by InitBounded().

◆ GetPPoint()

G4double G4CircularCurve::GetPPoint ( const G4Point3D p) const
virtual

Implements G4Curve.

Definition at line 139 of file G4CircularCurve.cc.

140{
141 G4Point3D ptLocal= position.GetToPlacementCoordinates()*pt;
142 G4double angle= std::atan2(ptLocal.y(), ptLocal.x());
143 return (angle<0)? angle+twopi: angle;
144}
double G4double
Definition: G4Types.hh:64

◆ GetRadius()

G4double G4CircularCurve::GetRadius ( ) const
inline

◆ Init()

void G4CircularCurve::Init ( const G4Axis2Placement3D position0,
G4double  radius0 
)

◆ InitBounded()

void G4CircularCurve::InitBounded ( )
protectedvirtual

Implements G4Curve.

Definition at line 81 of file G4CircularCurve.cc.

82{
83 // the bbox must include the start and endpoints as well as the
84 // extreme points if they lie on the curve
86
87 // the parameter values
88 // belonging to the points with an extreme x, y and z coordinate
89 for (G4int i=0; i<3; i++)
90 {
91 G4double u = std::atan2(position.GetPY()(i), position.GetPX()(i));
92
93 if (IsPOn(u))
95
96 if (IsPOn(u+pi))
97 bBox.Extend(GetPoint(u+pi));
98 }
99}
int G4int
Definition: G4Types.hh:66
void Init(const G4Point3D &)
void Extend(const G4Point3D &)
virtual G4Point3D GetPoint(G4double param) const
G4bool IsPOn(G4double param) const
const G4Point3D & GetStart() const
const G4Point3D & GetEnd() const

◆ IntersectRay2D()

G4int G4CircularCurve::IntersectRay2D ( const G4Ray ray)
virtual

Implements G4Curve.

Definition at line 160 of file G4CircularCurve.cc.

161{
162 G4Exception("G4CircularCurve::IntersectRay2D()", "GeomSolids0002",
163 FatalException,"G4CircularCurve is always 3D!");
164 return 0;
165}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ operator=()

G4CircularCurve & G4CircularCurve::operator= ( const G4CircularCurve right)

Definition at line 60 of file G4CircularCurve.cc.

61{
62 if (&right == this) return *this;
63
64 radius = right.radius;
65 pShift = right.pShift;
66 position = right.position;
67 bBox = right.bBox;
68 start = right.start;
69 end = right.end;
70 pStart = right.pStart;
71 pEnd = right.pEnd;
72 pRange = right.pRange;
73 bounded = right.bounded;
74 sameSense = right.sameSense;
75
76 return *this;
77}

◆ Project()

G4Curve * G4CircularCurve::Project ( const G4Transform3D tr = G4Transform3D::Identity)
virtual

Implements G4Curve.

Definition at line 103 of file G4CircularCurve.cc.

104{
105 G4Ellipse e;
106 e.Init(position, radius, radius);
108
109 return e.Project(tr);
110}
void SetBounds(G4double p1, G4double p2)
G4double GetPEnd() const
G4double GetPStart() const
G4Curve * Project(const G4Transform3D &tr=G4Transform3D::Identity)
Definition: G4Ellipse.cc:91
void Init(const G4Axis2Placement3D &position0, G4double semiAxis10, G4double semiAxis20)

◆ Tangent()

G4bool G4CircularCurve::Tangent ( G4CurvePoint cp,
G4Vector3D v 
)
virtual

Implements G4Curve.

Definition at line 114 of file G4CircularCurve.cc.

115{
116 // The tangent is computed from the 3D point representation
117 // for all conics. An alternaive implementation (based on
118 // the parametric point) might be worthwhile adding
119 // for efficiency.
120
121 const G4Axis2Placement3D& pos= *(GetPosition());
123
124 v= -p.y()*pos.GetPX() + p.x()*pos.GetPY();
125 return true;
126}
G4Vector3D GetPY() const
G4Vector3D GetPX() const
const G4Transform3D & GetToPlacementCoordinates() const
const G4Axis2Placement3D * GetPosition() const
const G4Point3D & GetPoint()

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