-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'cgal/5.6.x-branch'
- Loading branch information
Showing
12 changed files
with
237 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
if(LASLIB_FOUND AND NOT TARGET CGAL::LASLIB_support) | ||
add_library(CGAL::LASLIB_support INTERFACE IMPORTED) | ||
set_target_properties(CGAL::LASLIB_support PROPERTIES | ||
INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_LASLIB" | ||
INTERFACE_INCLUDE_DIRECTORIES "${LASLIB_INCLUDE_DIR};${LASZIP_INCLUDE_DIR}" | ||
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${LASLIB_INCLUDE_DIR};${LASZIP_INCLUDE_DIR}" | ||
INTERFACE_LINK_LIBRARIES "${LASLIB_LIBRARIES}") | ||
if(LASLIB_FOUND) | ||
if (NOT TARGET CGAL::LASLIB_support) | ||
if (NOT TARGET LASlib) | ||
# message(STATUS "Found using MODULE mode") | ||
add_library(CGAL::LASLIB_support INTERFACE IMPORTED) | ||
set_target_properties(CGAL::LASLIB_support PROPERTIES | ||
INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_LASLIB" | ||
INTERFACE_INCLUDE_DIRECTORIES "${LASLIB_INCLUDE_DIR}" | ||
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${LASLIB_INCLUDE_DIR}" | ||
INTERFACE_LINK_LIBRARIES "${LASLIB_LIBRARIES}") | ||
else() | ||
# message(STATUS "Found using CONFIG mode") | ||
add_library(CGAL::LASLIB_support INTERFACE IMPORTED) | ||
set_target_properties(CGAL::LASLIB_support PROPERTIES | ||
INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_LASLIB") | ||
target_link_libraries(CGAL::LASLIB_support INTERFACE LASlib) | ||
endif() | ||
endif() | ||
endif() |
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
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
45 changes: 45 additions & 0 deletions
45
Point_set_processing_3/examples/Point_set_processing_3/write_las_example.cpp
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,45 @@ | ||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> | ||
|
||
#include <CGAL/property_map.h> | ||
#include <CGAL/IO/read_las_points.h> | ||
#include <CGAL/IO/write_las_points.h> | ||
|
||
#include <utility> | ||
#include <vector> | ||
#include <fstream> | ||
|
||
// types | ||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; | ||
typedef Kernel::FT FT; | ||
typedef Kernel::Point_3 Point; | ||
typedef std::array<unsigned short, 4> Color; | ||
typedef std::pair<Point, Color> PointWithColor; | ||
|
||
int main(int argc, char*argv[]) | ||
{ | ||
const char* fname = "colored_points.las"; | ||
|
||
std::ofstream os(fname, std::ios::binary); | ||
|
||
std::vector<PointWithColor> points; // store points | ||
points.push_back(std::make_pair(Point(0, 0, 0), Color{ 65535, 0, 0, 0 })); | ||
points.push_back(std::make_pair(Point(1, 0, 0), Color{ 0, 65535, 0, 0 })); | ||
points.push_back(std::make_pair(Point(0, 1, 0), Color{ 0, 0, 65535, 0 })); | ||
points.push_back(std::make_pair(Point(1, 1, 0), Color{ 0, 65535, 65535, 0 })); | ||
points.push_back(std::make_pair(Point(1, 1, 1), Color{ 65535, 65535, 0, 0 })); | ||
|
||
// Writes a .las point set file with colors | ||
if(!CGAL::IO::write_LAS_with_properties(os, points, | ||
CGAL::IO::make_las_point_writer(CGAL::First_of_pair_property_map<PointWithColor>()), | ||
std::make_tuple(CGAL::Second_of_pair_property_map<PointWithColor>(), | ||
CGAL::IO::LAS_property::R(), | ||
CGAL::IO::LAS_property::G(), | ||
CGAL::IO::LAS_property::B(), | ||
CGAL::IO::LAS_property::I()))) | ||
{ | ||
std::cerr << "Error: cannot write file " << fname << std::endl; | ||
return EXIT_FAILURE; | ||
} | ||
|
||
return EXIT_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
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
Binary file not shown.
Oops, something went wrong.