IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
SimilarityTransform2d.h
1 // SimilarityTransform2d.h:
3 // ------------------------
4 //
17 
18 #ifndef __IPSDKGEOMETRY_SIMILARITYTRANSFORM2D_H__
19 #define __IPSDKGEOMETRY_SIMILARITYTRANSFORM2D_H__
20 
21 #include <IPSDKGeometry/Transform/2d/BaseGeometryTransform2d.h>
22 #include <IPSDKMath/Geometry/2d/Transform/Similarity2d.h>
23 
24 namespace ipsdk {
25 namespace geom {
26 
29 
31 {
32  // declare geometry transform 2d
34 
35 // predefined public types
36 public:
38  static const eTransform2dType::domain g_transform2dType = eTransform2dType::eT2DT_SimilarityTransform;
39 
40 public:
44  SimilarityTransform2d(const ipReal64 scale,
45  const ipReal64 theta,
46  const ipReal64 xOffset,
47  const ipReal64 yOffset);
51 
52 // methods
53 public:
55  eTransform2dType getTransform2dType() const;
56 
59  void init(const ipReal64 scale,
60  const ipReal64 theta,
61  const ipReal64 xOffset,
62  const ipReal64 yOffset);
63  void init(const math::transform::Similarity2d& transform);
65 
66 protected:
69  template <typename T>
70  void processPoint(Point2dData<T>& entity) const;
71  template <typename T>
72  bool processInSitu(Point2d<T>& entity) const;
73  bool processInSitu(Vector2d& entity) const;
74  template <typename T>
75  bool processInSitu(PointCloud2d<T>& entity) const;
76  template <typename T>
77  bool processInSitu(Polygon2d<T>& entity) const;
78  template <typename T>
79  bool processInSitu(PolygonWithHoles2d<T>& entity) const;
80  bool processInSitu(Shape2d& entity) const;
81  template <typename T>
82  bool processInSitu(Circle2d<T>& entity) const;
83  template <typename T>
84  bool processInSitu(Ellipse2d<T>& entity) const;
85  template <typename T>
86  bool processInSitu(Square2d<T>& entity) const;
87  template <typename T>
88  bool processInSitu(Rectangle2d<T>& entity) const;
89  template <typename T>
90  bool processInSitu(Segment2d<T>& entity) const;
92 
93 // attributes
94 protected:
97 };
98 
101 
102 inline eTransform2dType
104 {
105  return g_transform2dType;
106 }
107 
108 inline void
110  const ipReal64 theta,
111  const ipReal64 xOffset,
112  const ipReal64 yOffset)
113 {
114  _transform.setParams(scale, theta, xOffset, yOffset);
115 }
116 
117 inline void
119 {
120  _transform = transform;
121 }
122 
125 
126 } // end of namespace geom
127 } // end of namespace ipsdk
128 
129 #endif // __IPSDKGEOMETRY_SIMILARITYTRANSFORM2D_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
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Point class associated to cartesian 2d coordinates.
Definition: GeometryEntity2dTypes.h:28
static const eTransform2dType::domain g_transform2dType
geometry transformation type
Definition: SimilarityTransform2d.h:38
math::transform::Similarity2d _transform
underlying transformation
Definition: SimilarityTransform2d.h:96
Similarity transformation.
Definition: GeometryTransform2dTypes.h:45
eTransform2dType getTransform2dType() const
method allowing to retrieve entity 2d transformation type
Definition: SimilarityTransform2d.h:103
void init(const ipReal64 scale, const ipReal64 theta, const ipReal64 xOffset, const ipReal64 yOffset)
initialization of transformation parameters
Definition: SimilarityTransform2d.h:109
void setParams(const ipReal64 scale, const ipReal64 theta, const ipReal64 tx, const ipReal64 ty)
select parameters associated to transformation
Definition: Similarity2d.h:156
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
Definition: Similarity2d.h:33
Closed polygon potentially associated to interior polygonal holes.
Definition: PolygonWithHoles2d.h:40
#define IPSDKGEOMETRY_API
Import/Export macro for library IPSDKGeometry.
Definition: IPSDKGeometryExports.h:25
Unordered collection of 2d points.
Definition: PointCloud2d.h:35
2d segment associated to two points
Definition: Segment2d.h:38
Closed polygon associated to an ordered collection of 2d points.
Definition: Polygon2d.h:38
Non-reflective similarity 2d transformation.
Definition: SimilarityTransform2d.h:30
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
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