LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
GeoLineSegment.h
Go to the documentation of this file.
1 
14 #ifndef BASICTOOL_GEOLINESEGMENT_H
15 #define BASICTOOL_GEOLINESEGMENT_H
16 
18 
19 namespace geoalgo {
25  class LineSegment {
26 
27  public:
29  LineSegment();
30 
32  virtual ~LineSegment() {}
33 
35  LineSegment(const double start_x,
36  const double start_y,
37  const double start_z,
38  const double end_x,
39  const double end_y,
40  const double end_z);
41 
43  LineSegment(const Point_t& start, const Point_t& end);
44 
45  //
46  // Getters
47  //
48  const Point_t& Start() const;
49  const Point_t& End() const;
50  const Vector_t Dir() const;
51 
52  //
53  // Setters
54  //
55  void Start(const double x, const double y, const double z);
56  void End(const double x, const double y, const double z);
57 
58  protected:
59  void DirReset();
63 
64  public:
65  //
66  // Template
67  //
69  template <class T, class U>
70  LineSegment(const T& start, const U& end) : LineSegment(Point_t(start), Point_t(end))
71  {}
72  };
73 
75 }
76 
77 #endif
78  // end of doxygen group
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
Representation of a simple 3D line segment Defines a finite 3D straight line by having the start and ...
const Vector_t Dir() const
Direction getter.
Vector_t _dir
Direction.
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
LineSegment LineSegment_t
Class def header for a class Point and Vector.
LineSegment(const T &start, const U &end)
Alternative ctor using template (3)
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.
virtual ~LineSegment()
Default destructor.