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

#include <G4Line.hh>

+ Inheritance diagram for G4Line:

Public Member Functions

 G4Line ()
 
virtual ~G4Line ()
 
 G4Line (const G4Line &orig)
 
G4Lineoperator= (const G4Line &right)
 
G4CurveProject (const G4Transform3D &tr=G4Transform3D::Identity)
 
G4bool Tangent (G4CurvePoint &cp, G4Vector3D &vec)
 
G4double GetPMax () const
 
G4Point3D GetPoint (G4double param) const
 
G4double GetPPoint (const G4Point3D &pt) const
 
G4Point3D GetPnt () const
 
G4Vector3D GetDir () const
 
void Init (const G4Point3D &pnt0, const G4Vector3D &dir0)
 
G4int IntersectRay2D (const G4Ray &ray)
 
- 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

void InitBounded ()
 
virtual void InitBounded ()=0
 

Additional Inherited Members

- 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 G4Line.hh.

Constructor & Destructor Documentation

◆ G4Line() [1/2]

G4Line::G4Line ( )

Definition at line 38 of file G4Line.cc.

38{}

Referenced by Project().

◆ ~G4Line()

G4Line::~G4Line ( )
virtual

Definition at line 39 of file G4Line.cc.

39{}

◆ G4Line() [2/2]

G4Line::G4Line ( const G4Line orig)

Definition at line 41 of file G4Line.cc.

42 : G4Curve(), pnt(right.pnt), dir(right.dir),
43 invDir(right.invDir), v(right.v)
44{
45 bBox = right.bBox;
46 start = right.start;
47 end = right.end;
48 pStart = right.pStart;
49 pEnd = right.pEnd;
50 pRange = right.pRange;
51 bounded = right.bounded;
52 sameSense = right.sameSense;
53}
G4bool bounded
Definition: G4Curve.hh:166
G4Curve()
Definition: G4Curve.cc:39
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

◆ GetDir()

G4Vector3D G4Line::GetDir ( ) const
inline

◆ GetPMax()

G4double G4Line::GetPMax ( ) const
inlinevirtual

Implements G4Curve.

◆ GetPnt()

G4Point3D G4Line::GetPnt ( ) const
inline

◆ GetPoint()

G4Point3D G4Line::GetPoint ( G4double  param) const
inlinevirtual

Implements G4Curve.

◆ GetPPoint()

G4double G4Line::GetPPoint ( const G4Point3D pt) const
inlinevirtual

Implements G4Curve.

◆ Init()

void G4Line::Init ( const G4Point3D pnt0,
const G4Vector3D dir0 
)
inline

◆ InitBounded()

void G4Line::InitBounded ( )
inlineprotectedvirtual

Implements G4Curve.

◆ IntersectRay2D()

G4int G4Line::IntersectRay2D ( const G4Ray ray)
inlinevirtual

Implements G4Curve.

◆ operator=()

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

Definition at line 55 of file G4Line.cc.

56{
57 if (&right == this) return *this;
58
59 pnt = right.pnt;
60 dir = right.dir;
61 invDir = right.invDir;
62 v = right.v;
63 bBox = right.bBox;
64 start = right.start;
65 end = right.end;
66 pStart = right.pStart;
67 pEnd = right.pEnd;
68 pRange = right.pRange;
69 bounded = right.bounded;
70 sameSense = right.sameSense;
71
72 return *this;
73}

◆ Project()

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

Implements G4Curve.

Definition at line 75 of file G4Line.cc.

76{
77 G4Vector3D newDir= tr*dir;
78
79 if (std::abs(newDir.x())+std::abs(newDir.y()) < kCarTolerance){
80
81 newDir.setX(kCarTolerance);
82 newDir.setY(kCarTolerance);
83 };
84
85 G4Point3D newPnt= tr*pnt;
86 newDir.setZ(0);
87 newPnt.setZ(0);
88
89 G4Line* r= new G4Line();
90
91 // L. Broglia : terrible mistake !!!!
92 //r->Init(newDir, newPnt);
93 r->Init(newPnt, newDir);
94
96
97 return r;
98}
G4double kCarTolerance
Definition: G4Curve.hh:168
void SetBounds(G4double p1, G4double p2)
G4double GetPEnd() const
G4double GetPStart() const
Definition: G4Line.hh:45
void Init(const G4Point3D &pnt0, const G4Vector3D &dir0)
G4Line()
Definition: G4Line.cc:38

◆ Tangent()

G4bool G4Line::Tangent ( G4CurvePoint cp,
G4Vector3D vec 
)
virtual

Implements G4Curve.

Definition at line 102 of file G4Line.cc.

103{
104 if(GetSameSense())
105 vec = -dir;
106 else
107 vec = dir;
108
109 return true;
110}
G4int GetSameSense() const

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