BuffIO.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: Internal BUFF file format support.
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 
11 #ifndef _BUFFIO_H_
12 #define _BUFFIO_H_
13 
16 
17 namespace artec { namespace sdk { namespace base
18 {
19 
20 class ICancellationToken;
21 class IProgressInfo;
22 
23 namespace io {
24 
25 extern "C" {
26 
27 /** Save IFrameMesh to BUFF file
28 * @param path - file path to save mesh to
29 * @param mesh - mesh to be saved
30 * @param progr - progress interface
31 * @param cncl - cancel interface
32 * @return error code
33 */
35  saveBuffFrameToFile(const wchar_t* path, const IFrameMesh* mesh, IProgressInfo* progr = 0, ICancellationToken* cncl = 0);
36 
37 /** Save IFrameMesh to BUFF blob
38 * @note save only geometry, not texture also, because image is stored in separate blob
39 * @param data - blob to save mesh to
40 * @param mesh - mesh to be saved
41 * @param progr - progress interface
42 * @param cncl - cancel interface
43 * @return error code
44 */
46  saveBuffFrameToBlob(IBlob** data, const IFrameMesh* mesh, IProgressInfo* progr = 0, ICancellationToken* cncl = 0);
47 
48 /** Load IFrameMesh from BUFF file
49 * @param mesh - loaded mesh
50 * @param path - file path to load image from
51 * @param progr - progress interface
52 * @param cncl - cancel interface
53 * @return error code
54 */
56  loadBuffFrameFromFile(IFrameMesh** mesh, const wchar_t* path, IProgressInfo* progr = 0, ICancellationToken* cncl = 0);
57 
58 /** Load IFrameMesh from BUFF blob
59 * @note load only geometry, not texture also, because image is stored in separate blob
60 * @param mesh - loaded mesh
61 * @param data - blob to load image from
62 * @param progr - progress interface
63 * @param cncl - cancel interface
64 * @return error code
65 */
67  loadBuffFrameFromBlob(IFrameMesh** mesh, const IBlob* data, IProgressInfo* progr = 0, ICancellationToken* cncl = 0);
68 
69 }
70 
71 class Buff
72 {
73 public:
74 
75  /** Save IFrameMesh to BUFF file
76  * @param path - file path to save mesh to
77  * @param mesh - mesh to be saved
78  * @param progr - progress interface
79  * @param cncl - cancel interface
80  * @return error code
81  */
82  static ErrorCode save(const wchar_t* path, const IFrameMesh* mesh, IProgressInfo* progr = 0, ICancellationToken* cncl = 0)
83  {
84  return saveBuffFrameToFile(path, mesh, progr, cncl);
85  }
86 
87  /** Save IFrameMesh to BUFF blob
88  * @note save only geometry, not texture also, because image is stored in separate blob
89  * @param data - blob to save mesh to
90  * @param mesh - mesh to be saved
91  * @param progr - progress interface
92  * @param cncl - cancel interface
93  * @return error code
94  */
95  static ErrorCode save(IBlob** data, const IFrameMesh* mesh, IProgressInfo* progr = 0, ICancellationToken* cncl = 0)
96  {
97  return saveBuffFrameToBlob(data, mesh, progr, cncl);
98  }
99 
100  /** Load IFrameMesh from BUFF file
101  * @param mesh - loaded mesh
102  * @param path - file path to load image from
103  * @param progr - progress interface
104  * @param cncl - cancel interface
105  * @return error code
106  */
107  static ErrorCode load(IFrameMesh** mesh, const wchar_t* path, IProgressInfo* progr = 0, ICancellationToken* cncl = 0)
108  {
109  return loadBuffFrameFromFile(mesh, path, progr, cncl);
110  }
111 
112  /** Load IFrameMesh from BUFF blob
113  * @note load only geometry, not texture also, because image is stored in separate blob
114  * @param mesh - loaded mesh
115  * @param data - blob to load image from
116  * @param progr - progress interface
117  * @param cncl - cancel interface
118  * @return error code
119  */
120  static ErrorCode load(IFrameMesh** mesh, const IBlob* data, IProgressInfo* progr = 0, ICancellationToken* cncl = 0)
121  {
122  return loadBuffFrameFromBlob(mesh, data, progr, cncl);
123  }
124 };
125 
126 } } } } // namespace artec::sdk::base::io
127 
128 #endif // _BUFFIO_H_
ErrorCode ABASESDK_LINK_SPEC saveBuffFrameToFile(const wchar_t *path, const IFrameMesh *mesh, IProgressInfo *progr=0, ICancellationToken *cncl=0)
ErrorCode ABASESDK_LINK_SPEC loadBuffFrameFromBlob(IFrameMesh **mesh, const IBlob *data, IProgressInfo *progr=0, ICancellationToken *cncl=0)
ErrorCode ABASESDK_LINK_SPEC saveBuffFrameToBlob(IBlob **data, const IFrameMesh *mesh, IProgressInfo *progr=0, ICancellationToken *cncl=0)
static ErrorCode load(IFrameMesh **mesh, const IBlob *data, IProgressInfo *progr=0, ICancellationToken *cncl=0)
Definition: BuffIO.h:120
static ErrorCode load(IFrameMesh **mesh, const wchar_t *path, IProgressInfo *progr=0, ICancellationToken *cncl=0)
Definition: BuffIO.h:107
ErrorCode ABASESDK_LINK_SPEC loadBuffFrameFromFile(IFrameMesh **mesh, const wchar_t *path, IProgressInfo *progr=0, ICancellationToken *cncl=0)
static ErrorCode save(const wchar_t *path, const IFrameMesh *mesh, IProgressInfo *progr=0, ICancellationToken *cncl=0)
Definition: BuffIO.h:82
#define ABASESDK_LINK_SPEC
Definition: BaseSdkDefines.h:7
static ErrorCode save(IBlob **data, const IFrameMesh *mesh, IProgressInfo *progr=0, ICancellationToken *cncl=0)
Definition: BuffIO.h:95