Artec 3D Scanning SDK  2.0
ICompositeContainer.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: Container for sequence of composite meshes
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 #ifndef _ICOMPOSITECONTAINER_H_
11 #define _ICOMPOSITECONTAINER_H_
12 
13 #include <artec/sdk/base/Errors.h>
15 #include <artec/sdk/base/IRef.h>
16 #include <artec/sdk/base/Matrix.h>
17 
18 namespace artec { namespace sdk { namespace base
19 {
20 
21 class IBlob;
22 class ICompositeMesh;
23 class ICompositeContainer;
24 
25 extern "C"
26 {
27  /**
28  * Create new CompositeContainer
29  * @param pContainer - destination CompositeContainer
30  *
31  * @return
32  * error code
33  */
34  ErrorCode ABASESDK_LINK_SPEC createCompositeContainer(ICompositeContainer** pContainer);
35 
36  /**
37  * Clone all CompositeContainer content
38  * @param out - destination CompositeContainer
39  * @param in - CompositeContainer to take elements from
40  *
41  * @return
42  * error code
43  */
44  ErrorCode ABASESDK_LINK_SPEC cloneCompositeContainer(ICompositeContainer* out, const ICompositeContainer* in);
45 }
46 
47 /**
48 * @brief Collection of composite meshes with attributes
49 *
50 * @details CompositeContainer is a collection (container) of composites with its own transformation and
51 * additional information (container attributes).
52 * Each composite consists of composite mesh, transformation matrix and composite-mesh attributes.
53 * @nosubgrouping
54 */
55 class ICompositeContainer : public IRef
56 {
57 public:
58  /// @{ @name Scan-element operations
59 
60  /// @{ @brief Access container element (composite mesh) by index.
61  /// @details Index must be in range [0, getSize()-1]. Replacing frame mesh at index position
62  /// using setElement() will not affect transformation matrix and attributes
63  virtual ICompositeMesh* getElement(int index) const = 0;
64  virtual ErrorCode setElement(int index, ICompositeMesh* mesh) = 0;
65  /// @}
66 
67  /// @{ @brief Add/remove composite to container.
68  /// @details Transformation matrix is identity by default.
69  virtual ErrorCode add(ICompositeMesh* mesh) = 0;
70  virtual ErrorCode add(ICompositeMesh* mesh, const Matrix4x4D& transformMatrix, IBlob* meshAttributes = NULL) = 0;
71  virtual ErrorCode remove(int index) = 0;
72  /// @}
73 
74  /// @{ @brief Access composite mesh orientation by index.
75  /// @details Index must be in range [0, getSize()-1]. Replacing transformation matrix at index position
76  /// using setTransformation() will not affect composite mesh and attributes.
77  /// Matrix with zero elements will be returned if element index is out of range.
78  virtual const Matrix4x4D& getTransformation(int index) const = 0;
79  virtual ErrorCode setTransformation(int index, const Matrix4x4D& transformMatrix) = 0;
80  /// @}
81 
82  /// @{ @brief Access composite mesh attributes by index.
83  /// @details Index must be in range [0, getSize()-1]. Replacing the attributes at index position
84  /// using setAttributes() will not affect composite mesh and transformation matrix
85  virtual IBlob* getAttributes(int index) const = 0;
86  virtual ErrorCode setAttributes(int index, IBlob* attributes) = 0;
87  /// @}
88 
89  /// @}
90  /// @{ @name Container-attribute operations
91 
92  /// @{ Access container transformation
93  virtual const Matrix4x4D& getContainerTransformation() const = 0;
94  virtual void setContainerTransformation(const Matrix4x4D& transformMatrix) = 0;
95  /// @}
96 
97  /// @{ Access container attributes
98  virtual IBlob* getContainerAttributes() const = 0;
99  virtual void setContainerAttributes(IBlob* attributes) = 0;
100  /// @}
101 
102  /// @}
103  /// @{ @name General container operations
104 
105  /// Get element number in container
106  virtual int getSize() const = 0;
107 
108  /// Delete all container elements
109  virtual void clear() = 0;
110 
111  /// @}
112 };
113 
114 } } } // namespace artec::sdk::base
115 
116 #endif // _ICOMPOSITECONTAINER_H_
virtual ErrorCode setAttributes(int index, IBlob *attributes)=0
Access composite mesh attributes by index.
virtual int getSize() const =0
Get element number in container.
ErrorCode ABASESDK_LINK_SPEC cloneCompositeContainer(ICompositeContainer *out, const ICompositeContainer *in)
Clone all CompositeContainer content.
Transformation matrix.
Definition: Matrix.h:26
virtual IBlob * getContainerAttributes() const =0
Access container attributes.
virtual const Matrix4x4D & getTransformation(int index) const =0
Access composite mesh orientation by index.
virtual void setContainerAttributes(IBlob *attributes)=0
Access container attributes.
virtual ErrorCode add(ICompositeMesh *mesh)=0
Add/remove composite to container.
ErrorCode ABASESDK_LINK_SPEC createCompositeContainer(ICompositeContainer **pContainer)
Create new CompositeContainer.
virtual ICompositeMesh * getElement(int index) const =0
Access container element (composite mesh) by index.
virtual void clear()=0
Delete all container elements.
virtual const Matrix4x4D & getContainerTransformation() const =0
Access container transformation.
virtual void setContainerTransformation(const Matrix4x4D &transformMatrix)=0
Access container transformation.
Interface for Binary Large Object (memory chunk) with smart reference counting.
Definition: IBlob.h:35
virtual IBlob * getAttributes(int index) const =0
Access composite mesh attributes by index.
Indexed triangle mesh with optional unwrapped textures.
virtual ErrorCode setTransformation(int index, const Matrix4x4D &transformMatrix)=0
Access composite mesh orientation by index.
Collection of composite meshes with attributes.
#define ABASESDK_LINK_SPEC
virtual ErrorCode setElement(int index, ICompositeMesh *mesh)=0
Access container element (composite mesh) by index.
Interface that implements reference counting and life-time management.
Definition: IRef.h:22