SBSDK 3.3.5
Polyga’s SB SDK is a set of programmable API’s that allow users to directly communicate and control any of Polyga’s 3D scanners using C++, C# or Command line.
SBData.h
Go to the documentation of this file.
1
10#pragma once
11#pragma warning( disable : 4251)
12
13#include "SBSDK_API.h"
14#include "SBTypes.h"
15#include <memory>
16#include <vector>
17
18
19
20
21namespace PLG {
22 struct PLGImage;
23 struct PLGMesh;
24 struct PLGCalib;
25 struct PLGScan;
26}
27
28
29namespace SBSDK3
30{
36 {
37 public:
44
50 virtual ~SBImage();
55 uint32_t width();
60 uint32_t height();
65 size_t size();
70 uint32_t bytePerPixel();
75 uint8_t* data();
76
83
90 bool save(const char* fileName);
91
92 std::shared_ptr<PLG::PLGImage> mpPLGImg;
93
94 private:
95 friend class USBScanner;
96 friend class Emulator;
97 friend class GigEScanner;
98 SBImage(std::shared_ptr<PLG::PLGImage> PLGImg, SBCameraIDEnums id);
99
101 };
108 {
109 public:
120 virtual ~SBImageList();
125 SBImage& operator [](int idx);
130 size_t size();
136 void push_back(SBImage& img);
141 void clear();
142
143 private:
144 std::vector<SBImage> images;
145 };
146
152 {
153 public:
159
164 virtual ~SBCalib();
165
172 void setText(const char* text, size_t size);
173
180 void setBinary(uint8_t* bin, size_t size);
181
186 void setZFilter(float zNear, float zFar);
187
192 void getZFilter(float& zNear, float& zFar);
193
198 void setCalibBoardSize(float boardSize);
199
205
211
216 uint8_t* getBinary();
217
222 bool save(const char* fileName);
223
228 bool load(const char* fileName);
229
234 bool exportXML(const char* fileName);
235
236
237 public:
238 std::shared_ptr<PLG::PLGCalib> mpPLGCalib;
239 //std::shared_ptr<PLGTextureCalib> mpPLGTextureCalib
240 };
241
248 {
249 public:
259 virtual ~SBScan();
266 bool save(const char* fileName);
273 bool load(const char* fileName);
278 uint32_t getNumImages();
286 void getCameraImages(int camIdx, SBImageList& imageList);
295
301 bool empty();
302
303 std::shared_ptr<PLG::PLGScan> mpPLGScan;
304 std::shared_ptr<PLG::PLGCalib> mpPLGCalib;
305 std::shared_ptr<PLG::PLGCalib> mpPLGTextureCalib;
306 };
307
315 friend class SBMesh;
316 private:
317 static const int MAT_SIZE = 16;
318 public:
324 SBTransform(const float mat[MAT_SIZE]);
330
331 float mMat[MAT_SIZE];
332 };
333
334
342 {
343 public:
353 virtual ~SBMesh();
366 void getVertices(SBVector* vertexArray);
379 void getNormals(SBVector* normalArray);
385 size_t getNumFaces();
393 void getFaces(SBFace* faceArray);
406 void getVertexColors(SBColor* colorArray);
407
412 size_t getNumUVs();
413
421 void getUVs(SBUv* uvArray);
422
431
438 bool save(const char* fileName);
445 bool applyTransform(const SBTransform& transform);
446
452 bool empty();
453
454 public:
455 std::shared_ptr<PLG::PLGMesh> mpPLGMesh;
458 };
459}
460
SBSDK API dll imports.
#define SBSDK_API
Definition: SBSDK_API.h:15
SBTypes Header File. Structure types and Class Enum types defining parameter options and device infor...
Stores and manages information related to the scanner calibration.
Definition: SBData.h:152
void setText(const char *text, size_t size)
set calibration by using xml text
uint8_t * getBinary()
get calibration data in binary format
void setBinary(uint8_t *bin, size_t size)
set calibration by using binary calibration data
bool load(const char *fileName)
load calibration data from the file
virtual ~SBCalib()
Class Decosntructor.
SBCalib()
Class Constructor.
size_t getBinarySize()
get size of the binary data size
void setCalibBoardSize(float boardSize)
set calibration board size
bool save(const char *fileName)
save calibration data to the file
void getZFilter(float &zNear, float &zFar)
get z filter value
void setZFilter(float zNear, float zFar)
set z filter value
float getCalibBoardSize()
get calibration board size
bool exportXML(const char *fileName)
export binary data in xml format
std::shared_ptr< PLG::PLGCalib > mpPLGCalib
Definition: SBData.h:238
Contains Image and properties.
Definition: SBData.h:36
virtual ~SBImage()
Class Deconstructor.
uint32_t height()
Returns height of the image.
std::shared_ptr< PLG::PLGImage > mpPLGImg
Definition: SBData.h:92
uint8_t * data()
Returns byte data afrray of the image.
size_t size()
Returns byte size of the image.
uint32_t bytePerPixel()
Returns number of bytes per pixel.
bool save(const char *fileName)
Save file to disk. Returns if success.
SBImage()
Default Constructor. SBImage Default Constructor.
SBCameraIDEnums CameraID()
Get camera ID.
uint32_t width()
Returns width of the image.
SBImage Container.
Definition: SBData.h:108
size_t size()
Returns size of the SBImage vector.
virtual ~SBImageList()
Class Deconstructor. Override to modify the behavior once an instance is deleted.
void push_back(SBImage &img)
Appends an element to the list.
void clear()
Clears contents of SBImage vector.
SBImageList()
Default Constructor.
Mesh Class Definition. SBMesh contains the information related to the vertices and vaces,...
Definition: SBData.h:342
void getVertexColors(SBColor *colorArray)
Returns the number of vertex color values in the mesh.
bool empty()
Returns if it is empty Returns true if it is empty.
bool applyTransform(const SBTransform &transform)
Apply transform to the mesh. Returns if success.
void getNormals(SBVector *normalArray)
Returns the number of normals in the mesh.
SBImage mVImage
Definition: SBData.h:457
SBMesh()
Default class constructor.
size_t getNumVertices()
Returns the number of vertices in the mesh.
void getUVs(SBUv *uvArray)
Returns the number of UVs in the mesh.
std::shared_ptr< PLG::PLGMesh > mpPLGMesh
Definition: SBData.h:455
bool getTextureImage(SBImage &img)
Returns the texture images.
void getVertices(SBVector *vertexArray)
Returns the number of vertices in the mesh.
bool save(const char *fileName)
Save mesh to disk. Returns if success. Supported Formats:
size_t getNumFaces()
Returns the number of faces in the mesh.
virtual ~SBMesh()
Default class deconstructor.
SBImage mTextureImage
Definition: SBData.h:456
size_t getNumNormals()
Returns the number of normals in the mesh.
size_t getNumVertexColors()
Returns the number of vertex color.
void getFaces(SBFace *faceArray)
Returns the number of faces in the mesh.
size_t getNumUVs()
Returns the number of uv.
Class containing scan Images and accessing functions.
Definition: SBData.h:248
bool save(const char *fileName)
Save .pbs file to disk. Returns if success.
uint32_t getNumImages()
Returns the number of images taken for the scan.
virtual ~SBScan()
Class Decosntructor.
std::shared_ptr< PLG::PLGScan > mpPLGScan
Definition: SBData.h:303
std::shared_ptr< PLG::PLGCalib > mpPLGTextureCalib
Definition: SBData.h:305
bool getTextureImage(SBImage &img)
Returns the texture images corresponding the given camera id.
bool load(const char *fileName)
Load .pbs file from disk. Returns if success.
SBScan()
Class Constructor.
std::shared_ptr< PLG::PLGCalib > mpPLGCalib
Definition: SBData.h:304
bool empty()
Returns if it is empty Returns true if it is empty.
void getCameraImages(int camIdx, SBImageList &imageList)
Returns the images corresponding the given camera id.
Transform Class Definition. SBTransform contains the transformation matrix.
Definition: SBData.h:314
~SBTransform()
Default class destructor.
SBTransform(const float mat[MAT_SIZE])
Class Constructor.
Definition: SBData.h:21
Definition: ISBScanner.h:20
SBCameraIDEnums
Definition: SBTypes.h:127
RGBA color structure.
Definition: SBTypes.h:203
Contains vector indexes defining a mesh face.
Definition: SBTypes.h:215
Definition: SBTypes.h:193
3 Dimensional Vector
Definition: SBTypes.h:182