GoPxL SDK

- Home
- Files
- Namespace

GoGdpMesh.h
Go to the documentation of this file.
1
9 #ifndef GO_PXL_SDK_GOGDPMESH_H
10 #define GO_PXL_SDK_GOGDPMESH_H
11
12 #include <GoPxLSdk/GoGdpMsg/GoGdpMsg.h>
13
14 class GoGdpMsgTests;
15
16 namespace GoPxLSdk
17 {
18 enum Channel_ID
19 {
20 ID_Vertex = 0,
21 ID_Facet = 1,
22 ID_Facet_normal = 2,
23 ID_Vertex_normal = 3,
24 ID_Vertex_texture = 4,
25 ID_Vertex_curvature = 5,
26 };
27
28 enum Channel_Type
29 {
30 Type_Invalid = 0,
31 Type_Vertex = 1,
32 Type_Facet = 2,
33 Type_Facet_normal = 3,
34 Type_Vertex_normal = 4,
35 Type_Vertex_texture = 5,
36 Type_Vertex_curvature = 6
37 };
38
39 enum Channel_State
40 {
41 Error = 0,
42 Unallocated = 1,
43 Allocated = 2,
44 Empty = 3,
45 Partial_used = 4,
46 Full = 5
47 };
48
49 typedef struct GoFacet32u
50 {
51 k32u vertex1;
52 k32u vertex2;
53 k32u vertex3;
54 } GoFacet32u;
55
56 struct MeshMsgChannel
57 {
58 k32u id;
59 k32u type;
60 k32s state;
61 k32u flag;
62 kSize allocatedCount;
63 kSize usedCount;
64 std::vector<std::shared_ptr<void>> buffer;
65
66 MeshMsgChannel() = default;
67 MeshMsgChannel(k32s id, k32u type, k32s state, k32u flag, kSize allocatedCount, kSize usedCount, std::vector<std::shared_ptr<void>> buffer) :
68 id(id), type(type), state(state), flag(flag), allocatedCount(allocatedCount), usedCount(usedCount), buffer(buffer)
69 {
70
71 }
72 };
73
74 class GoPxLSdkClass GoGdpMesh : public GoGdpMsg
75 {
76 public:
83 GoGdpMesh();
84 ~GoGdpMesh() = default;
85
94 void Deserialize(kSerializer serializer) override;
95
103 const bool HasData() const;
104
112 const kSize SystemChannelCount() const;
113
121 const kSize MaxUserChannelCount() const;
122
130 const kSize UserChannelCount() const;
131
139 const kSize ChannelCount() const;
140
148 const kPoint3d64f Offset() const;
149
157 const kPoint3d64f Range() const;
158
167 const Channel_Type ChannelType(size_t id) const;
168
177 const Channel_State ChannelState(size_t id) const;
178
188 const k32u ChannelFlag(size_t id) const;
189
200 const kSize AllocatedChannelDataCount(size_t id) const;
201
208 const kSize UsedChannelDataCount(size_t id) const;
209
216 const std::vector<std::shared_ptr<void>>& ChannelData(size_t id) const;
217
218 private:
219 bool hasData = false;
220 kSize systemChannelCount = 0;
221 kSize maxUserChannelCount = 0;
222 kSize userChannelCount = 0;
223 kSize channelCount = 0;
224 kPoint3d64f offset = { 0.0 };
225 kPoint3d64f range = { 0.0 };
226 std::vector<MeshMsgChannel> channels;
227
228 friend class ::GoGdpMsgTests;
229
230 };
231
232 }
233
234 #endif
235
GoPxLSdk::Channel_Type
Channel_Type
Definition: GoGdpMesh.h:28
GoPxLSdkClass
#define GoPxLSdkClass
Definition: Def.h:35
GoPxLSdk::Error
Definition: GoGdpMesh.h:41
GoFacet32u::vertex2
k32u vertex2
Definition: GoGdpMesh.h:52
GoPxLSdk::ID_Vertex_curvature
Definition: GoGdpMesh.h:25
GoPxLSdk::Partial_used
Definition: GoGdpMesh.h:45
GoPxLSdk::MeshMsgChannel
Definition: GoGdpMesh.h:56
GoPxLSdk::MeshMsgChannel::usedCount
kSize usedCount
Definition: GoGdpMesh.h:63
GoPxLSdk::Type_Vertex_texture
Definition: GoGdpMesh.h:35
GoPxLSdk::Type_Vertex_curvature
Definition: GoGdpMesh.h:36
GoPxLSdk::MeshMsgChannel::flag
k32u flag
Definition: GoGdpMesh.h:61
GoPxLSdk::Allocated
Definition: GoGdpMesh.h:43
GoPxLSdk::MeshMsgChannel::MeshMsgChannel
MeshMsgChannel(k32s id, k32u type, k32s state, k32u flag, kSize allocatedCount, kSize usedCount, std::vector< std::shared_ptr< void >> buffer)
Definition: GoGdpMesh.h:67
GoPxLSdk::MeshMsgChannel::buffer
std::vector< std::shared_ptr< void > > buffer
Definition: GoGdpMesh.h:64
GoPxLSdk::MeshMsgChannel::id
k32u id
Definition: GoGdpMesh.h:58
GoPxLSdk::Channel_ID
Channel_ID
Definition: GoGdpMesh.h:18
GoPxLSdk::MeshMsgChannel::MeshMsgChannel
MeshMsgChannel()=default
GoGdpMsg.h
GoPxLSdk::MeshMsgChannel::type
k32u type
Definition: GoGdpMesh.h:59
GoPxLSdk::MeshMsgChannel::allocatedCount
kSize allocatedCount
Definition: GoGdpMesh.h:62
GoPxLSdk::Type_Invalid
Definition: GoGdpMesh.h:30
GoPxLSdk::ID_Vertex_normal
Definition: GoGdpMesh.h:23
GoPxLSdk::Empty
Definition: GoGdpMesh.h:44
GoPxLSdk::Unallocated
Definition: GoGdpMesh.h:42
GoPxLSdk::Channel_State
Channel_State
Definition: GoGdpMesh.h:39
GoPxLSdk::ID_Vertex
Definition: GoGdpMesh.h:20
GoPxLSdk::GoGdpMesh
Definition: GoGdpMesh.h:74
GoPxLSdk::Type_Facet_normal
Definition: GoGdpMesh.h:33
GoFacet32u::vertex3
k32u vertex3
Definition: GoGdpMesh.h:53
GoPxLSdk::Type_Vertex_normal
Definition: GoGdpMesh.h:34
GoFacet32u::vertex1
k32u vertex1
Definition: GoGdpMesh.h:51
GoPxLSdk::MeshMsgChannel::state
k32s state
Definition: GoGdpMesh.h:60
GoPxLSdk
Definition: Def.h:46
GoPxLSdk::ID_Facet_normal
Definition: GoGdpMesh.h:22
GoPxLSdk::ID_Facet
Definition: GoGdpMesh.h:21
GoPxLSdk::Full
Definition: GoGdpMesh.h:46
GoFacet32u
Definition: GoGdpMesh.h:49
GoPxLSdk::GoGdpMsg
Definition: GoGdpMsg.h:37
GoPxLSdk::Type_Facet
Definition: GoGdpMesh.h:32
GoPxLSdk::ID_Vertex_texture
Definition: GoGdpMesh.h:24
GoPxLSdk::Type_Vertex
Definition: GoGdpMesh.h:31