All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
larcorealg/larcorealg/GeoAlgo/GeoLineSegment.h
Go to the documentation of this file.
1 /**
2  * \file GeoLineSegment.h
3  *
4  * \ingroup GeoAlgo
5  *
6  * \brief Class def header for a class LineSegment
7  *
8  * @author kazuhiro
9  */
10 
11 /** \addtogroup GeoAlgo
12 
13  @{*/
14 #ifndef BASICTOOL_GEOLINESEGMENT_H
15 #define BASICTOOL_GEOLINESEGMENT_H
16 
18 
19 namespace geoalgo {
20  /**
21  \class LineSegment
22  @brief Representation of a simple 3D line segment
23  Defines a finite 3D straight line by having the start and end position (Point_t). \n
24  */
25  class LineSegment{
26 
27  public:
28 
29  /// Default constructor
30  LineSegment();
31 
32  /// Default destructor
33  virtual ~LineSegment(){}
34 
35  /// Alternative ctor (1)
36  LineSegment(const double start_x, const double start_y, const double start_z,
37  const double end_x, const double end_y, const double end_z );
38 
39  /// Altenartive ctor (2)
40  LineSegment(const Point_t& start, const Point_t& end);
41 
42  //
43  // Getters
44  //
45  const Point_t& Start() const; ///< Start getter
46  const Point_t& End() const; ///< End getter
47  const Vector_t Dir() const; ///< Direction getter
48 
49  //
50  // Setters
51  //
52  void Start(const double x, const double y, const double z); ///< Start setter
53  void End (const double x, const double y, const double z); ///< End setter
54 
55  protected:
56 
57  void DirReset(); ///< Internal function to reset direction
58  Point_t _start; ///< Start position of a line
59  Point_t _end; ///< End position of a line
60  Vector_t _dir; ///< Direction
61 
62  public:
63 
64  //
65  // Template
66  //
67  /// Alternative ctor using template (3)
68  template <class T, class U> LineSegment(const T& start, const U& end)
69  : LineSegment(Point_t(start), Point_t(end))
70  {}
71 
72 
73  };
74 
76 }
77 
78 #endif
79 /** @} */ // end of doxygen group
80 
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
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.
process_name opflash particleana ie ie y
LineSegment(const T &start, const U &end)
Alternative ctor using template (3)
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.