All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
geoalgo::HalfLine Class Reference

Representation of a 3D semi-infinite line. Defines a semi-infinite 3D line by having a start point (Point_t) and direction (Vector_t)
along which the line extends. It hides the start and direction attributes from users for
protecting the dimensionality. More...

#include <GeoHalfLine.h>

Inheritance diagram for geoalgo::HalfLine:
geoalgo::Cone geoalgo::Cone

Public Member Functions

 HalfLine ()
 Default constructor. More...
 
virtual ~HalfLine ()
 Default destructor. More...
 
 HalfLine (const double x, const double y, const double z, const double dirx, const double diry, const double dirz)
 Alternative ctor (1) More...
 
 HalfLine (const Point_t &start, const Vector_t &dir)
 Altenartive ctor (2) More...
 
const Point_tStart () const
 Start getter. More...
 
const Vector_tDir () const
 Direction getter. More...
 
void Start (const double x, const double y, const double z)
 Start setter. More...
 
void Dir (const double x, const double y, const double z)
 Dir setter. More...
 
void Start (const TVector3 &pt)
 Start setter. More...
 
void Dir (const TVector3 &dir)
 Dir setter. More...
 
template<class T , class U >
 HalfLine (const T &start, const U &dir)
 Alternative ctor using template (3) More...
 
template<class T >
void Start (const T &pos)
 Start setter template. More...
 
template<class T >
void Dir (const T &dir)
 Dir setter template. More...
 
 HalfLine ()
 Default constructor. More...
 
virtual ~HalfLine ()
 Default destructor. More...
 
 HalfLine (const double x, const double y, const double z, const double dirx, const double diry, const double dirz)
 Alternative ctor (1) More...
 
 HalfLine (const Point_t &start, const Vector_t &dir)
 Altenartive ctor (2) More...
 
const Point_tStart () const
 Start getter. More...
 
const Vector_tDir () const
 Direction getter. More...
 
void Start (const double x, const double y, const double z)
 Start setter. More...
 
void Dir (const double x, const double y, const double z)
 Dir setter. More...
 
void Start (const TVector3 &pt)
 Start setter. More...
 
void Dir (const TVector3 &dir)
 Dir setter. More...
 
template<class T , class U >
 HalfLine (const T &start, const U &dir)
 Alternative ctor using template (3) More...
 
template<class T >
void Start (const T &pos)
 Start setter template. More...
 
template<class T >
void Dir (const T &dir)
 Dir setter template. More...
 

Protected Member Functions

void Normalize ()
 Normalize direction. More...
 
void Normalize ()
 Normalize direction. More...
 

Protected Attributes

Point_t _start
 Beginning of the half line. More...
 
Vector_t _dir
 Direction of the half line from _start. More...
 

Detailed Description

Representation of a 3D semi-infinite line. Defines a semi-infinite 3D line by having a start point (Point_t) and direction (Vector_t)
along which the line extends. It hides the start and direction attributes from users for
protecting the dimensionality.

Definition at line 30 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.h.

Constructor & Destructor Documentation

geoalgo::HalfLine::HalfLine ( )

Default constructor.

Definition at line 5 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.cxx.

6  : _start(3)
7  , _dir(3)
8  {Normalize();}
Point_t _start
Beginning of the half line.
Vector_t _dir
Direction of the half line from _start.
virtual geoalgo::HalfLine::~HalfLine ( )
inlinevirtual

Default destructor.

Definition at line 38 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.h.

38 {};
geoalgo::HalfLine::HalfLine ( const double  x,
const double  y,
const double  z,
const double  dirx,
const double  diry,
const double  dirz 
)

Alternative ctor (1)

Definition at line 10 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.cxx.

12  : _start (x, y, z )
13  , _dir (dirx, diry, dirz)
14  {Normalize();}
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
Point_t _start
Beginning of the half line.
process_name opflash particleana ie ie y
Vector_t _dir
Direction of the half line from _start.
geoalgo::HalfLine::HalfLine ( const Point_t start,
const Vector_t dir 
)

Altenartive ctor (2)

Definition at line 16 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.cxx.

17  : _start ( start )
18  , _dir ( dir )
19  {
20  if(start.size()!=3 || dir.size()!=3)
21  throw GeoAlgoException("HalfLine ctor accepts only 3D Point!");
22  Normalize();
23  }
Point_t _start
Beginning of the half line.
tuple dir
Definition: dropbox.py:28
Vector_t _dir
Direction of the half line from _start.
template<class T , class U >
geoalgo::HalfLine::HalfLine ( const T &  start,
const U &  dir 
)
inline

Alternative ctor using template (3)

Definition at line 69 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.h.

70  : HalfLine(Point_t(start), Vector_t(dir))
71  {}
tuple dir
Definition: dropbox.py:28
Vector Vector_t
Point has same feature as Vector.
geoalgo::HalfLine::HalfLine ( )

Default constructor.

virtual geoalgo::HalfLine::~HalfLine ( )
inlinevirtual

Default destructor.

Definition at line 34 of file sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoHalfLine.h.

34 {};
geoalgo::HalfLine::HalfLine ( const double  x,
const double  y,
const double  z,
const double  dirx,
const double  diry,
const double  dirz 
)

Alternative ctor (1)

geoalgo::HalfLine::HalfLine ( const Point_t start,
const Vector_t dir 
)

Altenartive ctor (2)

