IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
RTreeUtils.h
Go to the documentation of this file.
1 // RTreeUtils.h:
3 // -------------
4 //
14 
15 #ifndef __IPSDKGEOMETRY_RTREEUTILS_H__
16 #define __IPSDKGEOMETRY_RTREEUTILS_H__
17 
20 #include <vector>
21 
22 namespace ipsdk {
23 namespace geom {
24 
25 class Shape2d;
26 class Shape3d;
27 
30 
33 template <typename T>
34 IPSDKGEOMETRY_API boost::shared_ptr<RTree<Point2dData<T> > >
35 createPoint2dRTree(const std::vector<Point2dData<T> >& coll,
36  const ipUInt32 startIdx = 0);
37 
41 createBBox2dRTree(const std::vector<BoundingBox2d<Shape2dDataType> >& coll,
42  const ipUInt32 startIdx = 0);
43 
47 createSeg2dRTree(const Shape2d& shape2d,
48  const ipBool bProcessHoles);
49 
52 template <typename T>
53 IPSDKGEOMETRY_API boost::shared_ptr<RTree<Point3dData<T> > >
54 createPoint3dRTree(const std::vector<Point3dData<T> >& coll,
55  const ipUInt32 startIdx = 0);
56 
60 createBBox3dRTree(const std::vector<BoundingBox3d<Shape3dDataType> >& coll,
61  const ipUInt32 startIdx = 0);
62 
66 createLTri3dRTree(const Shape3d& shape3d,
67  const ipBool bProcessHoles);
68 
71 // \return ipsdk::NumericLimits<ipReal64>::max() if a rtree is empty
73 distance(const Seg2dRTree& seg2dRTree1, const Seg2dRTree& seg2dRTree2);
74 
77 // \return ipsdk::NumericLimits<ipReal64>::max() if a rtree is empty
79 distance(const LTri3dRTree& lTri3dRTree1, const LTri3dRTree& lTri3dRTree2);
80 
100 contactLength(const Seg2dRTree& seg2dRTree1,
101  const Seg2dRTree& seg2dRTree2,
102  const ipReal64 contactDist,
103  const eSegmentContactPolicy& contactPolicy,
104  const ipReal32 segmentSubSamplingStep = 0);
105 
119 contactSurface(const LTri3dRTree& lTri3dRTree1,
120  const LTri3dRTree& lTri3dRTree2,
121  const ipReal64 contactDist);
122 
125 
126 } // end of namespace geom
127 } // end of namespace ipsdk
128 
129 #endif // __IPSDKGEOMETRY_RTREEUTILS_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
boost::shared_ptr< Seg2dRTree > Seg2dRTreePtr
shared pointer to segment 2d with Shape2dDataType data type
Definition: RTreeTypes.h:99
RTree< LightTriangle3d > LTri3dRTree
RTree associated to light triangle 3d data.
Definition: RTreeTypes.h:155
IPSDKGEOMETRY_API Seg2dRTreePtr createSeg2dRTree(const Shape2d &shape2d, const ipBool bProcessHoles)
function allowing to create a segment based RTree object from shape data
IPSDKGEOMETRY_API LTri3dRTreePtr createLTri3dRTree(const Shape3d &shape3d, const ipBool bProcessHoles)
function allowing to create a lightweight triangle based RTree object from shape data ...
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
boost::shared_ptr< BBox3dRTree > BBox3dRTreePtr
shared pointer to bounding box 3d with Shape3dDataType data type
Definition: RTreeTypes.h:135
IPSDKGEOMETRY_API boost::shared_ptr< RTree< Point2dData< T > > > createPoint2dRTree(const std::vector< Point2dData< T > > &coll, const ipUInt32 startIdx=0)
function allowing to create a point 2d based RTree object from point 2d collection ...
IPSDKGEOMETRY_API BBox2dRTreePtr createBBox2dRTree(const std::vector< BoundingBox2d< Shape2dDataType > > &coll, const ipUInt32 startIdx=0)
function allowing to create a bounding box based RTree object from bounding box collection ...
boost::shared_ptr< BBox2dRTree > BBox2dRTreePtr
shared pointer to bounding box 2d with Shape2dDataType data type
Definition: RTreeTypes.h:87
IPSDKGEOMETRY_API ipReal64 distance(const Point2d< T > &pt1, const Point2d< T > &pt2)
compute euclidian distance between two points
Definition of import/export macro for library.
IPSDKGEOMETRY_API BBox3dRTreePtr createBBox3dRTree(const std::vector< BoundingBox3d< Shape3dDataType > > &coll, const ipUInt32 startIdx=0)
function allowing to create a bounding box based RTree object from bounding box collection ...
#define IPSDKGEOMETRY_API
Import/Export macro for library IPSDKGeometry.
Definition: IPSDKGeometryExports.h:25
predefined types for RTree objects management
eSegmentContactPolicy
Enumerate describing policy used to define if a segment belongs to elements in contact with a shape...
Definition: RTreeTypes.h:46
IPSDKGEOMETRY_API ipReal64 contactSurface(const LTri3dRTree &lTri3dRTree1, const LTri3dRTree &lTri3dRTree2, const ipReal64 contactDist)
function allowing to compute surface of contact between a lightweight triangle based RTree object and...
bool ipBool
Base types definition.
Definition: BaseTypes.h:47
IPSDKGEOMETRY_API boost::shared_ptr< RTree< Point3dData< T > > > createPoint3dRTree(const std::vector< Point3dData< T > > &coll, const ipUInt32 startIdx=0)
function allowing to create a point 3d based RTree object from point 3d collection ...
IPSDKGEOMETRY_API ipReal64 contactLength(const Seg2dRTree &seg2dRTree1, const Seg2dRTree &seg2dRTree2, const ipReal64 contactDist, const eSegmentContactPolicy &contactPolicy, const ipReal32 segmentSubSamplingStep=0)
function allowing to compute length of contact between a segment based RTree object and an other one ...
boost::shared_ptr< LTri3dRTree > LTri3dRTreePtr
shared pointer to light triangle 3d data
Definition: RTreeTypes.h:158
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
RTree< Segment2d< Shape2dDataType > > Seg2dRTree
RTree associated to segment 2d with Shape2dDataType data type.
Definition: RTreeTypes.h:96
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53