IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
PointCloud2d.h
1 // PointCloud2d.h:
3 // ---------------
4 //
14 
15 #ifndef __IPSDKGEOMETRY_POINTCLOUD2D_H__
16 #define __IPSDKGEOMETRY_POINTCLOUD2D_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::geom::PointCloud2d<T>::_pointColl' : class 'std::vector<ipsdk::geom::Point2d<T>>' needs to have dll-interface to be used by clients of class 'ipsdk::geom::PointCloud2d<T>'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
23 #include <IPSDKGeometry/Entity/2d/BaseTypedGeometryEntity2d.h>
24 #include <IPSDKGeometry/Entity/2d/Point/Point2dData.h>
26 #include <vector>
27 
28 namespace ipsdk {
29 namespace geom {
30 
33 
34 template <typename T>
36 {
37  // declare 2d geometry entity
39 
40 // predefined public types
41 public:
43  static const eCoordinateSystem2dType::domain g_coordinateSystem2dType = eCoordinateSystem2dType::eCS2DT_Cartesian;
44 
46  static const eEntity2dType::domain g_entity2dType = eEntity2dType::eE2DT_PointCloud;
47 
50 
52  typedef std::vector<PointType> PointColl;
53 
54 public:
57  PointCloud2d();
58  PointCloud2d(const PointColl& pointColl);
59  ~PointCloud2d();
61 
62 // methods
63 public:
65  inline eCoordinateSystem2dType getCoordinateSystem2dType() const;
66 
68  inline eEntity2dType getEntity2dType() const;
69 
71  inline ipUInt32 size() const;
72 
75  inline void setCollection(const PointColl& pointColl);
76  inline const PointColl& getCollection() const;
77  inline PointColl& getCollection();
79 
81  inline void push_back(const PointType& pt);
82 
84  inline void clear();
85 
86 // attributes
87 protected:
90 };
91 
94 
95 template <typename T>
98 {
99  return g_coordinateSystem2dType;
100 }
101 
102 template <typename T>
103 inline eEntity2dType
105 {
106  return g_entity2dType;
107 }
108 
109 template <typename T>
110 inline ipUInt32
112 {
113  return static_cast<ipUInt32>(_pointColl.size());
114 }
115 
116 template <typename T>
117 inline void
119 {
120  _pointColl = pointColl;
121 }
122 
123 template <typename T>
124 inline const typename PointCloud2d<T>::PointColl&
126 {
127  return _pointColl;
128 }
129 
130 template <typename T>
131 inline typename PointCloud2d<T>::PointColl&
133 {
134  return _pointColl;
135 }
136 
137 template <typename T>
138 inline void
140 {
141  _pointColl.push_back(pt);
142 }
143 
144 template <typename T>
145 inline void
147 {
148  _pointColl.clear();
149 }
150 
153 
154 } // end of namespace geom
155 } // end of namespace ipsdk
156 
157 #pragma warning (pop)
158 
159 #endif // __IPSDKGEOMETRY_POINTCLOUD2D_H__
const PointColl & getCollection() const
access to points collection
Definition: PointCloud2d.h:125
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
void setCollection(const PointColl &pointColl)
access to points collection
Definition: PointCloud2d.h:118
Point2dData< T > PointType
point type associated to object
Definition: PointCloud2d.h:49
ipUInt32 size() const
retrieve number of points into cloud
Definition: PointCloud2d.h:111
eEntity2dType getEntity2dType() const
method allowing to retrieve entity 2d type
Definition: PointCloud2d.h:104
eCoordinateSystem2dType
Enumerate describing coordinate system 2d type.
Definition: GeometryEntity2dTypes.h:76
void clear()
clear point collection
Definition: PointCloud2d.h:146
#define IPSDKGEOMETRY_API
Import/Export macro for library IPSDKGeometry.
Definition: IPSDKGeometryExports.h:25
Base class for typed 3d geometry entities.
Definition: BaseTypedGeometryEntity2d.h:27
Unordered collection of 2d points.
Definition: PointCloud2d.h:35
#define IPSDK_DECLARE_GEOMETRY_ENTITY_2D(libraryName, className)
Macro allowing to declare a geometry entity 2d.
Definition: GeometryEntity2dHdrMacros.h:131
eCoordinateSystem2dType getCoordinateSystem2dType() const
method allowing to retrieve coordinate system 2d type
Definition: PointCloud2d.h:97
Point cloud.
Definition: GeometryEntity2dTypes.h:46
Basic operators used for point cloud 2d management.
eEntity2dType
Enumerate describing entity 2d type.
Definition: GeometryEntity2dTypes.h:38
std::vector< PointType > PointColl
collection of points associated to polygon
Definition: PointCloud2d.h:52
PointColl _pointColl
ordered collection of points associated to polygon
Definition: PointCloud2d.h:89
Lightweight structure used to store Point2d data.
Definition: GeometryEntity2dTypes.h:26
Cartesian coordinate system.
Definition: GeometryEntity2dTypes.h:78
void push_back(const PointType &pt)
append a new element at the end of collection
Definition: PointCloud2d.h:139
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53