IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
GeometryTransform2dSrcMacros.h
Go to the documentation of this file.
1 // GeometryTransform2dSrcMacros.h:
3 // -------------------------------
4 //
14 
15 #ifndef __IPSDKGEOMETRY_GEOMETRYTRANSFORM2DSRCMACROS_H__
16 #define __IPSDKGEOMETRY_GEOMETRYTRANSFORM2DSRCMACROS_H__
17 
19 #include <IPSDKGeometry/Entity/2d/Point/Point2d.h>
20 #include <IPSDKGeometry/Entity/2d/Vector/Vector2d.h>
21 #include <IPSDKGeometry/Entity/2d/BoundingBox/BoundingBox2d.h>
22 #include <IPSDKGeometry/Entity/2d/PointCloud/PointCloud2d.h>
23 #include <IPSDKGeometry/Entity/2d/Polygon/Polygon2d.h>
24 #include <IPSDKGeometry/Entity/2d/PolygonWithHoles/PolygonWithHoles2d.h>
25 #include <IPSDKGeometry/Entity/2d/Shape/Shape2d.h>
26 #include <IPSDKGeometry/Entity/2d/Circle/Circle2d.h>
27 #include <IPSDKGeometry/Entity/2d/Ellipse/Ellipse2d.h>
28 #include <IPSDKGeometry/Entity/2d/Square/Square2d.h>
29 #include <IPSDKGeometry/Entity/2d/Rectangle/Rectangle2d.h>
30 #include <IPSDKGeometry/Entity/2d/Line/Line2d.h>
31 #include <IPSDKGeometry/Entity/2d/Parabola/Parabola2d.h>
32 #include <IPSDKGeometry/Entity/2d/Segment/Segment2d.h>
33 
36 
39 #define IPSDK_IMPLEMENT_GEOMETRY_TRANSFORM_2D(libraryName, namespaceSeq, className, version) \
40  IPSDK_IMPLEMENT_SERIAL_WITH_COPY(libraryName, namespaceSeq, className, version) \
41  bool className::applyInSitu(BaseGeometryEntity2d& entity) const \
42  { \
43  return entity.visitInSitu(*this); \
44  } \
45  GeometryEntity2dPtr className::apply(const BaseGeometryEntity2d& entity) const \
46  { \
47  return entity.visitNonInSitu(*this); \
48  }
49 
52 #define IPSDK_IMPLEMENT_INSITU_GEOMETRY_TRANSFORM_2D(libraryName, namespaceSeq, className, version) \
53  IPSDK_IMPLEMENT_SERIAL_WITH_COPY(libraryName, namespaceSeq, className, version) \
54  bool className::applyInSitu(BaseGeometryEntity2d& entity) const \
55  { \
56  return entity.visitInSitu(*this); \
57  } \
58  GeometryEntity2dPtr className::apply(const BaseGeometryEntity2d& entity) const \
59  { \
60  GeometryEntity2dPtr pResultEntity(static_cast<BaseGeometryEntity2d*>(entity.duplicate())); \
61  if (applyInSitu(*pResultEntity) == true) \
62  return pResultEntity; \
63  else \
64  return GeometryEntity2dPtr(); \
65  }
66 
69 
72 #define IPSDK_REGISTER_INSITU_GEOMETRY_TRANSFORM_2D_MACRO(r, classInfo, type) \
73  template IPSDKGEOMETRY_API bool \
74  BOOST_PP_SEQ_ELEM(0, classInfo)::processInSitu<type>( \
75  BOOST_PP_SEQ_ELEM(1, classInfo)<type>&) const;
76 
79 #define IPSDK_REGISTER_INSITU_GEOMETRY_TRANSFORM_2D(className, entityType, typeSeq) \
80  BOOST_PP_SEQ_FOR_EACH(IPSDK_REGISTER_INSITU_GEOMETRY_TRANSFORM_2D_MACRO, \
81  (className)(entityType), typeSeq);
82 
85 
88 #define IPSDK_REGISTER_NONINSITU_GEOMETRY_TRANSFORM_2D_MACRO(r, classInfo, type) \
89  template IPSDKGEOMETRY_API GeometryEntity2dPtr \
90  BOOST_PP_SEQ_ELEM(0, classInfo)::process<type>( \
91  const BOOST_PP_SEQ_ELEM(1, classInfo)<type>&) const;
92 
95 #define IPSDK_REGISTER_NONINSITU_GEOMETRY_TRANSFORM_2D(className, entityType, typeSeq) \
96  BOOST_PP_SEQ_FOR_EACH(IPSDK_REGISTER_NONINSITU_GEOMETRY_TRANSFORM_2D_MACRO, \
97  (className)(entityType), typeSeq);
98 
101 
102 #endif // __IPSDKGEOMETRY_GEOMETRYTRANSFORM2DSRCMACROS_H__
Source part of macros set for class serialization.