template<class T , class U >
geoalgo::HalfLine::HalfLine ( const T &  start,
const U &  dir 
)
inline

Alternative ctor using template (3)

Definition at line 65 of file sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoHalfLine.h.

66  : HalfLine(Point_t(start), Vector_t(dir))
67  {}
tuple dir
Definition: dropbox.py:28
Vector Vector_t
Point has same feature as Vector.

Member Function Documentation

const Vector_t& geoalgo::HalfLine::Dir ( ) const

Direction getter.

void geoalgo::HalfLine::Dir ( const double  x,
const double  y,
const double  z 
)

Dir setter.

const Vector_t & geoalgo::HalfLine::Dir ( ) const

Direction getter.

Definition at line 27 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.cxx.

27 { return _dir; }
Vector_t _dir
Direction of the half line from _start.
void geoalgo::HalfLine::Dir ( const TVector3 &  dir)

Dir setter.

void geoalgo::HalfLine::Dir ( const double  x,
const double  y,
const double  z 
)

Dir setter.

Definition at line 32 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.cxx.

33  { _dir[0] = x; _dir[1] = y; _dir[2] = z; Normalize(); }
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
process_name opflash particleana ie ie y
Vector_t _dir
Direction of the half line from _start.
void geoalgo::HalfLine::Dir ( const TVector3 &  dir)

Dir setter.

Definition at line 38 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.cxx.

39  { _dir[0] = dir[0]; _dir[1] = dir[1]; _dir[2] = dir[2]; Normalize(); }
tuple dir
Definition: dropbox.py:28
Vector_t _dir
Direction of the half line from _start.
template<class T >
void geoalgo::HalfLine::Dir ( const T &  dir)
inline

Dir setter template.

Definition at line 79 of file sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoHalfLine.h.

80  {
81  _dir = Vector_t(dir);
82  if(_dir.size()!=3) throw GeoAlgoException("<<Start>> Only 3 dimensional start point allowed!");
83  Normalize();
84  }
tuple dir
Definition: dropbox.py:28
Vector Vector_t
Point has same feature as Vector.
Vector_t _dir
Direction of the half line from _start.
template<class T >
void geoalgo::HalfLine::Dir ( const T &  dir)
inline

Dir setter template.

Definition at line 83 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.h.

84  {
85  _dir = Vector_t(dir);
86  if(_dir.size()!=3) throw GeoAlgoException("<<Start>> Only 3 dimensional start point allowed!");
87  Normalize();
88  }
tuple dir
Definition: dropbox.py:28
Vector Vector_t
Point has same feature as Vector.
Vector_t _dir
Direction of the half line from _start.
void geoalgo::HalfLine::Normalize ( )
protected

Normalize direction.

void geoalgo::HalfLine::Normalize ( )
protected

Normalize direction.

Definition at line 41 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.cxx.

42  {
43  auto l = _dir.Length();
44  if(!l)
45  throw GeoAlgoException("<<Normalize>> cannot normalize 0-length direction vector!");
46 
47  // inf check commented out till compatible solution found... --kazu
48  //if(isnan(l))
49  //throw GeoAlgoException("<<Normalize>> cannot normalize inf-length direction vector!");
50  _dir /= l;
51  }
double Length() const
Compute the length of the vector.
Vector_t _dir
Direction of the half line from _start.
const Point_t& geoalgo::HalfLine::Start ( ) const

Start getter.

void geoalgo::HalfLine::Start ( const double  x,
const double  y,
const double  z 
)

Start setter.

const Point_t & geoalgo::HalfLine::Start ( ) const

Start getter.

Definition at line 25 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.cxx.

25 { return _start; }
Point_t _start
Beginning of the half line.
void geoalgo::HalfLine::Start ( const TVector3 &  pt)

Start setter.

void geoalgo::HalfLine::Start ( const double  x,
const double  y,
const double  z 
)

Start setter.

Definition at line 29 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.cxx.

30  { _start[0] = x; _start[1] = y; _start[2] = z; }
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
Point_t _start
Beginning of the half line.
process_name opflash particleana ie ie y
void geoalgo::HalfLine::Start ( const TVector3 &  pt)

Start setter.

Definition at line 35 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.cxx.

36  { _start[0] = pt[0]; _start[1] = pt[1]; _start[2] = pt[2]; }
Point_t _start
Beginning of the half line.
template<class T >
void geoalgo::HalfLine::Start ( const T &  pos)
inline

Start setter template.

Definition at line 71 of file sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoHalfLine.h.

72  {
73  _start = Point_t(pos);
74  if(_start.size()!=3) throw GeoAlgoException("<<Start>> Only 3 dimensional start point allowed!");
75  }
Point_t _start
Beginning of the half line.
template<class T >
void geoalgo::HalfLine::Start ( const T &  pos)
inline

Start setter template.

Definition at line 75 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.h.

76  {
77  _start = Point_t(pos);
78  if(_start.size()!=3) throw GeoAlgoException("<<Start>> Only 3 dimensional start point allowed!");
79  }
Point_t _start
Beginning of the half line.

Member Data Documentation

Vector_t geoalgo::HalfLine::_dir
protected

Direction of the half line from _start.

Definition at line 60 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.h.

Point_t geoalgo::HalfLine::_start
protected

Beginning of the half line.

Definition at line 59 of file larcorealg/larcorealg/GeoAlgo/GeoHalfLine.h.


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