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 
19 namespace artec { namespace sdk { namespace base
20 {
21 
22 class IFrameMesh;
23 class IScan;
24 class IBlob;
25 
26 extern "C"
27 {
28  /**
29  * Create new Scan
30  * @param pContainer - destination Scan
31  * @param scannerType - use ScannerType_Unknown as unknown scanner type
32  * @param textureMappingMatrix - matrix for texture coordinates calculation
33  *
34  * @return
35  * error code
36  */
37  ErrorCode ABASESDK_LINK_SPEC createScan(IScan** pContainer, ScannerType scannerType = ScannerType_Unknown,
38  const Matrix3x4D* textureMappingMatrix = NULL);
39 
40  /**
41  * Accumulates all meshes from a the given IScan to given IFrameMesh
42  * coordinates are transformed according current scan and frame transformation matrices
43  */
44  ErrorCode ABASESDK_LINK_SPEC mergeToFrameMesh(IFrameMesh *mesh, const IScan *scanContainer, bool skipTextureData = true);
45 
46  /**
47  * clone all Scan content
48  * @param out - destination Scan
49  * @param in - Scan to take elements from
50  *
51  * @return
52  * error code
53  */
54  ErrorCode ABASESDK_LINK_SPEC cloneScan(IScan* out, const IScan* in);
55 
56  /**
57  * Creates Scan with identical attributes
58  * @param out New Scan
59  * @param in Scan to copy attributes from
60  *
61  * @note The shallow(!) copy of attributes takes place here.
62  *
63  * @return
64  * error code
65  */
66  ErrorCode ABASESDK_LINK_SPEC createSimilarScan( IScan** out, const IScan* attributesPattern );
67 }
68 
69 /**
70 * @brief Collection of reconstructed frame meshes with attributes
71 *
72 * @details Scan is a collection (container) of reconstructed frames with its own transformation and
73 * additional information (scan attributes).
74 * Each reconstructed frame consists of frame mesh, transformation matrix and frame-mesh attributes.
75 * @nosubgrouping
76 */
77 class IScan : public IRef
78 {
79 public:
80  /// @{ @name Scan-element operations
81 
82  /// @{ @brief Access container element (frame mesh) by index.
83  /// @details Index must be in range [0, getSize()-1]. Replacing frame mesh at index position
84  /// using setElement() will not affect transformation matrix and attributes.
85  virtual IFrameMesh* getElement(int index) const = 0;
86  virtual ErrorCode setElement(int index, IFrameMesh* mesh) = 0;
87  /// @}
88 
89  /// @{ @brief Add/remove reconstructed frame to scan.
90  /// @details Transformation matrix is identity by default.
91  virtual ErrorCode add(IFrameMesh* frame) = 0;
92  virtual ErrorCode add(IFrameMesh* frame, const Matrix4x4D& matrix, IBlob* frameAttributes = NULL) = 0;
93  virtual ErrorCode remove(int index) = 0;
94  /// @}
95 
96  /// @{ @brief Access frame-mesh orientation by index.
97  /// @details Index must be in range [0, getSize()-1]. Replacing transformation matrix at index position
98  /// using setTransformation() will not affect frame mesh and attributes.
99  /// Matrix with zero elements will be returned if element index is out of range.
100  virtual const Matrix4x4D& getTransformation(int index) const = 0;
101  virtual ErrorCode setTransformation(int index, const Matrix4x4D& m) = 0;
102  /// @}
103 
104  /// @{ Access frame attributes. Index must be in range [0, getSize()-1]
105  virtual IBlob* getAttributes(int index) const = 0;
106  virtual ErrorCode setAttributes(int index, IBlob* attributes) = 0;
107  /// @}
108 
109  /// @}
110  /// @{ @name Scan-attribute operations
111 
112  /// @{ Get the device type the frames come from
113  virtual ScannerType getScannerType() const = 0;
114  /// @}
115 
116  /// @{ Access scan transformation
117  virtual const Matrix4x4D& getScanTransformation() const = 0;
118  virtual void setScanTransformation(const Matrix4x4D& m) = 0;
119  /// @}
120 
121  /// @{ Access scan attributes
122  virtual IBlob* getScanAttributes() const = 0;
123  virtual void setScanAttributes(IBlob* attributes) = 0;
124  /// @}
125 
126  /// @{ Access matrix for texture mapping
127  virtual const Matrix3x4D& getTextureMappingMatrix() const = 0;
128  virtual void setTextureMappingMatrix(const Matrix3x4D& m) = 0;
129  /// @}
130 
131  /// @}
132  /// @{ @name General container operations
133 
134  /// Get elements number in scan
135  virtual int getSize() const = 0;
136 
137  /// Delete all scan elements
138  virtual void clear() = 0;
139 
140  /// @}
141 };
142 
143 } } } // namespace artec::sdk::base
144 
145 #endif // _ISCAN_H_
ErrorCode ABASESDK_LINK_SPEC cloneScan(IScan *out, const IScan *in)
virtual IBlob * getScanAttributes() const =0
Access scan attributes.
virtual IFrameMesh * getElement(int index) const =0
Access container element (frame mesh) by index.
ErrorCode ABASESDK_LINK_SPEC createScan(IScan **pContainer, ScannerType scannerType=ScannerType_Unknown, const Matrix3x4D *textureMappingMatrix=NULL)
virtual void clear()=0
Delete all scan elements.
ErrorCode ABASESDK_LINK_SPEC createSimilarScan(IScan **out, const IScan *attributesPattern)
virtual ScannerType getScannerType() const =0
Get the device type the frames come from.
virtual ErrorCode add(IFrameMesh *frame)=0
Add/remove reconstructed frame to scan.
virtual IBlob * getAttributes(int index) const =0
Access frame attributes. Index must be in range [0, getSize()-1].
virtual int getSize() const =0
Get elements number in scan.
virtual void setScanTransformation(const Matrix4x4D &m)=0
Access scan transformation.
virtual const Matrix4x4D & getTransformation(int index) const =0
Access frame-mesh orientation by index.
virtual const Matrix3x4D & getTextureMappingMatrix() const =0
Access matrix for texture mapping.
virtual ErrorCode setElement(int index, IFrameMesh *mesh)=0
Access container element (frame mesh) by index.
virtual const Matrix4x4D & getScanTransformation() const =0
Access scan transformation.
Collection of reconstructed frame meshes with attributes.
Definition: IScan.h:77
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)
GenericMatrix< 3, 4, double > Matrix3x4D
Definition: Matrix.h:794
#define ABASESDK_LINK_SPEC
Definition: BaseSdkDefines.h:7
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.