All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/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 
21  LineSegment::LineSegment(const Point_t& start, const Point_t& end)
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 
47  void LineSegment::DirReset() { _dir = _end - _start; }
48 
49 }
50 
51 #endif
52 
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
const Vector_t Dir() const
Direction getter.
recob::tracking::Point_t Point_t
process_name opflash particleana ie ie y
const Point_t & End() const
End getter.
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
const Point_t & Start() const
Start getter.
Point_t _start
Start position of a line.
void DirReset()
Internal function to reset direction.
recob::tracking::Vector_t Vector_t