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 This is a 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  /// Element operations
64 
65  /// Element access. Index must be in range [0...getSize())
66  virtual IScan* getElement(int index) const = 0;
67  virtual ErrorCode setElement(int index, IScan* scan) = 0;
68 
69  /// Add/remove scan to/from container
70  virtual ErrorCode add(const IScan* scan) = 0;
71  virtual ErrorCode remove(int index) = 0;
72 
73 
74  // Collection operations
75 
76  /// Retrieve compositemesh container
77  virtual ICompositeContainer* getCompositeContainer() const = 0;
78 
79  /// Set compositemesh container
80  virtual void setCompositeContainer(const ICompositeContainer* meshes) = 0;
81 
82 
83  // Container operations
84 
85  /// Number of elements in collection
86  virtual int getSize() const = 0;
87 
88  /// Clear collection
89  virtual void clear() = 0;
90 };
91 
92 } } } // namespace artec::sdk::base
93 
94 #endif // _ISCANCOLLECTION_H_
virtual void clear()=0
Clear collection.
ErrorCode ABASESDK_LINK_SPEC createModel(IModel **pContainer)
Create new Model.
This is a 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/remove scan to/from container.
virtual ICompositeContainer * getCompositeContainer() const =0
Retrieve compositemesh container.
virtual ErrorCode setElement(int index, IScan *scan)=0
virtual int getSize() const =0
Number of elements in collection.
bool ABASESDK_LINK_SPEC allScansInModelEmpty(const IModel *in)
check for empty scan collection
Collection of reconstructed frame meshes with attributes.
Definition: IScan.h:77
Collection of composite meshes with attributes.
#define ABASESDK_LINK_SPEC
Definition: BaseSdkDefines.h:7
ErrorCode ABASESDK_LINK_SPEC cloneModel(IModel *out, const IModel *in)
create new Scans and CompositeContainer, but clone all content
virtual IScan * getElement(int index) const =0
Element operations.