15 #ifndef __IPSDKGEOMETRY_SQUARE2D_H__ 16 #define __IPSDKGEOMETRY_SQUARE2D_H__ 20 #pragma warning (push) 21 #pragma warning (disable : 4251) 24 #include <IPSDKGeometry/Entity/2d/BaseTypedGeometryEntity2d.h> 25 #include <IPSDKGeometry/Entity/2d/Point/Point2d.h> 54 Square2d(
const T xCenter,
const T yCenter,
const T halfLength,
const ipReal64 orientation);
69 inline void setCenter(
const Point2d<T>& centerPt);
70 inline void setCenter(
const T xMin,
const T yMin);
71 inline void setHalfLength(
const T halfLength);
72 inline void setOrientation(
const ipReal64 orientation);
73 inline ipReal64 getOrientation()
const;
74 inline T centerX()
const;
75 inline T centerY()
const;
77 inline T getHalfLength()
const;
78 inline T getLength()
const;
107 template <
typename T>
111 return g_coordinateSystem2dType;
114 template <
typename T>
118 return g_entity2dType;
121 template <
typename T>
125 _centerPt = centerPt;
128 template <
typename T>
135 template <
typename T>
139 _centerPt.setCoords(xMin, yMin);
142 template <
typename T>
146 _halfLength = halfLength;
149 template <
typename T>
156 template <
typename T>
163 template <
typename T>
167 _orientation = orientation;
170 template <
typename T>
177 template <
typename T>
184 template <
typename T>
188 return 2*_halfLength;
191 template <
typename T>
198 template <
typename T>
203 return Point2dData<T>(
static_cast<T
>(modulus*std::cos(_orientation+5.*M_PI/4.)) + _centerPt._x,
204 static_cast<T>(modulus*std::sin(_orientation+5.*M_PI/4.)) + _centerPt._y);
207 template <
typename T>
212 return Point2dData<T>(
static_cast<T
>(modulus*std::cos(_orientation-M_PI/4.)) + _centerPt._x,
213 static_cast<T>(modulus*std::sin(_orientation-M_PI/4.)) + _centerPt._y);
216 template <
typename T>
221 return Point2dData<T>(
static_cast<T
>(modulus*std::cos(_orientation+3.*M_PI/4.)) + _centerPt._x,
222 static_cast<T>(modulus*std::sin(_orientation+3.*M_PI/4.)) + _centerPt._y);
225 template <
typename T>
230 return Point2dData<T>(
static_cast<T
>(modulus*std::cos(_orientation+M_PI/4.)) + _centerPt._x,
231 static_cast<T>(modulus*std::sin(_orientation+M_PI/4.)) + _centerPt._y);
240 #pragma warning (pop) 242 #endif // __IPSDKGEOMETRY_SQUARE2D_H__ eCoordinateSystem2dType getCoordinateSystem2dType() const
method allowing to retrieve coordinate system 2d type
Definition: Square2d.h:109
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Point class associated to cartesian 2d coordinates.
Definition: GeometryEntity2dTypes.h:28
Point2dData< T > topLeftCorner() const
compute square corners coordinates For instance, the topLeftCorner() method calculates the square cor...
Definition: Square2d.h:200
IPSDK_FORCEINLINE PackT sqrt(const PackT &in)
returns the square root of a pack
Definition: sqrt.h:40
Circle.
Definition: GeometryEntity2dTypes.h:54
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
void setCenter(const Point2dData< T > ¢erPt)
access to point coordinates
Definition: Square2d.h:123
void setHalfLength(const T halfLength)
access to point coordinates
Definition: Square2d.h:144
eCoordinateSystem2dType
Enumerate describing coordinate system 2d type.
Definition: GeometryEntity2dTypes.h:76
ipReal64 getOrientation() const
access to point coordinates
Definition: Square2d.h:193
T getHalfLength() const
access to point coordinates
Definition: Square2d.h:179
Definition of import/export macro for library.
#define IPSDKGEOMETRY_API
Import/Export macro for library IPSDKGeometry.
Definition: IPSDKGeometryExports.h:25
Base class for typed 3d geometry entities.
Definition: BaseTypedGeometryEntity2d.h:27
void setOrientation(const ipReal64 orientation)
access to point coordinates
Definition: Square2d.h:165
ipReal64 _orientation
orientation (in radian) of the square
Definition: Square2d.h:100
#define IPSDK_DECLARE_GEOMETRY_ENTITY_2D(libraryName, className)
Macro allowing to declare a geometry entity 2d.
Definition: GeometryEntity2dHdrMacros.h:131
eEntity2dType getEntity2dType() const
method allowing to retrieve entity 2d type
Definition: Square2d.h:116
T centerX() const
access to point coordinates
Definition: Square2d.h:151
T getLength() const
access to point coordinates
Definition: Square2d.h:186
Point2dData< T > bottomRightCorner() const
compute square corners coordinates For instance, the topLeftCorner() method calculates the square cor...
Definition: Square2d.h:227
const Point2dData< T > & center() const
access to point coordinates
Definition: Square2d.h:172
const Point2dData< T > & getCoords() const
access to point coordinates
Definition: Point2d.h:139
T _halfLength
half length of the square sides
Definition: Square2d.h:97
eEntity2dType
Enumerate describing entity 2d type.
Definition: GeometryEntity2dTypes.h:38
Point2dData< T > _centerPt
coordinates associated to the center of the square
Definition: Square2d.h:94
2d square class associated to cartesian 2d coordinates
Definition: Square2d.h:35
Point2dData< T > bottomLeftCorner() const
compute square corners coordinates For instance, the topLeftCorner() method calculates the square cor...
Definition: Square2d.h:218
Lightweight structure used to store Point2d data.
Definition: GeometryEntity2dTypes.h:26
Point2dData< T > topRightCorner() const
compute square corners coordinates For instance, the topLeftCorner() method calculates the square cor...
Definition: Square2d.h:209
T centerY() const
access to point coordinates
Definition: Square2d.h:158
Cartesian coordinate system.
Definition: GeometryEntity2dTypes.h:78