Artec 3D Scanning SDK  2.0
IModel.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: Model (simple container for scans and composite meshes)
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 #ifndef _IMODEL_H_
11 #define _IMODEL_H_
12 
14 #include <artec/sdk/base/Errors.h>
15 #include <artec/sdk/base/IRef.h>
16 
17 namespace artec { namespace sdk { namespace base
18 {
19 
20 class IScan;
21 class ICompositeContainer;
22 class IModel;
23 
24 extern "C"
25 {
26  /**
27  * @brief Create new Model
28  * @param pContainer destination Model
29  * @return error code
30  */
31  ErrorCode ABASESDK_LINK_SPEC createModel(IModel** pContainer);
32 
33  /**
34  * @brief Create new Scans and CompositeContainer, but clone all content
35  * @param out Destination Model
36  * @param in Model to take elements from
37  * @return Error code
38  */
39  ErrorCode ABASESDK_LINK_SPEC cloneModel(IModel* out, const IModel* in);
40 
41  /**
42  * @brief Check for empty scan collection
43  * @param in Model to check
44  * @return True If all IScan-s in the IModel are empty.
45  */
46  bool ABASESDK_LINK_SPEC allScansInModelEmpty(const IModel* in);
47 
48  /**
49  * @brief Check for empty CompositeContainer
50  * @param in Model to check
51  * @return True If CompositeContainer in the IModel is empty.
52  */
54 }
55 
56 /**
57 * @brief Container of Scan(s) and a single CompositeContainer.
58 * @details A newly created Model is empty and contains neither Scans, nor CompositeContainer.
59 */
60 class IModel : public IRef
61 {
62 public:
63 
64  /** Element access.
65  *
66  * @param index Defines index of the existing element. It must be in the range of [0...getSize()].
67  * @return
68  * Pointer to the IScan instance at the index
69  */
70  virtual IScan* getElement(int index) const = 0;
71 
72  /** Sets an element at the specified index.
73  *
74  * @param index Specifies the index of an existing element. It must be in the range of [0...getSize()].
75  * @param scan Pointer to the IScan instance to replace value at the index.
76  * @return
77  * ErrorCode reporting success or error
78  */
79  virtual ErrorCode setElement(int index, IScan* scan) = 0;
80 
81  /** Add a new scan to the model.
82  *
83  * @param scan Pointer to the IScan instance to add.
84  * @return
85  * ErrorCode reporting about success or error
86  */
87  virtual ErrorCode add(const IScan* scan) = 0;
88 
89  /** Remove scan at the defined index.
90  *
91  * @param index Specifies the index of an existing element. It must be in the range of [0...getSize()].
92  * @return
93  * ErrorCode reporting about success or error
94  */
95  virtual ErrorCode remove(int index) = 0;
96 
97  /** Retrieve the Compositemesh container
98  *
99  * @return
100  * pointer to the ICompositeContainer instance
101  */
102  virtual ICompositeContainer* getCompositeContainer() const = 0;
103 
104  /** Set CompositeMesh container
105  *
106  * @param meshes Pointer to the ICompositeContainer instance to add.
107  */
108  virtual void setCompositeContainer(const ICompositeContainer* meshes) = 0;
109 
110  /** Retrieve size of the IModel
111  *
112  * @return
113  * number of elements in the collection
114  */
115  virtual int getSize() const = 0;
116 
117  /** Remove all elements
118  */
119  virtual void clear() = 0;
120 };
121 
122 } } } // namespace artec::sdk::base
123 
124 #endif // _ISCANCOLLECTION_H_
virtual IScan * getElement(int index) const =0
Element access.
virtual void clear()=0
Remove all elements.
ErrorCode ABASESDK_LINK_SPEC createModel(IModel **pContainer)
Create new Model.
Container of Scan(s) and a single CompositeContainer.
Definition: IModel.h:60
virtual void setCompositeContainer(const ICompositeContainer *meshes)=0
Set CompositeMesh container.
bool ABASESDK_LINK_SPEC isCompositeContainerInModelEmpty(const IModel *in)
Check for empty CompositeContainer.
virtual ErrorCode add(const IScan *scan)=0
Add a new scan to the model.
virtual int getSize() const =0
Retrieve size of the IModel.
virtual ErrorCode setElement(int index, IScan *scan)=0
Sets an element at the specified index.
bool ABASESDK_LINK_SPEC allScansInModelEmpty(const IModel *in)
Check for empty scan collection.
virtual ICompositeContainer * getCompositeContainer() const =0
Retrieve the Compositemesh container.
Collection of reconstructed frame meshes with attributes.
Definition: IScan.h:79
Collection of composite meshes with attributes.
#define ABASESDK_LINK_SPEC
Interface that implements reference counting and life-time management.
Definition: IRef.h:22
ErrorCode ABASESDK_LINK_SPEC cloneModel(IModel *out, const IModel *in)
Create new Scans and CompositeContainer, but clone all content.