IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
RotationTransform2d.h
1 // RotationTransform2d.h:
3 // ----------------------
4 //
14 
15 #ifndef __IPSDKGEOMETRY_ROTATIONTRANSFORM2D_H__
16 #define __IPSDKGEOMETRY_ROTATIONTRANSFORM2D_H__
17 
18 #include <IPSDKGeometry/Transform/2d/BaseGeometryTransform2d.h>
19 #include <IPSDKMath/Constants.h>
20 #include <IPSDKMath/Geometry/2d/Transform/Rotation2d.h>
21 
22 namespace ipsdk {
23 namespace geom {
24 
27 
29 {
30  // declare geometry transform 2d
32 
33 // predefined public types
34 public:
36  static const eTransform2dType::domain g_transform2dType = eTransform2dType::eT2DT_Rotation;
37 
38 public:
42  RotationTransform2d(const ipReal64 theta);
46 
47 // methods
48 public:
50  eTransform2dType getTransform2dType() const;
51 
54  void init(const ipReal64 theta);
55  void init(const math::transform::Rotation2d& transform);
57 
58 protected:
61  template <typename T>
62  void processPoint(Point2dData<T>& entity) const;
63  template <typename T>
64  bool processInSitu(Point2d<T>& entity) const;
65  bool processInSitu(Vector2d& entity) const;
66  template <typename T>
67  bool processInSitu(PointCloud2d<T>& entity) const;
68  template <typename T>
69  bool processInSitu(Polygon2d<T>& entity) const;
70  template <typename T>
71  bool processInSitu(PolygonWithHoles2d<T>& entity) const;
72  bool processInSitu(Shape2d& entity) const;
73  template <typename T>
74  bool processInSitu(Circle2d<T>& entity) const;
75  template <typename T>
76  bool processInSitu(Ellipse2d<T>& entity) const;
77  template <typename T>
78  bool processInSitu(Square2d<T>& entity) const;
79  template <typename T>
80  bool processInSitu(Rectangle2d<T>& entity) const;
81  bool processInSitu(Line2d& entity) const;
82  bool processInSitu(Parabola2d& entity) const;
83  template <typename T>
84  bool processInSitu(Segment2d<T>& entity) const;
86 
87 // attributes
88 protected:
91 };
92 
95 
96 inline eTransform2dType
98 {
99  return g_transform2dType;
100 }
101 
102 inline void
104 {
105  _transform.setParams(theta);
106 }
107 
108 inline void
110 {
111  _transform = transform;
112 }
113 
116 
117 } // end of namespace geom
118 } // end of namespace ipsdk
119 
120 #endif // __IPSDKGEOMETRY_ROTATIONTRANSFORM2D_H__
2d ellipse class associated to cartesian 2d coordinates. For a non rotated ellipse, the major axis follows the x axis and the minor axis follows the y axis.
Definition: Ellipse2d.h:40
Transformation class allowing to manage 2d rotations.
Definition: Rotation2d.h:33
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Point class associated to cartesian 2d coordinates.
Definition: GeometryEntity2dTypes.h:28
void init(const ipReal64 theta)
initialization of transformation parameters
Definition: RotationTransform2d.h:103
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
#define IPSDK_DECLARE_GEOMETRY_TRANSFORM_2D(libraryName, className)
Macro allowing to declare a geometry transform 2d.
Definition: GeometryTransform2dHdrMacros.h:26
Closed polygon potentially associated to interior polygonal holes.
Definition: PolygonWithHoles2d.h:40
Predefined constants for ipsdk math library.
eTransform2dType getTransform2dType() const
method allowing to retrieve entity 2d transformation type
Definition: RotationTransform2d.h:97
Parabola 2d class.
Definition: Parabola2d.h:47
static const eTransform2dType::domain g_transform2dType
geometry transformation type
Definition: RotationTransform2d.h:36
math::transform::Rotation2d _transform
underlying transformation
Definition: RotationTransform2d.h:90
#define IPSDKGEOMETRY_API
Import/Export macro for library IPSDKGeometry.
Definition: IPSDKGeometryExports.h:25
Rotation.
Definition: GeometryTransform2dTypes.h:37
Unordered collection of 2d points.
Definition: PointCloud2d.h:35
2d line associated to polar coordinates
Definition: Line2d.h:42
Rotation 2d transformation (origin centered)
Definition: RotationTransform2d.h:28
2d segment associated to two points
Definition: Segment2d.h:38
Closed polygon associated to an ordered collection of 2d points.
Definition: Polygon2d.h:38
Vector class associated to polar 2d coordinates.
Definition: Vector2d.h:32
2d rectangle class associated to cartesian 2d coordinates
Definition: Rectangle2d.h:35
2d circle associated to cartesian 2d coordinates
Definition: Circle2d.h:36
void setParams(const ipReal64 theta)
select parameters associated to transformation
Definition: Rotation2d.h:115
Base class for geometry 2d transformations.
Definition: BaseGeometryTransform2d.h:34
2d square class associated to cartesian 2d coordinates
Definition: Square2d.h:35
Shape 2d associated to one or more closed polygon 2d.
Definition: Shape2d.h:35
Lightweight structure used to store Point2d data.
Definition: GeometryEntity2dTypes.h:26
eTransform2dType
Enumerate describing geometry 2d transform type.
Definition: GeometryTransform2dTypes.h:33