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  * Create new Model
28  * @param pContainer - destination Model
29  *
30  * @return
31  * error code
32  */
33  ErrorCode ABASESDK_LINK_SPEC createModel(IModel** pContainer);
34 
35  /**
36  * create new Scans and CompositeContainer, but clone all content
37  * @param out - destination Model
38  * @param in - Model to take elements from
39  *
40  * @return
41  * error code
42  */
43  ErrorCode ABASESDK_LINK_SPEC cloneModel(IModel* out, const IModel* in);
44 
45  /**
46  * check for empty scan collection
47  * @param in - Model to check
48  *
49  * @return
50  * true - all IScan in Model is empty
51  */
52  bool ABASESDK_LINK_SPEC allScansInModelEmpty(const IModel* in);
53 
54  /**
55  * check for empty CompositeContainer
56  * @param in - Model to check
57  *
58  * @return
59  * true - CompositeContainer in Model is empty
60  */
62 }
63 
64 class IModel : public IRef
65 {
66  /*
67  * This is a container of Scans and PolyScans
68  */
69 public:
70  /// Element operations
71 
72  /// Element access. Index must be in range [0...getSize())
73  virtual IScan* getElement(int index) const = 0;
74  virtual ErrorCode setElement(int index, IScan* scan) = 0;
75 
76  /// Add/remove scan to/from container
77  virtual ErrorCode add(const IScan* scan) = 0;
78  virtual ErrorCode remove(int index) = 0;
79 
80 
81  // Collection operations
82 
83  /// Retrieve compositemesh container
84  virtual ICompositeContainer* getCompositeContainer() const = 0;
85 
86  /// Set compositemesh container
87  virtual void setCompositeContainer(const ICompositeContainer* meshes) = 0;
88 
89 
90  // Container operations
91 
92  /// Number of elements in collection
93  virtual int getSize() const = 0;
94 
95  /// Clear collection
96  virtual void clear() = 0;
97 };
98 
99 } } } // namespace artec::sdk::base
100 
101 #endif // _ISCANCOLLECTION_H_
virtual void clear()=0
Clear collection.
ErrorCode ABASESDK_LINK_SPEC createModel(IModel **pContainer)
virtual void setCompositeContainer(const ICompositeContainer *meshes)=0
Set compositemesh container.
bool ABASESDK_LINK_SPEC isCompositeContainerInModelEmpty(const IModel *in)
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)
#define ABASESDK_LINK_SPEC
Definition: BaseSdkDefines.h:7
ErrorCode ABASESDK_LINK_SPEC cloneModel(IModel *out, const IModel *in)
virtual IScan * getElement(int index) const =0
Element operations.