DAVID4 SDK  1.8.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ShapeFusionJsonRpc.h
1 //=============================================================================
2 // See License in Related Pages
3 //=============================================================================
4 
5 #pragma once
6 
7 #ifndef DAVID_SDK_SHAPE_FUSION_JSON_RPC_H
8 #define DAVID_SDK_SHAPE_FUSION_JSON_RPC_H
9 
10 #include "davidSDK/ClientJsonRpc.h"
11 #include <limits>
12 
13 namespace david {
14 
15 
16 //=============================================================================
17 // ShapeFusionJsonRpc
18 //=============================================================================
19 
20 /// Implements interface functions of IShapeFusion.
21 /// All calls are delegated to a JSON-RPC 2.0 client.
22 /// Example:
23 /// @include SimpleShapeFusion.cpp
25 {
26 public:
27  /// Constructor.
28  /// @param[in,out] client Valid pointer to client implementation.
30 
31  /// Destructor.
32  virtual ~ShapeFusionJsonRpc();
33 
34  // See IShapeFusion
35  virtual void ExportMesh(int meshID, const std::string& filename);
36 
37  // See IShapeFusion
38  virtual int ImportMesh(const std::string& filename);
39 
40  // See IShapeFusion
41  virtual int DuplicateMesh(int sourceMeshID);
42 
43  // See IShapeFusion
44  virtual void DeleteAllMeshes();
45 
46  // See IShapeFusion
47  virtual void DeleteMesh(int meshID);
48 
49  // See IShapeFusion
50  virtual void GetVertexPositions(std::vector<float>& positions, int meshID, enum CoordinateSystem coordinateSystem = WorldCoordinates);
51 
52  // See IShapeFusion
53  virtual void GetVertexQualities(std::vector<float>& qualities, int meshID);
54 
55  // See IShapeFusion
56  virtual void GetVertexNormals(std::vector<float>& normals, int meshID, enum CoordinateSystem coordinateSystem = WorldCoordinates);
57 
58  // See IShapeFusion
59  virtual void GetVertexTexCoords(std::vector<float>& texCoords, int meshID);
60 
61  // See IShapeFusion
62  virtual void GetTriangles(std::vector<int>& triangles, int meshID);
63 
64  // See IShapeFusion
65  virtual void GetTextureImageData(void* data, size_t dataSizeInBytes, int meshID, int submeshIndex=0);
66 
67  // See IShapeFusion
68  virtual bool GetTextureImageFormat(int& width, int& height, enum PixelFormat& pixelFormat, int meshID, int submeshIndex=0);
69 
70  // See IShapeFusion
71  virtual void SetTexture(const void* data, size_t dataSizeInBytes, int width, int height, enum PixelFormat pixelFormat, int meshID, int submeshIndex = 0);
72 
73  // See IShapeFusion
74  virtual void GetPose(double world_T_local[16], int meshID);
75 
76  // See IShapeFusion
77  virtual void SetPose(const double world_T_local[16], int meshID);
78 
79  // See IShapeFusion
80  virtual void Rotate(int meshID, enum TransformType transformType, double degrees);
81 
82  // See IShapeFusion
83  virtual void Translate(int meshID, enum TransformType transformType, double amount);
84 
85  // See IShapeFusion
86  virtual void ReduceMeshDensity(int meshID, float factor);
87 
88  // See IShapeFusion
89  virtual double AlignPairCoarse(int meshID1, int meshID2, const CoarseAlignParams &params);
90 
91  // See IShapeFusion
92  virtual void AlignPairFine(int meshID1, int meshID2, const FineAlignParams &params);
93 
94  // See IShapeFusion
95  virtual void AlignGlobalFine(const GlobalFineAlignParams &params);
96 
97  // See IShapeFusion
98  virtual int Fuse(int resolution, float holeSizeThresRel=1.f, int sharpness=1);
99 
100  // See IShapeFusion
101  virtual int CombineMeshes(const std::vector<int> &meshIDs);
102 
103  // See IShapeFusion
104  virtual std::vector<int> UncombineMeshes(int meshIDgroup);
105 
106  //-------------------------------------------------------------------------
107  /// @name Not implemented
108  /// @warning The following functions are not implemented!
109  /// @{
110  //-------------------------------------------------------------------------
111 
112  // See IShapeFusion
113  virtual void RemoveVerticesByVirtualCamMask(const std::vector<bool>& mask, int width, int height, double f, const double world_T_cam[16]);
114 
115  // See IShapeFusion
116  virtual void RemoveSelectedVertices(const std::vector<SubmeshVertexIndex>& selectedVertices, int meshID);
117 
118  // See IShapeFusion
119  virtual void InvertTriangleOrientation(int meshID);
120 
121  // See IShapeFusion
122  virtual int GetFuseResolution(double metricResolution, int maxResolution);
123 
124  // See IShapeFusion
125  virtual int NewMesh();
126 
127  // See IShapeFusion
128  virtual int GetSubmeshCount(int meshID);
129 
130  // See IShapeFusion
131  virtual void SetSubmeshCount(int count, int meshID);
132 
133  // See IShapeFusion
134  virtual void GetSubmeshBuffer(void* data, size_t size, enum SubmeshBufferType bufferType, int meshID, int submeshIndex);
135 
136  // See IShapeFusion
137  virtual void SetSubmeshBuffer(const void* data, size_t size, enum SubmeshBufferType bufferType, int meshID, int submeshIndex);
138 
139  // See IShapeFusion
140  virtual bool HasSubmeshBuffer(enum SubmeshBufferType bufferType, int meshID, int submeshIndex);
141 
142  // See IShapeFusion
143  virtual size_t GetSubmeshBufferSize(enum SubmeshBufferType bufferType, int meshID, int submeshIndex);
144 
145  // See IShapeFusion
146  virtual int GetSubmeshVertexCount(int meshID, int submeshIndex);
147 
148  // See IShapeFusion
149  virtual void SetSubmeshVertexCount(int vertexCount, int meshID, int submeshIndex);
150 
151  // See IShapeFusion
152  virtual int GetSubmeshTriangleCount(int meshID, int submeshIndex);
153 
154  // See IShapeFusion
155  virtual void SetSubmeshTriangleCount(int triangleCount, int meshID, int submeshIndex);
156 
157  /// @}
158 
159 private:
160  //-------------------------------------------------------------------------
161  // Private member variables
162  //-------------------------------------------------------------------------
163 
164  ClientJsonRpc* m_client; ///< Client implementation
165 };
166 
167 
168 } // namespace
169 
170 #endif // DAVID_SDK_SHAPE_FUSION_JSON_RPC_H