IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
AnisotropicScaleTransform2d.h
1 // AnisotropicScaleTransform2d.h:
3 // ------------------------------
4 //
14 
15 #ifndef __IPSDKGEOMETRY_ANISOTROPICSCALETRANSFORM2D_H__
16 #define __IPSDKGEOMETRY_ANISOTROPICSCALETRANSFORM2D_H__
17 
18 #include <IPSDKGeometry/Transform/2d/BaseGeometryTransform2d.h>
19 #include <IPSDKMath/Geometry/2d/Transform/AnisotropicScale2d.h>
20 
21 namespace ipsdk {
22 namespace geom {
23 
24 template <typename T>
25 class BaseTypedGeometryEntity2d;
26 
29 
31 {
32  // declare geometry transform 2d
34 
35 // predefined public types
36 public:
38  static const eTransform2dType::domain g_transform2dType = eTransform2dType::eT2DT_AnisotropicScale;
39 
43  template <typename T>
44  static Ellipse2d<T> anisotropicScale(const Circle2d<T>& entity, const ipReal64 scaleX, const ipReal64 scaleY);
45 
46 public:
51  const ipReal64 scaleY);
55 
56 // methods
57 public:
59  eTransform2dType getTransform2dType() const;
60 
63  void init(const ipReal64 scaleX,
64  const ipReal64 scaleY);
65  void init(const math::transform::AnisotropicScale2d& transform);
67 
68 protected:
71  template <typename T>
72  void processPoint(Point2dData<T>& entity) const;
73  template <typename T>
74  bool processInSitu(Point2d<T>& entity) const;
75  template <typename T>
76  GeometryEntity2dPtr process(const Point2d<T>& entity) const;
77  bool processInSitu(Vector2d& entity) const;
78  GeometryEntity2dPtr process(const Vector2d& entity) const;
79  template <typename T>
80  bool processInSitu(BoundingBox2d<T>& entity) const;
81  template <typename T>
82  GeometryEntity2dPtr process(const BoundingBox2d<T>& entity) const;
83  template <typename T>
84  bool processInSitu(PointCloud2d<T>& entity) const;
85  template <typename T>
86  GeometryEntity2dPtr process(const PointCloud2d<T>& entity) const;
87  template <typename T>
88  bool processInSitu(Polygon2d<T>& entity) const;
89  template <typename T>
90  GeometryEntity2dPtr process(const Polygon2d<T>& entity) const;
91  template <typename T>
92  bool processInSitu(PolygonWithHoles2d<T>& entity) const;
93  template <typename T>
94  GeometryEntity2dPtr process(const PolygonWithHoles2d<T>& entity) const;
95  bool processInSitu(Shape2d& entity) const;
96  GeometryEntity2dPtr process(const Shape2d& entity) const;
97  template <typename T>
98  bool processInSitu(Segment2d<T>& entity) const;
99  template <typename T>
100  GeometryEntity2dPtr process(const Segment2d<T>& entity) const;
101  template <typename T>
102  GeometryEntity2dPtr process(const Circle2d<T>& entity) const;
104 
105 // attributes
106 protected:
109 };
110 
113 
114 inline eTransform2dType
116 {
117  return g_transform2dType;
118 }
119 
120 inline void
122  const ipReal64 scaleY)
123 {
124  _transform.setParams(scaleX, scaleY);
125 }
126 
127 inline void
129 {
130  _transform = transform;
131 }
132 
135 
136 } // end of namespace geom
137 } // end of namespace ipsdk
138 
139 #endif // __IPSDKGEOMETRY_ANISOTROPICSCALE2D_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
Anisotropic scale.
Definition: GeometryTransform2dTypes.h:41
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
math::transform::AnisotropicScale2d _transform
underlying transformation
Definition: AnisotropicScaleTransform2d.h:108
void setParams(const ipReal64 scaleX, const ipReal64 scaleY)
select parameters associated to transformation
Definition: AnisotropicScale2d.h:122
#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
void init(const ipReal64 scaleX, const ipReal64 scaleY)
initialization of transformation parameters
Definition: AnisotropicScaleTransform2d.h:121
boost::shared_ptr< BaseGeometryEntity2d > GeometryEntity2dPtr
shared pointer to BaseGeometryEntity2d
Definition: GeometryEntity2dTypes.h:88
Closed polygon associated to an ordered collection of 2d points.
Definition: Polygon2d.h:38
static const eTransform2dType::domain g_transform2dType
geometry transformation type
Definition: AnisotropicScaleTransform2d.h:38
Vector class associated to polar 2d coordinates.
Definition: Vector2d.h:32
eTransform2dType getTransform2dType() const
method allowing to retrieve entity 2d transformation type
Definition: AnisotropicScaleTransform2d.h:115
2d circle associated to cartesian 2d coordinates
Definition: Circle2d.h:36
Base class for geometry 2d transformations.
Definition: BaseGeometryTransform2d.h:34
Definition: AnisotropicScale2d.h:33
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
Rectangular 2d bounding box class associated to cartesian 2d coordinates.
Definition: BoundingBox2d.h:37
Anisotropic 2d scale transformation.
Definition: AnisotropicScaleTransform2d.h:30
eTransform2dType
Enumerate describing geometry 2d transform type.
Definition: GeometryTransform2dTypes.h:33