15 #ifndef __IPSDKGEOMETRY_SEGMENT2D_H__ 16 #define __IPSDKGEOMETRY_SEGMENT2D_H__ 20 #pragma warning (push) 21 #pragma warning (disable : 4251) 23 #include <IPSDKGeometry/Entity/2d/BaseTypedGeometryEntity2d.h> 25 #include <IPSDKGeometry/Entity/2d/Point/Point2d.h> 26 #include <IPSDKGeometry/Entity/2d/Vector/Vector2d.h> 55 Segment2d(
const T x0,
const T y0,
const T x1,
const T y1);
73 inline void setCoords(
const T x0,
const T y0,
const T x1,
const T y1);
141 template <
typename T>
150 template <
typename T>
152 Segment2d<T>::Segment2d(
const Point2d<T>& pt0,
const Point2d<T>& pt1) :
153 _pt0(pt0.getCoords()),
154 _pt1(pt1.getCoords())
159 template <
typename T>
161 Segment2d<T>::Segment2d(
const Point2dData<T>& pt0,
const Point2dData<T>& pt1) :
168 template <
typename T>
170 Segment2d<T>::Segment2d(
const Point2d<T>& pt0,
const Vector2d& v01)
175 template <
typename T>
177 Segment2d<T>::Segment2d(
const Point2dData<T>& pt0,
const Vector2d& v01)
182 template <
typename T>
186 return g_coordinateSystem2dType;
189 template <
typename T>
193 return g_entity2dType;
196 template <
typename T>
200 _pt0.setCoords(x0, y0);
201 _pt1.setCoords(x1, y1);
204 template <
typename T>
212 template <
typename T>
220 template <
typename T>
227 template <
typename T>
233 _pt1.
_x += math::round<T>(v01.
getX());
234 _pt1._y += math::round<T>(v01.
getY());
237 template <
typename T>
244 template <
typename T>
251 template <
typename T>
258 template <
typename T>
265 template <
typename T>
272 template <
typename T>
279 template <
typename T>
283 return (_pt0._x + _pt1._x) / 2.0;
286 template <
typename T>
290 return (_pt0._y + _pt1._y) / 2.0;
293 template <
typename T>
300 template <
typename T>
307 template <
typename T>
315 template <
typename T>
330 #pragma warning (pop) 332 #endif // __IPSDKGEOMETRY_SEGMENT2D_H__ Operators associated to segment 2d entities.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
T _x
x coordinate of point
Definition: Point2dData.h:69
Point class associated to cartesian 2d coordinates.
Definition: GeometryEntity2dTypes.h:28
ipReal64 getMiddleY() const
retrieve segment middle point coordinates
Definition: Segment2d.h:288
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
ipReal64 getY() const
retrieve cartesian components of vector
Definition: Vector2d.h:240
ipReal64 getX() const
retrieve cartesian components of vector
Definition: Vector2d.h:234
eCoordinateSystem2dType
Enumerate describing coordinate system 2d type.
Definition: GeometryEntity2dTypes.h:76
Segment.
Definition: GeometryEntity2dTypes.h:68
ipReal64 getMiddleX() const
retrieve segment middle point coordinates
Definition: Segment2d.h:281
void setPoint1(const Point2d< T > &pt1)
access to segment coordinates
Definition: Segment2d.h:253
IPSDKGEOMETRY_API ipReal64 distance(const Point2d< T > &pt1, const Point2d< T > &pt2)
compute euclidian distance between two points
eEntity2dType getEntity2dType() const
method allowing to retrieve entity 2d type
Definition: Segment2d.h:191
#define IPSDKGEOMETRY_API
Import/Export macro for library IPSDKGeometry.
Definition: IPSDKGeometryExports.h:25
Base class for typed 3d geometry entities.
Definition: BaseTypedGeometryEntity2d.h:27
const Point2dData< T > & getPoint0() const
access to segment coordinates
Definition: Segment2d.h:267
#define IPSDK_DECLARE_GEOMETRY_ENTITY_2D(libraryName, className)
Macro allowing to declare a geometry entity 2d.
Definition: GeometryEntity2dHdrMacros.h:131
void setPoint0(const Point2d< T > &pt0)
access to segment coordinates
Definition: Segment2d.h:239
2d segment associated to two points
Definition: Segment2d.h:38
Utility functions for ipsdk math library.
Point2dData< ipReal64 > getMiddlePoint() const
retrieve segment middle point coordinates
Definition: Segment2d.h:295
ipReal64 distance(const Point2d< T > &pt) const
retrieve orthogonal distance between point and segment
Definition: Segment2d.h:302
Point2dData< T > _pt1
second point associated to segment
Definition: Segment2d.h:135
const Point2dData< T > & getPoint1() const
access to segment coordinates
Definition: Segment2d.h:274
Vector class associated to polar 2d coordinates.
Definition: Vector2d.h:32
const Point2dData< T > & getCoords() const
access to point coordinates
Definition: Point2d.h:139
boost::numeric::ublas::bounded_vector< ipReal64, 2 > Vector2d
2d vector type associated to library
Definition: LinearAlgebraTypes.h:39
eEntity2dType
Enumerate describing entity 2d type.
Definition: GeometryEntity2dTypes.h:38
Point2dData< T > _pt0
first point associated to segment
Definition: Segment2d.h:132
eCoordinateSystem2dType getCoordinateSystem2dType() const
method allowing to retrieve coordinate system 2d type
Definition: Segment2d.h:184
void setCoords(const T x0, const T y0, const T x1, const T y1)
access to segment coordinates
Definition: Segment2d.h:198
Lightweight structure used to store Point2d data.
Definition: GeometryEntity2dTypes.h:26
Cartesian coordinate system.
Definition: GeometryEntity2dTypes.h:78