LArSoft  v10_04_05
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(double const start_x,
36  double const start_y,
37  double const start_z,
38  double const end_x,
39  double const end_y,
40  double const end_z);
41 
43  LineSegment(Point_t const& start, Point_t const& end);
44 
45  //
46  // Getters
47  //
48  Point_t const& Start() const;
49  Point_t const& End() const;
50  Vector_t const Dir() const;
51 
52  //
53  // Setters
54  //
55  void Start(double const x, double const y, double const z);
56  void End(double const x, double const y, double const z);
57 
58  protected:
59  void DirReset();
63 
64  public:
65  //
66  // Template
67  //
69  template <class T, class U>
70  LineSegment(T const& start, U const& 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
Point_t const & Start() const
Start getter.
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 ...
Vector_t const 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(T const &start, U const &end)
Alternative ctor using template (3)
LineSegment()
Default constructor.
Point_t _end
End position of a line.
Point_t _start
Start position of a line.
void DirReset()
Internal function to reset direction.
Point_t const & End() const
End getter.
virtual ~LineSegment()
Default destructor.