All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoLine.cxx
Go to the documentation of this file.
1 #ifndef BASICTOOL_GEOLINE_CXX
2 #define BASICTOOL_GEOLINE_CXX
3 
4 #include "GeoLine.h"
5 
6 namespace geoalgo {
7 
8  Line::Line()
9  : _pt1(3)
10  , _pt2(3)
11  {}
12 
13  Line::Line(const double x1, const double y1, const double z1,
14  const double x2, const double y2, const double z2)
15  : _pt1 (x1, y1, z1)
16  , _pt2 (x2, y2, z2)
17  { check_and_raise(_pt1,_pt2); }
18 
19  Line::Line(const Point_t& pt1, const Point_t& pt2)
20  : _pt1 ( pt1 )
21  , _pt2 ( pt2 )
22  { check_and_raise(pt1,pt2); }
23 
24  const Point_t& Line::Pt1() const { return _pt1; }
25  const Point_t& Line::Pt2() const { return _pt2; }
26 
27  void Line::Pt1(const double x, const double y, const double z)
28  {
29  _pt1[0] = x;
30  _pt1[1] = y;
31  _pt1[2] = z;
33  }
34 
35  void Line::Pt2(const double x, const double y, const double z)
36  {
37  _pt2[0] = x;
38  _pt2[1] = y;
39  _pt2[2] = z;
41  }
42 
43  void Line::check_and_raise(const Point_t& p1, const Point_t& p2) const
44  {
45  if(p1.size()!=3) throw GeoAlgoException("<<check_and_raise>> Pt1 is not 3 dimensional point!");
46  if(p2.size()!=3) throw GeoAlgoException("<<check_and_raise>> Pt2 is not 3 dimensional point!");
47  if(p1 == p2) throw GeoAlgoException("<<check_and_raise>> Two identical points not allowed for Line ctor!");
48  }
49 
50 }
51 #endif
52 /** @} */ // end of doxygen group
53 
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
const Point_t & Pt2() const
Direction getter.
Point_t _pt1
First point denoting infinite line.
recob::tracking::Point_t Point_t
process_name opflash particleana ie ie y
const Point_t & Pt1() const
Start getter.
Vector_t _pt2
Second point denoting infinite line.
physics associatedGroupsWithLeft p1
void check_and_raise(const Point_t &p1, const Point_t &p2) const
Compatibility check.