#include <G4CircularCurve.hh>
Inheritance diagram for G4CircularCurve:
Public Member Functions | |
G4CircularCurve () | |
virtual | ~G4CircularCurve () |
G4CircularCurve (const G4CircularCurve &right) | |
G4CircularCurve & | operator= (const G4CircularCurve &right) |
virtual G4Curve * | Project (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) |
Protected Member Functions | |
virtual void | InitBounded () |
Definition at line 44 of file G4CircularCurve.hh.
G4CircularCurve::G4CircularCurve | ( | ) |
G4CircularCurve::~G4CircularCurve | ( | ) | [virtual] |
G4CircularCurve::G4CircularCurve | ( | const G4CircularCurve & | right | ) |
Definition at line 44 of file G4CircularCurve.cc.
References G4Curve::bBox, G4Curve::bounded, G4Curve::end, G4Curve::pEnd, G4Conic::position, G4Curve::pRange, G4Conic::pShift, G4Curve::pStart, G4Curve::sameSense, and G4Curve::start.
00045 : G4Conic(), radius(right.radius) 00046 { 00047 pShift = right.pShift; 00048 position = right.position; 00049 bBox = right.bBox; 00050 start = right.start; 00051 end = right.end; 00052 pStart = right.pStart; 00053 pEnd = right.pEnd; 00054 pRange = right.pRange; 00055 bounded = right.bounded; 00056 sameSense = right.sameSense; 00057 }
G4double G4CircularCurve::GetPMax | ( | ) | const [virtual] |
Implements G4Curve.
Definition at line 133 of file G4CircularCurve.cc.
References G4Axis2Placement3D::GetLocation(), G4Axis2Placement3D::GetPX(), G4Axis2Placement3D::GetPY(), and G4Conic::position.
Referenced by InitBounded().
00134 { 00135 return G4Point3D( position.GetLocation()+radius* 00136 ( std::cos(param)*position.GetPX() + std::sin(param)*position.GetPY() ) ); 00137 }
Implements G4Curve.
Definition at line 139 of file G4CircularCurve.cc.
References G4Axis2Placement3D::GetToPlacementCoordinates(), and G4Conic::position.
00140 { 00141 G4Point3D ptLocal= position.GetToPlacementCoordinates()*pt; 00142 G4double angle= std::atan2(ptLocal.y(), ptLocal.x()); 00143 return (angle<0)? angle+twopi: angle; 00144 }
G4double G4CircularCurve::GetRadius | ( | ) | const [inline] |
void G4CircularCurve::Init | ( | const G4Axis2Placement3D & | position0, | |
G4double | radius0 | |||
) | [inline] |
Definition at line 38 of file G4CircularCurve.icc.
References G4Conic::position.
00040 { 00041 position= position0; 00042 radius= radius0; 00043 }
void G4CircularCurve::InitBounded | ( | ) | [protected, virtual] |
Implements G4Curve.
Definition at line 81 of file G4CircularCurve.cc.
References G4Curve::bBox, G4BoundingBox3D::Extend(), G4Curve::GetEnd(), GetPoint(), G4Axis2Placement3D::GetPX(), G4Axis2Placement3D::GetPY(), G4Curve::GetStart(), G4BoundingBox3D::Init(), G4Curve::IsPOn(), G4INCL::Math::pi, and G4Conic::position.
00082 { 00083 // the bbox must include the start and endpoints as well as the 00084 // extreme points if they lie on the curve 00085 bBox.Init(GetStart(), GetEnd()); 00086 00087 // the parameter values 00088 // belonging to the points with an extreme x, y and z coordinate 00089 for (G4int i=0; i<3; i++) 00090 { 00091 G4double u = std::atan2(position.GetPY()(i), position.GetPX()(i)); 00092 00093 if (IsPOn(u)) 00094 bBox.Extend(GetPoint(u)); 00095 00096 if (IsPOn(u+pi)) 00097 bBox.Extend(GetPoint(u+pi)); 00098 } 00099 }
Implements G4Curve.
Definition at line 160 of file G4CircularCurve.cc.
References FatalException, and G4Exception().
00161 { 00162 G4Exception("G4CircularCurve::IntersectRay2D()", "GeomSolids0002", 00163 FatalException,"G4CircularCurve is always 3D!"); 00164 return 0; 00165 }
G4CircularCurve & G4CircularCurve::operator= | ( | const G4CircularCurve & | right | ) |
Definition at line 60 of file G4CircularCurve.cc.
References G4Curve::bBox, G4Curve::bounded, G4Curve::end, G4Curve::pEnd, G4Conic::position, G4Curve::pRange, G4Conic::pShift, G4Curve::pStart, radius, G4Curve::sameSense, and G4Curve::start.
00061 { 00062 if (&right == this) return *this; 00063 00064 radius = right.radius; 00065 pShift = right.pShift; 00066 position = right.position; 00067 bBox = right.bBox; 00068 start = right.start; 00069 end = right.end; 00070 pStart = right.pStart; 00071 pEnd = right.pEnd; 00072 pRange = right.pRange; 00073 bounded = right.bounded; 00074 sameSense = right.sameSense; 00075 00076 return *this; 00077 }
G4Curve * G4CircularCurve::Project | ( | const G4Transform3D & | tr = G4Transform3D::Identity |
) | [virtual] |
Implements G4Curve.
Definition at line 103 of file G4CircularCurve.cc.
References G4Curve::GetPEnd(), G4Curve::GetPStart(), G4Ellipse::Init(), G4Conic::position, G4Ellipse::Project(), and G4Curve::SetBounds().
00104 { 00105 G4Ellipse e; 00106 e.Init(position, radius, radius); 00107 e.SetBounds(GetPStart(), GetPEnd()); 00108 00109 return e.Project(tr); 00110 }
G4bool G4CircularCurve::Tangent | ( | G4CurvePoint & | cp, | |
G4Vector3D & | v | |||
) | [virtual] |
Implements G4Curve.
Definition at line 114 of file G4CircularCurve.cc.
References G4CurvePoint::GetPoint(), G4Conic::GetPosition(), G4Axis2Placement3D::GetPX(), G4Axis2Placement3D::GetPY(), and G4Axis2Placement3D::GetToPlacementCoordinates().
00115 { 00116 // The tangent is computed from the 3D point representation 00117 // for all conics. An alternaive implementation (based on 00118 // the parametric point) might be worthwhile adding 00119 // for efficiency. 00120 00121 const G4Axis2Placement3D& pos= *(GetPosition()); 00122 G4Point3D p= pos.GetToPlacementCoordinates() * cp.GetPoint(); 00123 00124 v= -p.y()*pos.GetPX() + p.x()*pos.GetPY(); 00125 return true; 00126 }