LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
geoalgo::DirectedLine Class Reference

Representation of a 3D infinite line. Defines an infinite 3D line with a point and a direction. Line points are constructed like this: (pt, dir) -> (pt, pt+dir) It hides the point attributes from users for protecting the dimensionality. More...

#include "GeoDirectedLine.h"

Inheritance diagram for geoalgo::DirectedLine:
geoalgo::Line

Public Member Functions

 DirectedLine ()
 Default ctor. More...
 
 DirectedLine (const double x, const double y, const double z, const double dirx, const double diry, const double dirz)
 Alternative ctor (1) More...
 
 DirectedLine (const Point_t &pt, const Vector_t &dir)
 Altenartive ctor (2) More...
 
 DirectedLine (const HalfLine &l)
 Alternative ctor (3) More...
 
template<class T , class U >
 DirectedLine (const T &pt, const U &dir)
 Alternative ctor using template (3) More...
 
Vector_t Dir () const
 
const Point_tPt1 () const
 Start getter. More...
 
void Pt1 (const double x, const double y, const double z)
 Pt1 setter. More...
 
template<class T >
void Pt1 (const T &pt1)
 Pt1 setter template. More...
 
const Point_tPt2 () const
 Direction getter. More...
 
void Pt2 (const double x, const double y, const double z)
 Pt2 setter. More...
 
template<class T >
void Pt2 (const T &pt2)
 Pt2 setter template. More...
 

Protected Member Functions

void check_and_raise (const Point_t &p1, const Point_t &p2) const
 Compatibility check. More...
 

Protected Attributes

Point_t _pt1
 First point denoting infinite line. More...
 
Vector_t _pt2
 Second point denoting infinite line. More...
 

Detailed Description

Representation of a 3D infinite line. Defines an infinite 3D line with a point and a direction. Line points are constructed like this: (pt, dir) -> (pt, pt+dir) It hides the point attributes from users for protecting the dimensionality.

Definition at line 32 of file GeoDirectedLine.h.

Constructor & Destructor Documentation

geoalgo::DirectedLine::DirectedLine ( )

Default ctor.

Definition at line 6 of file GeoDirectedLine.cxx.

6 : Line() {}
Line()
Default constructor.
Definition: GeoLine.cxx:6
geoalgo::DirectedLine::DirectedLine ( const double  x,
const double  y,
const double  z,
const double  dirx,
const double  diry,
const double  dirz 
)

Alternative ctor (1)

Definition at line 8 of file GeoDirectedLine.cxx.

References geoalgo::Line::_pt1, geoalgo::Line::_pt2, and geoalgo::Line::check_and_raise().

