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 class IScan : public IRef
70 {
71  /*
72  * This is a scanned frame container with transformation and some
73  * additional information on each surface
74  */
75 public:
76  // Element operations
77 
78  /// Element access. Index must be in range [0...getSize())
79  virtual IFrameMesh* getElement(int index) const = 0;
80  virtual ErrorCode setElement(int index, IFrameMesh* mesh) = 0;
81 
82  /// Add/remove frame to scan
83  virtual ErrorCode add(IFrameMesh* frame) = 0;
84  virtual ErrorCode add(IFrameMesh* frame, const Matrix4x4D& matrix, IBlob* frameAttributes = NULL) = 0;
85  virtual ErrorCode remove(int index) = 0;
86 
87  /// Access frame orientation by index
88  /// Matrix with zero elements will be returned for invalid element index
89  virtual const Matrix4x4D& getTransformation(int index) const = 0;
90  virtual ErrorCode setTransformation(int index, const Matrix4x4D& m) = 0;
91 
92  /// Get frame attributes by index
93  virtual IBlob* getAttributes(int index) const = 0;
94  virtual ErrorCode setAttributes(int index, IBlob* attributes) = 0;
95 
96 
97  // Scan operations
98 
99  /// Get the data origin device type
100  virtual ScannerType getScannerType() const = 0;
101 
102  /// Get scan transformation
103  virtual const Matrix4x4D& getScanTransformation() const = 0;
104  virtual void setScanTransformation(const Matrix4x4D& m) = 0;
105 
106  /// Get scan attributes by index
107  virtual IBlob* getScanAttributes() const = 0;
108  virtual void setScanAttributes(IBlob* attributes) = 0;
109 
110  /// Access matrix for texture mapping
111  virtual const Matrix3x4D& getTextureMappingMatrix() const = 0;
112  virtual void setTextureMappingMatrix(const Matrix3x4D& m) = 0;
113 
114 
115  // Container operations
116 
117  /// Get elements number in scan
118  virtual int getSize() const = 0;
119 
120  /// Delete all scan elements
121  virtual void clear() = 0;
122 };
123 
124 } } } // namespace artec::sdk::base
125 
126 #endif // _ISCAN_H_
ErrorCode ABASESDK_LINK_SPEC cloneScan(IScan *out, const IScan *in)
virtual IBlob * getScanAttributes() const =0
Get scan attributes by index.
virtual IFrameMesh * getElement(int index) const =0
Element access. Index must be in range [0...getSize())
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 data origin device type.
virtual ErrorCode add(IFrameMesh *frame)=0
Add/remove frame to scan.
virtual IBlob * getAttributes(int index) const =0
Get frame attributes by index.
virtual int getSize() const =0
Get elements number in scan.
virtual void setScanTransformation(const Matrix4x4D &m)=0
virtual const Matrix4x4D & getTransformation(int index) const =0
virtual const Matrix3x4D & getTextureMappingMatrix() const =0
Access matrix for texture mapping.
virtual ErrorCode setElement(int index, IFrameMesh *mesh)=0
virtual const Matrix4x4D & getScanTransformation() const =0
Get scan transformation.
virtual ErrorCode setTransformation(int index, const Matrix4x4D &m)=0
ErrorCode ABASESDK_LINK_SPEC mergeToFrameMesh(IFrameMesh *mesh, const IScan *scanContainer, bool skipTextureData=true)
GenericMatrix< 3, 4, double > Matrix3x4D
Definition: Matrix.h:820
#define ABASESDK_LINK_SPEC
Definition: BaseSdkDefines.h:7
virtual ErrorCode setAttributes(int index, IBlob *attributes)=0
virtual void setTextureMappingMatrix(const Matrix3x4D &m)=0
virtual void setScanAttributes(IBlob *attributes)=0