IKernel.hpp
1 #ifndef DM_PROCESSOR_IKERNEL_HPP_INCLUDED
2 #define DM_PROCESSOR_IKERNEL_HPP_INCLUDED
3 
4 #ifdef _MSC_VER
5  #pragma once
6 #endif
7 
8 #include "DM/config.hpp"
9 #include "DM/IPoint.hpp"
10 #include "DM/IPolyline.hpp"
11 #include "DM/IBox.hpp"
12 #include "DM/IPointIndexLeaf.hpp"
13 #include "DM/IFilter.hpp"
14 #include "DM/ObjectBase.hpp"
15 
16 #include "DM/Processor/AutoLink.hpp"
17 
18 DM_NAMESPACE_BEGIN
19 
20 /// \brief The kernel processor concept is used for manipulating geometry objects within an ODM in an efficient and easy manner
21 class DM_PS_API IKernelBase : public ObjectBase
22 {
23 public:
24  virtual ~IKernelBase() {}
25 
26  ///gets a copy of the object (required for multi-threaded execution)
27  virtual IKernelBase* threadClone() const = 0;
28 
29  ///function is called, when the spatial index leaf changes
30  virtual void leafChanged(const IPointIndexLeaf &leaf) = 0;
31 };
33 
34 
35 /// \brief kernel for handling point object
36 class DM_PS_API IPointKernel : public IKernelBase
37 {
38 public:
39  virtual ~IPointKernel() {}
40 
41  /// Speed-up: inspect the bounding box and attribute statistics of each tile before it is loaded and processed.
42  /// Skip tiles for which surely none of their points pass this filter.
43  /// The returned filter is usually the same as the filter used internally by the kernel to decide if a point shall be processed.
44  /// If all tiles shall be processed, return an empty handle.
45  virtual FilterHandle tileFilter() = 0;
46 
47  virtual bool process(const IPoint &source, IPoint &target) = 0;
48 };
50 
51 
52 /// \brief kernel for handling polyline object
53 class DM_PS_API IPolylineKernel : public IKernelBase
54 {
55 public:
56  virtual ~IPolylineKernel() {}
57 
58  virtual bool process(const IPolyline &source, IPolyline &target) = 0;
59 };
61 
62 
63 class DM_PS_API IGeometryKernel : public IKernelBase
64 {
65 public:
66  virtual ~IGeometryKernel() {}
67 
68  virtual bool process(const IGeometry &source, IGeometry &target) = 0;
69 };
71 
72 
73 DM_NAMESPACE_END
74 
75 #endif //DM_PROCESSOR_IKERNEL_HPP_INCLUDED