14  : Line(x, y, z, x + dirx, y + diry, z + dirz)
15  {
17  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
Point_t _pt1
First point denoting infinite line.
Definition: GeoLine.h:63
Vector_t _pt2
Second point denoting infinite line.
Definition: GeoLine.h:64
Line()
Default constructor.
Definition: GeoLine.cxx:6
void check_and_raise(const Point_t &p1, const Point_t &p2) const
Compatibility check.
Definition: GeoLine.cxx:49
geoalgo::DirectedLine::DirectedLine ( const Point_t pt,
const Vector_t dir 
)

Altenartive ctor (2)

Definition at line 19 of file GeoDirectedLine.cxx.

References geoalgo::Line::_pt1, geoalgo::Line::_pt2, and geoalgo::Line::check_and_raise().

19  : Line(pt, pt + dir)
20  {
22  }
Point_t _pt1
First point denoting infinite line.
Definition: GeoLine.h:63
TMarker * pt
Definition: egs.C:25
TDirectory * dir
Definition: macro.C:5
Vector_t _pt2
Second point denoting infinite line.
Definition: GeoLine.h:64
Line()
Default constructor.
Definition: GeoLine.cxx:6
void check_and_raise(const Point_t &p1, const Point_t &p2) const
Compatibility check.
Definition: GeoLine.cxx:49
geoalgo::DirectedLine::DirectedLine ( const HalfLine l)

Alternative ctor (3)

Definition at line 24 of file GeoDirectedLine.cxx.

References geoalgo::Line::_pt1, geoalgo::Line::_pt2, and geoalgo::Line::check_and_raise().

24  : Line(l.Start(), l.Start() + l.Dir())
25  {
27  }
Point_t _pt1
First point denoting infinite line.
Definition: GeoLine.h:63
Vector_t _pt2
Second point denoting infinite line.
Definition: GeoLine.h:64
Line()
Default constructor.
Definition: GeoLine.cxx:6
void check_and_raise(const Point_t &p1, const Point_t &p2) const
Compatibility check.
Definition: GeoLine.cxx:49
template<class T , class U >
geoalgo::DirectedLine::DirectedLine ( const T &  pt,
const U &  dir 
)
inline

Alternative ctor using template (3)

Definition at line 54 of file GeoDirectedLine.h.

References Dir().

54  : Line(Point_t(pt), Point_t(pt + dir))
55  {}
TMarker * pt
Definition: egs.C:25
Vector Point_t
Definition: GeoVector.h:204
TDirectory * dir
Definition: macro.C:5
Line()
Default constructor.
Definition: GeoLine.cxx:6

Member Function Documentation

void geoalgo::Line::check_and_raise ( const Point_t p1,
const Point_t p2 
) const
protectedinherited

Compatibility check.

Definition at line 49 of file GeoLine.cxx.

Referenced by DirectedLine(), geoalgo::Line::Line(), geoalgo::Line::Pt1(), geoalgo::Line::Pt2(), and geoalgo::Line::~Line().

50  {
51  if (p1.size() != 3)
52  throw GeoAlgoException("<<check_and_raise>> Pt1 is not 3 dimensional point!");
53  if (p2.size() != 3)
54  throw GeoAlgoException("<<check_and_raise>> Pt2 is not 3 dimensional point!");
55  if (p1 == p2)
56  throw GeoAlgoException("<<check_and_raise>> Two identical points not allowed for Line ctor!");
57  }
Vector_t geoalgo::DirectedLine::Dir ( ) const

Definition at line 29 of file GeoDirectedLine.cxx.

References geoalgo::Line::_pt1, and geoalgo::Line::_pt2.

Referenced by DirectedLine().

30  {
31  return _pt2 - _pt1;
32  }
Point_t _pt1
First point denoting infinite line.
Definition: GeoLine.h:63
Vector_t _pt2
Second point denoting infinite line.
Definition: GeoLine.h:64
const Point_t & geoalgo::Line::Pt1 ( ) const
inherited
void geoalgo::Line::Pt1 ( const double  x,
const double  y,
const double  z 
)
inherited

Pt1 setter.

Definition at line 33 of file GeoLine.cxx.

References geoalgo::Line::_pt1, geoalgo::Line::_pt2, geoalgo::Line::check_and_raise(), x, y, and z.

34  {
35  _pt1[0] = x;
36  _pt1[1] = y;
37  _pt1[2] = z;
39  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
Point_t _pt1
First point denoting infinite line.
Definition: GeoLine.h:63
Vector_t _pt2
Second point denoting infinite line.
Definition: GeoLine.h:64
void check_and_raise(const Point_t &p1, const Point_t &p2) const
Compatibility check.
Definition: GeoLine.cxx:49
template<class T >
void geoalgo::Line::Pt1 ( const T &  pt1)
inlineinherited

Pt1 setter template.

Definition at line 77 of file GeoLine.h.

References geoalgo::Line::check_and_raise().

78  {
79  _pt1 = Point_t(pt1);
81  }
Point_t _pt1
First point denoting infinite line.
Definition: GeoLine.h:63
Vector Point_t
Definition: GeoVector.h:204
Vector_t _pt2
Second point denoting infinite line.
Definition: GeoLine.h:64
TText * pt1
Definition: plot.C:61
void check_and_raise(const Point_t &p1, const Point_t &p2) const
Compatibility check.
Definition: GeoLine.cxx:49
const Point_t & geoalgo::Line::Pt2 ( ) const
inherited

Direction getter.

Definition at line 28 of file GeoLine.cxx.

References geoalgo::Line::_pt2.

Referenced by geoalgo::GeoAlgo::_ClosestPt_(), geoalgo::GeoAlgo::_commonOrigin_(), geoalgo::GeoAlgo::_SqDist_(), and geoalgo::Line::~Line().

29  {
30  return _pt2;
31  }
Vector_t _pt2
Second point denoting infinite line.
Definition: GeoLine.h:64
void geoalgo::Line::Pt2 ( const double  x,
const double  y,
const double  z 
)
inherited

Pt2 setter.

Definition at line 41 of file GeoLine.cxx.

References geoalgo::Line::_pt1, geoalgo::Line::_pt2, geoalgo::Line::check_and_raise(), x, y, and z.

42  {
43  _pt2[0] = x;
44  _pt2[1] = y;
45  _pt2[2] = z;
47  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
Point_t _pt1
First point denoting infinite line.
Definition: GeoLine.h:63
Vector_t _pt2
Second point denoting infinite line.
Definition: GeoLine.h:64
void check_and_raise(const Point_t &p1, const Point_t &p2) const
Compatibility check.
Definition: GeoLine.cxx:49
template<class T >
void geoalgo::Line::Pt2 ( const T &  pt2)
inlineinherited

Pt2 setter template.

Definition at line 85 of file GeoLine.h.

References geoalgo::Line::check_and_raise().

86  {
87  _pt2 = Vector_t(pt2);
89  }
Point_t _pt1
First point denoting infinite line.
Definition: GeoLine.h:63
TText * pt2
Definition: plot.C:64
Vector_t _pt2
Second point denoting infinite line.
Definition: GeoLine.h:64
Vector Vector_t
Point has same feature as Vector.
Definition: GeoVector.h:203
void check_and_raise(const Point_t &p1, const Point_t &p2) const
Compatibility check.
Definition: GeoLine.cxx:49

Member Data Documentation

Point_t geoalgo::Line::_pt1
protectedinherited

First point denoting infinite line.

Definition at line 63 of file GeoLine.h.

Referenced by geoalgo::Cylinder::Contain(), Dir(), DirectedLine(), geoalgo::Line::Line(), geoalgo::Line::Pt1(), and geoalgo::Line::Pt2().

Vector_t geoalgo::Line::_pt2
protectedinherited

Second point denoting infinite line.

Definition at line 64 of file GeoLine.h.

Referenced by geoalgo::Cylinder::Contain(), Dir(), DirectedLine(), geoalgo::Line::Line(), geoalgo::Line::Pt1(), and geoalgo::Line::Pt2().


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