LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
GeoLineSegment.cxx
Go to the documentation of this file.
1 #ifndef BASICTOOL_GEOLINESEGMENT_CXX
2 #define BASICTOOL_GEOLINESEGMENT_CXX
3 
4 #include "GeoLineSegment.h"
5 
6 namespace geoalgo {
7 
9  : _start(3)
10  , _end(3)
11  , _dir(3)
12  {DirReset();}
13 
14  LineSegment::LineSegment(const double start_x, const double start_y, const double start_z,
15  const double end_x, const double end_y, const double end_z )
16  : _start ( start_x, start_y, start_z )
17  , _end ( end_x, end_y, end_z )
18  , _dir (3)
19  {DirReset();}
20 
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  }
30 
31  const Point_t& LineSegment::Start() const { return _start; }
32 
33  const Point_t& LineSegment::End() const { return _end; }
34 
35  const Vector_t LineSegment::Dir() const { return _dir; }
36 
37  void LineSegment::Start(const double x, const double y, const double z)
38  { _start[0] = x; _start[1] = y; _start[2] = z;
39  DirReset();
40  }
41 
42  void LineSegment::End(const double x, const double y, const double z)
43  { _end[0] = x; _end[1] = y; _end[2] = z;
44  DirReset();
45  }
46 
48 
49 }
50 
51 #endif
52 
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
const Vector_t Dir() const
Direction getter.
Vector_t _dir
Direction.
const Point_t & End() const
End getter.
LineSegment()
Default constructor.
Point_t _end
End position of a line.
const Point_t & Start() const
Start getter.
Point_t _start
Start position of a line.
void DirReset()
Internal function to reset direction.
Class def header for a class LineSegment.
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)