LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
geoalgo::LineSegment Class Reference

Representation of a simple 3D line segment Defines a finite 3D straight line by having the start and end position (Point_t).
. More...

#include "GeoLineSegment.h"

Public Member Functions

 LineSegment ()
 Default constructor. More...
 
virtual ~LineSegment ()
 Default destructor. More...
 
 LineSegment (const double start_x, const double start_y, const double start_z, const double end_x, const double end_y, const double end_z)
 Alternative ctor (1) More...
 
 LineSegment (const Point_t &start, const Point_t &end)
 Altenartive ctor (2) More...
 
const Point_tStart () const
 Start getter. More...
 
const Point_tEnd () const
 End getter. More...
 
const Vector_t Dir () const
 Direction getter. More...
 
void Start (const double x, const double y, const double z)
 Start setter. More...
 
void End (const double x, const double y, const double z)
 End setter. More...
 
template<class T , class U >
 LineSegment (const T &start, const U &end)
 Alternative ctor using template (3) More...
 

Protected Member Functions

void DirReset ()
 Internal function to reset direction. More...
 

Protected Attributes

Point_t _start
 Start position of a line. More...
 
Point_t _end
 End position of a line. More...
 
Vector_t _dir
 Direction. More...
 

Detailed Description

Representation of a simple 3D line segment Defines a finite 3D straight line by having the start and end position (Point_t).
.

Definition at line 25 of file GeoLineSegment.h.

Constructor & Destructor Documentation

geoalgo::LineSegment::LineSegment ( )

Default constructor.

Definition at line 8 of file GeoLineSegment.cxx.

References DirReset().

Referenced by ~LineSegment().

9  : _start(3)
10  , _end(3)
11  , _dir(3)
12  {DirReset();}
Vector_t _dir
Direction.
Point_t _end
End position of a line.
Point_t _start
Start position of a line.
void DirReset()
Internal function to reset direction.
virtual geoalgo::LineSegment::~LineSegment ( )
inlinevirtual

Default destructor.

Definition at line 33 of file GeoLineSegment.h.

References Dir(), DirReset(), End(), evd::details::end(), LineSegment(), Start(), x, y, and z.

33 {}
geoalgo::LineSegment::LineSegment ( const double  start_x,
const double  start_y,
const double  start_z,
const double  end_x,
const double  end_y,
const double  end_z 
)

Alternative ctor (1)

Definition at line 14 of file GeoLineSegment.cxx.

References DirReset().

16  : _start ( start_x, start_y, start_z )
17  , _end ( end_x, end_y, end_z )
18  , _dir (3)
19  {DirReset();}
Vector_t _dir
Direction.
Point_t _end
End position of a line.
Point_t _start
Start position of a line.
void DirReset()
Internal function to reset direction.
geoalgo::LineSegment::LineSegment ( const Point_t start,
const Point_t end 
)

Altenartive ctor (2)

Definition at line 21 of file GeoLineSegment.cxx.

References DirReset().

22  : _start ( start )
23  , _end ( end )
24  , _dir (3)
25  {
26  if(start.size()!=3 || end.size()!=3)
27  throw GeoAlgoException("LineSegment ctor accepts only 3D Point!");
28  DirReset();
29  }
Vector_t _dir
Direction.
Point_t _end
End position of a line.
Point_t _start
Start position of a line.
void DirReset()
Internal function to reset direction.
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
template<class T , class U >
geoalgo::LineSegment::LineSegment ( const T &  start,
const U &  end 
)
inline

Alternative ctor using template (3)

Definition at line 68 of file GeoLineSegment.h.

69  : LineSegment(Point_t(start), Point_t(end))
70  {}
LineSegment()
Default constructor.
Vector Point_t
Definition: GeoVector.h:200
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)

Member Function Documentation

const Vector_t geoalgo::LineSegment::Dir ( ) const

Direction getter.

Definition at line 35 of file GeoLineSegment.cxx.

References _dir.

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

35 { return _dir; }
Vector_t _dir
Direction.
void geoalgo::LineSegment::DirReset ( )
protected

Internal function to reset direction.

Definition at line 47 of file GeoLineSegment.cxx.

References _dir, _end, and _start.

Referenced by End(), LineSegment(), Start(), and ~LineSegment().

47 { _dir = _end - _start; }
Vector_t _dir
Direction.
Point_t _end
End position of a line.
Point_t _start
Start position of a line.
const Point_t & geoalgo::LineSegment::End ( ) const

End getter.

Definition at line 33 of file GeoLineSegment.cxx.

References _end.

Referenced by geoalgo::GeoAlgo::_ClosestPt_(), geoalgo::GeoAlgo::_SqDist_(), geoalgo::GeoObjCollection::Add(), geoalgo::GeoAlgo::Intersection(), and ~LineSegment().

33 { return _end; }
Point_t _end
End position of a line.
void geoalgo::LineSegment::End ( const double  x,
const double  y,
const double  z 
)

End setter.

Definition at line 42 of file GeoLineSegment.cxx.

References _end, DirReset(), x, y, and z.

43  { _end[0] = x; _end[1] = y; _end[2] = z;
44  DirReset();
45  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
Point_t _end
End position of a line.
void DirReset()
Internal function to reset direction.
const Point_t & geoalgo::LineSegment::Start ( ) const
void geoalgo::LineSegment::Start ( const double  x,
const double  y,
const double  z 
)

Start setter.

Definition at line 37 of file GeoLineSegment.cxx.

References _start, DirReset(), x, y, and z.

38  { _start[0] = x; _start[1] = y; _start[2] = z;
39  DirReset();
40  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
Point_t _start
Start position of a line.
void DirReset()
Internal function to reset direction.

Member Data Documentation

Vector_t geoalgo::LineSegment::_dir
protected

Direction.

Definition at line 60 of file GeoLineSegment.h.

Referenced by Dir(), and DirReset().

Point_t geoalgo::LineSegment::_end
protected

End position of a line.

Definition at line 59 of file GeoLineSegment.h.

Referenced by DirReset(), and End().

Point_t geoalgo::LineSegment::_start
protected

Start position of a line.

Definition at line 58 of file GeoLineSegment.h.

Referenced by DirReset(), and Start().


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