-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmesh_extractor_c.cpp
More file actions
66 lines (60 loc) · 2.67 KB
/
mesh_extractor_c.cpp
File metadata and controls
66 lines (60 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "libplateau_c.h"
#include "city_model_c.h"
#include <plateau/polygon_mesh/mesh_extractor.h>
#include <plateau/geometry/geo_coordinate.h>
#include <plateau_dll_logger.h>
using namespace libplateau;
using namespace plateau::polygonMesh;
extern "C"{
/**
* MeshExtractor::extract して結果を out_model に格納します。
* out_model の delete はDLL利用者の責任です。
* ただしModelをdeleteすると配下のNode,Meshにもアクセスできなくなるので注意してください。
*/
LIBPLATEAU_C_EXPORT APIResult LIBPLATEAU_C_API plateau_mesh_extractor_extract(
const CityModelHandle* const city_model_handle,
const MeshExtractOptions options,
Model* const out_model){
API_TRY{
MeshExtractor::extract(*out_model, city_model_handle->getCityModel(), options);
return APIResult::Success;
}
API_CATCH;
return APIResult::ErrorUnknown;
}
/**
* MeshExtractor::extract して結果を out_model に格納します。
* out_model の delete はDLL利用者の責任です。
* ただしModelをdeleteすると配下のNode,Meshにもアクセスできなくなるので注意してください。
*/
LIBPLATEAU_C_EXPORT APIResult LIBPLATEAU_C_API plateau_mesh_extractor_extract_in_extents(
const CityModelHandle* const city_model_handle,
const MeshExtractOptions options,
const std::vector<plateau::geometry::Extent>* extents,
Model* const out_model) {
API_TRY{
MeshExtractor::extractInExtents(*out_model, city_model_handle->getCityModel(), options, *extents);
return APIResult::Success;
}
API_CATCH;
return APIResult::ErrorUnknown;
}
LIBPLATEAU_C_EXPORT APIResult LIBPLATEAU_C_API plateau_mesh_extractor_extract_in_extents_with_log(
const CityModelHandle* const city_model_handle,
const MeshExtractOptions options,
const std::vector<plateau::geometry::Extent>* extents,
Model* const out_model,
const DllLogLevel logLevel,
LogCallbackFuncPtr logErrorCallback,
LogCallbackFuncPtr logWarnCallback,
LogCallbackFuncPtr logInfoCallback) {
API_TRY{
auto logger = std::make_shared<PlateauDllLogger>(logLevel);
logger->setLogCallbacks(logErrorCallback, logWarnCallback, logInfoCallback);
MeshExtractor::extractInExtents(*out_model, city_model_handle->getCityModel(), options, *extents, logger);
return APIResult::Success;
}
API_CATCH;
return APIResult::ErrorUnknown;
}
}