Technische Universität Wien
Orientation and Processing of Airborne Laser Scanning data
Department of Geodesy and Geoinformation - Research Groups Photogrammetry and Remote Sensing
distroDM
c++_api
inc
DM
IQueryBase.hpp
1
#pragma once
2
3
4
#include "DM/config.hpp"
5
#include "DM/Handle.hpp"
6
#include "DM/ObjectBase.hpp"
7
#include "DM/ICalculator.hpp"
8
9
#include <assert.h>
10
11
DM_NAMESPACE_BEGIN
12
13
/// \brief range class for query geometry objects
14
struct
DM_API
RangeType
{
15
static
CalculatorHandle
as_calculator(
const
double
&v);
16
17
RangeType
() {}
18
RangeType
(
const
double
& v) : Min(as_calculator(v)) {}
19
RangeType
(
const
CalculatorHandle
&v) : Min(v) {}
20
RangeType
(
const
double
& min,
const
double
& max,
const
double
& inc = 1) : Min(as_calculator(min)), Max(as_calculator(max)), Inc(as_calculator(inc)) {}
21
RangeType
(
const
CalculatorHandle
&min,
const
CalculatorHandle
&max,
const
CalculatorHandle
&inc =
CalculatorHandle
()) : Min(min), Max(max), Inc(inc) {}
22
23
bool
isEmpty()
const
{
return
!Min; }
24
bool
isValue()
const
{
return
!Max; }
25
bool
isRange()
const
{
return
Max; }
26
bool
isConstant()
const
;
///< returns true if values are geometry independent (and the parameter less access function can be used)
27
28
double
value()
const
;
29
double
min()
const
;
30
double
max()
const
;
31
double
increment()
const
;
32
33
double
value(
const
DM::IGeometry
&pt)
const
;
34
double
min(
const
DM::IGeometry
&pt)
const
;
35
double
max(
const
DM::IGeometry
&pt)
const
;
36
double
increment(
const
DM::IGeometry
&pt)
const
;
37
38
double
maximumValue()
const
;
///< highest possible value that may be returned by this object (returns double max if no maximum value can be queried)
39
40
RangeType
operator*(
const
double
&f)
const
;
41
42
CalculatorHandle
Min, Max, Inc;
43
};
44
45
enum struct
QueryType
46
{
47
null
,
///< undefined query type
48
fixed
,
///< fixed region type
49
knn,
///<
50
incremental,
51
combined
52
};
53
54
/// \brief Base class of all query objects
55
class
DM_API
IQueryBase
:
public
ObjectBase
56
{
57
protected
:
58
virtual
~
IQueryBase
() {}
59
60
public
:
61
/// get geometry type (kind of runtime type information)
62
virtual
QueryType
type()
const
= 0;
63
64
/// returns dimension of query (2 or 3)
65
virtual
int
dimension()
const
= 0;
66
67
/// returns the maximum search distance in 2d (or double max if no limits exists)
68
virtual
double
maxSearchDistance2D()
const
= 0;
69
/// returns the maximum search distance in 3d (or double max if no limits exists)
70
virtual
double
maxSearchDistance3D()
const
= 0;
71
72
/// get an object copy
73
virtual
IQueryBase
* clone()
const
= 0;
74
};
75
76
typedef
Handle< IQueryBase >
QueryBaseHandle
;
77
78
79
DM_NAMESPACE_END
DM::RangeType
range class for query geometry objects
Definition:
IQueryBase.hpp:14
DM::QueryType
QueryType
Definition:
IQueryBase.hpp:45
DM::QueryType::fixed
@ fixed
fixed region type
DM::IQueryBase
Base class of all query objects.
Definition:
IQueryBase.hpp:55
DM::IGeometry
Base class of all geometry objects.
Definition:
IGeometry.hpp:26
DM::Handle< ICalculator >
DM::ObjectBase
Definition:
M/c++_api/inc/DM/ObjectBase.hpp:8