summaryrefslogtreecommitdiff
path: root/example/common
diff options
context:
space:
mode:
Diffstat (limited to 'example/common')
-rw-r--r--example/common/CMakeLists.txt36
-rw-r--r--example/common/cgal3Doffreader_result.txt8
-rw-r--r--example/common/example_CGAL_3D_points_off_reader.cpp41
-rw-r--r--example/common/example_CGAL_points_off_reader.cpp46
-rw-r--r--example/common/example_vector_double_points_off_reader.cpp43
-rw-r--r--example/common/vectordoubleoffreader_result.txt7
6 files changed, 0 insertions, 181 deletions
diff --git a/example/common/CMakeLists.txt b/example/common/CMakeLists.txt
deleted file mode 100644
index 04015cdc..00000000
--- a/example/common/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-project(Common_examples)
-
-add_executable ( vector_double_off_reader example_vector_double_points_off_reader.cpp )
-target_link_libraries(vector_double_off_reader ${CGAL_LIBRARY})
-file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
-add_test(NAME Common_example_vector_double_off_reader COMMAND $<TARGET_FILE:vector_double_off_reader>
- "alphacomplexdoc.off")
-
-install(TARGETS vector_double_off_reader DESTINATION bin)
-
-if (DIFF_PATH)
- # Do not forget to copy test results files in current binary dir
- file(COPY "vectordoubleoffreader_result.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
-
- add_test(Common_example_vector_double_off_reader_diff_files ${DIFF_PATH}
- ${CMAKE_CURRENT_BINARY_DIR}/vectordoubleoffreader_result.txt ${CMAKE_CURRENT_BINARY_DIR}/alphacomplexdoc.off.txt)
-endif()
-
-if(CGAL_FOUND)
- add_executable ( cgal_3D_off_reader example_CGAL_3D_points_off_reader.cpp )
- target_link_libraries(cgal_3D_off_reader ${CGAL_LIBRARY})
- add_test(NAME Common_example_vector_cgal_3D_off_reader COMMAND $<TARGET_FILE:cgal_3D_off_reader>
- "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off")
-
- install(TARGETS cgal_3D_off_reader DESTINATION bin)
-
- # need CGAL 4.7 and Eigen3
- if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
- add_executable ( cgal_off_reader example_CGAL_points_off_reader.cpp )
- target_link_libraries(cgal_off_reader ${CGAL_LIBRARY})
- add_test(NAME Common_example_vector_cgal_off_reader COMMAND $<TARGET_FILE:cgal_off_reader>
- "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off")
- install(TARGETS cgal_off_reader DESTINATION bin)
- endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
-
-endif()
diff --git a/example/common/cgal3Doffreader_result.txt b/example/common/cgal3Doffreader_result.txt
deleted file mode 100644
index f992c8e3..00000000
--- a/example/common/cgal3Doffreader_result.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Point[1] = (0.959535, -0.418347, 0.302237)
-Point[2] = (2.16795, 1.85348, -0.52312)
-Point[3] = (-2.38753, -1.50911, -0.565889)
-Point[4] = (-2.70428, -1.25688, 0.188394)
-Point[5] = (-1.22932, -1.64337, -0.998632)
-...
-Point[300] = (-0.56244, 2.6018, -0.749591)
-
diff --git a/example/common/example_CGAL_3D_points_off_reader.cpp b/example/common/example_CGAL_3D_points_off_reader.cpp
deleted file mode 100644
index 4658d8d5..00000000
--- a/example/common/example_CGAL_3D_points_off_reader.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <gudhi/Points_3D_off_io.h>
-
-#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
-
-#include <iostream>
-#include <string>
-#include <vector>
-
-using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
-using Point_3 = Kernel::Point_3;
-
-void usage(char * const progName) {
- std::cerr << "Usage: " << progName << " inputFile.off" << std::endl;
- exit(-1);
-}
-
-int main(int argc, char **argv) {
- if (argc != 2) {
- std::cerr << "Error: Number of arguments (" << argc << ") is not correct" << std::endl;
- usage(argv[0]);
- }
-
- std::string off_input_file(argv[1]);
- // Read the OFF file (input file name given as parameter) and triangulate points
- Gudhi::Points_3D_off_reader<Point_3> off_reader(off_input_file);
- // Check the read operation was correct
- if (!off_reader.is_valid()) {
- std::cerr << "Unable to read file " << off_input_file << std::endl;
- usage(argv[0]);
- }
-
- // Retrieve the triangulation
- std::vector<Point_3> point_cloud = off_reader.get_point_cloud();
-
- int n {};
- for (auto point : point_cloud) {
- ++n;
- std::cout << "Point[" << n << "] = (" << point[0] << ", " << point[1] << ", " << point[2] << ")\n";
- }
- return 0;
-}
diff --git a/example/common/example_CGAL_points_off_reader.cpp b/example/common/example_CGAL_points_off_reader.cpp
deleted file mode 100644
index f45683a5..00000000
--- a/example/common/example_CGAL_points_off_reader.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <gudhi/Points_off_io.h>
-
-// For CGAL points type in dimension d
-// cf. http://doc.cgal.org/latest/Kernel_d/classCGAL_1_1Point__d.html
-#include <CGAL/Epick_d.h>
-
-#include <iostream>
-#include <string>
-#include <vector>
-
-using Kernel = CGAL::Epick_d< CGAL::Dynamic_dimension_tag >;
-using Point_d = Kernel::Point_d;
-
-void usage(char * const progName) {
- std::cerr << "Usage: " << progName << " inputFile.off" << std::endl;
- exit(-1);
-}
-
-int main(int argc, char **argv) {
- if (argc != 2) {
- std::cerr << "Error: Number of arguments (" << argc << ") is not correct" << std::endl;
- usage(argv[0]);
- }
-
- std::string off_input_file(argv[1]);
- // Read the OFF file (input file name given as parameter) and triangulate points
- Gudhi::Points_off_reader<Point_d> off_reader(off_input_file);
- // Check the read operation was correct
- if (!off_reader.is_valid()) {
- std::cerr << "Unable to read file " << off_input_file << std::endl;
- usage(argv[0]);
- }
-
- // Retrieve the triangulation
- std::vector<Point_d> point_cloud = off_reader.get_point_cloud();
-
- int n {};
- for (auto point : point_cloud) {
- std::cout << "Point[" << n << "] = ";
- for (std::size_t i {0}; i < point.size(); i++)
- std::cout << point[i] << " ";
- std::cout << "\n";
- ++n;
- }
- return 0;
-}
diff --git a/example/common/example_vector_double_points_off_reader.cpp b/example/common/example_vector_double_points_off_reader.cpp
deleted file mode 100644
index 5093da85..00000000
--- a/example/common/example_vector_double_points_off_reader.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <gudhi/Points_off_io.h>
-
-#include <iostream>
-#include <string>
-#include <vector>
-
-using Point_d = std::vector<double>;
-
-void usage(char * const progName) {
- std::cerr << "Usage: " << progName << " inputFile.off" << std::endl;
- exit(-1);
-}
-
-int main(int argc, char **argv) {
- if (argc != 2) {
- std::cerr << "Error: Number of arguments (" << argc << ") is not correct" << std::endl;
- usage(argv[0]);
- }
-
- std::string off_input_file(argv[1]);
- // Read the OFF file (input file name given as parameter) and triangulate points
- Gudhi::Points_off_reader<Point_d> off_reader(off_input_file);
- // Check the read operation was correct
- if (!off_reader.is_valid()) {
- std::cerr << "Unable to read file " << off_input_file << std::endl;
- usage(argv[0]);
- }
-
- // Retrieve the triangulation
- std::vector<Point_d> point_cloud = off_reader.get_point_cloud();
-
- std::ofstream output_file(off_input_file + ".txt");
- int n {0};
- for (auto point : point_cloud) {
- output_file << "Point[" << n << "] = ";
- for (std::size_t i {0}; i < point.size(); i++)
- output_file << point[i] << " ";
- output_file << "\n";
- ++n;
- }
- output_file.close();
- return 0;
-}
diff --git a/example/common/vectordoubleoffreader_result.txt b/example/common/vectordoubleoffreader_result.txt
deleted file mode 100644
index 1deb8dbd..00000000
--- a/example/common/vectordoubleoffreader_result.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Point[0] = 1 1
-Point[1] = 7 0
-Point[2] = 4 6
-Point[3] = 9 6
-Point[4] = 0 14
-Point[5] = 2 19
-Point[6] = 9 17