Add an example to illustrate the use of display for LCC; remove all the use of display from other examples

This commit is contained in:
Guillaume Damiand 2017-12-01 15:38:19 +01:00 committed by Maxime Gimeno
parent aaf0c578f0
commit d0010de73f
5 changed files with 44 additions and 58 deletions

View File

@ -11,10 +11,10 @@ endif()
# If you want to visualize a linear cell complex, you can use the following viewer
# based on qt. Just uncomment the following line, plus the line find_package(CGALBasicViewer) below
# find_package(CGAL COMPONENTS Qt5)
find_package(CGAL COMPONENTS Qt5)
# If you don't want to visualize, use the following line (otherwise comment it)
find_package(CGAL QUIET)
# find_package(CGAL QUIET)
# For Gprof.
# ADD_DEFINITIONS("-pg")
@ -24,38 +24,28 @@ find_package(CGAL QUIET)
# add_definition(-DCGAL_DISABLE_ROUNDING_MATH_CHECK)
if ( CGAL_FOUND )
include( ${CGAL_USE_FILE} )
# find_package(CGALBasicViewer)
include(${CGAL_USE_FILE})
find_package(CGALBasicViewer)
include( CGAL_CreateSingleSourceCGALProgram )
include_directories(BEFORE ../../include)
create_single_source_cgal_program( "linear_cell_complex_3.cpp" )
create_single_source_cgal_program( "linear_cell_complex_4.cpp" )
create_single_source_cgal_program(
"linear_cell_complex_3_with_colored_vertices.cpp" )
create_single_source_cgal_program(
"linear_cell_complex_3_with_mypoint.cpp" )
create_single_source_cgal_program("linear_cell_complex_3.cpp")
create_single_source_cgal_program("linear_cell_complex_4.cpp")
create_single_source_cgal_program("linear_cell_complex_3_with_colored_vertices.cpp")
create_single_source_cgal_program("linear_cell_complex_3_with_mypoint.cpp")
create_single_source_cgal_program("plane_graph_to_lcc_2.cpp")
create_single_source_cgal_program("linear_cell_complex_3_attributes_management.cpp")
create_single_source_cgal_program("voronoi_2.cpp")
create_single_source_cgal_program("voronoi_3.cpp")
create_single_source_cgal_program("gmap_linear_cell_complex_3.cpp")
create_single_source_cgal_program("linear_cell_complex_3_operations.cpp")
add_executable(voronoi_2 voronoi_2.cpp)
target_link_libraries(voronoi_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}
${BASIC_VIEWER_LIBRARIES})
add_executable(voronoi_3 voronoi_3.cpp)
target_link_libraries(voronoi_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}
${BASIC_VIEWER_LIBRARIES})
if (USE_BASIC_VIEWER)
qt5_use_modules(voronoi_3 ${BASIC_VIEWER_MODULES})
endif(USE_BASIC_VIEWER)
create_single_source_cgal_program( "gmap_linear_cell_complex_3.cpp" )
add_executable(linear_cell_complex_3_operations linear_cell_complex_3_operations.cpp)
target_link_libraries(linear_cell_complex_3_operations ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}
${BASIC_VIEWER_LIBRARIES})
create_single_source_cgal_program("display_linear_cell_complex.cpp")
if (USE_BASIC_VIEWER)
target_link_libraries(display_linear_cell_complex ${BASIC_VIEWER_LIBRARIES})
qt5_use_modules(display_linear_cell_complex ${BASIC_VIEWER_MODULES})
endif(USE_BASIC_VIEWER)
else()
message(STATUS "This program requires the CGAL library, "

View File

@ -0,0 +1,26 @@
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#ifdef CGAL_USE_BASIC_VIEWER
#include <CGAL/Linear_cell_complex_viewer_qt.h>
#endif
typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC;
typedef LCC::Point Point;
int main()
{
LCC lcc;
lcc.make_hexahedron(Point(0,0,0), Point(5,0,0),
Point(5,5,0), Point(0,5,0),
Point(0,5,4), Point(0,0,4),
Point(5,0,4), Point(5,5,4));
lcc.display_characteristics(std::cout)<<", valid="
<<lcc.is_valid()<<std::endl;
#ifdef CGAL_USE_BASIC_VIEWER
CGAL::display(lcc);
#endif // CGAL_USE_BASIC_VIEWER
return EXIT_SUCCESS;
}

View File

@ -2,11 +2,6 @@
#include <CGAL/Linear_cell_complex_for_generalized_map.h>
#include <vector>
#ifdef CGAL_USE_BASIC_VIEWER
#include <CGAL/Linear_cell_complex_viewer_qt.h>
#endif
typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC_3_cmap;
typedef CGAL::Linear_cell_complex_for_generalized_map<3> LCC_3_gmap;
@ -54,10 +49,6 @@ void run_test()
lcc.template sew<3>(lcc.template opposite<2>(lcc.next(dh1)),
lcc.other_orientation(lcc.template opposite<2>(lcc.previous(dh3))));
#ifdef CGAL_USE_BASIC_VIEWER
display(lcc);
#endif // CGAL_USE_BASIC_VIEWER
lcc.insert_cell_1_in_cell_2(lcc.next(dh1),
Alpha1<LCC>::run(lcc, lcc.previous(dh1)));
dh2=lcc.template opposite<2>(lcc.next(lcc.next
@ -73,14 +64,9 @@ void run_test()
lcc.insert_cell_2_in_cell_3(path.begin(),path.end());
lcc.display_characteristics(std::cout) << ", valid="
<< lcc.is_valid() << std::endl;
#ifdef CGAL_USE_BASIC_VIEWER
display(lcc);
#endif // CGAL_USE_BASIC_VIEWER
<< lcc.is_valid() << std::endl;
}
int main()
{
run_test<LCC_3_cmap>();

View File

@ -7,10 +7,6 @@
#include <fstream>
#ifdef CGAL_USE_BASIC_VIEWER
#include <CGAL/Linear_cell_complex_viewer_qt.h>
#endif
// This example works both with cmap and gmap as combinatorial data structure.
//typedef CGAL::Linear_cell_complex_for_combinatorial_map<2> LCC_2;
typedef CGAL::Linear_cell_complex_for_generalized_map<2> LCC_2;
@ -56,10 +52,6 @@ void display_voronoi(LCC_2& alcc, Dart_handle adart)
alcc.display_characteristics(std::cout) << ", valid="
<< alcc.is_valid()
<< std::endl;
#ifdef CGAL_USE_BASIC_VIEWER
display(alcc);
#endif // CGAL_USE_BASIC_VIEWER
}
template<typename LCC, typename TR>

View File

@ -5,10 +5,6 @@
#include <iostream>
#include <fstream>
#ifdef CGAL_USE_BASIC_VIEWER
#include <CGAL/Linear_cell_complex_viewer_qt.h>
#endif
/* // If you want to use exact constructions.
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
typedef CGAL::Linear_cell_complex<3,3,
@ -58,10 +54,6 @@ void display_voronoi(LCC_3& alcc, Dart_handle adart)
alcc.display_characteristics(std::cout) << ", valid="
<< alcc.is_valid()
<< std::endl;
#ifdef CGAL_USE_BASIC_VIEWER
display(alcc);
#endif // CGAL_USE_BASIC_VIEWER
}
template<typename LCC, typename TR>