ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
CVConst.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "CVTypes.h"
11 
12 // system
13 #include <cfloat>
14 #include <cmath>
15 #include <limits>
16 
18 #ifndef M_PI
19 constexpr double M_PI = 3.14159265358979323846;
20 #endif
21 
23 #ifndef M_PI_2
24 constexpr double M_PI_2 = 1.57079632679489661923;
25 #endif
26 
28 #ifndef SQRT_3
29 constexpr double SQRT_3 = 1.7320508075688772935274463415059;
30 #endif
31 
33 #ifndef ZERO_TOLERANCE
34 [[deprecated(
35  "Use ZERO_TOLERANCE_F/ZERO_TOLERANCE_D or "
36  "cloudViewer::LessThanEpsilon()/"
37  "cloudViewer::GreaterThanEpsilon()")]] constexpr double ZERO_TOLERANCE =
38  std::numeric_limits<double>::epsilon();
39 #endif
40 
43 constexpr float ZERO_TOLERANCE_F = std::numeric_limits<float>::epsilon();
44 
49 constexpr double ZERO_TOLERANCE_D = static_cast<double>(ZERO_TOLERANCE_F);
50 
54 
57 constexpr ScalarType ZERO_TOLERANCE_SCALAR =
58  std::numeric_limits<ScalarType>::epsilon();
59 
62 constexpr ScalarType ZERO_TOLERANCE_POINT_COORDINATE =
63  std::numeric_limits<PointCoordinateType>::epsilon();
64 
66 
67 constexpr PointCoordinateType PC_ONE = static_cast<PointCoordinateType>(1.0);
68 
70 
72  std::numeric_limits<PointCoordinateType>::quiet_NaN();
73 
75 
76 constexpr ScalarType NAN_VALUE = std::numeric_limits<ScalarType>::quiet_NaN();
77 
78 constexpr float MIN_POINT_SIZE_F = 1.0f;
79 constexpr float MAX_POINT_SIZE_F = 16.0f;
80 constexpr float MIN_LINE_WIDTH_F = 1.0f;
81 constexpr float MAX_LINE_WIDTH_F = 16.0f;
82 
83 // Min and max zoom ratio (relative)
84 static constexpr float CC_GL_MAX_ZOOM_RATIO = 1.0e6f;
85 static constexpr float CC_GL_MIN_ZOOM_RATIO = 1.0e-6f;
86 
87 constexpr double EPSILON_VALUE = 1.0e-5;
88 
89 // Point visibility states
90 // By default visibility is expressed relatively to the sensor point of view.
91 // Warning: 'visible' value must always be the lowest!
92 constexpr unsigned char POINT_VISIBLE =
93  0;
94 constexpr unsigned char POINT_HIDDEN =
95  1;
96 constexpr unsigned char POINT_OUT_OF_RANGE =
97  2;
98 constexpr unsigned char POINT_OUT_OF_FOV =
99  4;
111 };
112 
116  CHAMFER_345 = 1
117 };
118 
122  NO_MODEL = 0,
123  LS = 1,
124  TRI = 2,
125  QUADRIC = 3
126 };
127 
129 constexpr unsigned CV_LOCAL_MODEL_MIN_SIZE[] = {
130  1,
131  3,
132  3,
133  6,
134 };
constexpr unsigned char POINT_VISIBLE
Definition: CVConst.h:92
constexpr ScalarType ZERO_TOLERANCE_SCALAR
Definition: CVConst.h:57
constexpr double ZERO_TOLERANCE
Numerical threshold for considering a value as "zero".
Definition: CVConst.h:37
constexpr float MIN_POINT_SIZE_F
Definition: CVConst.h:78
constexpr float ZERO_TOLERANCE_F
Definition: CVConst.h:43
static constexpr float CC_GL_MIN_ZOOM_RATIO
Definition: CVConst.h:85
static constexpr float CC_GL_MAX_ZOOM_RATIO
Definition: CVConst.h:84
constexpr float MIN_LINE_WIDTH_F
Definition: CVConst.h:80
constexpr PointCoordinateType PC_ONE
'1' as a PointCoordinateType value
Definition: CVConst.h:67
constexpr unsigned CV_LOCAL_MODEL_MIN_SIZE[]
Min number of points to compute local models (see CV_LOCAL_MODEL_TYPES)
Definition: CVConst.h:129
CV_LOCAL_MODEL_TYPES
Definition: CVConst.h:121
@ LS
Definition: CVConst.h:123
@ NO_MODEL
Definition: CVConst.h:122
@ TRI
Definition: CVConst.h:124
@ QUADRIC
Definition: CVConst.h:125
constexpr unsigned char POINT_HIDDEN
Definition: CVConst.h:94
constexpr float MAX_LINE_WIDTH_F
Definition: CVConst.h:81
constexpr double SQRT_3
Square root of 3.
Definition: CVConst.h:29
constexpr double M_PI
Pi.
Definition: CVConst.h:19
constexpr unsigned char POINT_OUT_OF_FOV
Definition: CVConst.h:98
CC_VIEW_ORIENTATION
View orientation.
Definition: CVConst.h:102
@ CC_ISO_VIEW_1
Definition: CVConst.h:109
@ CC_ISO_VIEW_2
Definition: CVConst.h:110
@ CC_FRONT_VIEW
Definition: CVConst.h:105
@ CC_TOP_VIEW
Definition: CVConst.h:103
@ CC_RIGHT_VIEW
Definition: CVConst.h:108
@ CC_BOTTOM_VIEW
Definition: CVConst.h:104
@ CC_BACK_VIEW
Definition: CVConst.h:106
@ CC_LEFT_VIEW
Definition: CVConst.h:107
constexpr ScalarType NAN_VALUE
NaN as a ScalarType value.
Definition: CVConst.h:76
constexpr ScalarType ZERO_TOLERANCE_POINT_COORDINATE
Definition: CVConst.h:62
constexpr unsigned char POINT_OUT_OF_RANGE
Definition: CVConst.h:96
constexpr double EPSILON_VALUE
Definition: CVConst.h:87
constexpr double M_PI_2
Pi/2.
Definition: CVConst.h:24
constexpr double ZERO_SQUARED_TOLERANCE_D
Definition: CVConst.h:53
constexpr double ZERO_TOLERANCE_D
Definition: CVConst.h:49
constexpr float MAX_POINT_SIZE_F
Definition: CVConst.h:79
constexpr PointCoordinateType PC_NAN
'NaN' as a PointCoordinateType value
Definition: CVConst.h:71
CHAMFER_DISTANCE_TYPE
Chamfer distances types.
Definition: CVConst.h:114
@ CHAMFER_111
Definition: CVConst.h:115
@ CHAMFER_345
Definition: CVConst.h:116
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16