IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Point3d.h
1 // Point3d.h:
3 // ----------
4 //
14 
15 #ifndef __IPSDKGEOMETRY_POINT3D_H__
16 #define __IPSDKGEOMETRY_POINT3D_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::geom::Point3d<ipsdk::ipInt32>::_ptData' : struct 'ipsdk::geom::Point3dData<T>' needs to have dll-interface to be used by clients of class 'ipsdk::geom::Point3d<ipsdk::ipInt32>'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
23 #include <IPSDKGeometry/Entity/3d/BaseTypedGeometryEntity3d.h>
24 #include <IPSDKGeometry/Entity/3d/Point/Point3dData.h>
27 
28 namespace ipsdk {
29 namespace geom {
30 
31 class Vector3d;
32 
35 
36 template <typename T>
37 class IPSDKGEOMETRY_API Point3d : public BaseTypedGeometryEntity3d<T>
38 {
39  // declare 3d geometry entity
40  IPSDK_DECLARE_GEOMETRY_ENTITY_3D(IPSDKGeometry, Point3d);
41 
42 // predefined public types
43 public:
45  static const eCoordinateSystem3dType::domain g_coordinateSystem3dType = eCoordinateSystem3dType::eCS3DT_Cartesian;
46 
48  static const eEntity3dType::domain g_entity3dType = eEntity3dType::eE3DT_Point;
49 
50 public:
53  Point3d();
54  Point3d(const Point3dData<T>& ptData);
55  Point3d(const T x, const T y, const T z);
56  ~Point3d();
58 
59 // methods
60 public:
62  inline eCoordinateSystem3dType getCoordinateSystem3dType() const;
63 
65  inline eEntity3dType getEntity3dType() const;
66 
69  inline const Point3dData<T>& getCoords() const;
70  inline Point3dData<T>& getCoords();
71  inline operator Point3dData<T>() const;
72  inline void setCoords(const T x, const T y, const T z);
73  inline void setCoords(const Point3dData<T>& ptData);
74  inline void setX(const T x);
75  inline void setY(const T y);
76  inline void setZ(const T z);
77  inline T getX() const;
78  inline T getY() const;
79  inline T getZ() const;
80  inline T& getX();
81  inline T& getY();
82  inline T& getZ();
84 
86  ipReal64 normL2() const;
87 
91  Point3d<T>& operator+=(const Point3d<T>& pt);
92  Point3d<T> operator+(const Point3d<T>& pt) const;
93  Point3d<T>& operator+=(const Vector3d& vec);
94  Point3d<T> operator+(const Vector3d& vec) const;
95  Point3d<T>& operator+=(const T value);
96  Point3d<T> operator+(const T value) const;
97  Point3d<T>& operator-=(const Point3d<T>& pt);
98  Point3d<T> operator-(const Point3d<T>& pt) const;
99  Point3d<T>& operator-=(const Vector3d& vec);
100  Point3d<T> operator-(const Vector3d& vec) const;
101  Point3d<T>& operator-=(const T value);
102  Point3d<T> operator-(const T value) const;
103  Point3d<T>& operator*=(const Point3d<T>& pt);
104  Point3d<T> operator*(const Point3d<T>& pt) const;
105  Point3d<T>& operator*=(const Vector3d& vec);
106  Point3d<T> operator*(const Vector3d& vec) const;
107  Point3d<T>& operator*=(const ipReal64 value);
108  Point3d<T> operator*(const ipReal64 value) const;
109  Point3d<T>& operator/=(const Point3d<T>& pt);
110  Point3d<T> operator/(const Point3d<T>& pt) const;
111  Point3d<T>& operator/=(const Vector3d& vec);
112  Point3d<T> operator/(const Vector3d& vec) const;
113  Point3d<T>& operator/=(const ipReal64 value);
114  Point3d<T> operator/(const ipReal64 value) const;
116 
117 // attributes
118 protected:
121 };
122 
125 
126 template <typename T>
129 {
130  return g_coordinateSystem3dType;
131 }
132 
133 template <typename T>
134 inline eEntity3dType
136 {
137  return g_entity3dType;
138 }
139 
140 template <typename T>
141 inline const Point3dData<T>&
143 {
144  return _ptData;
145 }
146 
147 template <typename T>
148 inline
150 {
151  return _ptData;
152 }
153 
154 template <typename T>
155 inline Point3dData<T>&
157 {
158  return _ptData;
159 }
160 
161 template <typename T>
162 inline void
164 {
165  _ptData = ptData;
166 }
167 
168 template <typename T>
169 inline void
170 Point3d<T>::setCoords(const T x, const T y, const T z)
171 {
172  _ptData._x = x;
173  _ptData._y = y;
174  _ptData._z = z;
175 }
176 
177 template <typename T>
178 inline void
180 {
181  _ptData._x = x;
182 }
183 
184 template <typename T>
185 inline void
187 {
188  _ptData._y = y;
189 }
190 
191 template <typename T>
192 inline void
194 {
195  _ptData._z = z;
196 }
197 
198 template <typename T>
199 inline T
201 {
202  return _ptData._x;
203 }
204 
205 template <typename T>
206 inline T
208 {
209  return _ptData._y;
210 }
211 
212 template <typename T>
213 inline T
215 {
216  return _ptData._z;
217 }
218 
219 template <typename T>
220 inline T&
222 {
223  return _ptData._x;
224 }
225 
226 template <typename T>
227 inline T&
229 {
230  return _ptData._y;
231 }
232 
233 template <typename T>
234 inline T&
236 {
237  return _ptData._z;
238 }
239 
242 
243 } // end of namespace geom
244 } // end of namespace ipsdk
245 
246 #pragma warning (pop)
247 
248 #endif // __IPSDKGEOMETRY_POINT3D_H__
T getY() const
access to point coordinates
Definition: Point3d.h:207
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
eCoordinateSystem3dType
Enumerate describing coordinate system 3d type.
Definition: GeometryEntity3dTypes.h:74
void setZ(const T z)
access to point coordinates
Definition: Point3d.h:193
T getZ() const
access to point coordinates
Definition: Point3d.h:214
Point class associated to cartesian 3d coordinates.
Definition: GeometryEntity3dTypes.h:29
eEntity3dType getEntity3dType() const
method allowing to retrieve entity 3d type
Definition: Point3d.h:135
#define IPSDK_DECLARE_GEOMETRY_ENTITY_3D(libraryName, className)
Macro allowing to declare a geometry entity 3d.
Definition: GeometryEntity3dHdrMacros.h:131
IPSDKGEOMETRY_API Point2d< T > operator*(const ipReal64 value, const Point2d< T > &pt)
arithmetic operators on point
void setY(const T y)
access to point coordinates
Definition: Point3d.h:186
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Utility functions for points 3d management.
void setCoords(const T x, const T y, const T z)
access to point coordinates
Definition: Point3d.h:170
const Point3dData< T > & getCoords() const
access to point coordinates
Definition: Point3d.h:142
Basic operators used for point 3d management.
Vector class associated to spherical 3d coordinates.
Definition: Vector3d.h:32
#define IPSDKGEOMETRY_API
Import/Export macro for library IPSDKGeometry.
Definition: IPSDKGeometryExports.h:25
Point3dData< T > _ptData
coordinates of point
Definition: Point3d.h:120
void setX(const T x)
access to point coordinates
Definition: Point3d.h:179
eEntity3dType
Enumerate describing entity 3d type.
Definition: GeometryEntity3dTypes.h:38
T getX() const
access to point coordinates
Definition: Point3d.h:200
boost::numeric::ublas::bounded_vector< ipReal64, 3 > Vector3d
3d vector type associated to library
Definition: LinearAlgebraTypes.h:42
Cartesian coordinate system.
Definition: GeometryEntity3dTypes.h:76
IPSDKGEOMETRY_API ipReal64 normL2(const Point2d< T > &pt)
compute point norm
Lightweight structure used to store Point3d data.
Definition: GeometryEntity3dTypes.h:27
Point.
Definition: GeometryEntity3dTypes.h:40
eCoordinateSystem3dType getCoordinateSystem3dType() const
method allowing to retrieve coordinate system 3d type
Definition: Point3d.h:128