Artec 3D Scanning SDK  2.0
IScan.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: Container for sequence of scanned frames
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 #ifndef _ISCAN_H_
11 #define _ISCAN_H_
12 
14 #include <artec/sdk/base/Errors.h>
15 #include <artec/sdk/base/IRef.h>
16 #include <artec/sdk/base/Matrix.h>
18 #include <artec/sdk/base/Uuid.h>
19 
20 namespace artec { namespace sdk { namespace base
21 {
22 
23 class IFrameMesh;
24 class IScan;
25 class IBlob;
26 
27 extern "C"
28 {
29  /**
30  * Create new Scan with given name and new uuid
31  * @param pContainer - destination Scan
32  * @param scannerType - use ScannerType_Unknown as unknown scanner type
33  * @param textureMappingMatrix - matrix for texture coordinate calculation
34  * @param name - new scan name
35  *
36  * @return
37  * error code
38  */
39  ErrorCode ABASESDK_LINK_SPEC createScan(IScan** pContainer, ScannerType scannerType = ScannerType_Unknown,
40  const Matrix3x4D* textureMappingMatrix = NULL, const wchar_t* name = NULL);
41 
42  /**
43  * Accumulates all meshes from the given IScan to the given IFrameMesh.
44  * Coordinates are transformed according to the current scan and frame transformation matrices
45  */
46  ErrorCode ABASESDK_LINK_SPEC mergeToFrameMesh(IFrameMesh *mesh, const IScan *scanContainer, bool skipTextureData = true);
47 
48  /**
49  * Clone all Scan content, except name and uuid
50  * @param out - Destination Scan
51  * @param in - Scan to take elements from
52  *
53  * @return
54  * error code
55  */
56  ErrorCode ABASESDK_LINK_SPEC cloneScan(IScan* out, const IScan* in);
57 
58  /**
59  * Create Scan with identical attributes, new scan has empty name and new uuid
60  * @param out New Scan
61  * @param in Scan to copy attributes from
62  *
63  * @note It copies only attributes, not the data.
64  *
65  * @return
66  * error code
67  */
68  ErrorCode ABASESDK_LINK_SPEC createSimilarScan( IScan** out, const IScan* attributesPattern );
69 }
70 
71 /**
72 * @brief Collection of reconstructed frame meshes with attributes
73 *
74 * @details Scan is a collection (container) of reconstructed frames with its own transformation and
75 * additional information (scan attributes).
76 * Each reconstructed frame consists of frame mesh, transformation matrix and frame-mesh attributes.
77 * @nosubgrouping
78 */
79 class IScan : public IRef
80 {
81 public:
82  /// @{ @name Scan-element operations
83 
84  /// @{ @brief Access container element (frame mesh) by index.
85  /// @details Index must be in range [0, getSize()-1]. Replacing frame mesh at index position
86  /// using setElement() will not affect transformation matrix and attributes.
87  virtual IFrameMesh* getElement(int index) const = 0;
88  virtual ErrorCode setElement(int index, IFrameMesh* mesh) = 0;
89  /// @}
90 
91  /// @{ @brief Add/remove reconstructed frame to scan.
92  /// @details Transformation matrix is identity by default.
93  virtual ErrorCode add(IFrameMesh* frame) = 0;
94  virtual ErrorCode add(IFrameMesh* frame, const Matrix4x4D& matrix, IBlob* frameAttributes = NULL) = 0;
95  virtual ErrorCode remove(int index) = 0;
96  /// @}
97 
98  /// @{ @brief Access frame-mesh orientation by index.
99  /// @details Index must be in range [0, getSize()-1]. Replacing transformation matrix at index position
100  /// using setTransformation() will not affect frame mesh and attributes.
101  /// Matrix with zero elements will be returned if an element index is out of range.
102  virtual const Matrix4x4D& getTransformation(int index) const = 0;
103  virtual ErrorCode setTransformation(int index, const Matrix4x4D& m) = 0;
104  /// @}
105 
106  /// @{ Access frame attributes. Index must be in range [0, getSize()-1]
107  virtual IBlob* getAttributes(int index) const = 0;
108  virtual ErrorCode setAttributes(int index, IBlob* attributes) = 0;
109  /// @}
110 
111  /// @}
112  /// @{ @name Scan-attribute operations
113 
114  /// @{ Get the device type that produces the frames
115  virtual ScannerType getScannerType() const = 0;
116  /// @}
117 
118  /// @{ Access scan transformation
119  virtual const Matrix4x4D& getScanTransformation() const = 0;
120  virtual void setScanTransformation(const Matrix4x4D& m) = 0;
121  /// @}
122 
123  /// @{ Access scan attributes
124  virtual IBlob* getScanAttributes() const = 0;
125  virtual void setScanAttributes(IBlob* attributes) = 0;
126  /// @}
127 
128  /// @{ Access matrix for texture mapping
129  virtual const Matrix3x4D& getTextureMappingMatrix() const = 0;
130  virtual void setTextureMappingMatrix(const Matrix3x4D& m) = 0;
131  /// @}
132 
133  /// @}
134  /// @{ @name General container operations
135 
136  /// Get elements number in scan
137  virtual int getSize() const = 0;
138 
139  /// Delete all scan elements
140  virtual void clear() = 0;
141 
142  /// @{ Access scan uuid
143  virtual const Uuid& getUuid() const = 0;
144  virtual void setUuid(const Uuid& uuid) = 0;
145  /// @}
146 
147  /// @{ Access scan name
148  virtual const wchar_t* getName() const = 0;
149  virtual void setName(const wchar_t* name) = 0;
150  /// @}
151 
152  /// @}
153 };
154 
155 } } } // namespace artec::sdk::base
156 
157 #endif // _ISCAN_H_
ErrorCode ABASESDK_LINK_SPEC cloneScan(IScan *out, const IScan *in)
Clone all Scan content, except name and uuid.
virtual const Matrix3x4D & getTextureMappingMatrix() const =0
Access matrix for texture mapping.
Transformation matrix.
Definition: Matrix.h:26
virtual const wchar_t * getName() const =0
Access scan name.
virtual void clear()=0
Delete all scan elements.
ErrorCode ABASESDK_LINK_SPEC createSimilarScan(IScan **out, const IScan *attributesPattern)
Create Scan with identical attributes, new scan has empty name and new uuid.
virtual const Matrix4x4D & getScanTransformation() const =0
Access scan transformation.
virtual void setName(const wchar_t *name)=0
Access scan name.
virtual ErrorCode add(IFrameMesh *frame)=0
Add/remove reconstructed frame to scan.
Indexed triangle mesh with optional texture.
Definition: IFrameMesh.h:42
virtual IBlob * getAttributes(int index) const =0
Access frame attributes. Index must be in range [0, getSize()-1].
virtual void setScanTransformation(const Matrix4x4D &m)=0
Access scan transformation.
virtual const Uuid & getUuid() const =0
Access scan uuid.
virtual IBlob * getScanAttributes() const =0
Access scan attributes.
virtual const Matrix4x4D & getTransformation(int index) const =0
Access frame-mesh orientation by index.
Matrix of unspecified size.
Definition: GenericMatrix.h:30
Interface for Binary Large Object (memory chunk) with smart reference counting.
Definition: IBlob.h:35
virtual void setUuid(const Uuid &uuid)=0
Get elements number in scan.
virtual ErrorCode setElement(int index, IFrameMesh *mesh)=0
Access container element (frame mesh) by index.
ErrorCode ABASESDK_LINK_SPEC createScan(IScan **pContainer, ScannerType scannerType=ScannerType_Unknown, const Matrix3x4D *textureMappingMatrix=NULL, const wchar_t *name=NULL)
Create new Scan with given name and new uuid.
virtual IFrameMesh * getElement(int index) const =0
Access container element (frame mesh) by index.
Collection of reconstructed frame meshes with attributes.
Definition: IScan.h:79
virtual ErrorCode setTransformation(int index, const Matrix4x4D &m)=0
Access frame-mesh orientation by index.
ErrorCode ABASESDK_LINK_SPEC mergeToFrameMesh(IFrameMesh *mesh, const IScan *scanContainer, bool skipTextureData=true)
Accumulates all meshes from the given IScan to the given IFrameMesh.
GenericMatrix< 3, 4, double > Matrix3x4D
Definition: Matrix.h:783
#define ABASESDK_LINK_SPEC
virtual int getSize() const =0
Get elements number in scan.
virtual ScannerType getScannerType() const =0
Get the device type that produces the frames.
Interface that implements reference counting and life-time management.
Definition: IRef.h:22
virtual ErrorCode setAttributes(int index, IBlob *attributes)=0
Access frame attributes. Index must be in range [0, getSize()-1].
virtual void setTextureMappingMatrix(const Matrix3x4D &m)=0
Access matrix for texture mapping.
virtual void setScanAttributes(IBlob *attributes)=0
Access scan attributes.