diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h index 91fb21c262f..ad2eca30e8f 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h @@ -23,6 +23,7 @@ #include #include #include +#include namespace CGAL { @@ -130,8 +131,12 @@ namespace CGAL { return first; } +#ifndef CGAL_NO_DEPRECATED_CODE +/*! + \deprecated This function is deprecated since CGAL 5.6. Use `read_plane_graph_in_lcc()` instead. +*/ template< class LCC > -[[deprecated("Use read_plane_graph_in_lcc instead")]] +CGAL_DEPRECATED typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, const std::vector& vertices, @@ -139,6 +144,7 @@ import_from_plane_graph(LCC& alcc, { return read_plane_graph_in_lcc(alcc, vertices, edge_indices); } +#endif /** * Imports a plane-embedded graph from a file into a LinearCellComplex. @@ -198,13 +204,18 @@ import_from_plane_graph(LCC& alcc, return read_plane_graph_in_lcc(alcc, vertices, edge_indices); } -template -[[deprecated("Use read_plane_graph_in_lcc instead")]] +#ifndef CGAL_NO_DEPRECATED_CODE +/*! + \deprecated This function is deprecated since CGAL 5.6. Use `read_plane_graph_in_lcc()` instead. +*/ +template< class LCC > +CGAL_DEPRECATED typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, std::istream& ais) { return read_plane_graph_in_lcc(alcc, ais); } +#endif template < class LCC > typename LCC::Dart_descriptor @@ -215,13 +226,18 @@ import_from_plane_graph(LCC& alcc, std::istream& ais) return read_plane_graph_in_lcc(alcc, input); } -template -[[deprecated("Use read_plane_graph_in_lcc instead")]] +#ifndef CGAL_NO_DEPRECATED_CODE +/*! + \deprecated This function is deprecated since CGAL 5.6. Use `read_plane_graph_in_lcc()` instead. +*/ +template< class LCC > +CGAL_DEPRECATED typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, const char* filename) { return read_plane_graph_in_lcc(alcc, filename); } +#endif template < class LCC > bool load_off(LCC& alcc, std::istream& in) diff --git a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt index 249c1f9c8be..613e7058057 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt @@ -38,4 +38,22 @@ cgal_add_compilation_test(Linear_cell_complex_4_test_index) add_executable(Linear_cell_complex_copy_test_index Linear_cell_complex_copy_test.cpp ${hfiles}) target_compile_definitions(Linear_cell_complex_copy_test_index PRIVATE USE_COMPACT_CONTAINER_WITH_INDEX) target_link_libraries(Linear_cell_complex_copy_test_index PRIVATE CGAL CGAL::Data) -cgal_add_compilation_test(Linear_cell_complex_copy_test_index) \ No newline at end of file +cgal_add_compilation_test(Linear_cell_complex_copy_test_index) + +# Test sans warning de dépréciation pour test_plane_graph_alias +add_executable(test_plane_graph_alias_nowarn test_plane_graph_alias.cpp ${hfiles}) +target_compile_definitions(test_plane_graph_alias_nowarn PRIVATE CGAL_NO_DEPRECATION_WARNINGS) +target_link_libraries(test_plane_graph_alias_nowarn PRIVATE CGAL CGAL::Data) +cgal_add_compilation_test(test_plane_graph_alias_nowarn) + +# Test sans warning de dépréciation pour test_polyhedron_3_alias +add_executable(test_polyhedron_3_alias_nowarn test_polyhedron_3_alias.cpp ${hfiles}) +target_compile_definitions(test_polyhedron_3_alias_nowarn PRIVATE CGAL_NO_DEPRECATION_WARNINGS) +target_link_libraries(test_polyhedron_3_alias_nowarn PRIVATE CGAL CGAL::Data) +cgal_add_compilation_test(test_polyhedron_3_alias_nowarn) + +# Test sans warning de dépréciation pour test_triangulation_alias +add_executable(test_triangulation_alias_nowarn test_triangulation_alias.cpp ${hfiles}) +target_compile_definitions(test_triangulation_alias_nowarn PRIVATE CGAL_NO_DEPRECATION_WARNINGS) +target_link_libraries(test_triangulation_alias_nowarn PRIVATE CGAL CGAL::Data) +cgal_add_compilation_test(test_triangulation_alias_nowarn) \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp index 72c51642c0e..e1aa4732a80 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -22,7 +23,7 @@ int main() input.clear(); input.seekg(0, std::ios::beg); - #if !defined(CGAL_NO_DEPRECATED_CODE) && !defined(CGAL_NO_DEPRECATION_WARNINGS) + #ifndef CGAL_NO_DEPRECATED_CODE // Test deprecated function auto d2 = CGAL::import_from_plane_graph(lcc2, input); assert(d2 != LCC::null_descriptor); diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp index 9b471aa4822..210a751ac88 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -20,7 +21,7 @@ int main() auto d1 = CGAL::polyhedron_3_to_lcc(lcc1, P); assert(d1 == LCC::null_descriptor); -#if !defined(CGAL_NO_DEPRECATED_CODE) && !defined(CGAL_NO_DEPRECATION_WARNINGS) +#ifndef CGAL_NO_DEPRECATED_CODE auto d2 = CGAL::import_from_polyhedron_3(lcc2, P); assert(d2 == LCC::null_descriptor); #endif diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp index 0cc22dd6727..427e772eb0b 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -17,7 +18,7 @@ int main() auto d1 = CGAL::triangulation_3_to_lcc(lcc1, T); assert(d1 == LCC_3::null_descriptor); -#if !defined(CGAL_NO_DEPRECATED_CODE) && !defined(CGAL_NO_DEPRECATION_WARNINGS) +#ifndef CGAL_NO_DEPRECATED_CODE auto d2 = CGAL::import_from_triangulation_3(lcc2, T); assert(d2 == LCC_3::null_descriptor); #endif diff --git a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h index cdcf6317ea1..aaf1dfeeb33 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h +++ b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h @@ -21,6 +21,7 @@ #include #include #include +#include namespace CGAL { @@ -94,14 +95,21 @@ namespace CGAL { return firstAll; } +#ifndef CGAL_NO_DEPRECATED_CODE + +/*! + \deprecated This function is deprecated since CGAL 5.6. Use `polyhedron_3_to_lcc()` instead. +*/ template< class LCC, class Polyhedron > -[[deprecated("Use polyhedron_3_to_lcc instead")]] +CGAL_DEPRECATED typename LCC::Dart_descriptor import_from_polyhedron_3(LCC& alcc, const Polyhedron &apoly) { return polyhedron_3_to_lcc(alcc, apoly); } +#endif // CGAL_NO_DEPRECATED_CODE + /** Convert a Polyhedron_3 read into a flux into 3D linear cell complex. * @param alcc the linear cell complex where Polyhedron_3 will be converted. * @param ais the istream where read the Polyhedron_3. diff --git a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h index abd6caf2c51..42b686a6f54 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h +++ b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h @@ -19,6 +19,7 @@ #include #include #include +#include namespace CGAL { @@ -149,15 +150,20 @@ namespace CGAL { return dart; } - template < class LCC, class Triangulation > -[[deprecated("Use triangulation_3_to_lcc instead")]] -typename LCC::Dart_descriptor import_from_triangulation_3 -(LCC& alcc, const Triangulation &atr, - std::map* avol_to_dart=nullptr) +#ifndef CGAL_NO_DEPRECATED_CODE +/*! + \deprecated This function is deprecated since CGAL 5.6. Use `triangulation_3_to_lcc()` instead. +*/ +template +CGAL_DEPRECATED +typename LCC::Dart_descriptor +import_from_triangulation_3(LCC& alcc, const Triangulation& atr, + std::map* avol_to_dart = nullptr) { return triangulation_3_to_lcc(alcc, atr, avol_to_dart); } +#endif } // namespace CGAL