-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd42058
commit e87d0e5
Showing
5 changed files
with
112 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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 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,5 @@ | ||
# Binaries | ||
add_executable(transform_map transform_map.cc) | ||
set_wavemap_target_properties(transform_map) | ||
target_link_libraries(transform_map PUBLIC | ||
wavemap::wavemap_core wavemap::wavemap_io) |
This file contains 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,36 @@ | ||
#include <memory> | ||
|
||
#include <wavemap/core/common.h> | ||
#include <wavemap/core/utils/edit/transform.h> | ||
#include <wavemap/io/file_conversions.h> | ||
|
||
int main(int, char**) { | ||
// Settings | ||
std::filesystem::path input_map_path = | ||
"/home/victor/data/wavemaps/newer_college_cloister_10cm.wvmp"; | ||
std::filesystem::path output_map_path = | ||
"/home/victor/data/wavemaps/newer_college_cloister_10cm_tranformed.wvmp"; | ||
|
||
// Create a smart pointer that will own the loaded map | ||
wavemap::MapBase::Ptr map_base; | ||
|
||
// Load the map | ||
bool success = wavemap::io::fileToMap(input_map_path, map_base); | ||
CHECK(success); | ||
|
||
// Downcast it to a concrete map type | ||
auto map = std::dynamic_pointer_cast<wavemap::HashedWaveletOctree>(map_base); | ||
CHECK_NOTNULL(map); | ||
|
||
// Define a transformation that flips the map upside down, for illustration | ||
wavemap::Transformation3D T_AB; | ||
T_AB.getRotation() = wavemap::Rotation3D{0.f, 1.f, 0.f, 0.f}; | ||
|
||
// Transform the map | ||
map = wavemap::edit::transform(*map, T_AB, | ||
std::make_shared<wavemap::ThreadPool>()); | ||
|
||
// Save the map | ||
success &= wavemap::io::mapToFile(*map, output_map_path); | ||
CHECK(success); | ||
} |
This file contains 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 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