AopIO.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: AAOP file format support
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 
11 #ifndef __ArtecBaseSDK_AOPIO_H_
12 #define __ArtecBaseSDK_AOPIO_H_
13 
15 #include <artec/sdk/base/Errors.h>
16 
17 namespace artec { namespace sdk { namespace base
18 {
19 
20 class IMesh;
21 class IRangeImageCylindric;
22 
23 namespace io {
24 
25 extern "C" {
26 
27 /// Save range image to AOP file
28 /// @param path File path to save mesh to
29 /// @param ri Range image to be saved
31  saveAopImageToFile(const wchar_t* path, const IRangeImageCylindric* ri);
32 
33 /// Save surface in AOP format, converting it to image
34 /// @param path File path to save mesh to
35 /// @param surface Surface to be saved
36 /// @param width,height Dimensions of range image texture in pixels
37 /// @param interpolateHoles If true then holes will be linearly interpolated on cylinder
38 /// @param cutEdges Cut top and bottom of cylinder if percent of populated cells in range image
39 /// there lesser than edgeQualityFactor
40 /// @param edgeQualityFactor Necessary percent in [0..100] of populated cells on edges.
41 /// @note Surface should be in origin, aligned along OY axis, so that OY is inside surface
43  saveAopMeshToFile(const wchar_t* path, const IMesh* surface, int width, int height,
44  bool interpolateHoles, bool cutEdges = false, int edgeQualityFactor = 80);
45 }
46 
47 class Aop
48 {
49 public:
50 
51  /// Save range image in AOP format
52  /// @param path File path to save mesh to
53  /// @param ri Range image to be saved
54  static ErrorCode save(const wchar_t* path, const IRangeImageCylindric* ri)
55  {
56  return saveAopImageToFile(path, ri);
57  }
58 
59  /// Save surface in AOP format, converting it to image
60  /// @param path File path to save mesh to
61  /// @param surface Surface to be saved
62  /// @param width,height Dimensions of range image texture in pixels
63  /// @param interpolateHoles If true then holes will be linearly interpolated on cylinder
64  /// @param cutEdges Cut top and bottom of cylinder if percent of populated cells in range image
65  /// there lesser than edgeQualityFactor
66  /// @param edgeQualityFactor Necessary percent in [0..100] of populated cells on edges.
67  /// @note Surface should be in origin, aligned along OY axis, so that OY is inside surface
68  static ErrorCode
69  save(const wchar_t* path, const IMesh* surface, int width, int height,
70  bool interpolateHoles, bool cutEdges = false, int edgeQualityFactor = 80)
71  {
72  return saveAopMeshToFile(path, surface, width, height, interpolateHoles, cutEdges, edgeQualityFactor);
73  }
74 };
75 
76 } } } } // namespace artec::sdk::base::io
77 
78 #endif//__ArtecBaseSDK_AOPIO_H_
ErrorCode ABASESDK_LINK_SPEC saveAopMeshToFile(const wchar_t *path, const IMesh *surface, int width, int height, bool interpolateHoles, bool cutEdges=false, int edgeQualityFactor=80)
static ErrorCode save(const wchar_t *path, const IRangeImageCylindric *ri)
Definition: AopIO.h:54
ErrorCode ABASESDK_LINK_SPEC saveAopImageToFile(const wchar_t *path, const IRangeImageCylindric *ri)
static ErrorCode save(const wchar_t *path, const IMesh *surface, int width, int height, bool interpolateHoles, bool cutEdges=false, int edgeQualityFactor=80)
Definition: AopIO.h:69
#define ABASESDK_LINK_SPEC
Definition: BaseSdkDefines.h:7