ImagingTools Core SDK
IPointsBasedObject.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// STD includes
6
7#ifdef __GNUC__
8 #include <mm_malloc.h>
9#endif
10#ifdef __MINGW32__
11 #include <mm_malloc.h>
12#endif
13#ifdef __MINGW64__
14 #include <mm_malloc.h>
15#endif
16
17
18// ImtCore includes
19#include <imt3d/IObject3d.h>
20
21
22namespace imt3d
23{
24
25
30{
31public:
32 enum ChangeFlags
33 {
34 CF_CREATE = 20000,
35 CF_APPEND
36 };
37
38 enum PointFormat
39 {
40 PF_XYZ_32 = 0, // 3 float point coordinates
41 PF_XYZ_64, // 3 double point coordinates
42 PF_XYZ_ABC_32, // position data (XYZ) and Euler angles (ABC) in radians, both as 32-bit float number
43 PF_XYZW_32, // 4 float point coordinates (homogeneous point coordinates)
44 PF_XYZW_NORMAL_CURVATURE_32, // 4 float point coordinates + 4 float normal coordinates + 4 float curvature
45 PF_XYZW_NORMAL_RGBA_32, // 4 float point coordinates + 4 float normal coordinates + color information as 32-bit float number
46 PF_XYZW_RGBA_32, // 4 float point coordinates + color information as 32-bit float number
47 PF_UNDEFINED
48 };
49
50 I_DECLARE_ENUM(PointFormat, PF_XYZ_32, PF_XYZ_64, PF_XYZ_ABC_32, PF_XYZW_32, PF_XYZW_NORMAL_CURVATURE_32, PF_XYZW_NORMAL_RGBA_32, PF_XYZW_RGBA_32, PF_UNDEFINED);
51
52#ifdef _MSC_VER
53#pragma warning(push)
54#pragma warning(disable : 4324)
55#endif
56 template <typename CoordinateType, int AlignSize, int ... InitValues>
57 struct alignas(AlignSize) Point
58 {
59 CoordinateType data[sizeof...(InitValues)] = { InitValues... };
60
61 void* operator new(size_t size){ return _mm_malloc(size, AlignSize); }
62 void *operator new[](size_t size){ return _mm_malloc(size, AlignSize); }
63 void operator delete(void* ptr){ _mm_free(ptr); }
64 void operator delete[](void* ptr){ _mm_free(ptr); }
65 };
66#ifdef _MSC_VER
67#pragma warning(pop)
68#endif
69
70 typedef Point<float, 16, 0, 0, 0> PointXyz32;
71 typedef Point<double, 32, 0, 0, 0> PointXyz64;
72 typedef Point<float, 16, 0, 0, 0, 0, 0, 0> PointXyzAbc32;
73 typedef Point<float, 16, 0, 0, 0, 1> PointXyzw32;
74 typedef Point<float, 16, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0> PointXyzwNormal32;
75 typedef Point<float, 16, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0> PointXyzwNormalRgba32;
76 typedef Point<float, 16, 0, 0, 0, 1, 0, 1, 0, 1> PointXyzwRgba32;
77
81 virtual PointFormat GetPointFormat() const = 0;
82
86 virtual int GetPointsCount() const = 0;
87
91 virtual void* GetPointData(int pointIndex) = 0;
92
96 virtual const void* GetPointData(int pointIndex) const = 0;
97
101 virtual void* GetData() = 0;
102
106 virtual const void* GetData() const = 0;
107
111 virtual int GetPointBytesSize() const = 0;
112};
113
114
115} // namespace imt3d
116
117
virtual PointFormat GetPointFormat() const =0
virtual const void * GetPointData(int pointIndex) const =0
virtual void * GetData()=0
virtual int GetPointsCount() const =0
virtual int GetPointBytesSize() const =0
virtual void * GetPointData(int pointIndex)=0
virtual const void * GetData() const =0