IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
CentroidTransform2d.h
1 // CentroidTransform2d.h:
3 // ----------------------
4 //
15 
16 #ifndef __IPSDKGEOMETRY_CENTROIDTRANSFORM2D_H__
17 #define __IPSDKGEOMETRY_CENTROIDTRANSFORM2D_H__
18 
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_Centroid;
36 
39 
40 public:
46 
47 // methods
48 public:
50  eTransform2dType getTransform2dType() const;
51 
53  static Point2d<ipReal64> centroid(const BaseGeometryEntity2d& entity);
54 
55 protected:
58  template <typename T>
59  GeometryEntity2dPtr process(const Point2d<T>& entity) const;
60  GeometryEntity2dPtr process(const Vector2d& entity) const;
61  template <typename T>
62  GeometryEntity2dPtr process(const BoundingBox2d<T>& entity) const;
63  template <typename T>
64  GeometryEntity2dPtr process(const PointCloud2d<T>& entity) const;
65  template <typename T>
66  GeometryEntity2dPtr process(const Polygon2d<T>& entity) const;
67  template <typename T>
68  GeometryEntity2dPtr process(const PolygonWithHoles2d<T>& entity) const;
69  GeometryEntity2dPtr process(const Shape2d& entity) const;
70  template <typename T>
71  GeometryEntity2dPtr process(const Circle2d<T>& entity) const;
72  template <typename T>
73  GeometryEntity2dPtr process(const Ellipse2d<T>& entity) const;
74  template <typename T>
75  GeometryEntity2dPtr process(const Square2d<T>& entity) const;
76  template <typename T>
77  GeometryEntity2dPtr process(const Rectangle2d<T>& entity) const;
78  template <typename T>
79  GeometryEntity2dPtr process(const Segment2d<T>& entity) const;
81 
82 // attributes
83 protected:
84 
85 };
86 
89 
90 inline eTransform2dType
92 {
93  return g_transform2dType;
94 }
95 
98 
99 } // end of namespace geom
100 } // end of namespace ipsdk
101 
102 #endif // __IPSDKGEOMETRY_CENTROIDTRANSFORM2D_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
Centroid computation.
Definition: GeometryTransform2dTypes.h:49
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Point class associated to cartesian 2d coordinates.
Definition: GeometryEntity2dTypes.h:28
#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
#define IPSDKGEOMETRY_API
Import/Export macro for library IPSDKGeometry.
Definition: IPSDKGeometryExports.h:25
Unordered collection of 2d points.
Definition: PointCloud2d.h:35
Computation of 2d centroid of input geometry using Bashein / Detmer algorithm strategy.
Definition: CentroidTransform2d.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
Point2d< ipReal64 > OutPointType
output point type
Definition: CentroidTransform2d.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: CentroidTransform2d.h:91
2d rectangle class associated to cartesian 2d coordinates
Definition: Rectangle2d.h:35
static const eTransform2dType::domain g_transform2dType
geometry transformation type
Definition: CentroidTransform2d.h:35
2d circle associated to cartesian 2d coordinates
Definition: Circle2d.h:36
Base class for 2d geometry entities.
Definition: BaseGeometryEntity2d.h:34
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