All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoObjCollection.h
Go to the documentation of this file.
1 /**
2  * \file GeoObjCollection.h
3  *
4  * \ingroup GeoAlgo
5  *
6  * \brief Class def header for a class GeoObjCollection
7  *
8  * @author kazuhiro
9  */
10 
11 /** \addtogroup GeoAlgo
12 
13  @{*/
14 #ifndef BASICTOOL_GEOOBJCOLLECTION_H
15 #define BASICTOOL_GEOOBJCOLLECTION_H
16 
17 #include <iostream>
18 #include "GeoTrajectory.h"
19 #include "GeoAABox.h"
20 #include "GeoLineSegment.h"
21 #include "GeoHalfLine.h"
22 #include "GeoCone.h"
23 #include "GeoSphere.h"
24 #include "GeoAlgoException.h"
25 #include <map>
26 namespace geoalgo {
27 
28  /**
29  \class GeoObjCollection
30  */
31  class GeoObjCollection {
32 
33  public:
34 
35  /// Default constructor
37 
38  /// Default destructor
39  virtual ~GeoObjCollection(){}
40 
41  void Clear();
42 
43  void Add(const Point_t& pt, std::string label="", std::string c="");
44 
45  void Add(const AABox_t& box, std::string label="", std::string c="");
46 
47  void Add(const LineSegment_t& seg, std::string label="", std::string c="");
48 
49  void Add(const HalfLine_t& seg, std::string label="", std::string c="");
50 
51  void Add(const Trajectory_t& trj, std::string label="", std::string c="");
52 
53  void Add(const Cone_t& cone, std::string label="", std::string c="");
54 
55  void Add(const Sphere_t& sphere, std::string label="", std::string c="");
56 
57  const std::vector< geoalgo::Point_t >& Point() const { return _pt_v; }
58  const std::vector< std::string >& PointColor() const { return _pt_col; }
59 
60  const std::vector< geoalgo::AABox_t >& AABox() const { return _box_v; }
61  const std::vector< std::string >& AABoxColor() const { return _box_col; }
62 
63  const std::vector< geoalgo::LineSegment_t >& LineSegment() const { return _seg_v; }
64  const std::vector< std::string >& LineSegmentColor() const { return _seg_col; }
65 
66  const std::vector< geoalgo::HalfLine_t >& HalfLine() const { return _lin_v; }
67  const std::vector< std::string >& HalfLineColor() const { return _lin_col; }
68 
69  const std::vector< geoalgo::Trajectory_t >& Trajectory() const { return _trj_v; }
70  const std::vector< std::string >& TrajectoryColor() const { return _trj_col; }
71 
72  const std::vector< geoalgo::Cone_t >& Cone() const { return _cone_v; }
73  const std::vector< std::string >& ConeColor() const { return _cone_col; }
74 
75  const std::vector< geoalgo::Sphere_t >& Sphere() const { return _sphere_v; }
76  const std::vector< std::string >& SphereColor() const { return _sphere_col; }
77 
78  const std::map<geoalgo::Point_t,std::string>& Labels() const { return _labels;}
79 
80  protected:
81 
82  const Point_t& _Point_(size_t i) const
83  { return _pt_v[i]; }
84 
85  const AABox_t& _AABox_(size_t i) const
86  { return _box_v[i]; }
87 
88  const LineSegment_t& _LineSegment_(size_t i) const
89  { return _seg_v[i]; }
90 
91  const Trajectory_t& _Trajectory_(size_t i) const
92  { return _trj_v[i]; }
93 
94  const Cone_t& _Cone_(size_t i) const
95  { return _cone_v[i]; }
96 
97  const Sphere_t& _Sphere_(size_t i) const
98  { return _sphere_v[i]; }
99 
100  void _AddLabel_(const Point_t& pt,
101  std::string label);
102 
103  std::vector< geoalgo::Point_t > _pt_v;
104  std::vector< std::string > _pt_col;
105  std::vector< geoalgo::AABox_t > _box_v;
106  std::vector< std::string > _box_col;
107  std::vector< geoalgo::LineSegment_t > _seg_v;
108  std::vector< std::string > _seg_col;
109  std::vector< geoalgo::HalfLine_t > _lin_v;
110  std::vector< std::string > _lin_col;
111  std::vector< geoalgo::Trajectory_t > _trj_v;
112  std::vector< std::string > _trj_col;
113  std::vector< geoalgo::Cone_t > _cone_v;
114  std::vector< std::string > _cone_col;
115  std::vector< geoalgo::Sphere > _sphere_v;
116  std::vector< std::string > _sphere_col;
117  std::map<geoalgo::Point_t,std::string > _labels;
118 
119  };
120 
121 }
122 #endif
123 /** @} */ // end of doxygen group
124 
const std::vector< geoalgo::LineSegment_t > & LineSegment() const
void _AddLabel_(const Point_t &pt, std::string label)
const std::vector< geoalgo::Point_t > & Point() const
Representation of a simple 3D line segment Defines a finite 3D straight line by having the start and ...
const std::vector< geoalgo::Sphere_t > & Sphere() const
Representation of a 3D rectangular box which sides are aligned w/ coordinate axis. A representation of an Axis-Aligned-Boundary-Box, a simple &amp; 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): .
void Add(const Point_t &pt, std::string label="", std::string c="")
const std::vector< geoalgo::HalfLine_t > & HalfLine() const
std::map< geoalgo::Point_t, std::string > _labels
Representation of a 3D semi-infinite line. Defines a 3D cone with the following properties: Start po...
const std::vector< geoalgo::Trajectory_t > & Trajectory() const
const std::map< geoalgo::Point_t, std::string > & Labels() const
Representation of a 3D semi-infinite line. Defines a semi-infinite 3D line by having a start point (P...
const std::vector< geoalgo::AABox_t > & AABox() const