IProcessorEx.hpp
1 #pragma once
2 
3 #include "DM/config.hpp"
4 #include "DM/Handle.hpp"
5 #include "DM/IFilter.hpp"
6 #include "DM/IAddInfoLayout.hpp"
7 #include "DM/IDatamanager.hpp"
8 #include "DM/ISpatialQueryDescriptor.hpp"
9 #include "DM/IControlObject.hpp"
10 #include "DM/IMessageOutput.hpp"
11 
12 #include "DM/IQueryDescriptor.hpp"
13 
14 #include "DM/Processor/ICUStrategy.hpp"
15 #include "DM/Processor/IKernelVectorEx.hpp"
16 #include "DM/Processor/AutoLink.hpp" //enable autolink
17 
18 DM_NAMESPACE_BEGIN
19 
20 
21 /// \brief Statistic interface to object that can be retrieved after a IProcessorEx run
22 class DM_PS_API IProcessStats : public ObjectBase
23 {
24 protected:
25  virtual ~IProcessStats() {}
26 
27 public:
28  virtual int64_t pointsProccessed() const = 0; ///< overall points processed (which fullfill the optional limit criterion): pointsProccessed = pointsFiltered + pointsUsed
29  virtual int64_t pointsFiltered() const = 0; ///< number of points that where filtered by the (optional) process filter
30  virtual int64_t pointsSkipped() const = 0; ///< number of points that where skipped by an optional post query constraint (e.g. minPtCount)
31  virtual int64_t pointsChanged() const = 0; ///< number of points that passed the (optional) process filter and have been changed by the kernel object
32  virtual int64_t pointsUnchanged() const = 0; ///< number of points that passed the (optional) process filter and have NOT been changed by the kernel object
33  virtual int64_t pointsUsed() const = 0; ///< number of points that passed the (optional) process filter: pointsUsed = pointsChanged + pointsUnchanged
34 
35  //statistic about spatial data selection
36  virtual int64_t neighborsMin() const = 0;
37  virtual int64_t neighborsMax() const = 0;
38  virtual double neighborsMean() const = 0;
39  virtual double neighborsSigma() const = 0;
40  virtual int64_t pointsZeroNeighbors() const = 0; ///< number of points that have no neighbors at all
41  virtual int64_t pointsSingleNeighbors() const = 0; //< number of points that have only a single neighbor
42 };
43 
45 
46 /// \brief Extended processor/kernel concept
47 /**
48  Compared to the simple processor/kernel the extended version handles all spatial neighborhood queries (also no spatial queries), supports
49  processing and spatial selection filters, as well as, addinfo layout setting for processing and neighborhood points. Furthermore, an optional
50  processing limit (currently only 2d) can be applied. After the runThreaded function was called a detailed statistic object can be accessed
51 
52  (see getStats and IProcessStats for details). Progress control support is also implemented (see setControlObject)
53  The code uses template functions and specialised code to bypass unneeded functions resulting in optimal performance.
54 
55  Hence, the extended processor concept reduces the necessary kernel code to an absolute minimum supporting efficient module development
56 */
57 class DM_PS_API IProcessorEx : public ObjectBase
58 {
59 public:
60  // \brief old spatial query concept
61  static IProcessorEx* New(IDatamanager &manager, SpatialQueryDescriptorHandle query,
62  FilterHandle processFilter, AddInfoLayoutHandle processLayout, bool processLayoutReadOnly,
63  FilterHandle spatialFilter, AddInfoLayoutHandle spatialLayout, bool spatialLayoutReadOnly);
64  static IProcessorEx* New(IDatamanager &manager, const IWindow &processLimit, SpatialQueryDescriptorHandle query,
65  FilterHandle processFilter, AddInfoLayoutHandle processLayout, bool processLayoutReadOnly,
66  FilterHandle spatialFilter, AddInfoLayoutHandle spatialLayout, bool spatialLayoutReadOnly);
67 
68  // \brief new generic spatial query concept
69  static IProcessorEx* New(IDatamanager &manager, QueryDescriptorHandle query,
70  FilterHandle processFilter, AddInfoLayoutHandle processLayout, bool processLayoutReadOnly,
71  FilterHandle spatialFilter, AddInfoLayoutHandle spatialLayout, bool spatialLayoutReadOnly);
72  static IProcessorEx* New(IDatamanager &manager, const IWindow &processLimit, QueryDescriptorHandle query,
73  FilterHandle processFilter, AddInfoLayoutHandle processLayout, bool processLayoutReadOnly,
74  FilterHandle spatialFilter, AddInfoLayoutHandle spatialLayout, bool spatialLayoutReadOnly);
75 
76  // \brief grid based processor
77  static IProcessorEx* New(IDatamanager &manager, const ICUStrategy &cuStrategy, QueryDescriptorHandle query,
78  FilterHandle processFilter,
79  FilterHandle neighborFilter, AddInfoLayoutHandle neighborLayout, bool neighborLayoutReadOnly);
80 
81 protected:
82  virtual ~IProcessorEx() {}
83 
84 public:
85  /// set and optional control object
86  virtual void setControlObject(ControlObjectHandle control) = 0;
87  /// get the current control object
88  virtual ControlObjectHandle getControlObject() const = 0;
89 
90  /// \brief start processing with the given kernel object
91  /// \param[in] kernel processing kernel object (will be cloned for each processing thread)
92  /// \param[in] threads number of processing thread (0 -> use logical number of cpus of the current machine)
93  /// \param[in] messageOutput optional message callback object to receive warnings and errors
94  virtual void runThreaded(IKernelBase &kernel, int threads = 0, MessageOutputHandle messageOutput = MessageOutputHandle()) = 0;
95 
96  /// get processing statistic object (after the runThreaded function was called)
97  virtual ProcessStatsHandle getStats() const = 0;
98 };
99 
101 
102 
103 DM_NAMESPACE_END
Statistic interface to object that can be retrieved after a IProcessorEx run.
Definition: IProcessorEx.hpp:22
2d window object
Definition: IWindow.hpp:11
The kernel processor concept is used for manipulating geometry objects within an ODM in an efficient ...
Definition: IKernelBase.hpp:16
Extended processor/kernel concept.
Definition: IProcessorEx.hpp:57
Definition: Handle.hpp:427
kernel for handling point object
Definition: ICUStrategy.hpp:24
Interface to an Datamanager (ODM) object.
Definition: IDatamanager.hpp:57
Smart pointer class using reference counting with support for DM objects (see ObjectBase)
Definition: Handle.hpp:75
Definition: M/c++_api/inc/DM/ObjectBase.hpp:8