IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
MomentsMsr2d.h
1 // MomentsMsr2d.h:
3 // ------------
4 //
18 
19 #ifndef __IPSDKGEOMETRY_MOMENTSMSR2D_H__
20 #define __IPSDKGEOMETRY_MOMENTSMSR2D_H__
21 
22 #include <IPSDKGeometry/Measure/2d/BaseTypedGeometryMeasure2d.h>
23 #include <IPSDKGeometry/Measure/Moments2dO3.h>
24 
25 namespace ipsdk {
26 namespace geom {
27 
30 
32 {
33  // declare geometry measure 2d
35 
36 // predefined public types
37 public:
38 
41 
43  static const eMeasure2dType::domain g_measure2dType = eMeasure2dType::eM2DT_Moments;
44 
45 public:
48  MomentsMsr2d();
49  ~MomentsMsr2d();
51 
52 // methods
53 public:
55  eMeasure2dType getMeasure2dType() const;
56 
57 protected:
58 
59 
62  template <typename T>
63  bool process(const Point2d<T>& entity, Moments2dO3& result) const;
64  bool process(const Vector2d& entity, Moments2dO3& result) const;
65  template <typename T>
66  bool process(const BoundingBox2d<T>& entity, Moments2dO3& result) const;
67  template <typename T>
68  bool process(const Polygon2d<T>& entity, Moments2dO3& result) const;
69  template <typename T>
70  bool process(const PolygonWithHoles2d<T>& entity, Moments2dO3& result) const;
71  bool process(const Shape2d& entity, Moments2dO3& result) const;
72  template <typename T>
73  bool process(const Circle2d<T>& entity, Moments2dO3& result) const;
74  template <typename T>
75  bool process(const Ellipse2d<T>& entity, Moments2dO3& result) const;
76  template <typename T>
77  bool process(const Square2d<T>& entity, Moments2dO3& result) const;
78  template <typename T>
79  bool process(const Rectangle2d<T>& entity, Moments2dO3& result) const;
81 
82 // attributes
83 protected:
84 
85 };
86 
89 
90 inline eMeasure2dType
92 {
93  return g_measure2dType;
94 }
95 
98 
99 } // end of namespace geom
100 } // end of namespace ipsdk
101 
102 #endif // __IPSDKGEOMETRY_MOMENTSMSR2D_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
#define IPSDK_DECLARE_GEOMETRY_MEASURE_2D(libraryName, className)
Macro allowing to declare a geometry measure 2d.
Definition: GeometryMeasure2dHdrMacros.h:26
eMeasure2dType
Enumerate describing geometry 2d measure type.
Definition: GeometryMeasure2dTypes.h:33
Closed polygon potentially associated to interior polygonal holes.
Definition: PolygonWithHoles2d.h:40
Base class for typed geometry measures 2d.
Definition: BaseTypedGeometryMeasure2d.h:27
Moments of order up to 3 on a 2d shape.
Definition: Moments2dO3.h:24
#define IPSDKGEOMETRY_API
Import/Export macro for library IPSDKGeometry.
Definition: IPSDKGeometryExports.h:25
BaseTypedGeometryMeasure2d< Moments2dO3 >::DataType DataType
Output data type associated to measure.
Definition: MomentsMsr2d.h:40
Closed polygon associated to an ordered collection of 2d points.
Definition: Polygon2d.h:38
Moments of order up to 3 measurement algorithm applied to a 2d geometry entity.
Definition: MomentsMsr2d.h:31
Vector class associated to polar 2d coordinates.
Definition: Vector2d.h:32
eMeasure2dType getMeasure2dType() const
method allowing to retrieve entity 2d measure type
Definition: MomentsMsr2d.h:91
2d rectangle class associated to cartesian 2d coordinates
Definition: Rectangle2d.h:35
2d circle associated to cartesian 2d coordinates
Definition: Circle2d.h:36
static const eMeasure2dType::domain g_measure2dType
geometry entity measurement type
Definition: MomentsMsr2d.h:43
2d square class associated to cartesian 2d coordinates
Definition: Square2d.h:35
Moments of order up to 3.
Definition: GeometryMeasure2dTypes.h:39
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