IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
SimplifyTransform2d.h
1 // SimplifyTransform2d.h:
3 // ----------------------
4 //
14 
15 #ifndef __IPSDKGEOMETRY_SIMPLIFYTRANSFORM2D_H__
16 #define __IPSDKGEOMETRY_SIMPLIFYTRANSFORM2D_H__
17 
19 #include <IPSDKGeometry/Transform/2d/BaseGeometryTransform2d.h>
20 
21 namespace ipsdk {
22 namespace geom {
23 
26 
28 {
29  // declare geometry transform 2d
31 
32 // predefined public types
33 public:
35  static const eTransform2dType::domain g_transform2dType = eTransform2dType::eT2DT_Simplify;
36 
37 public:
41  SimplifyTransform2d(const ipReal64 maxDistance);
44 
45 // methods
46 public:
48  eTransform2dType getTransform2dType() const;
49 
53  void setMaxDistance(const ipReal64 maxDistance);
54  const ipReal64 getMaxDistance() const;
56 
58  template <typename T>
59  Polygon2d<T> simplify(const Polygon2d<T>& entity) const;
60 
61 protected:
64  template <typename T>
65  bool processInSitu(Point2d<T>& entity) const;
66  template <typename T>
67  GeometryEntity2dPtr process(const Point2d<T>& entity) const;
68  bool processInSitu(Vector2d& entity) const;
69  GeometryEntity2dPtr process(const Vector2d& entity) const;
70  template <typename T>
71  bool processInSitu(BoundingBox2d<T>& entity) const;
72  template <typename T>
73  GeometryEntity2dPtr process(const BoundingBox2d<T>& entity) const;
74  template <typename T>
75  bool processInSitu(Polygon2d<T>& entity) const;
76  template <typename T>
77  GeometryEntity2dPtr process(const Polygon2d<T>& entity) const;
78  template <typename T>
79  bool processInSitu(PolygonWithHoles2d<T>& entity) const;
80  template <typename T>
81  GeometryEntity2dPtr process(const PolygonWithHoles2d<T>& entity) const;
82  bool processInSitu(Shape2d& entity) const;
83  GeometryEntity2dPtr process(const Shape2d& entity) const;
84  template <typename T>
85  bool processInSitu(Circle2d<T>& entity) const;
86  template <typename T>
87  GeometryEntity2dPtr process(const Circle2d<T>& entity) const;
88  template <typename T>
89  bool processInSitu(Ellipse2d<T>& entity) const;
90  template <typename T>
91  GeometryEntity2dPtr process(const Ellipse2d<T>& entity) const;
92  template <typename T>
93  bool processInSitu(Square2d<T>& entity) const;
94  template <typename T>
95  GeometryEntity2dPtr process(const Square2d<T>& entity) const;
96  template <typename T>
97  bool processInSitu(Rectangle2d<T>& entity) const;
98  template <typename T>
99  GeometryEntity2dPtr process(const Rectangle2d<T>& entity) const;
100  template <typename T>
101  bool processInSitu(Segment2d<T>& entity) const;
102  template <typename T>
103  GeometryEntity2dPtr process(const Segment2d<T>& entity) const;
105 
106 // attributes
107 protected:
111 };
112 
115 
116 inline eTransform2dType
118 {
119  return g_transform2dType;
120 }
121 
122 inline void
124 {
125  _maxDistance = maxDistance;
126 }
127 
128 inline const ipReal64
130 {
131  return _maxDistance;
132 }
133 
136 
137 } // end of namespace geom
138 } // end of namespace ipsdk
139 
140 #endif // __IPSDKGEOMETRY_SIMPLIFYTRANSFORM2D_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: SimplifyTransform2d.h:35
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
eTransform2dType getTransform2dType() const
method allowing to retrieve entity 2d transformation type
Definition: SimplifyTransform2d.h:117
Geometry simplification computation.
Definition: GeometryTransform2dTypes.h:55
Definition of import/export macro for library.
const ipReal64 getMaxDistance() const
access to maximum distance of a vertex to other segments to be removed (default value : 1...
Definition: SimplifyTransform2d.h:129
#define IPSDKGEOMETRY_API
Import/Export macro for library IPSDKGeometry.
Definition: IPSDKGeometryExports.h:25
Algorithm allowing to simplify a geometry.
Definition: SimplifyTransform2d.h:27
2d segment associated to two points
Definition: Segment2d.h:38
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
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
Rectangular 2d bounding box class associated to cartesian 2d coordinates.
Definition: BoundingBox2d.h:37
eTransform2dType
Enumerate describing geometry 2d transform type.
Definition: GeometryTransform2dTypes.h:33
ipReal64 _maxDistance
Definition: SimplifyTransform2d.h:110
void setMaxDistance(const ipReal64 maxDistance)
access to maximum distance of a vertex to other segments to be removed (default value : 1...
Definition: SimplifyTransform2d.h:123