LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
GeoObjCollection.h
Go to the documentation of this file.
1 
14 #ifndef BASICTOOL_GEOOBJCOLLECTION_H
15 #define BASICTOOL_GEOOBJCOLLECTION_H
16 
24 
25 #include <map>
26 #include <stddef.h>
27 #include <string>
28 #include <vector>
29 
30 namespace geoalgo {
31 
36 
37  public:
38  void Clear();
39 
40  void Add(Point_t const& pt, std::string label = "", std::string c = "");
41 
42  void Add(AABox_t const& box, std::string label = "", std::string c = "");
43 
44  void Add(LineSegment_t const& seg, std::string label = "", std::string c = "");
45 
46  void Add(HalfLine_t const& seg, std::string label = "", std::string c = "");
47 
48  void Add(Trajectory_t const& trj, std::string label = "", std::string c = "");
49 
50  void Add(Cone_t const& cone, std::string label = "", std::string c = "");
51 
52  void Add(Sphere_t const& sphere, std::string label = "", std::string c = "");
53 
54  const std::vector<geoalgo::Point_t>& Point() const { return _pt_v; }
55  const std::vector<std::string>& PointColor() const { return _pt_col; }
56 
57  const std::vector<geoalgo::AABox_t>& AABox() const { return _box_v; }
58  const std::vector<std::string>& AABoxColor() const { return _box_col; }
59 
60  const std::vector<geoalgo::LineSegment_t>& LineSegment() const { return _seg_v; }
61  const std::vector<std::string>& LineSegmentColor() const { return _seg_col; }
62 
63  const std::vector<geoalgo::HalfLine_t>& HalfLine() const { return _lin_v; }
64  const std::vector<std::string>& HalfLineColor() const { return _lin_col; }
65 
66  const std::vector<geoalgo::Trajectory_t>& Trajectory() const { return _trj_v; }
67  const std::vector<std::string>& TrajectoryColor() const { return _trj_col; }
68 
69  const std::vector<geoalgo::Cone_t>& Cone() const { return _cone_v; }
70  const std::vector<std::string>& ConeColor() const { return _cone_col; }
71 
72  const std::vector<geoalgo::Sphere_t>& Sphere() const { return _sphere_v; }
73  const std::vector<std::string>& SphereColor() const { return _sphere_col; }
74 
75  const std::map<geoalgo::Point_t, std::string>& Labels() const { return _labels; }
76 
77  protected:
78  Point_t const& _Point_(size_t i) const { return _pt_v[i]; }
79 
80  AABox_t const& _AABox_(size_t i) const { return _box_v[i]; }
81 
82  LineSegment_t const& _LineSegment_(size_t i) const { return _seg_v[i]; }
83 
84  Trajectory_t const& _Trajectory_(size_t i) const { return _trj_v[i]; }
85 
86  Cone_t const& _Cone_(size_t i) const { return _cone_v[i]; }
87 
88  Sphere_t const& _Sphere_(size_t i) const { return _sphere_v[i]; }
89 
90  void _AddLabel_(Point_t const& pt, std::string label);
91 
92  std::vector<geoalgo::Point_t> _pt_v;
93  std::vector<std::string> _pt_col;
94  std::vector<geoalgo::AABox_t> _box_v;
95  std::vector<std::string> _box_col;
96  std::vector<geoalgo::LineSegment_t> _seg_v;
97  std::vector<std::string> _seg_col;
98  std::vector<geoalgo::HalfLine_t> _lin_v;
99  std::vector<std::string> _lin_col;
100  std::vector<geoalgo::Trajectory_t> _trj_v;
101  std::vector<std::string> _trj_col;
102  std::vector<geoalgo::Cone_t> _cone_v;
103  std::vector<std::string> _cone_col;
104  std::vector<geoalgo::Sphere> _sphere_v;
105  std::vector<std::string> _sphere_col;
106  std::map<geoalgo::Point_t, std::string> _labels;
107  };
108 
109 }
110 #endif
111  // end of doxygen group
std::vector< std::string > _pt_col
const std::vector< geoalgo::AABox_t > & AABox() const
std::vector< geoalgo::AABox_t > _box_v
const std::vector< geoalgo::LineSegment_t > & LineSegment() const
std::vector< std::string > _cone_col
Class def header for a class HalfLine.
std::vector< geoalgo::Cone_t > _cone_v
const std::vector< geoalgo::Cone_t > & Cone() const
Representation of a simple 3D line segment Defines a finite 3D straight line by having the start and ...
std::vector< geoalgo::Sphere > _sphere_v
Representation of a 3D rectangular box which sides are aligned w/ coordinate axis. A representation of an Axis-Aligned-Boundary-Box, a simple & popular representation of 3D boundary box for collision detection. The concept was taken from the reference, Real-Time-Collision-Detection (RTCD), and in particular Ch. 4.2 (page 77): .
Definition: GeoAABox.h:34
Point_t const & _Point_(size_t i) const
LineSegment_t const & _LineSegment_(size_t i) const
Class def header for a class HalfLine.
const std::vector< std::string > & HalfLineColor() const
std::map< geoalgo::Point_t, std::string > _labels
Class def header for a class AABox.
std::vector< std::string > _trj_col
const std::vector< std::string > & AABoxColor() const
const std::vector< geoalgo::Point_t > & Point() const
std::vector< std::string > _box_col
Representation of a 3D semi-infinite line. Defines a 3D cone with the following properties: Start po...
Definition: GeoCone.h:27
std::vector< geoalgo::Trajectory_t > _trj_v
Class def header for a class Point and Vector.
Trajectory_t const & _Trajectory_(size_t i) const
Sphere_t const & _Sphere_(size_t i) const
const std::vector< std::string > & PointColor() const
const std::vector< std::string > & ConeColor() const
const std::vector< geoalgo::Trajectory_t > & Trajectory() const
Class def header for a class HalfLine.
TMarker * pt
Definition: egs.C:25
const std::vector< geoalgo::HalfLine_t > & HalfLine() const
std::vector< geoalgo::HalfLine_t > _lin_v
AABox_t const & _AABox_(size_t i) const
void _AddLabel_(Point_t const &pt, std::string label)
const std::vector< std::string > & SphereColor() const
const std::vector< std::string > & LineSegmentColor() const
std::vector< std::string > _lin_col
Cone_t const & _Cone_(size_t i) const
Representation of a 3D semi-infinite line. Defines a semi-infinite 3D line by having a start point (P...
Definition: GeoHalfLine.h:30
const std::vector< geoalgo::Sphere_t > & Sphere() const
std::vector< std::string > _sphere_col
Class def header for a class Trajectory.
Class def header for a class LineSegment.
void Add(Point_t const &pt, std::string label="", std::string c="")
std::vector< std::string > _seg_col
std::vector< geoalgo::Point_t > _pt_v
const std::vector< std::string > & TrajectoryColor() const
const std::map< geoalgo::Point_t, std::string > & Labels() const
std::vector< geoalgo::LineSegment_t > _seg_v