-
Notifications
You must be signed in to change notification settings - Fork 4
タイルimport用Grid分割処理 #281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
タイルimport用Grid分割処理 #281
Changes from 16 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
27180fe
複数GML結合機能
sevendev 402c6f6
weak_ptrに変更(意味ないかも)
sevendev 1bac893
結合時、最大LODのみを含める
sevendev 26d76e9
最大LODのみGrid Merge , Group id ではなくGrid id を使う
sevendev b655432
city_modelのgrid分けの処理もTile extractorで行う
sevendev c15deec
Grid id ごとに階層化
sevendev 69f1c86
Model/Node側のメソッドでchild node 有無判定( Mapを使わない )
sevendev 03a811b
group / grid id を両方渡す
sevendev cf0dff1
Grid名変更
sevendev fd40c85
Grid名変更
sevendev 70432d8
AIコメント対応
sevendev 4db4a48
AIコメント対応
sevendev 528a6ed
nitpickコメント対応
sevendev 857913a
AIコメント対応
sevendev 20735ae
AIコメント対応
sevendev e6fafaf
コメント変更
sevendev b5bc42c
AIコメント対応
sevendev fd86c9e
Unit Testが通らないので元の仕様にRevert
sevendev 31a127d
コメント変更
sevendev cfd7877
refactor
sevendev 1f3ff96
Added Unit Test.
sevendev dd4e68b
C#libでTestが通らなくなるのでudxのパス変更
sevendev 625bfc9
nitpick対応
sevendev f02038d
nitpick対応
sevendev 0c051e8
githubでwinのbuildが完了しないため.net standard 2.0にrevert
sevendev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #pragma once | ||
|
|
||
| #include <memory> | ||
| #include <vector> | ||
|
|
||
| namespace plateau::polygonMesh { | ||
| class citygml::CityModel; | ||
| using CityModelVector = std::shared_ptr<std::vector<std::weak_ptr<const citygml::CityModel>>>; | ||
| } | ||
|
sevendev marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #pragma once | ||
|
|
||
| #include <plateau/polygon_mesh/mesh_extractor.h> | ||
| #include <plateau/polygon_mesh/polygon_mesh_types.h> | ||
| #include <libplateau_api.h> | ||
| #include <memory> | ||
| #include "citygml/citymodel.h" | ||
| #include "model.h" | ||
|
|
||
| namespace plateau::polygonMesh { | ||
|
|
||
| /** | ||
| * TileExtractorは、複数のCityModelからメッシュを抽出し、指定された範囲(extents)に基づいて結合メッシュを抽出するクラスです。 | ||
| * | ||
| */ | ||
| class LIBPLATEAU_EXPORT TileExtractor : public MeshExtractor { | ||
| public: | ||
|
|
||
| /** | ||
| * CityModelのリストを結合し範囲内のModelを取り出します。 | ||
| */ | ||
| static std::shared_ptr<Model> extractWithCombine( | ||
| const CityModelVector& city_models, const MeshExtractOptions& options, | ||
| const std::vector<plateau::geometry::Extent>& extents); | ||
|
|
||
| /** | ||
| * CityModelのリストを結合し範囲内のModelを取り出します。 | ||
| */ | ||
| static void extractWithCombine(Model& out_model, | ||
| const CityModelVector& city_models, const MeshExtractOptions& options, | ||
| const std::vector<plateau::geometry::Extent>& extents); | ||
|
|
||
| /** | ||
| * CityModelから範囲内のModelを取り出しグリッド分割します。 | ||
| */ | ||
| static std::shared_ptr<Model> extractWithGrid( | ||
| const citygml::CityModel& city_model, const MeshExtractOptions& options, | ||
| const std::vector<plateau::geometry::Extent>& extents); | ||
|
|
||
| /** | ||
| * CityModelから範囲内のModelを取り出しグリッド分割します。 | ||
| */ | ||
| static void extractWithGrid(Model& out_model, | ||
| const citygml::CityModel& city_model, const MeshExtractOptions& options, | ||
| const std::vector<plateau::geometry::Extent>& extents); | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| #include "libplateau_c.h" | ||
| #include "city_model_c.h" | ||
| #include <plateau/polygon_mesh/tile_extractor.h> | ||
|
|
||
| using namespace libplateau; | ||
| using namespace plateau::polygonMesh; | ||
|
|
||
| extern "C"{ | ||
|
|
||
| LIBPLATEAU_C_EXPORT APIResult LIBPLATEAU_C_API plateau_tile_extractor_extract_with_combine( | ||
| const CityModelHandle* const* city_model_handles, | ||
| const int city_model_size, | ||
| const MeshExtractOptions options, | ||
| const std::vector<plateau::geometry::Extent>* extents, | ||
| Model* const out_model) { | ||
| API_TRY{ | ||
|
|
||
| if (out_model == nullptr || extents == nullptr) { | ||
| return APIResult::ErrorInvalidArgument; | ||
| } | ||
| if (city_model_size < 0) { | ||
| return APIResult::ErrorInvalidArgument; | ||
| } | ||
| if (city_model_size > 0 && city_model_handles == nullptr) { | ||
| return APIResult::ErrorInvalidArgument; | ||
| } | ||
|
|
||
| CityModelVector city_models = std::make_shared<std::vector<std::weak_ptr<const citygml::CityModel>>>(); | ||
| city_models->reserve(static_cast<size_t>(city_model_size)); | ||
| for (int i = 0; i < city_model_size; ++i) { | ||
| if (!city_model_handles[i]) { | ||
| continue; // nullptr の場合はスキップ | ||
| } | ||
| auto ptr = city_model_handles[i]->getCityModelPtr(); // 共有所有権を値で受ける | ||
| if (!ptr) { | ||
| continue; // 空の shared_ptr はスキップ | ||
| } | ||
| std::weak_ptr<const citygml::CityModel> weak = ptr; | ||
| city_models->push_back(weak); | ||
| } | ||
|
|
||
| if (city_models->empty()) { | ||
| // 入力に有効な CityModel が含まれていない | ||
| return APIResult::ErrorInvalidArgument; | ||
| } | ||
|
|
||
| TileExtractor::extractWithCombine(*out_model, city_models, options, *extents); | ||
| return APIResult::Success; | ||
|
|
||
| } | ||
| API_CATCH; | ||
| return APIResult::ErrorUnknown; | ||
| } | ||
|
|
||
| LIBPLATEAU_C_EXPORT APIResult LIBPLATEAU_C_API plateau_tile_extractor_extract_with_grid( | ||
| const CityModelHandle* const city_model_handle, | ||
| const MeshExtractOptions options, | ||
| const std::vector<plateau::geometry::Extent>* extents, | ||
| Model* const out_model) { | ||
| API_TRY{ | ||
| if (out_model == nullptr || extents == nullptr || city_model_handle == nullptr) { | ||
| return APIResult::ErrorInvalidArgument; | ||
| } | ||
| auto cityModelPtr = city_model_handle->getCityModelPtr(); | ||
| if (!cityModelPtr) { | ||
| return APIResult::ErrorInvalidArgument; | ||
| } | ||
| TileExtractor::extractWithGrid(*out_model, *cityModelPtr, options, *extents); | ||
| return APIResult::Success; | ||
| } | ||
| API_CATCH; | ||
| return APIResult::ErrorUnknown; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,4 +11,5 @@ target_sources(plateau PRIVATE | |
| "city_object_list.cpp" | ||
| "map_attacher.cpp" | ||
| "transform.cpp" | ||
| "tile_extractor.cpp" | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.