8#define PI (3.14159265358979323846)
55 constexpr SizeF() : width(0), height(0) {}
56 constexpr SizeF(
double width,
double height) : width(width), height(height) {}
86 constexpr ProfileROI() : xAxisCenter(0), width(0), height(0) {}
87 constexpr ProfileROI(
double xAxisCenter,
double width,
double height)
88 : xAxisCenter(xAxisCenter), width(width), height(height)
117 double translateY,
double translateZ)
122 translate(translateX, translateY, translateZ);
151 const double radians{theta *
PI / 180.0};
152 const double cosValue{cos(radians)};
153 const double sinValue{sin(radians)};
155 switch (rotationAxis) {
158 double rotationXMatrix[3][3] = {
159 {1, 0, 0}, {0, cosValue, -sinValue}, {0, sinValue, cosValue}};
160 multiMatrix(rotationXMatrix);
164 double rotationYMatrix[3][3] = {
165 {cosValue, 0, sinValue}, {0, 1, 0}, {-sinValue, 0, cosValue}};
166 multiMatrix(rotationYMatrix);
170 double rotationZMatrix[3][3] = {
171 {cosValue, -sinValue, 0}, {sinValue, cosValue, 0}, {0, 0, 1}};
172 multiMatrix(rotationZMatrix);
196 const double EPSILON = 1e-15;
197 double identityRotation[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
198 double zeroTranslation[3] = {0, 0, 0};
199 auto isApprox0 = [EPSILON](
double d) {
return std::fabs(d) <= EPSILON; };
201 for (
int row = 0; row < 3; row++) {
202 for (
int col = 0; col < 3; col++) {
203 if (!isApprox0(
rotation[row][col] - identityRotation[row][col])) {
209 for (
int row = 0; row < 3; row++) {
210 if (!isApprox0(
translation[row] - zeroTranslation[row])) {
218 double rotation[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
221 void multiMatrix(
const double rotationMatrix[3][3])
223 double tempRotation[3][3];
224 memcpy(&tempRotation, &
rotation, 9 *
sizeof(
double));
226 for (
int row = 0; row < 3; row++) {
227 for (
int col = 0; col < 3; col++) {
228 rotation[row][col] = rotationMatrix[row][0] * tempRotation[0][col] +
229 rotationMatrix[row][1] * tempRotation[1][col] +
230 rotationMatrix[row][2] * tempRotation[2][col];
#define PI
Definition CommonTypes.h:8
#define MMIND_API_EXPORT
Definition api_global.h:48
IpAssignmentMethod
Describes the assignment method of the device IP address.
Definition CommonTypes.h:238
Platform
Describes the platform of the camera.
Definition CommonTypes.h:243
FileFormat
Definition CommonTypes.h:18
CoordinateUnit
The unit of the coordinate data of the point cloud.
Definition CommonTypes.h:16
Represents a point in UntexturedPointCloud with the coordinate (x, y, z) information.
Definition CommonTypes.h:102
float y
Y channel, default unit: mm, invalid data: nan.
Definition CommonTypes.h:104
float x
X channel, default unit: mm, invalid data: nan.
Definition CommonTypes.h:103
float z
Z channel, default unit: mm, invalid data: nan.
Definition CommonTypes.h:105
Describes the region of interest (ROI) of a laser profiler.
Definition CommonTypes.h:85
constexpr ProfileROI(double xAxisCenter, double width, double height)
Definition CommonTypes.h:87
double xAxisCenter
The position (in mm) of the ROI's center on the X-axis.
Definition CommonTypes.h:93
double height
The Z-axis height (in mm) of the ROI.
Definition CommonTypes.h:95
double width
The X-axis width (in mm) of the ROI.
Definition CommonTypes.h:94
bool operator==(const ProfileROI &other)
constexpr ProfileROI()
Definition CommonTypes.h:86
Describes a region of interest (ROI).
Definition CommonTypes.h:67
size_t height
Definition CommonTypes.h:78
size_t width
Definition CommonTypes.h:77
unsigned upperLeftY
The row coordinate of the upper-left corner of the ROI.
Definition CommonTypes.h:76
unsigned upperLeftX
The column coordinate of the upper-left corner of the ROI.
Definition CommonTypes.h:75
constexpr ROI(unsigned upperLeftX, unsigned upperLeftY, size_t width, size_t height)
Definition CommonTypes.h:69
constexpr ROI()
Definition CommonTypes.h:68
bool operator==(const ROI &other)
Definition CommonTypes.h:73
Describes a value range.
Definition CommonTypes.h:29
T max
Definition CommonTypes.h:33
T min
Definition CommonTypes.h:32
constexpr Range()
Definition CommonTypes.h:30
constexpr Range(T min, T max)
Definition CommonTypes.h:31
Describes a two-dimensional size with a width and a height using double-precision floating-point numb...
Definition CommonTypes.h:54
constexpr SizeF(double width, double height)
Definition CommonTypes.h:56
constexpr SizeF()
Definition CommonTypes.h:55
bool operator==(const SizeF &other)
double height
Definition CommonTypes.h:60
double width
Definition CommonTypes.h:59
Describes a two-dimensional size with a width and a height.
Definition CommonTypes.h:40
size_t height
Definition CommonTypes.h:46
size_t width
Definition CommonTypes.h:45
constexpr Size(size_t width, size_t height)
Definition CommonTypes.h:42
bool operator==(const Size &other)
Definition CommonTypes.h:43
constexpr Size()
Definition CommonTypes.h:41