Compare commits

...

141 Commits

Author SHA1 Message Date
Andreas Fabri d1d3ea5248 Lab: use results 2025-11-27 14:10:34 +00:00
Laurent Rineau b3e2f204a4 Merge branch 'master'
# Conflicts:
#	Installation/include/CGAL/version.h
#	Installation/lib/cmake/CGAL/CGALConfigVersion.cmake
2025-09-18 11:29:58 +02:00
Sébastien Loriot fdef97e88e Merge remote-tracking branch 'cgal/6.1.x-branch' into 'cgal/main' 2025-09-15 18:27:14 +02:00
Sébastien Loriot 1f4a934d0f Merge remote-tracking branch 'cgal/6.1.x-branch' into 'cgal/main' 2025-09-09 19:56:20 +02:00
Sebastien Loriot 106f9659b1
Lab: Plugin to open .spheres.txt files (#9028)
## Summary of Changes

Added a Plugin to import .spheres.txt files with a list of spheres.

## Release Management

* Affected package(s): Lab
2025-09-08 15:30:38 +02:00
Sébastien Loriot 72cfcc4156 Merge remote-tracking branch 'cgal/6.1.x-branch' into 'cgal/main' 2025-09-03 16:57:03 +02:00
Sebastien Loriot b2eb8d9331
CGAL: Remove some deprecated functions (#9023)
## Summary of Changes

I start removing some IO functions which are annoying to find in the
search box. More to come.

- [x] `CGAL::write_off()`
- [x] `CGAL::write_wrl()`
- [x] `CGAL::write_vtk()`

### Todo

- [ ] remove the test cases.

## Release Management

* Affected package(s): BGL, Surface_mesh, Point_set_processing

* License and copyright ownership:  unchanged
2025-09-03 16:33:06 +02:00
Andreas Fabri 74cf183ba2 Adress warning 2025-08-21 06:06:38 +01:00
Sébastien Loriot 2ae34a22ba Merge remote-tracking branch 'cgal/6.1.x-branch' into 'cgal/main' 2025-08-13 18:09:36 +02:00
Sebastien Loriot 7b906084dd
BGL: Add Face_around_face_circulator (#9022)
## Summary of Changes

Add missing implementation.  Thank's for pointing out @efifogel 

## Release Management

* Affected package(s): BGL
* Issue(s) solved (if any): fix #9021
* License and copyright ownership:  unchanged
2025-08-13 18:03:34 +02:00
Andreas Fabri 589c5d59a5 cleanup in Polyhedron_3 2025-08-12 07:24:20 +01:00
Andreas Fabri add575c358 cleanup of CMakeLists.txt 2025-08-11 10:17:15 +01:00
Sven Oesau 90f6b74bf4 revert changes to shader_spheres.vert
removing unused function
2025-08-08 12:01:12 +02:00
Sven Oesau 84ece78f82 Lab plugin to open .spheres.txt files with a list of spheres 2025-08-08 11:41:36 +02:00
Sébastien Loriot a827db20db trailing whitespaces 2025-08-07 14:54:56 +02:00
Sébastien Loriot d8b2a56fe3 fix CHANGES.md 2025-08-07 14:47:48 +02:00
Sébastien Loriot 81952a1c18 Merge pull request #8965 from ybellargui/Small_feature/rename_functions_with_deprecated
[Small Feature] Rename import functions with deprecation and add alias tests
2025-08-07 14:42:13 +02:00
Andreas Fabri 5a77ef7ab6 remove deprecated test from CMakeLists.txt 2025-08-07 11:17:07 +01:00
Andreas Fabri c87a0d8b29 remove deprecated test from CMakeLists.txt 2025-08-07 11:03:08 +01:00
Andreas Fabri 4ef2b0a350 Remove BGL/test/BGL/test_deprecated_io.cpp 2025-08-07 07:05:22 +01:00
ybellargui d5ed4e0eae Update CHANGES.md for function renaming 2025-08-06 23:15:41 +02:00
Andreas Fabri ab99c7de81 remove deprecated test 2025-08-06 08:27:12 +01:00
Andreas Fabri c225dd0c34 Surface_mesh 2025-08-06 08:22:31 +01:00
Andreas Fabri 79f93a46df Surface_mesh 2025-08-06 07:51:26 +01:00
Andreas Fabri 91193bf866 In Point_set_processing 2025-08-06 07:41:11 +01:00
Andreas Fabri edd1868f50 CGAL: Remove some deprecated functions 2025-08-05 16:13:44 +01:00
Andreas Fabri 2ec7520d96 BGL: Add Face_around_face_circulator 2025-08-05 15:36:01 +01:00
Sebastien Loriot d731405249
PMP: Fix slow compute_vertex_normal() (#8684)
## Summary of Changes

For the testcase provided in this PR `compute_vertex_normal()` is
particularly slow. A vertex has a fan of incident faces with identical
normal. As the first fix tests with `operator==(Vector_3,Vector_3)` it
is still slow when the object is slightly rotated or perturbed. With a
bound on the angle between normals it is fixed, but is that acceptable?
For `double` probably. Do we have to specialize for exact number types?

## Release Management

* Affected package(s): PMP
* License and copyright ownership: GF
2025-08-05 16:22:21 +02:00
Sebastien Loriot fb1686fca1
SMS: Make Lindstrom Turk placement more robust (#8237)
## Summary of Changes

Reduced data set to illustrate Issue #8213. 
The collapse of edge `v1-v2` results in a completely wrong placement of
the vertex.


![image](https://github.com/CGAL/cgal/assets/3263539/97ff96a1-7f6b-4182-b7b8-5267cb53f8ef)

The next step is to make the placement robust.

## Release Management

* Affected package(s): Surface_mesh_simplification.
* Issue(s) solved (if any): fix #8213
* License and copyright ownership:   unchanged
2025-08-05 16:21:30 +02:00
Sebastien Loriot 833d425ca3
Triangulation: Add static filter for 5D and 6D orientation predicate (#8862)
## Summary of Changes

This PR adds a static filter for the orientation test of 4D, 5D and 6D
points. It is ~20% faster than just interval arithmetic.

- [x] Add for 4D
- [x] ~~Add in sphere predicate~~

## Release Management

* Affected package(s): Triangulation
* License and copyright ownership:  unchanged
2025-08-05 16:15:54 +02:00
Sebastien Loriot 2157a3350b
Tetrahedral_remeshing - make it determistic (#8945)
## Summary of Changes

Tetrahedral_remeshing is not deterministic (though outputs are very
close in 2 consecutive runs).
Making it deterministic...

## Release Management

* Affected package(s): Tetrahedral_remeshing
* License and copyright ownership: unchanged
2025-08-05 16:14:21 +02:00
Sebastien Loriot 8b7010fb33
Reset depth when updating exact (#8944)
Only meaningful when CGAL_PROFILE is defined.
2025-08-05 16:13:21 +02:00
Sebastien Loriot a712bd69a0
Triangulation_2: Document degree() (#8976)
## Summary of Changes

Add the documentation of `degree()`  and also of `is_vertex()`. 

## Release Management

* Affected package(s): 2D Triangulations
* Issue(s) solved (if any): fix #8975
* License and copyright ownership: unchanged
2025-08-05 16:03:06 +02:00
Sebastien Loriot 510db0c4d3
Vector_d == Vector_d (#8995)
## Summary of Changes

implement Vector_d == Vector_d and !=
document it (also for Point_d)
disable < <= > >=

## Release Management

* Affected package(s): NewKernel_d
* Issue(s) solved (if any): fix #8990
2025-08-05 16:02:24 +02:00
Sébastien Loriot 4b9ca293c7 main will now target 6.2 2025-08-04 10:20:25 +02:00
lvalque 748fa237da replace boost::small_vector by std::array 2025-07-30 11:37:43 +02:00
lvalque d0a7b6748b remove unused functor 2025-07-29 17:00:39 +02:00
lvalque 952eb52c5f Merge branch 'PMP-slow_vertex_normal-GF' of github.com:afabri/cgal into PMP-slow_vertex_normal-AFabri 2025-07-29 09:51:28 +02:00
lvalque d19ae8a395
Update Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp
Co-authored-by: Andreas Fabri <andreas.fabri@geometryfactory.com>
2025-07-28 17:51:16 +02:00
lvalque 1b830ee23c
Apply suggestions from code review
Co-authored-by: Andreas Fabri <andreas.fabri@geometryfactory.com>
2025-07-28 16:44:29 +02:00
lvalque 37262f5f7e include of small_vector.hpp was missing 2025-07-28 15:08:14 +02:00
Marc Glisse 89c0551c82 Vector_d == Vector_d
implement it
document it (also for Point_d)
disable < <= > >=
2025-07-23 14:29:21 +02:00
Andreas Fabri 5b547309e7 Read the right input file in test_triangulation_static_filters_6 2025-07-22 07:20:17 +01:00
lvalque 20d1c99950 adjust the error_bound to be consistant with the one in does_enclose_other_normal 2025-07-18 17:07:42 +02:00
lvalque 7840dc8506 Remove the old algorithm in n^4 2025-07-18 16:50:12 +02:00
lvalque 1d27b1ae44 Factorization and cleanup of compute_vertex_normal_most_visible_min_circle() 2025-07-18 16:47:48 +02:00
Andreas Fabri 17586da7a4 No need to spatial_sort() 2025-07-17 19:34:06 +01:00
Yliess Bellargui 5a28105560 [Small Feature] Fix alias tests: move CGAL_NO_DEPRECATED_CODE guard inside main() 2025-07-17 17:04:36 +02:00
Yliess Bellargui b9c05d8e3a [Small Feature] Cleanup deprecated warnings 2025-07-17 16:43:01 +02:00
Mael Rouxel-Labbé 263dc8b49b Misc fixes 2025-07-17 12:16:25 +02:00
Mael 13f5968eaa
Clean up 2025-07-17 11:37:58 +02:00
Yliess Bellargui 60782f879f [Small Feature] Clean up test targets with CGAL_NO_DEPRECATION_WARNINGS 2025-07-16 16:42:55 +02:00
Yliess Bellargui 48e2387253 [Small Feature] Use CGAL_DEPRECATED and protect deprecated functions 2025-07-16 14:43:17 +02:00
Yliess Bellargui 66de6cba3d [Small Feature] Use CGAL_DEPRECATED and protect deprecated functions 2025-07-16 13:56:17 +02:00
lvalque 4018082784 Variants as if maccro instead of comment lines 2025-07-16 12:10:08 +02:00
lvalque f51867ac36 delete Boundinx_box_filter.h 2025-07-16 12:09:09 +02:00
lvalque 02883a4196 rename CrossProduct.h to robust_cross_product.h and move it in the appropriate directory 2025-07-15 18:35:10 +02:00
lvalque dc2f51ba03 Merge branch 'SMS-issue_8213-GF' of github.com:afabri/cgal into SMS-issue_8213-GF 2025-07-15 17:24:36 +02:00
Andreas Fabri 8476307276 Add call of T2::is_vertex() in the testsuite 2025-07-15 11:14:26 +01:00
Andreas Fabri 3fbdc2deed polish 2025-07-15 11:03:47 +01:00
Andreas Fabri 61baefa79a
Apply suggestions from code review
Co-authored-by: Mael <mael.rouxel.labbe@geometryfactory.com>
2025-07-15 12:00:44 +02:00
Yliess Bellargui 289716dbab [Small Feature] Fix deprecation warnings in test files 2025-07-15 07:53:26 +02:00
lvalque 06787e2246 Merge branch 'PMP-slow_vertex_normal-GF' of github.com:LeoValque/cgal into PMP-slow_vertex_normal-GF 2025-07-12 20:21:30 +02:00
Andreas Fabri 8d4877b025 Triangulation_2: Document degree() 2025-07-09 15:09:42 +01:00
Yliess Bellargui 81e0122efa [Small Feature] Fix missing comment terminator in doc 2025-07-08 12:10:12 +02:00
Yliess Bellargui afc4f72b26 [Small Feature] Rename plane_graph_to_lcc -> read_plane_graph_in_lcc 2025-07-08 09:45:15 +02:00
Andreas Fabri b54a4268d0 Add 5d and 6d test 2025-07-04 10:24:56 +01:00
Andreas Fabri f9bf2571dd Add a test for the 4D static filters 2025-07-04 08:27:55 +01:00
Sébastien Loriot ce87535e11 fix doxygen command 2025-07-03 14:05:46 +02:00
Jane Tournois 0cf1ff531b comment verbose macro 2025-07-03 10:33:38 +02:00
Sébastien Loriot 388632e0fa fix warning 2025-07-03 09:46:32 +02:00
Sébastien Loriot 1d9c84f9ef static -> inline 2025-07-03 09:41:43 +02:00
Sébastien Loriot 7977b1f22d fix compilation errors 2025-07-03 09:37:41 +02:00
Sébastien Loriot 1c61ef7de9 fix warnings 2025-07-03 09:34:40 +02:00
Sébastien Loriot 143a8e1e88 fix warning 2025-07-03 09:31:23 +02:00
Sébastien Loriot 6bc33ee1ac unused var 2025-07-02 20:23:46 +02:00
Andreas Fabri 076ffc109f It works also for 4D and we go from 2sec to 1.2 sec 2025-07-02 17:31:21 +01:00
Andreas Fabri 15760cfc78 In 5D we enter Orientation_5, but not in 4D. why? 2025-07-02 17:08:49 +01:00
Andreas Fabri b38b13e2ef WIP for bench4 2025-07-02 16:55:01 +01:00
Sébastien Loriot 1e991ff6ad disambiguate determinant call 2025-07-02 17:06:22 +02:00
Sébastien Loriot 605afd3fe5 add missing include 2025-07-02 15:10:27 +02:00
Andreas Fabri c6b19ed0e3 Add license header 2025-07-02 10:40:52 +01:00
Andreas Fabri 496239a0ed Integrate generated files 2025-07-02 10:32:21 +01:00
Andreas Fabri 63cc54c367 Less abs() 2025-07-01 18:15:07 +01:00
Andreas Fabri 68d2be2798 Less calls to abs() 2025-07-01 17:28:34 +01:00
Yliess Bellargui e170d7b0de [Small Feature] Apply review: cleanup doc, remove old alias, fix tests 2025-07-01 17:30:00 +02:00
Sébastien Loriot f2e16bd0c9 dim 6 2025-07-01 16:05:37 +02:00
Sébastien Loriot 8daad7fc09 fix predicate and add filtered version 2025-07-01 15:58:00 +02:00
Andreas Fabri 5bfaaac650 Addd source for filter generator 2025-07-01 11:41:06 +01:00
Yliess Bellargui ff6a91eb61 [Small Feature] Rename import functions with deprecation and add alias tests 2025-07-01 11:36:49 +02:00
Jane Tournois cb19aa7feb cleaning 2025-06-20 14:23:02 +02:00
Jane Tournois fcf02c4ceb make tetrahedral_remeshing deterministic
* use make_vertex_pair(edge) for ordered pair
* do not move vertices in the order of the unordered_map m_vertex_id,
but in the order of vertices_iterator, which is deterministic. To do so,
add struct Move that embeds all the needed data to compute the move

AND avoid computing twice the same midpoint
2025-06-20 14:22:50 +02:00
Jane Tournois ecd2ed13f8 add a test for determinism of Tetrahedral_remeshing 2025-06-19 15:01:45 +02:00
Sébastien Loriot c165dcaa8f reset depth when updating exact 2025-06-18 16:44:27 +02:00
Léo Valque 69a00534f8 Solve bug in compute normals 2025-06-11 11:24:26 +02:00
Léo Valque b6e9acb9d3 add a min circum circle algorithmm of elziga end hearn instead of naive one 2025-06-11 10:42:36 +02:00
Andreas Fabri a7edfa506f merge cgal/master 2025-05-22 15:39:23 +01:00
Andreas Fabri 6acfaaedac fix minor 2025-05-22 15:37:41 +01:00
Andreas Fabri 0f86fa6d23 clean up in the cross product alternatives 2025-05-22 15:20:14 +01:00
Andreas Fabri c63c2a24e2 Activate Leo's code 2025-05-22 14:51:31 +01:00
Andreas Fabri 51d035d9d9 'Fix' in an untested function 2025-04-28 16:23:27 +01:00
Andreas Fabri 6b729748e1 Adress some items of Issue #8802 2025-04-28 16:09:13 +01:00
Andreas Fabri 9a134d2145 Adress some items of Issue #8802 2025-04-28 15:39:43 +01:00
Andreas Fabri 338b31bf32 Add dependency 2025-04-28 12:07:16 +01:00
Andreas Fabri 400c1da751 In bench6.cpp add indices to the vertices, and report the edges on the convex hull 2025-04-25 17:26:18 +01:00
Andreas Fabri a2cfa40a26 Add CGAL:: in a concept 2025-04-25 15:19:38 +01:00
Andreas Fabri f75ddf8eda less abs() calls 2025-04-24 21:48:35 +01:00
Andreas Fabri 9e588e9b1a fabs > CGAL::abs 2025-04-24 13:57:51 +01:00
Andreas Fabri a9621595e5 Fixed code for 6D. For 100K points: 133 instead of 239 sec 2025-04-24 13:42:44 +01:00
Andreas Fabri 717f6aff44 Add benchmark and static filter for 6D 2025-04-24 10:32:25 +01:00
Andreas Fabri e45f8faaa7 typo 2025-04-24 09:24:32 +01:00
Sébastien Loriot c75cc8aabd FPG output for the orientationC6 2025-04-24 10:23:25 +02:00
Andreas Fabri 3d0a5e54a2 Add source of Orientation_6 for FPG 2025-04-24 09:19:00 +01:00
Andreas Fabri 90a376de17 Add to package description 2025-04-24 08:39:07 +01:00
Andreas Fabri eef2bea7b1 Add doc for storage policies 2025-04-24 08:11:39 +01:00
Andreas Fabri f147e0f0cc Use TDS_full_cell_mirror_storage_policy 2025-04-23 20:54:42 +01:00
Andreas Fabri d9c4f603ee const& 2025-04-23 17:47:47 +01:00
Andreas Fabri 9f07b04778 Replace queue with stack<T,Vector<T>> in insert_in_tagged_hole. static/data member would give even more speed 2025-04-23 17:41:25 +01:00
Andreas Fabri 0e61fdc8e1 vector for visited cells 2025-04-23 15:44:20 +01:00
Andreas Fabri 41ecef0fa3 Add macro for disabling filtering CGAL_NO_STATIC_FILTER_5 2025-04-23 14:51:31 +01:00
Andreas Fabri 23526e4c3b Static filter works but is slower than unfiltered :< 2025-04-23 14:23:54 +01:00
Sébastien Loriot 1c07d4c3b4 FPG generated version 2025-04-23 14:55:29 +02:00
Andreas Fabri f747db2774 rewrite predicate 2025-04-23 13:48:57 +01:00
Andreas Fabri 2d0dfd2822 Compiles but segfault 2025-04-23 11:53:03 +01:00
Andreas Fabri b9f983a515 Add static filter for Orientation_5 2025-04-23 11:00:43 +01:00
Sébastien Loriot e622f3e03e replace with FPG generated code 2025-04-23 11:08:12 +02:00
Sébastien Loriot f21e9b18ba update predicate source 2025-04-23 11:07:38 +02:00
Andreas Fabri 8cacb534a5 needs one more point 2025-04-23 09:42:15 +01:00
Andreas Fabri e79ee242bd Add code for FPG of Orientation_5 2025-04-23 09:37:39 +01:00
Léo Valque cc5297554c Correct code with suggestion of sebastien 2025-04-01 09:48:25 +02:00
Léo Valque 95b4eba11e Fix of issue 8213 by consider length of a vector being zero if enough small, define diff_of_product in a specific file 2025-02-06 09:35:02 +01:00
Andreas Fabri be12df3dc1 A deviation of 0.1 degree can savely considered as zero here 2025-01-13 07:18:26 +00:00
Andreas Fabri 125a0d6041 A trivial fix for the data set, but does not work when the face normals are slightly perturbed 2025-01-10 09:16:17 +00:00
Andreas Fabri 924bfdf2c3 PMP: Slow compute_vertex_normal() 2025-01-09 14:00:52 +00:00
Andreas Fabri b54a2eab1a Add a filter 2024-05-30 14:59:22 +01:00
Mael Rouxel-Labbé 042cb277fb Use the more robust formulation on another eligible cross product 2024-05-30 14:58:00 +02:00
Mael Rouxel-Labbé c40da70441 Enhance example 2024-05-30 14:46:49 +02:00
Mael Rouxel-Labbé 24e1c96f62 Fix trace function 2024-05-30 14:46:35 +02:00
Mael Rouxel-Labbé b80c1d8f48 Comments & debug code 2024-05-30 14:46:19 +02:00
Mael Rouxel-Labbé 99613eb99c Generalize an expression to make it easier to use other kernels 2024-05-30 14:45:40 +02:00
Andreas Fabri 8e5c5b84f3 SMS: Fix placement 2024-05-29 09:52:23 +01:00
113 changed files with 5545 additions and 1885 deletions

View File

@ -509,8 +509,7 @@ the requirement for traversal of all faces in a graph.
/// I/O Functions for the \ref IOStream3MF
/// \ingroup PkgBGLIOFct
/// \defgroup PkgBGLIOFctDeprecated I/O Functions (Deprecated)
/// \ingroup PkgBGLIOFct
/*!
\addtogroup PkgBGLPropertiesDynamic

View File

@ -247,36 +247,7 @@ bool read_OFF(const std::string& fname,
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgBGLIOFctDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF()` should be used instead.
*/
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_off(std::istream& is, Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::read_OFF(is, g, np);
}
/*!
\ingroup PkgBGLIOFctDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF()` should be used instead.
*/
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_off(const char* fname, Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::read_OFF(fname, g, np);
}
template <typename Graph>
CGAL_DEPRECATED bool read_off(const std::string& fname, Graph& g)
{
return read_off(fname.c_str(), g, parameters::default_values());
}
#endif // CGAL_NO_DEPRECATED_CODE
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -453,31 +424,6 @@ bool write_OFF(const std::string& fname,
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgBGLIOFctDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF()` should be used instead.
*/
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::write_OFF(os, g, np);
}
/*!
\ingroup PkgBGLIOFctDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF()` should be used instead.
*/
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool write_off(const char* fname, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::write_OFF(fname, g, np);
}
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL

View File

@ -529,20 +529,7 @@ bool write_VTP(const std::string& fname, const Graph& g, const CGAL_NP_CLASS& np
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgBGLIOFctDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_VTP()` should be used instead.
*/
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool write_vtp(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::write_VTP(os, g, np);
}
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL

View File

@ -111,20 +111,7 @@ bool write_WRL(const std::string& fname, const Graph& g, const CGAL_NP_CLASS& np
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgBGLIOFctDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_WRL()` should be used instead.
*/
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool write_wrl(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::write_WRL(os, g, np);
}
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL

View File

@ -871,7 +871,54 @@ private:
*/
template <typename Graph>
class Face_around_face_circulator
{};
#ifndef DOXYGEN_RUNNING
: public boost::iterator_adaptor<
Face_around_face_circulator<Graph> // Derived
, Halfedge_around_face_circulator<Graph> // Base
, typename boost::graph_traits<Graph>::face_descriptor // Value
, Bidirectional_circulator_tag // CategoryOrTraversal
, typename boost::graph_traits<Graph>::face_descriptor // Reference
>
#endif
{
internal::Opposite_face<Graph> fct;
typedef typename boost::graph_traits<Graph>::halfedge_descriptor halfedge_descriptor;
public:
#ifndef DOXYGEN_RUNNING
typedef std::size_t size_type;
#endif
Face_around_face_circulator()
{}
Face_around_face_circulator(halfedge_descriptor h, const Graph& g)
: Face_around_face_circulator::iterator_adaptor_(Halfedge_around_face_circulator<Graph>(h,g)), fct(g)
{}
#ifndef DOXYGEN_RUNNING
explicit operator bool() const
{
return (! (this->base_reference() == nullptr));
}
bool operator== (void*) const
{
return this->base_reference()== nullptr;
}
bool operator!= (void*) const
{
return this->base_reference()!= nullptr;
}
private:
friend class boost::iterator_core_access;
typename boost::graph_traits<Graph>::face_descriptor dereference() const { return fct(*this->base_reference()); }
#endif
};
/**
* \ingroup PkgBGLIterators

View File

@ -38,7 +38,6 @@ create_single_source_cgal_program("test_graph_traits.cpp")
create_single_source_cgal_program("test_Properties.cpp")
create_single_source_cgal_program("bench_read_from_stream_vs_add_face_and_add_faces.cpp")
create_single_source_cgal_program("graph_traits_inheritance.cpp" )
create_single_source_cgal_program("test_deprecated_io.cpp")
find_package(OpenMesh QUIET)
if(OpenMesh_FOUND)
@ -69,8 +68,6 @@ if (VTK_FOUND AND VTK_LIBRARIES)
message(STATUS "VTK ${VTK_VERSION} found ${VTK_LIBRARIES}")
target_link_libraries(test_bgl_read_write PRIVATE ${VTK_LIBRARIES})
target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK -DNOMINMAX)
target_link_libraries(test_deprecated_io PRIVATE ${VTK_LIBRARIES})
target_compile_definitions(test_deprecated_io PRIVATE -DCGAL_USE_VTK -DNOMINMAX)
else()
message(STATUS "Tests that use VTK will not be compiled.")
endif() #VTK_FOUND

View File

@ -18,6 +18,7 @@ typedef GraphTraits::edge_descriptor edge_descriptor;
typedef GraphTraits::out_edge_iterator out_edge_iterator;
typedef GraphTraits::in_edge_iterator in_edge_iterator;
typedef CGAL::Face_around_face_circulator<Polyhedron> face_around_face_circulator;
typedef CGAL::Halfedge_around_face_circulator<Polyhedron> halfedge_around_face_circulator;
typedef CGAL::Halfedge_around_target_circulator<Polyhedron> halfedge_around_target_circulator;
typedef CGAL::Vertex_around_target_circulator<Polyhedron> vertex_around_target_circulator;
@ -32,6 +33,7 @@ typedef CGAL::Vertex_around_target_iterator<Polyhedron> vertex_around_target_ite
int main(int argc, char* argv[])
{
BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator<face_around_face_circulator>));
BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator<halfedge_around_face_circulator>));
BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator<halfedge_around_target_circulator>));
BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator<vertex_around_target_circulator>));
@ -62,6 +64,14 @@ int main(int argc, char* argv[])
}while(hafc != done);
}
{
face_around_face_circulator fafc(hd,P), done(fafc);
do {
++fafc;
}while(fafc != done);
}
{
halfedge_around_target_circulator havc(hd,P), done(havc);
vertex_descriptor vd = target(hd,P);

View File

@ -1,59 +0,0 @@
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
#include <fstream>
#include <iostream>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/boost/graph/generators.h>
#include <CGAL/boost/graph/IO/OFF.h>
#include <CGAL/boost/graph/IO/VTK.h>
#include <CGAL/boost/graph/IO/WRL.h>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point_3;
typedef CGAL::Surface_mesh<Point_3> SM;
int main()
{
// OFF
SM sm_in, sm_out;
Point_3 p0(0,0,0), p1(1,0,0), p2(0,1,0);
CGAL::make_triangle(p0, p1, p2, sm_out);
bool ok = CGAL::write_off("tmp_deprecated.off", sm_out);
assert(ok);
ok = CGAL::read_off("tmp_deprecated.off", sm_in);
assert(ok);
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
sm_in.clear();
std::ofstream os("tmp_deprecated.off");
ok = CGAL::write_off(os, sm_out);
assert(ok);
os.close();
std::ifstream is("tmp_deprecated.off");
ok = CGAL::read_off(is, sm_in);
assert(ok);
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
is.close();
sm_in.clear();
#ifdef CGAL_USE_VTK
//vtk
os.open("tmp_deprecated.vtp");
ok = CGAL::write_vtp(os, sm_out);
assert(ok);
os.close();
ok = CGAL::IO::read_VTP("tmp_deprecated.vtp", sm_in);
assert(ok);
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
sm_in.clear();
#endif
//wrl
os.open("tmp_deprecated.wrl");
ok = CGAL::write_wrl(os, sm_out);
assert(ok);
os.close();
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,221 @@
// Copyright (c) 2025 GeometryFactory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Andreas Fabri
#ifndef CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_4_H
#define CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_4_H
#include <CGAL/Profile_counter.h>
#include <CGAL/Filtered_kernel/internal/Static_filters/Static_filter_error.h>
#include <CGAL/determinant.h>
#include <cmath>
namespace CGAL { namespace internal { namespace Static_filters_predicates {
template < typename K_base >
class Orientation_4
: public K_base::Orientation_4
{
typedef typename K_base::Orientation Orientation;
typedef typename K_base::Point_4 Point_4;
typedef typename K_base::Orientation_4 Base;
public:
using Base::operator();
Orientation
operator()(const Point_4 &p, const Point_4 &q,
const Point_4 &r, const Point_4 &s,
const Point_4 &t) const
{
CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_4", tmp);
double p0, p1, p2, p3, q0, q1, q2, q3, r0, r1, r2, r3, s0, s1, s2, s3, t0, t1, t2, t3;
if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) &&
fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) &&
fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) &&
fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) &&
fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) &&
fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) &&
fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) &&
fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) &&
fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) &&
fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) )
{
CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t));
double m01;
m01 = (q0 - p0);
double m02;
m02 = (r0 - p0);
double m03;
m03 = (s0 - p0);
double m04;
m04 = (t0 - p0);
double m11;
m11 = (q1 - p1);
double m12;
m12 = (r1 - p1);
double m13;
m13 = (s1 - p1);
double m14;
m14 = (t1 - p1);
double m21;
m21 = (q2 - p2);
double m22;
m22 = (r2 - p2);
double m23;
m23 = (s2 - p2);
double m24;
m24 = (t2 - p2);
double m31;
m31 = (q3 - p3);
double m32;
m32 = (r3 - p3);
double m33;
m33 = (s3 - p3);
double m34;
m34 = (t3 - p3);
double det;
det = ::CGAL::determinant( m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34 );
double eps;
double max1 = CGAL::abs(m01);
double am = CGAL::abs(m02);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m03);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m11);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m12);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m13);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m23);
if( (max1 < am) ) { max1 = am; }
double max2 = CGAL::abs(m01);
am = CGAL::abs(m02);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m11);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m12);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m21);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m22);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m23);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m33);
if( (max2 < am) ) { max2 = am; }
double max3 = CGAL::abs(m04);
am = CGAL::abs(m14);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m24);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m34);
if( (max3 < am) ) { max3 = am; }
double max4 = CGAL::abs(m11);
am = CGAL::abs(m12);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m21);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m22);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m31);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m32);
if( (max4 < am) ) { max4 = am; }
double lower_bound_1;
double upper_bound_1;
lower_bound_1 = max1;
upper_bound_1 = max1;
if( (max2 < lower_bound_1) )
{
lower_bound_1 = max2;
}
else
{
if( (max2 > upper_bound_1) )
{
upper_bound_1 = max2;
}
}
if( (max3 < lower_bound_1) )
{
lower_bound_1 = max3;
}
else
{
if( (max3 > upper_bound_1) )
{
upper_bound_1 = max3;
}
}
if( (max4 < lower_bound_1) )
{
lower_bound_1 = max4;
}
else
{
if( (max4 > upper_bound_1) )
{
upper_bound_1 = max4;
}
}
if( (lower_bound_1 < 2.89273249588395272840e-74) )
{
return Base::operator()(p, q, r, s, t);
}
else
{
if( (upper_bound_1 > 7.23700557733225900010e+75) )
{
return Base::operator()(p, q, r, s, t);
}
eps = (3.17768858673611327578e-14 * (((max4 * max2) * max1) * max3));
if( (det > eps) )
{
CGAL_assertion(should_be == POSITIVE);
return POSITIVE;
}
else
{
if( (det < -eps) )
{
CGAL_assertion(should_be == NEGATIVE);
return NEGATIVE;
}
else
{
return Base::operator()(p, q, r, s, t);
}
}
}
}
return Base::operator()(p, q, r, s, t);
}
};
} } } // namespace CGAL::internal::Static_filters_predicates
#endif // CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_4_H

View File

@ -0,0 +1,289 @@
// Copyright (c) 2025 GeometryFactory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Andreas Fabri
#ifndef CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_5_H
#define CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_5_H
#include <CGAL/Profile_counter.h>
#include <CGAL/Filtered_kernel/internal/Static_filters/Static_filter_error.h>
#include <CGAL/determinant.h>
#include <cmath>
namespace CGAL { namespace internal { namespace Static_filters_predicates {
template < typename K_base >
class Orientation_5
: public K_base::Orientation_5
{
typedef typename K_base::Orientation Orientation;
typedef typename K_base::Point_5 Point_5;
typedef typename K_base::Orientation_5 Base;
public:
using Base::operator();
Orientation
operator()(const Point_5 &p, const Point_5 &q,
const Point_5 &r, const Point_5 &s,
const Point_5 &t, const Point_5 &u) const
{
CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_5", tmp);
double p0, p1, p2, p3, p4, q0, q1, q2, q3, q4, r0, r1, r2, r3, r4, s0, s1, s2, s3, s4, t0, t1, t2, t3, t4, u0, u1, u2, u3, u4;
if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) &&
fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) &&
fit_in_double(p.c4(), p4) &&
fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) &&
fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) &&
fit_in_double(q.c4(), q4) &&
fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) &&
fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) &&
fit_in_double(r.c4(), r4) &&
fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) &&
fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) &&
fit_in_double(s.c4(), s4) &&
fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) &&
fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) &&
fit_in_double(t.c4(), t4) &&
fit_in_double(u.c0(), u0) && fit_in_double(u.c1(), u1) &&
fit_in_double(u.c2(), u2) && fit_in_double(u.c3(), u3) &&
fit_in_double(u.c4(), u4))
{
CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t, u));
double m01;
m01 = (q0 - p0);
double m02;
m02 = (r0 - p0);
double m03;
m03 = (s0 - p0);
double m04;
m04 = (t0 - p0);
double m05;
m05 = (u0 - p0);
double m11;
m11 = (q1 - p1);
double m12;
m12 = (r1 - p1);
double m13;
m13 = (s1 - p1);
double m14;
m14 = (t1 - p1);
double m15;
m15 = (u1 - p1);
double m21;
m21 = (q2 - p2);
double m22;
m22 = (r2 - p2);
double m23;
m23 = (s2 - p2);
double m24;
m24 = (t2 - p2);
double m25;
m25 = (u2 - p2);
double m31;
m31 = (q3 - p3);
double m32;
m32 = (r3 - p3);
double m33;
m33 = (s3 - p3);
double m34;
m34 = (t3 - p3);
double m35;
m35 = (u3 - p3);
double m41;
m41 = (q4 - p4);
double m42;
m42 = (r4 - p4);
double m43;
m43 = (s4 - p4);
double m44;
m44 = (t4 - p4);
double m45;
m45 = (u4 - p4);
double det;
det = ::CGAL::determinant( m01, m02, m03, m04, m05, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25, m31, m32, m33, m34, m35, m41, m42, m43, m44, m45 );
double eps;
double max1 = CGAL::abs(m01);
double am = CGAL::abs(m02);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m03);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m11);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m12);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m13);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m21);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m22);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m23);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m33);
if( (max1 < am) ) { max1 = am; }
double max2 = CGAL::abs(m01);
am = CGAL::abs(m02);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m11);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m12);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m21);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m22);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m23);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m31);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m32);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m33);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m43);
if( (max2 < am) ) { max2 = am; }
double max3 = CGAL::abs(m04);
am = CGAL::abs(m14);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m24);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m34);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m44);
if( (max3 < am) ) { max3 = am; }
double max4 = CGAL::abs(m05);
am = CGAL::abs(m15);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m25);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m35);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m45);
if( (max4 < am) ) { max4 = am; }
double max5 = CGAL::abs(m11);
am = CGAL::abs(m12);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m21);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m22);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m31);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m32);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m41);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m42);
if( (max5 < am) ) { max5 = am; }
double lower_bound_1;
double upper_bound_1;
lower_bound_1 = max5;
upper_bound_1 = max5;
if( (max1 < lower_bound_1) )
{
lower_bound_1 = max1;
}
else
{
if( (max1 > upper_bound_1) )
{
upper_bound_1 = max1;
}
}
if( (max2 < lower_bound_1) )
{
lower_bound_1 = max2;
}
else
{
if( (max2 > upper_bound_1) )
{
upper_bound_1 = max2;
}
}
if( (max3 < lower_bound_1) )
{
lower_bound_1 = max3;
}
else
{
if( (max3 > upper_bound_1) )
{
upper_bound_1 = max3;
}
}
if( (max4 < lower_bound_1) )
{
lower_bound_1 = max4;
}
else
{
if( (max4 > upper_bound_1) )
{
upper_bound_1 = max4;
}
}
if( (lower_bound_1 < 9.99657131447050328602e-60) )
{
return Base::operator()(p, q, r, s, t, u);
}
else
{
if( (upper_bound_1 > 3.21387608851797912384e+60) )
{
return Base::operator()(p, q, r, s, t, u);
}
eps = (2.22889232457534740153e-13 * ((((max5 * max2) * max1) * max3) * max4));
if( (det > eps) )
{
CGAL_assertion(should_be == POSITIVE);
return POSITIVE;
}
else
{
if( (det < -eps) )
{
CGAL_assertion(should_be == NEGATIVE);
return NEGATIVE;
}
else
{
return Base::operator()(p, q, r, s, t, u);
}
}
}
}
return Base::operator()(p, q, r, s, t, u);
}
};
} } } // namespace CGAL::internal::Static_filters_predicates
#endif // CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_5_H

View File

@ -0,0 +1,358 @@
// Copyright (c) 2025 GeometryFactory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Andreas Fabri
#ifndef CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_6_H
#define CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_6_H
#include <CGAL/Profile_counter.h>
#include <CGAL/Filtered_kernel/internal/Static_filters/Static_filter_error.h>
#include <CGAL/determinant.h>
#include <cmath>
namespace CGAL { namespace internal { namespace Static_filters_predicates {
template < typename K_base >
class Orientation_6
: public K_base::Orientation_6
{
typedef typename K_base::Orientation Orientation;
typedef typename K_base::Point_6 Point_6;
typedef typename K_base::Orientation_6 Base;
public:
using Base::operator();
Orientation
operator()(const Point_6 &p, const Point_6 &q,
const Point_6 &r, const Point_6 &s,
const Point_6 &t, const Point_6 &u, const Point_6 &v) const
{
CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_6", tmp);
double p0, p1, p2, p3, p4, p5, q0, q1, q2, q3, q4, q5, r0, r1, r2, r3, r4, r5, s0, s1, s2, s3, s4, s5, t0, t1, t2, t3, t4, t5, u0, u1, u2, u3, u4, u5, v0, v1, v2, v3, v4, v5;
if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) &&
fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) &&
fit_in_double(p.c4(), p4) && fit_in_double(p.c5(), p5) &&
fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) &&
fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) &&
fit_in_double(q.c4(), q4) && fit_in_double(q.c5(), q5) &&
fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) &&
fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) &&
fit_in_double(r.c4(), r4) && fit_in_double(r.c5(), r5) &&
fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) &&
fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) &&
fit_in_double(s.c4(), s4) && fit_in_double(s.c5(), s5) &&
fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) &&
fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) &&
fit_in_double(t.c4(), t4) && fit_in_double(t.c5(), t5) &&
fit_in_double(u.c0(), u0) && fit_in_double(u.c1(), u1) &&
fit_in_double(u.c2(), u2) && fit_in_double(u.c3(), u3) &&
fit_in_double(u.c4(), u4) && fit_in_double(u.c5(), u5) &&
fit_in_double(v.c0(), v0) && fit_in_double(v.c1(), v1) &&
fit_in_double(v.c2(), v2) && fit_in_double(v.c3(), v3) &&
fit_in_double(v.c4(), v4) && fit_in_double(v.c5(), v5))
{
CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t, u, v));
double m01;
m01 = (q0 - p0);
double m02;
m02 = (r0 - p0);
double m03;
m03 = (s0 - p0);
double m04;
m04 = (t0 - p0);
double m05;
m05 = (u0 - p0);
double m06;
m06 = (v0 - p0);
double m11;
m11 = (q1 - p1);
double m12;
m12 = (r1 - p1);
double m13;
m13 = (s1 - p1);
double m14;
m14 = (t1 - p1);
double m15;
m15 = (u1 - p1);
double m16;
m16 = (v1 - p1);
double m21;
m21 = (q2 - p2);
double m22;
m22 = (r2 - p2);
double m23;
m23 = (s2 - p2);
double m24;
m24 = (t2 - p2);
double m25;
m25 = (u2 - p2);
double m26;
m26 = (v2 - p2);
double m31;
m31 = (q3 - p3);
double m32;
m32 = (r3 - p3);
double m33;
m33 = (s3 - p3);
double m34;
m34 = (t3 - p3);
double m35;
m35 = (u3 - p3);
double m36;
m36 = (v3 - p3);
double m41;
m41 = (q4 - p4);
double m42;
m42 = (r4 - p4);
double m43;
m43 = (s4 - p4);
double m44;
m44 = (t4 - p4);
double m45;
m45 = (u4 - p4);
double m46;
m46 = (v4 - p4);
double m51;
m51 = (q5 - p5);
double m52;
m52 = (r5 - p5);
double m53;
m53 = (s5 - p5);
double m54;
m54 = (t5 - p5);
double m55;
m55 = (u5 - p5);
double m56;
m56 = (v5 - p5);
double det;
det = ::CGAL::determinant( m01, m02, m03, m04, m05, m06, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26, m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56 );
double eps;
double max1 = CGAL::abs(m01);
double am = CGAL::abs(m02);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m11);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m12);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m21);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m22);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m31);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m32);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m41);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m42);
if( (max1 < am) ) { max1 = am; }
double max2 = CGAL::abs(m03);
am = CGAL::abs(m11);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m12);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m13);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m21);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m22);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m23);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m31);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m32);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m33);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m41);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m42);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m43);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m51);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m52);
if( (max2 < am) ) { max2 = am; }
double max3 = CGAL::abs(m04);
am = CGAL::abs(m14);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m24);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m34);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m44);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m54);
if( (max3 < am) ) { max3 = am; }
double max4 = CGAL::abs(m05);
am = CGAL::abs(m15);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m25);
if( (max4 < am) ) { max3 = am; }
am = CGAL::abs(m35);
if( (max4 < am) ) { max4= am; }
am = CGAL::abs(m45);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m55);
if( (max4 < am) ) { max4 = am; }
double max5 = CGAL::abs(m06);
am = CGAL::abs(m16);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m26);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m36);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m46);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m56);
if( (max5 < am) ) { max5 = am; }
double max6 = CGAL::abs(m13);
am = CGAL::abs(m21);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m22);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m23);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m31);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m32);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m33);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m41);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m42);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m43);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m51);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m52);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m53);
am = CGAL::abs(m53);
if( (max6 < am) ) { max6 = am; }
double lower_bound_1;
double upper_bound_1;
lower_bound_1 = max6;
upper_bound_1 = max6;
if( (max5 < lower_bound_1) )
{
lower_bound_1 = max5;
}
else
{
if( (max5 > upper_bound_1) )
{
upper_bound_1 = max5;
}
}
if( (max1 < lower_bound_1) )
{
lower_bound_1 = max1;
}
else
{
if( (max1 > upper_bound_1) )
{
upper_bound_1 = max1;
}
}
if( (max2 < lower_bound_1) )
{
lower_bound_1 = max2;
}
else
{
if( (max2 > upper_bound_1) )
{
upper_bound_1 = max2;
}
}
if( (max3 < lower_bound_1) )
{
lower_bound_1 = max3;
}
else
{
if( (max3 > upper_bound_1) )
{
upper_bound_1 = max3;
}
}
if( (max4 < lower_bound_1) )
{
lower_bound_1 = max4;
}
else
{
if( (max4 > upper_bound_1) )
{
upper_bound_1 = max4;
}
}
if( (lower_bound_1 < 4.82472686053427214432e-50) )
{
return Base::operator()(p, q, r, s, t, u, v);
}
else
{
if( (upper_bound_1 > 1.87072209578355511223e+50) )
{
return Base::operator()(p, q, r, s, t, u, v);
}
eps = (1.76403842114300859158e-12 * (((((max1 * max2) * max6) * max3) * max4) * max5));
if( (det > eps) )
{
CGAL_assertion(should_be == POSITIVE);
return POSITIVE;
}
else
{
if( (det < -eps) )
{
CGAL_assertion(should_be == NEGATIVE);
return NEGATIVE;
}
}
}
}
return Base::operator()(p, q, r, s, t, u, v);
}
};
} } } // namespace CGAL::internal::Static_filters_predicates
#endif // CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_6_H

View File

@ -229,14 +229,14 @@ print_dag(const Return_base_tag&, std::ostream& os, int level)
struct Depth_base {
#ifdef CGAL_PROFILE
int depth_;
mutable int depth_;
Depth_base()
: depth_(0)
{}
int depth() const { return depth_; }
void set_depth(int i)
void set_depth(int i) const
{
depth_ = i;
CGAL_HISTOGRAM_PROFILER(std::string("[Lazy_kernel DAG depths]"), i);
@ -244,7 +244,7 @@ struct Depth_base {
}
#else
int depth() const { return 0; }
void set_depth(int) {}
void set_depth(int) const {}
#endif
};
@ -656,6 +656,7 @@ class Lazy_rep_n final :
auto* p = new typename Base::Indirect(ec()( CGAL::exact( std::get<I>(l) ) ... ) );
this->set_at(p);
this->set_ptr(p);
this->set_depth(0);
if(!noprune || is_currently_single_threaded())
lazy_reset_member(l);
}

View File

@ -1,5 +1,17 @@
# Release History
## [Release 6.2](https://github.com/CGAL/cgal/releases/tag/v6.2)
Release date: July 2026
### [Linear Cell Complex](https://doc.cgal.org/6.2/Manual/packages.html#PkgLinearCellComplex)
- **API Changes**: The following import functions have been deprecated and renamed for better naming clarity and consistency:
- `import_from_plane_graph()``read_plane_graph_in_lcc()`
- `import_from_polyhedron_3()``polyhedron_3_to_lcc()`
- `import_from_triangulation_3()``triangulation_3_to_lcc()`
- The old function names are still available but marked as deprecated for backward compatibility.
## [Release 6.1](https://github.com/CGAL/cgal/releases/tag/v6.1)
Release date: Sept 2025

View File

@ -17,12 +17,12 @@
#define CGAL_VERSION_H
#ifndef SWIG
#define CGAL_VERSION 6.1
#define CGAL_VERSION 6.2-dev
#define CGAL_GIT_HASH abcdef
#endif
#define CGAL_VERSION_NR 1060100930
#define CGAL_VERSION_NR 1060200900
#define CGAL_SVN_REVISION 99999
#define CGAL_RELEASE_DATE 20250901
#define CGAL_RELEASE_DATE 20260401
#include <CGAL/version_macros.h>

View File

@ -1,8 +1,8 @@
set(CGAL_MAJOR_VERSION 6)
set(CGAL_MINOR_VERSION 1)
set(CGAL_MINOR_VERSION 2)
set(CGAL_BUGFIX_VERSION 0)
include(${CMAKE_CURRENT_LIST_DIR}/CGALConfigBuildVersion.cmake)
set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.1")
set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.2-dev")
set(CGAL_VERSION_PUBLIC_RELEASE_NAME "CGAL-${CGAL_VERSION_PUBLIC_RELEASE_VERSION}")
if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0)

View File

@ -89,6 +89,44 @@ double operator[](int i)const;
Cartesian_const_iterator_d cartesian_begin()const;
/*! returns an iterator pointing beyond the last %Cartesian coordinate. */
Cartesian_const_iterator_d cartesian_end()const;
/*! returns whether the points coincide. */
friend bool operator==(Point_d,Point_d);
/*! returns whether the points are distinct. */
friend bool operator!=(Point_d,Point_d);
};
/*!
represents a vector in the Euclidean space
\cgalModels{DefaultConstructible,Assignable}
*/
class Vector_d {
public:
/*! introduces a vector with coordinates (x0, x1, ...) where the number of
coordinates matches the dimension.
\pre `DimensionTag` is a fixed dimension, not `Dynamic_dimension_tag`. */
Vector_d(double x0, double x1, ...);
/*! introduces a vector with coordinate set `[first,end)`.
\pre If `DimensionTag` is a fixed dimension, it matches `distance(first,end)`.
\tparam ForwardIterator has its value type that is convertible to `double`.
*/
template<typename ForwardIterator>
Vector_d(ForwardIterator first, ForwardIterator end);
/*! returns the i-th coordinate of a vector.
\pre `i` is non-negative and less than the dimension. */
double operator[](int i)const;
/*! returns an iterator pointing to the zeroth %Cartesian coordinate. */
Cartesian_const_iterator_d cartesian_begin()const;
/*! returns an iterator pointing beyond the last %Cartesian coordinate. */
Cartesian_const_iterator_d cartesian_end()const;
/*! returns whether the vectors coincide. */
friend bool operator==(Vector_d,Vector_d);
/*! returns whether the vectors are distinct. */
friend bool operator!=(Vector_d,Vector_d);
};
/*!

View File

@ -77,6 +77,48 @@ double operator[](int i)const;
Cartesian_const_iterator_d cartesian_begin()const;
/*! returns an iterator pointing beyond the last Cartesian coordinate. */
Cartesian_const_iterator_d cartesian_end()const;
/*! returns whether the points coincide. This may not be safe
if the points are the result of inexact constructions. */
friend bool operator==(Point_d,Point_d);
/*! returns whether the points are distinct. This may not be safe
if the points are the result of inexact constructions. */
friend bool operator!=(Point_d,Point_d);
};
/*!
represents a vector in the Euclidean space
\cgalModels{DefaultConstructible,Assignable}
*/
class Vector_d {
public:
/*! introduces a vector with coordinates (x0, x1, ...) where the number of
coordinates matches the dimension.
\pre `DimensionTag` is a fixed dimension, not `Dynamic_dimension_tag`. */
Vector_d(double x0, double x1, ...);
/*! introduces a vector with coordinate set `[first,end)`.
\pre If `DimensionTag` is a fixed dimension, it matches `distance(first,end)`.
\tparam InputIterator has its value type that is convertible to `double`.
*/
template<typename InputIterator>
Vector_d(InputIterator first, InputIterator end);
/*! returns the i-th coordinate of a vector.
\pre `i` is non-negative and less than the dimension. */
double operator[](int i)const;
/*! returns an iterator pointing to the zeroth Cartesian coordinate. */
Cartesian_const_iterator_d cartesian_begin()const;
/*! returns an iterator pointing beyond the last Cartesian coordinate. */
Cartesian_const_iterator_d cartesian_end()const;
/*! returns whether the vectors coincide. This may not be safe
if the vectors are the result of inexact constructions. */
friend bool operator==(Vector_d,Vector_d);
/*! returns whether the vectors are distinct. This may not be safe
if the vectors are the result of inexact constructions. */
friend bool operator!=(Vector_d,Vector_d);
};
/*!

View File

@ -1795,8 +1795,8 @@ bool MainWindow::loadScript(QFileInfo info)
QString program;
QString filename = info.absoluteFilePath();
QFile script_file(filename);
script_file.open(QIODevice::ReadOnly);
if(!script_file.isReadable()) {
bool success = script_file.open(QIODevice::ReadOnly);
if((! success) || (!script_file.isReadable())) {
throw std::ios_base::failure(script_file.errorString().toStdString());
}
program = script_file.readAll();
@ -2747,9 +2747,9 @@ void MainWindow::exportStatistics()
if(filename.isEmpty())
return;
QFile output(filename);
output.open(QIODevice::WriteOnly | QIODevice::Text);
bool success = output.open(QIODevice::WriteOnly | QIODevice::Text);
if(!output.isOpen()){
if((! success) || (!output.isOpen())){
qDebug() << "- Error, unable to open" << "outputFilename" << "for output";
}
QTextStream outStream(&output);

View File

@ -93,18 +93,20 @@ bool Camera_positions_list::save(QString filename) {
if(m_model->rowCount() <1)
return false;
QFile file(filename);
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
for(int i = 0; i < m_model->rowCount(); ++i)
{
QStandardItem* item = m_model->item(i);
out << item->data(Qt::DisplayRole).toString()
<< "\n"
<< item->data(Qt::UserRole).toString()
<< "\n";
if(file.open(QIODevice::WriteOnly)){
QTextStream out(&file);
for(int i = 0; i < m_model->rowCount(); ++i)
{
QStandardItem* item = m_model->item(i);
out << item->data(Qt::DisplayRole).toString()
<< "\n"
<< item->data(Qt::UserRole).toString()
<< "\n";
}
file.close();
return true;
}
file.close();
return true;
return false;
}
void Camera_positions_list::on_saveButton_pressed()
@ -129,19 +131,24 @@ void Camera_positions_list::on_openButton_pressed()
void Camera_positions_list::load(QString filename) {
QFile file(filename);
std::clog << "Loading camera positions " << qPrintable(filename) << std::endl;
file.open(QIODevice::ReadOnly);
QTextStream input(&file);
while(!input.atEnd()) {
QString text = input.readLine(1000);
QString coord = input.readLine(1000);
if(text.isNull() || coord.isNull()) return;
CGAL::qglviewer::Frame frame;
if(Three::activeViewer()->readFrame(coord, frame))
{
addItem(text,
Three::activeViewer()->dumpFrame(frame));
if(file.open(QIODevice::ReadOnly)){
std::clog << "Loading camera positions " << qPrintable(filename) << std::endl;
QTextStream input(&file);
while(!input.atEnd()) {
QString text = input.readLine(1000);
QString coord = input.readLine(1000);
if(text.isNull() || coord.isNull()) return;
CGAL::qglviewer::Frame frame;
if(Three::activeViewer()->readFrame(coord, frame))
{
addItem(text,
Three::activeViewer()->dumpFrame(frame));
}
}
}else {
std::clog << "Loading camera positions " << qPrintable(filename) << " failed" << std::endl;
}
}

View File

@ -35,6 +35,9 @@ target_link_libraries(off_to_nef_plugin PRIVATE scene_nef_polyhedron_item)
cgal_lab_plugin(polylines_io_plugin Polylines_io_plugin KEYWORDS Viewer Mesh_3)
target_link_libraries(polylines_io_plugin PRIVATE scene_polylines_item)
cgal_lab_plugin(spheres_io_plugin Spheres_io_plugin KEYWORDS Viewer Mesh_3)
target_link_libraries(spheres_io_plugin PRIVATE scene_basic_objects)
cgal_lab_plugin(wkt_plugin WKT_io_plugin KEYWORDS Viewer PointSetProcessing Mesh_3)
target_link_libraries(wkt_plugin PRIVATE scene_polylines_item)

View File

@ -0,0 +1,162 @@
#include "Scene_spheres_item.h"
#include <QMainWindow>
#include <CGAL/Three/CGAL_Lab_io_plugin_interface.h>
#include <CGAL/Three/CGAL_Lab_plugin_interface.h>
#include <CGAL/Three/CGAL_Lab_plugin_helper.h>
#include <CGAL/Three/Three.h>
#include <fstream>
#include <QVariant>
#include <QMessageBox>
#include <QInputDialog>
using namespace CGAL::Three;
class CGAL_Lab_spheres_io_plugin :
public QObject,
public CGAL_Lab_io_plugin_interface,
public CGAL_Lab_plugin_helper
{
Q_OBJECT
Q_INTERFACES(CGAL::Three::CGAL_Lab_plugin_interface CGAL::Three::CGAL_Lab_io_plugin_interface)
Q_PLUGIN_METADATA(IID "com.geometryfactory.CGALLab.PluginInterface/1.0" FILE "spheres_io_plugin.json")
Q_PLUGIN_METADATA(IID "com.geometryfactory.CGALLab.IOPluginInterface/1.90")
public:
// To silent a warning -Woverloaded-virtual
// See https://stackoverflow.com/questions/9995421/gcc-woverloaded-virtual-warnings
using CGAL_Lab_io_plugin_interface::init;
//! Configures the widget
void init(QMainWindow* mainWindow,
CGAL::Three::Scene_interface* scene_interface,
Messages_interface*) override{
//get the references
this->scene = scene_interface;
this->mw = mainWindow;
}
QString name() const override{ return "spheres_io_plugin"; }
QString nameFilters() const override{ return "Spheres files (*.spheres.txt)"; }
bool canLoad(QFileInfo fileinfo) const override;
QList<Scene_item*> load(QFileInfo fileinfo, bool& ok, bool add_to_scene=true) override;
bool canSave(const CGAL::Three::Scene_item*) override;
bool save(QFileInfo fileinfo,QList<CGAL::Three::Scene_item*>&) override;
bool applicable(QAction* ) const override {
return false;
}
QList<QAction*> actions() const override{
return QList<QAction*>();
}
bool isDefaultLoader(const Scene_item* item) const override{
if(qobject_cast<const Scene_spheres_item*>(item))
return true;
return false;
}
};
bool CGAL_Lab_spheres_io_plugin::canLoad(QFileInfo fileinfo) const{
if(!fileinfo.suffix().contains("cgal"))
return true;
std::ifstream in(fileinfo.filePath().toUtf8());
if(!in) {
return false;
}
int first;
if(!(in >> first)
|| first <= 0)
return false;
return true;
}
QList<Scene_item*>
CGAL_Lab_spheres_io_plugin::
load(QFileInfo fileinfo, bool& ok, bool add_to_scene){
// Open file
std::ifstream ifs(fileinfo.filePath().toUtf8());
if(!ifs) {
std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl;
ok = false;
return QList<Scene_item*>();
}
if(fileinfo.size() == 0)
{
CGAL::Three::Three::warning( tr("The file you are trying to load is empty."));
Scene_spheres_item* item = new Scene_spheres_item(nullptr, 0, false, false);
item->setName(fileinfo.completeBaseName());
ok = true;
if(add_to_scene)
CGAL::Three::Three::scene()->addItem(item);
return QList<Scene_item*>()<<item;
}
double x, y, z, r;
std::vector<std::array<double, 4> > spheres;
while (ifs >> x && ifs >> y && ifs >> z && ifs >> r)
spheres.push_back({x, y, z, r});
std::vector<QColor> colors;
if (true) {
colors.resize(spheres.size());
for (QColor &c : colors)
c = generate_random_color();
}
else {
colors.reserve(spheres.size());
compute_deterministic_color_map(QColor(180, 120, 130, 255), spheres.size(), std::back_inserter(colors));
}
Scene_spheres_item* item = new Scene_spheres_item(nullptr, spheres.size(), false, true);
item->setName(fileinfo.completeBaseName());
for (std::size_t i = 0;i<spheres.size();i++) {
const std::array<double, 4>& s = spheres[i];
item->add_sphere(CGAL::Epick::Sphere_3(CGAL::Epick::Point_3(s[0], s[1], s[2]), s[3] * s[3]), i, CGAL::IO::Color(colors[i].red(), colors[i].green(), colors[i].blue()));
}
std::cerr << "Number of spheres loaded: " << spheres.size() << std::endl;
item->invalidateOpenGLBuffers();
item->setRenderingMode(Gouraud);
CGAL::Three::Three::scene()->addItem(item);
item->computeElements();
return QList<Scene_item*>()<<item;
}
bool CGAL_Lab_spheres_io_plugin::canSave(const CGAL::Three::Scene_item* item)
{
return qobject_cast<const Scene_spheres_item*>(item) != 0;
}
bool CGAL_Lab_spheres_io_plugin::
save(QFileInfo fileinfo,QList<CGAL::Three::Scene_item*>& items)
{
Scene_item* item = items.front();
const Scene_spheres_item* sphere_item =
qobject_cast<const Scene_spheres_item*>(item);
if(!sphere_item)
return false;
std::ofstream out(fileinfo.filePath().toUtf8());
out.precision (std::numeric_limits<double>::digits10 + 2);
if(!out) {
std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl;
return false;
}
return false;
}
#include "Spheres_io_plugin.moc"

View File

@ -47,7 +47,7 @@ public:
QString ext = fileinfo.suffix();
bool res = true;
if(ext == "off")
CGAL::import_from_polyhedron_3_flux < Scene_lcc_item::LCC > (lcc, ifs);
CGAL::polyhedron_3_flux_to_lcc < Scene_lcc_item::LCC > (lcc, ifs);
else
{
res = CGAL::load_combinatorial_map(ifs, lcc);

View File

@ -2,7 +2,9 @@
#include<fstream>
#include <CGAL/Three/Triangle_container.h>
#include <CGAL/Three/Edge_container.h>
#include <CGAL/Three/Three.h>
#include <QApplication>
#include <QMenu>
using namespace CGAL::Three;
@ -43,9 +45,7 @@ struct Scene_spheres_item_priv
model_sphere_is_up = false;
}
~Scene_spheres_item_priv()
{
}
~Scene_spheres_item_priv() {}
void pick(int &id)const;
@ -85,6 +85,15 @@ void Scene_spheres_item_priv::pick(int& id) const
id = -1;
}
if (id != -1 && spheres[id].size() == 1) {
const Sphere& sphere = spheres[id][0].first;
Three::information(QString("Selected sphere: center (%1, %2, %3) radius %4").
arg(sphere.center().x(), 0, 'g', 10).
arg(sphere.center().y(), 0, 'g', 10).
arg(sphere.center().z(), 0, 'g', 10).
arg(CGAL::approximate_sqrt(sphere.squared_radius()), 0, 'g', 10));
}
int offset = 0;
float color[4];
for(std::size_t i=0; i<spheres.size(); ++i)
@ -112,8 +121,10 @@ void Scene_spheres_item_priv::pick(int& id) const
}
}
Scene_spheres_item::Scene_spheres_item(Scene_group_item* parent, std::size_t max_index, bool planed, bool pickable)
Scene_spheres_item::Scene_spheres_item(Scene_group_item* parent, std::size_t max_index, bool planed, bool pickable) : Scene_group_item()
{
connected_alpha_slider = false;
rendering_mode = Gouraud;
setParent(parent);
d = new Scene_spheres_item_priv(planed, max_index, this, pickable);
if(pickable)
@ -173,6 +184,9 @@ void Scene_spheres_item_priv::initializeBuffers(CGAL::Three::Viewer_interface *v
void Scene_spheres_item::draw(Viewer_interface *viewer) const
{
if (renderingMode() != Gouraud || !visible())
return;
if(!isInit(viewer))
initGL(viewer);
if ( getBuffersFilled() &&
@ -201,6 +215,7 @@ void Scene_spheres_item::draw(Viewer_interface *viewer) const
}
else
{
getTriangleContainer(0)->setAlpha(alpha());
getTriangleContainer(0)->draw(viewer, false);
}
if(d->pickable && (d->spheres.size() > 1 && viewer->inDrawWithNames()))
@ -218,6 +233,9 @@ void Scene_spheres_item::draw(Viewer_interface *viewer) const
void Scene_spheres_item::drawEdges(Viewer_interface *viewer) const
{
if (renderingMode() != Wireframe || !visible())
return;
if(!isInit(viewer))
initGL(viewer);
if ( getBuffersFilled() &&
@ -295,6 +313,18 @@ void Scene_spheres_item::invalidateOpenGLBuffers()
getTriangleContainer(1)->reset_vbos(COLORS);
}
getEdgeContainer(0)->reset_vbos(NOT_INSTANCED);
compute_bbox();
}
QMenu* Scene_spheres_item::contextMenu() {
QMenu* menu = Scene_item_rendering_helper::contextMenu();
if (!connected_alpha_slider && alphaSlider() != nullptr) {
connect(alphaSlider(), &QSlider::valueChanged, [this]() {redraw(); });
connected_alpha_slider = true;
}
return menu;
}
QString

View File

@ -2,6 +2,7 @@
#define SCENE_SPHERES_ITEM_H
#include "Scene_basic_objects_config.h"
#include "create_sphere.h"
#include "Color_map.h"
#include <CGAL/Three/Scene_group_item.h>
#include <CGAL/Three/Scene_item_rendering_helper.h>
@ -24,7 +25,7 @@ struct Scene_spheres_item_priv;
* have a Scene_spheres_item child).
*/
class SCENE_BASIC_OBJECTS_EXPORT Scene_spheres_item
: public CGAL::Three::Scene_item_rendering_helper
: public CGAL::Three::Scene_group_item
{
Q_OBJECT
public:
@ -37,6 +38,7 @@ public:
~Scene_spheres_item();
Bbox bbox() const override { return _bbox; }
bool isFinite() const override{ return true; }
bool isEmpty() const override{ return false; }
Scene_item* clone() const override{return nullptr;}
@ -57,10 +59,12 @@ public:
void setColor(QColor c) override;
bool save(const std::string &file_name) const;
QMenu *contextMenu() override;
void initializeBuffers(Viewer_interface *) const override;
void computeElements() const override;
bool eventFilter(QObject *watched, QEvent *event)override;
Q_SIGNALS:
void on_color_changed();
void picked(std::size_t id) const;
@ -68,6 +72,7 @@ Q_SIGNALS:
protected:
friend struct Scene_spheres_item_priv;
Scene_spheres_item_priv* d;
bool connected_alpha_slider;
};
#endif // SCENE_SPHERES_ITEM_H

View File

@ -375,7 +375,7 @@ void MainWindow::load_off (const QString & fileName, bool clear)
std::ifstream ifs (qPrintable (fileName));
CGAL::import_from_polyhedron_3_flux < LCC > (*scene.lcc, ifs);
CGAL::polyhedron_3_flux_to_lcc < LCC > (*scene.lcc, ifs);
#ifdef CGAL_PROFILE_LCC_DEMO
timer.stop();
@ -415,7 +415,7 @@ void MainWindow::load_3DTDS (const QString & fileName, bool clear)
T.insert (std::istream_iterator < Point_3 >(ifs),
std::istream_iterator < Point_3 >() );
CGAL::import_from_triangulation_3 < LCC, Triangulation >(*scene.lcc, T);
CGAL::triangulation_3_to_lcc < LCC, Triangulation >(*scene.lcc, T);
#ifdef CGAL_PROFILE_LCC_DEMO
timer.stop();
@ -673,7 +673,7 @@ void MainWindow::on_actionCompute_Voronoi_3D_triggered ()
std::map<Triangulation::Cell_handle,
LCC::Dart_descriptor > vol_to_dart;
dh = CGAL::import_from_triangulation_3 < LCC, Triangulation >
dh = CGAL::triangulation_3_to_lcc < LCC, Triangulation >
(delaunay_lcc, T, &vol_to_dart);
Dart_descriptor ddh=delaunay_lcc.dual(*scene.lcc, dh);

View File

@ -24,13 +24,20 @@ Here a small example:
<B>Middle</B>: the 2D linear cell complex reconstructed if combinatorial maps are the combinatorial data-structure.
<B>Right</B>: the 2D linear cell complex reconstructed if generalized maps are the combinatorial data-structure.
\sa `CGAL::import_from_triangulation_3<LCC,Triangulation>`
\sa `CGAL::import_from_polyhedron_3<LCC,Polyhedron>`
\sa `CGAL::triangulation_3_to_lcc<LCC,Triangulation>`
\sa `CGAL::polyhedron_3_to_lcc<LCC,Polyhedron>`
*/
template<class LCC>
typename LCC::Dart_descriptor import_from_plane_graph(LCC& lcc,
typename LCC::Dart_descriptor read_plane_graph_in_lcc(LCC& lcc,
std::istream& ais);
/*!
\ingroup PkgLinearCellComplexConstructions
\deprecated Use `read_plane_graph_in_lcc()` instead.
*/
template<class LCC>
[[deprecated("Use read_plane_graph_in_lcc instead")]]
typename LCC::Dart_descriptor import_from_plane_graph(LCC& lcc, std::istream& ais);
} /* namespace CGAL */

View File

@ -5,10 +5,10 @@ namespace CGAL{
Imports `apoly` (a `Polyhedron_3`) into `lcc`, a model of the `LinearCellComplex` concept. Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import.
\pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 2 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3.
\sa `CGAL::import_from_plane_graph<LCC>`
\sa `CGAL::import_from_triangulation_3<LCC,Triangulation>`
\sa `CGAL::read_plane_graph_in_lcc<LCC>`
\sa `CGAL::triangulation_3_to_lcc<LCC,Triangulation>`
*/
template<class LCC,class Polyhedron>
typename LCC::Dart_descriptor import_from_polyhedron_3(LCC& lcc,
typename LCC::Dart_descriptor polyhedron_3_to_lcc(LCC& lcc,
const Polyhedron &apoly);
}

View File

@ -3,13 +3,23 @@ namespace CGAL{
/*!
\ingroup PkgLinearCellComplexConstructions
Imports `atr` (a `Triangulation_3`) into `lcc`, a model of the `LinearCellComplex` concept. Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import.
\pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 3 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3.
Imports `atr` (a `Triangulation_3`) into `lcc`, a model of the `LinearCellComplex` concept.
Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import.
\pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 3 and
\link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3.
\sa `CGAL::import_from_plane_graph<LCC>`
\sa `CGAL::import_from_polyhedron_3<LCC,Polyhedron>`
\sa `CGAL::read_plane_graph_in_lcc<LCC>`
\sa `CGAL::polyhedron_3_to_lcc<LCC,Polyhedron>`
*/
template <class LCC,class Triangulation_>
typename LCC::Dart_descriptor import_from_triangulation_3(LCC& lcc,
const Triangulation_&atr);
typename LCC::Dart_descriptor triangulation_3_to_lcc(LCC& lcc, const Triangulation_&atr);
template <class LCC, class Triangulation_>
[[deprecated("Use triangulation_3_to_lcc instead")]]
typename LCC::Dart_descriptor import_from_triangulation_3(LCC& lcc, const Triangulation_& atr)
{
return triangulation_3_to_lcc(lcc, atr);
}
}

View File

@ -64,8 +64,8 @@ which constructs a vector as the difference of points `p2-p1`, and
\link LinearCellComplexTraits::Vector ` Vector `\endlink `operator() (const CGAL::Origin&, const ` \link Point ` Point`\endlink`& p)`
which constructs a vector as the difference of point `p` and a point at the origin
(used in \link CGAL::barycenter `barycenter`\endlink
and `CGAL::import_from_plane_graph`).
*/
and `CGAL::read_plane_graph_in_lcc`).*/
typedef unspecified_type Construct_vector;
/*!
@ -104,7 +104,7 @@ a model of \link Kernel::Direction_2 `Direction_2`\endlink.
typedef unspecified_type Direction_2;
/*!
a model of \link Kernel::ConstructDirection_2 `ConstructDirection_2`\endlink (used in `CGAL::import_from_plane_graph`).
a model of \link Kernel::ConstructDirection_2 `ConstructDirection_2`\endlink (used in `CGAL::read_plane_graph_in_lcc`).
*/
typedef unspecified_type Construct_direction_2;

View File

@ -105,11 +105,12 @@ There are several member functions allowing to insert specific configurations of
There are two functions allowing to build a linear cell complex from two other \cgal data types:
<UL>
<LI>\link CGAL::import_from_triangulation_3 `import_from_triangulation_3(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink;
<LI>\link CGAL::import_from_polyhedron_3 `import_from_polyhedron_3(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`.
<LI>\link CGAL::triangulation_3_to_lcc `triangulation_3_to_lcc(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink;
<LI>\link CGAL::polyhedron_3_to_lcc `polyhedron_3_to_lcc(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`.
</UL>
Lastly, the function \link CGAL::import_from_plane_graph `import_from_plane_graph(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link CGAL::import_from_plane_graph `reference manual`\endlink for the file format).
Lastly, the function \link CGAL::read_plane_graph_in_lcc `read_plane_graph_in_lcc(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link CGAL::read_plane_graph_in_lcc `reference manual`\endlink for the file format).
\subsection Linear_cell_complexModificationOperations Modification Operations
\anchor ssecmodifop

View File

@ -62,9 +62,9 @@
\cgalCRPSection{Global Functions}
\cgalCRPSubsection{Constructions for Linear Cell Complex}
- `CGAL::import_from_plane_graph<LCC>`
- `CGAL::import_from_triangulation_3<LCC,Triangulation>`
- `CGAL::import_from_polyhedron_3<LCC,Polyhedron>`
- `CGAL::read_plane_graph_in_lcc<LCC>` (formerly `import_from_plane_graph`)
- `CGAL::triangulation_3_to_lcc<LCC,Triangulation>` (formerly `import_from_triangulation_3`)
- `CGAL::polyhedron_3_to_lcc<LCC,Polyhedron>` (formerly `import_from_polyhedron_3`)
\cgalCRPSubsection{Operations for Linear Cell Complex}
- `CGAL::compute_normal_of_cell_0<LCC>`

View File

@ -24,7 +24,7 @@ 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_4.cpp")
create_single_source_cgal_program("plane_graph_to_lcc_2.cpp")
create_single_source_cgal_program("read_plane_graph_in_lcc_2.cpp")
create_single_source_cgal_program("voronoi_2.cpp")
create_single_source_cgal_program("voronoi_3.cpp")

View File

@ -8,7 +8,7 @@ Examples for Linear_cell_complex package:
Three "basic" examples, detailed in the user manual.
* plane_graph_to_lcc_2.cpp
* read_plane_graph_in_lcc_2.cpp
Program allowing to transform a planar graph into a 2D linear cell complex.

View File

@ -42,7 +42,7 @@ int main(int narg, char** argv)
std::ifstream is(filename.c_str());
std::cout<<"Import plane graph from "<<filename<<std::endl;
CGAL::import_from_plane_graph(lcc, is);
CGAL::read_plane_graph_in_lcc(lcc, is);
// Display the lcc characteristics.
std::cout<<"LCC characteristics:"<<std::endl<<" ";

View File

@ -134,7 +134,7 @@ int main(int narg, char** argv)
std::map<Triangulation::Cell_handle,
LCC_3::Dart_descriptor > vol_to_dart;
Dart_descriptor d=CGAL::import_from_triangulation_3<LCC_3, Triangulation>
Dart_descriptor d=CGAL::triangulation_3_to_lcc<LCC_3, Triangulation>
(lcc, T, &vol_to_dart);
std::cout<<"Delaunay triangulation :"<<std::endl<<" ";

View File

@ -23,6 +23,7 @@
#include <map>
#include <vector>
#include <list>
#include <CGAL/config.h>
namespace CGAL {
@ -36,7 +37,7 @@ namespace CGAL {
* Imports a plane-embedded graph from a list of points and edges represented as pairs of vertex indices
*/
template< class LCC >
typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc,
typename LCC::Dart_descriptor read_plane_graph_in_lcc(LCC& alcc,
const std::vector<typename LCC::Point>& vertices,
const std::vector<size_t>& edge_indices)
{
@ -130,6 +131,21 @@ namespace CGAL {
return first;
}
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\deprecated This function is deprecated since CGAL 6.2. Use `read_plane_graph_in_lcc()` instead.
*/
template< class LCC >
CGAL_DEPRECATED
typename LCC::Dart_descriptor
import_from_plane_graph(LCC& alcc,
const std::vector<typename LCC::Point>& vertices,
const std::vector<size_t>& edge_indices)
{
return read_plane_graph_in_lcc(alcc, vertices, edge_indices);
}
#endif
/**
* Imports a plane-embedded graph from a file into a LinearCellComplex.
*
@ -138,7 +154,7 @@ namespace CGAL {
* @return A dart created during the conversion.
*/
template< class LCC >
typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc,
typename LCC::Dart_descriptor read_plane_graph_in_lcc(LCC& alcc,
std::istream& ais)
{
using FT = typename LCC::FT;
@ -185,18 +201,44 @@ namespace CGAL {
edge_indices.push_back(v2);
}
return import_from_plane_graph(alcc, vertices, edge_indices);
return read_plane_graph_in_lcc(alcc, vertices, edge_indices);
}
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\deprecated This function is deprecated since CGAL 6.2. 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
import_from_plane_graph(LCC& alcc, const char* filename)
read_plane_graph_in_lcc(LCC& alcc, const char* filename)
{
std::ifstream input(filename);
if (!input.is_open()) return alcc.null_descriptor;
return import_from_plane_graph(alcc, input);
return read_plane_graph_in_lcc(alcc, input);
}
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\deprecated This function is deprecated since CGAL 6.2. 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)
{

View File

@ -36,3 +36,13 @@ add_executable(Linear_cell_complex_copy_test_index Linear_cell_complex_copy_test
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)
# Alias tests (test old function names, with deprecated warnings disabled)
create_single_source_cgal_program(test_triangulation_alias.cpp ${hfiles})
target_compile_definitions(test_triangulation_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS)
create_single_source_cgal_program(test_polyhedron_3_alias.cpp ${hfiles})
target_compile_definitions(test_polyhedron_3_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS)
create_single_source_cgal_program(test_plane_graph_alias.cpp ${hfiles})
target_compile_definitions(test_plane_graph_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS)

View File

@ -382,7 +382,7 @@ bool test_LCC_2()
std::cout<<"Error: impossible to open 'data/graph.txt'"<<std::endl;
return false;
}
CGAL::import_from_plane_graph<LCC>(lcc,in);
CGAL::read_plane_graph_in_lcc<LCC>(lcc,in);
if ( !check_number_of_cells_2(lcc, 66, 166, 104, 2) )
return false;
lcc.clear();
@ -431,7 +431,7 @@ struct Test_change_orientation_LCC_2<LCC, CGAL::Combinatorial_map_tag>
std::cout<<"Error: impossible to open 'data/graph.txt'"<<std::endl;
return false;
}
CGAL::import_from_plane_graph<LCC>(lcc,in);
CGAL::read_plane_graph_in_lcc<LCC>(lcc,in);
trace_test_begin();

View File

@ -997,7 +997,7 @@ bool test_LCC_3()
}
in >> P;
CGAL::import_from_polyhedron_3<LCC>(lcc,P);
CGAL::polyhedron_3_to_lcc<LCC>(lcc,P);
if ( !check_number_of_cells_3(lcc, 1539, 4434, 2894, 2, 2) )
return false;
@ -1029,7 +1029,7 @@ bool test_LCC_3()
}
T.insert ( std::istream_iterator < Point >(in),
std::istream_iterator < Point >() );
CGAL::import_from_triangulation_3<LCC>(lcc,T);
CGAL::triangulation_3_to_lcc<LCC>(lcc,T);
if ( !lcc.is_valid() )
return false;

View File

@ -0,0 +1,35 @@
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Linear_cell_complex_constructors.h>
#include <cassert>
#include <sstream>
#include <cstdlib>
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2> LCC;
int main()
{
#ifndef CGAL_NO_DEPRECATED_CODE
LCC lcc1, lcc2;
// Planar graph with 3 vertices and 3 edges (triangle)
std::stringstream input;
input << "3 3\n0.0 0.0\n1.0 0.0\n0.0 1.0\n0 1\n1 2\n2 0\n";
// Test new function
auto d1 = CGAL::read_plane_graph_in_lcc(lcc1, input);
assert(d1 != LCC::null_descriptor);
// Rewind input stream for second test
input.clear();
input.seekg(0, std::ios::beg);
// Test deprecated function
auto d2 = CGAL::import_from_plane_graph(lcc2, input);
assert(d2 != LCC::null_descriptor);
#endif // CGAL_NO_DEPRECATED_CODE
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,31 @@
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_3_to_lcc.h>
#include <sstream>
#include <cassert>
#include <cstdlib>
typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC;
typedef CGAL::Polyhedron_3<LCC::Traits> Polyhedron;
int main()
{
#ifndef CGAL_NO_DEPRECATED_CODE
std::stringstream ss("OFF\n0 0 0\n");
Polyhedron P;
ss >> P;
LCC lcc1, lcc2;
auto d1 = CGAL::polyhedron_3_to_lcc(lcc1, P);
assert(d1 == LCC::null_descriptor);
auto d2 = CGAL::import_from_polyhedron_3<LCC>(lcc2, P);
assert(d2 == LCC::null_descriptor);
#endif // CGAL_NO_DEPRECATED_CODE
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,29 @@
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Triangulation_3_to_lcc.h>
#include <cassert>
#include <cstdlib>
typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC_3;
typedef CGAL::Delaunay_triangulation_3<LCC_3::Traits> Triangulation;
int main()
{
#ifndef CGAL_NO_DEPRECATED_CODE
LCC_3 lcc1, lcc2;
Triangulation T;
assert(T.dimension() == -1);
auto d1 = CGAL::triangulation_3_to_lcc(lcc1, T);
assert(d1 == LCC_3::null_descriptor);
auto d2 = CGAL::import_from_triangulation_3(lcc2, T);
assert(d2 == LCC_3::null_descriptor);
#endif // CGAL_NO_DEPRECATED_CODE
return EXIT_SUCCESS;
}

View File

@ -18,6 +18,9 @@
#include <CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_circle_2.h>
#include <CGAL/Filtered_kernel/internal/Static_filters/Orientation_3.h>
#include <CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_sphere_3.h>
#include <CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h>
#include <CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h>
#include <CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h>
namespace CGAL {
namespace SFA { // static filter adapter
@ -151,6 +154,150 @@ template <class Base_,class R_> struct Side_of_oriented_sphere_3 : private Store
return typename internal::Static_filters_predicates::Side_of_oriented_sphere_3<Adapter>()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C),P(this->kernel(),c,D),P(this->kernel(),c,E));
}
};
template <class Base_,class R_> struct Adapter_4 {
typedef typename Get_type<R_, Orientation_tag>::type Orientation;
typedef typename Get_type<R_, Oriented_side_tag>::type Oriented_side;
typedef typename Get_type<R_, Point_tag>::type Point;
typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
typedef typename Get_functor<Base_, Orientation_of_points_tag>::type Orientation_base;
struct Point_4 {
R_ const&r; CC const&c; Point const& p;
Point_4(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){}
decltype(auto) c0()const{return c(p,0);}
decltype(auto) c1()const{return c(p,1);}
decltype(auto) c2()const{return c(p,2);}
decltype(auto) c3()const{return c(p,3);}
};
struct Orientation_4 {
typedef typename Get_type<R_, Orientation_tag>::type result_type;
auto operator()(Point_4 const&A, Point_4 const&B, Point_4 const&C,
Point_4 const&D, Point_4 const&E)const{
Point const* t[6]={&A.p,&B.p,&C.p,&D.p,&E.p};
return Orientation_base(A.r)(make_transforming_iterator<Dereference_functor>(t+0),make_transforming_iterator<Dereference_functor>(t+5));
}
};
};
template <class Base_,class R_> struct Orientation_of_points_4 : private Store_kernel<R_> {
CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_4)
typedef typename Get_type<R_, Point_tag>::type Point;
typedef typename Get_type<R_, Orientation_tag>::type result_type;
typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
typedef Adapter_4<Base_, R_> Adapter;
template<class Iter> result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{
CC c(this->kernel());
Point const& A=*f;
Point const& B=*++f;
Point const& C=*++f;
Point const& D=*++f;
Point const& E=*++f;
CGAL_assertion(++f==e);
typedef typename Adapter::Point_4 P;
return typename internal::Static_filters_predicates::Orientation_4<Adapter>()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C),
P(this->kernel(),c,D),P(this->kernel(),c,E));
}
};
template <class Base_,class R_> struct Adapter_5 {
typedef typename Get_type<R_, Orientation_tag>::type Orientation;
typedef typename Get_type<R_, Oriented_side_tag>::type Oriented_side;
typedef typename Get_type<R_, Point_tag>::type Point;
typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
typedef typename Get_functor<Base_, Orientation_of_points_tag>::type Orientation_base;
struct Point_5 {
R_ const&r; CC const&c; Point const& p;
Point_5(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){}
decltype(auto) c0()const{return c(p,0);}
decltype(auto) c1()const{return c(p,1);}
decltype(auto) c2()const{return c(p,2);}
decltype(auto) c3()const{return c(p,3);}
decltype(auto) c4()const{return c(p,4);}
};
struct Orientation_5 {
typedef typename Get_type<R_, Orientation_tag>::type result_type;
auto operator()(Point_5 const&A, Point_5 const&B, Point_5 const&C,
Point_5 const&D, Point_5 const&E, Point_5 const&F)const{
Point const* t[6]={&A.p,&B.p,&C.p,&D.p,&E.p,&F.p};
return Orientation_base(A.r)(make_transforming_iterator<Dereference_functor>(t+0),make_transforming_iterator<Dereference_functor>(t+6));
}
};
};
template <class Base_,class R_> struct Orientation_of_points_5 : private Store_kernel<R_> {
CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_5)
typedef typename Get_type<R_, Point_tag>::type Point;
typedef typename Get_type<R_, Orientation_tag>::type result_type;
typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
typedef Adapter_5<Base_, R_> Adapter;
template<class Iter> result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{
CC c(this->kernel());
Point const& A=*f;
Point const& B=*++f;
Point const& C=*++f;
Point const& D=*++f;
Point const& E=*++f;
Point const& F=*++f;
CGAL_assertion(++f==e);
typedef typename Adapter::Point_5 P;
return typename internal::Static_filters_predicates::Orientation_5<Adapter>()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C),
P(this->kernel(),c,D),P(this->kernel(),c,E),P(this->kernel(),c,F));
}
};
template <class Base_,class R_> struct Adapter_6 {
typedef typename Get_type<R_, Orientation_tag>::type Orientation;
typedef typename Get_type<R_, Oriented_side_tag>::type Oriented_side;
typedef typename Get_type<R_, Point_tag>::type Point;
typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
typedef typename Get_functor<Base_, Orientation_of_points_tag>::type Orientation_base;
struct Point_6 {
R_ const&r; CC const&c; Point const& p;
Point_6(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){}
decltype(auto) c0()const{return c(p,0);}
decltype(auto) c1()const{return c(p,1);}
decltype(auto) c2()const{return c(p,2);}
decltype(auto) c3()const{return c(p,3);}
decltype(auto) c4()const{return c(p,4);}
decltype(auto) c5()const{return c(p,5);}
};
struct Orientation_6 {
typedef typename Get_type<R_, Orientation_tag>::type result_type;
auto operator()(Point_6 const&A, Point_6 const&B, Point_6 const&C,
Point_6 const&D, Point_6 const&E, Point_6 const&F, Point_6 const&G)const{
Point const* t[7]={&A.p,&B.p,&C.p,&D.p,&E.p,&F.p,&G.p};
return Orientation_base(A.r)(make_transforming_iterator<Dereference_functor>(t+0),make_transforming_iterator<Dereference_functor>(t+7));
}
};
};
template <class Base_,class R_> struct Orientation_of_points_6 : private Store_kernel<R_> {
CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_6)
typedef typename Get_type<R_, Point_tag>::type Point;
typedef typename Get_type<R_, Orientation_tag>::type result_type;
typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
typedef Adapter_6<Base_, R_> Adapter;
template<class Iter> result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{
CC c(this->kernel());
Point const& A=*f;
Point const& B=*++f;
Point const& C=*++f;
Point const& D=*++f;
Point const& E=*++f;
Point const& F=*++f;
Point const& G=*++f;
CGAL_assertion(++f==e);
typedef typename Adapter::Point_6 P;
return typename internal::Static_filters_predicates::Orientation_6<Adapter>()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C),
P(this->kernel(),c,D),P(this->kernel(),c,E),P(this->kernel(),c,F),
P(this->kernel(),c,G));
}
};
} // namespace SFA
template <class Dim_ /* should be implicit */, class R_, class Derived_=Default>
@ -194,5 +341,44 @@ struct Cartesian_static_filters<Dimension_tag<3>, R_, Derived_> : public R_ {
typedef SFA::Side_of_oriented_sphere_3<R_,Derived> type;
};
};
#ifndef CGAL_NO_STATIC_FILTER_456
template <class R_, class Derived_>
struct Cartesian_static_filters<Dimension_tag<4>, R_, Derived_> : public R_ {
constexpr Cartesian_static_filters(){}
constexpr Cartesian_static_filters(int d):R_(d){}
typedef Cartesian_static_filters<Dimension_tag<4>, R_, Derived_> Self;
typedef typename Default::Get<Derived_,Self>::type Derived;
template <class T, class=void> struct Functor : Inherit_functor<R_, T> {};
template <class D> struct Functor <Orientation_of_points_tag,D> {
typedef SFA::Orientation_of_points_4<R_,Derived> type;
};
};
template <class R_, class Derived_>
struct Cartesian_static_filters<Dimension_tag<5>, R_, Derived_> : public R_ {
constexpr Cartesian_static_filters(){}
constexpr Cartesian_static_filters(int d):R_(d){}
typedef Cartesian_static_filters<Dimension_tag<5>, R_, Derived_> Self;
typedef typename Default::Get<Derived_,Self>::type Derived;
template <class T, class=void> struct Functor : Inherit_functor<R_, T> {};
template <class D> struct Functor <Orientation_of_points_tag,D> {
typedef SFA::Orientation_of_points_5<R_,Derived> type;
};
};
template <class R_, class Derived_>
struct Cartesian_static_filters<Dimension_tag<6>, R_, Derived_> : public R_ {
constexpr Cartesian_static_filters(){}
constexpr Cartesian_static_filters(int d):R_(d){}
typedef Cartesian_static_filters<Dimension_tag<6>, R_, Derived_> Self;
typedef typename Default::Get<Derived_,Self>::type Derived;
template <class T, class=void> struct Functor : Inherit_functor<R_, T> {};
template <class D> struct Functor <Orientation_of_points_tag,D> {
typedef SFA::Orientation_of_points_6<R_,Derived> type;
};
};
#endif
} // namespace CGAL
#endif

View File

@ -137,6 +137,12 @@ public:
friend auto operator!=(Point_d const&p, Point_d const&q) { return !(p==q); }
// May be accidentally inherited from the base class otherwise
friend auto operator< (Point_d const&p, Point_d const&q) = delete;
friend auto operator> (Point_d const&p, Point_d const&q) = delete;
friend auto operator<=(Point_d const&p, Point_d const&q) = delete;
friend auto operator>=(Point_d const&p, Point_d const&q) = delete;
friend std::ostream& operator <<(std::ostream& os, const Point_d& p)
{
auto b = p.cartesian_begin();

View File

@ -130,6 +130,19 @@ public:
return SLBase()(rep());
}
friend auto operator==(Vector_d const&p, Vector_d const&q) {
typedef typename Get_functor<Kbase, Equal_vectors_tag>::type EPBase;
return EPBase()(p.rep(), q.rep());
}
friend auto operator!=(Vector_d const&p, Vector_d const&q) { return !(p==q); }
// May be accidentally inherited from the base class otherwise
friend auto operator< (Vector_d const&p, Vector_d const&q) = delete;
friend auto operator> (Vector_d const&p, Vector_d const&q) = delete;
friend auto operator<=(Vector_d const&p, Vector_d const&q) = delete;
friend auto operator>=(Vector_d const&p, Vector_d const&q) = delete;
friend std::ostream& operator <<(std::ostream& os, const Vector_d& v)
{
auto b = v.cartesian_begin();

View File

@ -1279,6 +1279,36 @@ template<class R_> struct Equal_points : private Store_kernel<R_> {
CGAL_KD_DEFAULT_FUNCTOR(Equal_points_tag,(CartesianDKernelFunctors::Equal_points<K>),(),(Construct_ttag<Point_cartesian_const_iterator_tag>));
namespace CartesianDKernelFunctors {
template<class R_> struct Equal_vectors : private Store_kernel<R_> {
CGAL_FUNCTOR_INIT_STORE(Equal_vectors)
typedef R_ R;
typedef typename Get_type<R, Bool_tag>::type result_type;
typedef typename Get_functor<R, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type CI;
// TODO: This is_exact thing should be reengineered.
// the goal is to have a way to tell: don't filter this
typedef typename CGAL::Uses_no_arithmetic<CI> Uses_no_arithmetic;
template<class V,class W>
result_type operator()(V const&a, W const&b)const{
CI c(this->kernel());
auto a_begin=c(a,Begin_tag());
auto b_begin=c(b,Begin_tag());
auto a_end=c(a,End_tag());
result_type res = true;
// Is using CGAL::possibly for Uncertain really an optimization?
do res = res & (*a_begin++ == *b_begin++);
while(a_begin!=a_end && possibly(res));
return res;
}
};
}
CGAL_KD_DEFAULT_FUNCTOR(Equal_vectors_tag,(CartesianDKernelFunctors::Equal_vectors<K>),(),(Construct_ttag<Vector_cartesian_const_iterator_tag>));
namespace CartesianDKernelFunctors {
template<class R_> struct Oriented_side : private Store_kernel<R_> {
CGAL_FUNCTOR_INIT_STORE(Oriented_side)

View File

@ -282,6 +282,7 @@ namespace CGAL {
CGAL_DECL_PREDICATE(Less_lexicographically);
CGAL_DECL_PREDICATE(Less_or_equal_lexicographically);
CGAL_DECL_PREDICATE(Equal_points);
CGAL_DECL_PREDICATE(Equal_vectors);
CGAL_DECL_PREDICATE(Has_on_positive_side);
CGAL_DECL_PREDICATE_(Orientation); // duplicate with the type
CGAL_DECL_PREDICATE_(Oriented_side); // duplicate with the type

View File

@ -0,0 +1,254 @@
// Copyright (c) 2025
// INRIA Saclay-Ile de France (France)
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Andreas Fabri
// Files needed as input for the static filter generator
#if 0
double determinant(
double a00, double a01, double a02, double a03,
double a10, double a11, double a12, double a13,
double a20, double a21, double a22, double a23,
double a30, double a31, double a32, double a33)
{
double m01 = a10*a01 - a00*a11;
double m02 = a20*a01 - a00*a21;
double m03 = a30*a01 - a00*a31;
double m12 = a20*a11 - a10*a21;
double m13 = a30*a11 - a10*a31;
double m23 = a30*a21 - a20*a31;
double m012 = m12*a02 - m02*a12 + m01*a22;
double m013 = m13*a02 - m03*a12 + m01*a32;
double m023 = m23*a02 - m03*a22 + m02*a32;
double m123 = m23*a12 - m13*a22 + m12*a32;
double m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33;
return m0123;
}
int orientationC4(double p0, double p1, double p2, double p3,
double q0, double q1, double q2, double q3,
double r0, double r1, double r2, double r3,
double s0, double s1, double s2, double s3,
double t0, double t1, double t2, double t3)
group p0 q0 r0 t0 q0;
group p1 q1 r1 t1 q1;
group p2 q2 r2 t2 q2;
group p3 q3 r3 t3 q3;
{
double m01;
m01 = (q0 - p0);
double m02;
m02 = (r0 - p0);
double m03;
m03 = (s0 - p0);
double m04;
m04 = (t0 - p0);
double m11;
m11 = (q1 - p1);
double m12;
m12 = (r1 - p1);
double m13;
m13 = (s1 - p1);
double m14;
m14 = (t1 - p1);
double m21;
m21 = (q2 - p2);
double m22;
m22 = (r2 - p2);
double m23;
m23 = (s2 - p2);
double m24;
m24 = (t2 - p2);
double m31;
m31 = (q3 - p3);
double m32;
m32 = (r3 - p3);
double m33;
m33 = (s3 - p3);
double m34;
m34 = (t3 - p3);
double det = determinant(m01, m02, m03, m04,
m11, m12, m13, m14,
m21, m22, m23, m24,
m31, m32, m33, m34);
return sign(det);
}
//===========generated ==================
inline int orientationC4( double p0, double p1, double p2, double p3, double q0, double q1, double q2, double q3, double r0, double r1, double r2, double r3, double s0, double s1, double s2, double s3, double t0, double t1, double t2, double t3) {
double m01;
m01 = (q0 - p0);
double m02;
m02 = (r0 - p0);
double m03;
m03 = (s0 - p0);
double m04;
m04 = (t0 - p0);
double m11;
m11 = (q1 - p1);
double m12;
m12 = (r1 - p1);
double m13;
m13 = (s1 - p1);
double m14;
m14 = (t1 - p1);
double m21;
m21 = (q2 - p2);
double m22;
m22 = (r2 - p2);
double m23;
m23 = (s2 - p2);
double m24;
m24 = (t2 - p2);
double m31;
m31 = (q3 - p3);
double m32;
m32 = (r3 - p3);
double m33;
m33 = (s3 - p3);
double m34;
m34 = (t3 - p3);
double det;
det = determinant( m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34 );
int int_tmp_result;
double eps;
double max1 = CGAL::abs(m01);
double am = CGAL::abs(m02);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m03);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m11);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m12);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m13);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m23);
if( (max1 < am) ) { max1 = am; }
double max2 = CGAL::abs(m01);
am = CGAL::abs(m02);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m11);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m12);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m21);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m22);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m23);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m33);
if( (max2 < am) ) { max2 = am; }
double max3 = CGAL::abs(m04);
am = CGAL::abs(m14);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m24);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m34);
if( (max3 < am) ) { max3 = am; }
double max4 = CGAL::abs(m11);
am = CGAL::abs(m12);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m21);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m22);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m31);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m32);
if( (max4 < am) ) { max4 = am; }
double lower_bound_1;
double upper_bound_1;
lower_bound_1 = max1;
upper_bound_1 = max1;
if( (max2 < lower_bound_1) )
{
lower_bound_1 = max2;
}
else
{
if( (max2 > upper_bound_1) )
{
upper_bound_1 = max2;
}
}
if( (max3 < lower_bound_1) )
{
lower_bound_1 = max3;
}
else
{
if( (max3 > upper_bound_1) )
{
upper_bound_1 = max3;
}
}
if( (max4 < lower_bound_1) )
{
lower_bound_1 = max4;
}
else
{
if( (max4 > upper_bound_1) )
{
upper_bound_1 = max4;
}
}
if( (lower_bound_1 < 2.89273249588395272840e-74) )
{
return FPG_UNCERTAIN_VALUE;
}
else
{
if( (upper_bound_1 > 7.23700557733225900010e+75) )
{
return FPG_UNCERTAIN_VALUE;
}
eps = (3.17768858673611327578e-14 * (((max4 * max2) * max1) * max3));
if( (det > eps) )
{
int_tmp_result = 1;
}
else
{
if( (det < -eps) )
{
int_tmp_result = -1;
}
else
{
return FPG_UNCERTAIN_VALUE;
}
}
}
return int_tmp_result;
}
#endif

View File

@ -0,0 +1,345 @@
// Copyright (c) 2025
// INRIA Saclay-Ile de France (France)
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Andreas Fabri
// Files needed as input for the static filter generator
#if 0
double
determinant(
double a00, double a01, double a02, double a03, double a04,
double a10, double a11, double a12, double a13, double a14,
double a20, double a21, double a22, double a23, double a24,
double a30, double a31, double a32, double a33, double a34,
double a40, double a41, double a42, double a43, double a44)
{
double m01 = a10*a01 - a00*a11;
double m02 = a20*a01 - a00*a21;
double m03 = a30*a01 - a00*a31;
double m04 = a40*a01 - a00*a41;
double m12 = a20*a11 - a10*a21;
double m13 = a30*a11 - a10*a31;
double m14 = a40*a11 - a10*a41;
double m23 = a30*a21 - a20*a31;
double m24 = a40*a21 - a20*a41;
double m34 = a40*a31 - a30*a41;
double m012 = m12*a02 - m02*a12 + m01*a22;
double m013 = m13*a02 - m03*a12 + m01*a32;
double m014 = m14*a02 - m04*a12 + m01*a42;
double m023 = m23*a02 - m03*a22 + m02*a32;
double m024 = m24*a02 - m04*a22 + m02*a42;
double m034 = m34*a02 - m04*a32 + m03*a42;
double m123 = m23*a12 - m13*a22 + m12*a32;
double m124 = m24*a12 - m14*a22 + m12*a42;
double m134 = m34*a12 - m14*a32 + m13*a42;
double m234 = m34*a22 - m24*a32 + m23*a42;
double m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33;
double m0124 = m124*a03 - m024*a13 + m014*a23 - m012*a43;
double m0134 = m134*a03 - m034*a13 + m014*a33 - m013*a43;
double m0234 = m234*a03 - m034*a23 + m024*a33 - m023*a43;
double m1234 = m234*a13 - m134*a23 + m124*a33 - m123*a43;
double m01234 = m1234*a04 - m0234*a14 + m0134*a24 - m0124*a34 + m0123*a44;
return m01234;
}
int orientationC5(double p0, double p1, double p2, double p3, double p4,
double q0, double q1, double q2, double q3, double q4,
double r0, double r1, double r2, double r3, double r4,
double s0, double s1, double s2, double s3, double s4,
double t0, double t1, double t2, double t3, double t4,
double u0, double u1, double u2, double u3, double u4)
group p0 q0 r0 t0 q0 u0;
group p1 q1 r1 t1 q1 u1;
group p2 q2 r2 t2 q2 u2;
group p3 q3 r3 t3 q3 u3;
group p4 q4 r4 t4 q4 u4;
{
double m01;
m01 = (q0 - p0);
double m02;
m02 = (r0 - p0);
double m03;
m03 = (s0 - p0);
double m04;
m04 = (t0 - p0);
double m05;
m05 = (u0 - p0);
double m11;
m11 = (q1 - p1);
double m12;
m12 = (r1 - p1);
double m13;
m13 = (s1 - p1);
double m14;
m14 = (t1 - p1);
double m15;
m15 = (u1 - p1);
double m21;
m21 = (q2 - p2);
double m22;
m22 = (r2 - p2);
double m23;
m23 = (s2 - p2);
double m24;
m24 = (t2 - p2);
double m25;
m25 = (u2 - p2);
double m31;
m31 = (q3 - p3);
double m32;
m32 = (r3 - p3);
double m33;
m33 = (s3 - p3);
double m34;
m34 = (t3 - p3);
double m35;
m35 = (u3 - p3);
double m41;
m41 = (q4 - p4);
double m42;
m42 = (r4 - p4);
double m43;
m43 = (s4 - p4);
double m44;
m44 = (t4 - p4);
double m45;
m45 = (u4 - p4);
double det = determinant(m01, m02, m03, m04, m05,
m11, m12, m13, m14, m15,
m21, m22, m23, m24, m25,
m31, m32, m33, m34, m35,
m41, m42, m43, m44, m45);
return sign(det);
}
//===========generated ==================
inline int orientationC5( double p0, double p1, double p2, double p3, double p4, double q0, double q1, double q2, double q3, double q4, double r0, double r1, double r2, double r3, double r4, double s0, double s1, double s2, double s3, double s4, double t0, double t1, double t2, double t3, double t4, double u0, double u1, double u2, double u3, double u4) {
double m01;
m01 = (q0 - p0);
double m02;
m02 = (r0 - p0);
double m03;
m03 = (s0 - p0);
double m04;
m04 = (t0 - p0);
double m05;
m05 = (u0 - p0);
double m11;
m11 = (q1 - p1);
double m12;
m12 = (r1 - p1);
double m13;
m13 = (s1 - p1);
double m14;
m14 = (t1 - p1);
double m15;
m15 = (u1 - p1);
double m21;
m21 = (q2 - p2);
double m22;
m22 = (r2 - p2);
double m23;
m23 = (s2 - p2);
double m24;
m24 = (t2 - p2);
double m25;
m25 = (u2 - p2);
double m31;
m31 = (q3 - p3);
double m32;
m32 = (r3 - p3);
double m33;
m33 = (s3 - p3);
double m34;
m34 = (t3 - p3);
double m35;
m35 = (u3 - p3);
double m41;
m41 = (q4 - p4);
double m42;
m42 = (r4 - p4);
double m43;
m43 = (s4 - p4);
double m44;
m44 = (t4 - p4);
double m45;
m45 = (u4 - p4);
double det;
det = determinant( m01, m02, m03, m04, m05, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25, m31, m32, m33, m34, m35, m41, m42, m43, m44, m45 );
int int_tmp_result;
double eps;
double max1 = CGAL::abs(m01);
double am = CGAL::abs(m02);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m03);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m11);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m12);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m13);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m21);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m22);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m23);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m33);
if( (max1 < am) ) { max1 = am; }
double max2 = CGAL::abs(m01);
am = CGAL::abs(m02);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m11);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m12);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m21);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m22);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m23);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m31);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m32);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m33);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m43);
if( (max2 < am) ) { max2 = am; }
double max3 = CGAL::abs(m04);
am = CGAL::abs(m14);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m24);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m34);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m44);
if( (max3 < am) ) { max3 = am; }
double max4 = CGAL::abs(m05);
am = CGAL::abs(m15);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m25);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m35);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m45);
if( (max4 < am) ) { max4 = am; }
double max5 = CGAL::abs(m11);
am = CGAL::abs(m12);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m21);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m22);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m31);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m32);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m41);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m42);
if( (max5 < am) ) { max5 = am; }
double lower_bound_1;
double upper_bound_1;
lower_bound_1 = max5;
upper_bound_1 = max5;
if( (max1 < lower_bound_1) )
{
lower_bound_1 = max1;
}
else
{
if( (max1 > upper_bound_1) )
{
upper_bound_1 = max1;
}
}
if( (max2 < lower_bound_1) )
{
lower_bound_1 = max2;
}
else
{
if( (max2 > upper_bound_1) )
{
upper_bound_1 = max2;
}
}
if( (max3 < lower_bound_1) )
{
lower_bound_1 = max3;
}
else
{
if( (max3 > upper_bound_1) )
{
upper_bound_1 = max3;
}
}
if( (max4 < lower_bound_1) )
{
lower_bound_1 = max4;
}
else
{
if( (max4 > upper_bound_1) )
{
upper_bound_1 = max4;
}
}
if( (lower_bound_1 < 9.99657131447050328602e-60) )
{
return FPG_UNCERTAIN_VALUE;
}
else
{
if( (upper_bound_1 > 3.21387608851797912384e+60) )
{
return FPG_UNCERTAIN_VALUE;
}
eps = (2.22889232457534740153e-13 * ((((max5 * max2) * max1) * max3) * max4));
if( (det > eps) )
{
int_tmp_result = 1;
}
else
{
if( (det < -eps) )
{
int_tmp_result = -1;
}
else
{
return FPG_UNCERTAIN_VALUE;
}
}
}
return int_tmp_result;
}
#endif

View File

@ -0,0 +1,477 @@
// Copyright (c) 2025
// INRIA Saclay-Ile de France (France)
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Andreas Fabri
// Files needed as input for the static filter generator
#if 0
double
determinant(
double a00, double a01, double a02, double a03, double a04, double a05,
double a10, double a11, double a12, double a13, double a14, double a15,
double a20, double a21, double a22, double a23, double a24, double a25,
double a30, double a31, double a32, double a33, double a34, double a35,
double a40, double a41, double a42, double a43, double a44, double a45,
double a50, double a51, double a52, double a53, double a54, double a55)
{
double m01 = a00*a11 - a10*a01;
double m02 = a00*a21 - a20*a01;
double m03 = a00*a31 - a30*a01;
double m04 = a00*a41 - a40*a01;
double m05 = a00*a51 - a50*a01;
double m12 = a10*a21 - a20*a11;
double m13 = a10*a31 - a30*a11;
double m14 = a10*a41 - a40*a11;
double m15 = a10*a51 - a50*a11;
double m23 = a20*a31 - a30*a21;
double m24 = a20*a41 - a40*a21;
double m25 = a20*a51 - a50*a21;
double m34 = a30*a41 - a40*a31;
double m35 = a30*a51 - a50*a31;
double m45 = a40*a51 - a50*a41;
double m012 = m01*a22 - m02*a12 + m12*a02;
double m013 = m01*a32 - m03*a12 + m13*a02;
double m014 = m01*a42 - m04*a12 + m14*a02;
double m015 = m01*a52 - m05*a12 + m15*a02;
double m023 = m02*a32 - m03*a22 + m23*a02;
double m024 = m02*a42 - m04*a22 + m24*a02;
double m025 = m02*a52 - m05*a22 + m25*a02;
double m034 = m03*a42 - m04*a32 + m34*a02;
double m035 = m03*a52 - m05*a32 + m35*a02;
double m045 = m04*a52 - m05*a42 + m45*a02;
double m123 = m12*a32 - m13*a22 + m23*a12;
double m124 = m12*a42 - m14*a22 + m24*a12;
double m125 = m12*a52 - m15*a22 + m25*a12;
double m134 = m13*a42 - m14*a32 + m34*a12;
double m135 = m13*a52 - m15*a32 + m35*a12;
double m145 = m14*a52 - m15*a42 + m45*a12;
double m234 = m23*a42 - m24*a32 + m34*a22;
double m235 = m23*a52 - m25*a32 + m35*a22;
double m245 = m24*a52 - m25*a42 + m45*a22;
double m345 = m34*a52 - m35*a42 + m45*a32;
double m0123 = m012*a33 - m013*a23 + m023*a13 - m123*a03;
double m0124 = m012*a43 - m014*a23 + m024*a13 - m124*a03;
double m0125 = m012*a53 - m015*a23 + m025*a13 - m125*a03;
double m0134 = m013*a43 - m014*a33 + m034*a13 - m134*a03;
double m0135 = m013*a53 - m015*a33 + m035*a13 - m135*a03;
double m0145 = m014*a53 - m015*a43 + m045*a13 - m145*a03;
double m0234 = m023*a43 - m024*a33 + m034*a23 - m234*a03;
double m0235 = m023*a53 - m025*a33 + m035*a23 - m235*a03;
double m0245 = m024*a53 - m025*a43 + m045*a23 - m245*a03;
double m0345 = m034*a53 - m035*a43 + m045*a33 - m345*a03;
double m1234 = m123*a43 - m124*a33 + m134*a23 - m234*a13;
double m1235 = m123*a53 - m125*a33 + m135*a23 - m235*a13;
double m1245 = m124*a53 - m125*a43 + m145*a23 - m245*a13;
double m1345 = m134*a53 - m135*a43 + m145*a33 - m345*a13;
double m2345 = m234*a53 - m235*a43 + m245*a33 - m345*a23;
double m01234 = m0123*a44 - m0124*a34 + m0134*a24 - m0234*a14 + m1234*a04;
double m01235 = m0123*a54 - m0125*a34 + m0135*a24 - m0235*a14 + m1235*a04;
double m01245 = m0124*a54 - m0125*a44 + m0145*a24 - m0245*a14 + m1245*a04;
double m01345 = m0134*a54 - m0135*a44 + m0145*a34 - m0345*a14 + m1345*a04;
double m02345 = m0234*a54 - m0235*a44 + m0245*a34 - m0345*a24 + m2345*a04;
double m12345 = m1234*a54 - m1235*a44 + m1245*a34 - m1345*a24 + m2345*a14;
double m012345 = m01234*a55 - m01235*a45 + m01245*a35 - m01345*a25
+ m02345*a15 - m12345*a05;
return m012345;
}
int orientationC6(double p0, double p1, double p2, double p3, double p4, double p5,
double q0, double q1, double q2, double q3, double q4, double q5,
double r0, double r1, double r2, double r3, double r4, double r5,
double s0, double s1, double s2, double s3, double s4, double s5,
double t0, double t1, double t2, double t3, double t4, double t5,
double u0, double u1, double u2, double u3, double u4, double u5,
double v0, double v1, double v2, double v3, double v4, double v5)
group p0 q0 r0 t0 q0 u0 v0;
group p1 q1 r1 t1 q1 u1 v1;
group p2 q2 r2 t2 q2 u2 v2;
group p3 q3 r3 t3 q3 u3 v3;
group p4 q4 r4 t4 q4 u4 v4;
group p5 q5 r5 t5 q5 u5 v5;
{
double m01;
m01 = (q0 - p0);
double m02;
m02 = (r0 - p0);
double m03;
m03 = (s0 - p0);
double m04;
m04 = (t0 - p0);
double m05;
m05 = (u0 - p0);
double m06;
m06 = (v0 - p0);
double m11;
m11 = (q1 - p1);
double m12;
m12 = (r1 - p1);
double m13;
m13 = (s1 - p1);
double m14;
m14 = (t1 - p1);
double m15;
m15 = (u1 - p1);
double m16;
m16 = (v1 - p1);
double m21;
m21 = (q2 - p2);
double m22;
m22 = (r2 - p2);
double m23;
m23 = (s2 - p2);
double m24;
m24 = (t2 - p2);
double m25;
m25 = (u2 - p2);
double m26;
m26 = (v2 - p2);
double m31;
m31 = (q3 - p3);
double m32;
m32 = (r3 - p3);
double m33;
m33 = (s3 - p3);
double m34;
m34 = (t3 - p3);
double m35;
m35 = (u3 - p3);
double m36;
m36 = (v3 - p3);
double m41;
m41 = (q4 - p4);
double m42;
m42 = (r4 - p4);
double m43;
m43 = (s4 - p4);
double m44;
m44 = (t4 - p4);
double m45;
m45 = (u4 - p4);
double m46;
m46 = (v4 - p4);
double m51;
m51 = (q5 - p5);
double m52;
m52 = (r5 - p5);
double m53;
m53 = (s5 - p5);
double m54;
m54 = (t5 - p5);
double m55;
m55 = (u5 - p5);
double m56;
m56 = (v5 - p5);
double det = determinant(m01, m02, m03, m04, m05, m06,
m11, m12, m13, m14, m15, m16,
m21, m22, m23, m24, m25, m26,
m31, m32, m33, m34, m35, m36,
m41, m42, m43, m44, m45, m46,
m51, m52, m53, m54, m55, m56);
return sign(det);
}
//===========generated ==================
inline int orientationC6( double p0, double p1, double p2, double p3, double p4, double p5, double q0, double q1, double q2, double q3, double q4, double q5, double r0, double r1, double r2, double r3, double r4, double r5, double s0, double s1, double s2, double s3, double s4, double s5, double t0, double t1, double t2, double t3, double t4, double t5, double u0, double u1, double u2, double u3, double u4, double u5, double v0, double v1, double v2, double v3, double v4, double v5) {
double m01;
m01 = (q0 - p0);
double m02;
m02 = (r0 - p0);
double m03;
m03 = (s0 - p0);
double m04;
m04 = (t0 - p0);
double m05;
m05 = (u0 - p0);
double m06;
m06 = (v0 - p0);
double m11;
m11 = (q1 - p1);
double m12;
m12 = (r1 - p1);
double m13;
m13 = (s1 - p1);
double m14;
m14 = (t1 - p1);
double m15;
m15 = (u1 - p1);
double m16;
m16 = (v1 - p1);
double m21;
m21 = (q2 - p2);
double m22;
m22 = (r2 - p2);
double m23;
m23 = (s2 - p2);
double m24;
m24 = (t2 - p2);
double m25;
m25 = (u2 - p2);
double m26;
m26 = (v2 - p2);
double m31;
m31 = (q3 - p3);
double m32;
m32 = (r3 - p3);
double m33;
m33 = (s3 - p3);
double m34;
m34 = (t3 - p3);
double m35;
m35 = (u3 - p3);
double m36;
m36 = (v3 - p3);
double m41;
m41 = (q4 - p4);
double m42;
m42 = (r4 - p4);
double m43;
m43 = (s4 - p4);
double m44;
m44 = (t4 - p4);
double m45;
m45 = (u4 - p4);
double m46;
m46 = (v4 - p4);
double m51;
m51 = (q5 - p5);
double m52;
m52 = (r5 - p5);
double m53;
m53 = (s5 - p5);
double m54;
m54 = (t5 - p5);
double m55;
m55 = (u5 - p5);
double m56;
m56 = (v5 - p5);
double det;
det = determinant( m01, m02, m03, m04, m05, m06, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26, m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56 );
int int_tmp_result;
double eps;
double max1 = CGAL::abs(m01);
double am = CGAL::abs(m02);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m11);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m12);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m21);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m22);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m31);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m32);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m41);
if( (max1 < am) ) { max1 = am; }
am = CGAL::abs(m42);
if( (max1 < am) ) { max1 = am; }
double max2 = CGAL::abs(m03);
am = CGAL::abs(m11);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m12);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m13);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m21);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m22);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m23);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m31);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m32);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m33);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m41);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m42);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m43);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m51);
if( (max2 < am) ) { max2 = am; }
am = CGAL::abs(m52);
if( (max2 < am) ) { max2 = am; }
double max3 = CGAL::abs(m04);
am = CGAL::abs(m14);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m24);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m34);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m44);
if( (max3 < am) ) { max3 = am; }
am = CGAL::abs(m54);
if( (max3 < am) ) { max3 = am; }
double max4 = CGAL::abs(m05);
am = CGAL::abs(m15);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m25);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m35);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m45);
if( (max4 < am) ) { max4 = am; }
am = CGAL::abs(m55);
if( (max4 < am) ) { max4 = am; }
double max5 = CGAL::abs(m06);
am = CGAL::abs(m16);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m26);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m36);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m46);
if( (max5 < am) ) { max5 = am; }
am = CGAL::abs(m56);
if( (max5 < am) ) { max5 = am; }
double max6 = CGAL::abs(m13);
am = CGAL::abs(m21);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m22);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m23);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m31);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m32);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m33);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m41);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m42);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m43);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m51);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m52);
if( (max6 < am) ) { max6 = am; }
am = CGAL::abs(m53);
if( (max6 < am) ) { max6 = am; }
double lower_bound_1;
double upper_bound_1;
lower_bound_1 = max6;
upper_bound_1 = max6;
if( (max5 < lower_bound_1) )
{
lower_bound_1 = max5;
}
else
{
if( (max5 > upper_bound_1) )
{
upper_bound_1 = max5;
}
}
if( (max1 < lower_bound_1) )
{
lower_bound_1 = max1;
}
else
{
if( (max1 > upper_bound_1) )
{
upper_bound_1 = max1;
}
}
if( (max2 < lower_bound_1) )
{
lower_bound_1 = max2;
}
else
{
if( (max2 > upper_bound_1) )
{
upper_bound_1 = max2;
}
}
if( (max3 < lower_bound_1) )
{
lower_bound_1 = max3;
}
else
{
if( (max3 > upper_bound_1) )
{
upper_bound_1 = max3;
}
}
if( (max4 < lower_bound_1) )
{
lower_bound_1 = max4;
}
else
{
if( (max4 > upper_bound_1) )
{
upper_bound_1 = max4;
}
}
if( (lower_bound_1 < 4.82472686053427214432e-50) )
{
return FPG_UNCERTAIN_VALUE;
}
else
{
if( (upper_bound_1 > 1.87072209578355511223e+50) )
{
return FPG_UNCERTAIN_VALUE;
}
eps = (1.76403842114300859158e-12 * (((((max1 * max2) * max6) * max3) * max4) * max5));
if( (det > eps) )
{
int_tmp_result = 1;
}
else
{
if( (det < -eps) )
{
int_tmp_result = -1;
}
else
{
return FPG_UNCERTAIN_VALUE;
}
}
}
return int_tmp_result;
}
#endif

View File

@ -277,6 +277,7 @@ void test2(){
P x4=cp(0,0);
P x5=cp(0,-1);
P tab2[]={x1,x2,x3,x4};
assert(x1==x1 && x1!=x2);
assert(dp(x1,x2)[1]==2);
assert(po(tab2+0,tab2+3)==CGAL::COUNTERCLOCKWISE);
assert(sos(tab2+0,tab2+3,x4)==CGAL::ON_POSITIVE_SIDE);
@ -285,6 +286,7 @@ void test2(){
assert(y1.squared_length()==2);
assert(sl(y1)==2);
V y2=cv(3,-3);
assert(y1==y1 && y1!=y2);
assert(spr(y1,y2)==6);
assert(dv(y2,y1)[0]==2);
V tab3[]={y1,y2};

View File

@ -1312,7 +1312,7 @@ OutputIterator
adjacent_vertices(Vertex_handle v, OutputIterator vertices) const;
/*!
Returns the degree of a vertex, that is, the number of adjacent vertices.
Returns the degree of `v`, that is, the number of adjacent vertices.
\pre `v` \f$ \neq\f$ `Vertex_handle()`, `t`.`is_vertex(v)`.
*/
size_type degree(Vertex_handle v) const;

View File

@ -547,91 +547,6 @@ bool read_LAS(const std::string& fname, OutputIterator output, const CGAL_NP_CLA
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/// \cond SKIP_IN_MANUAL
using IO::make_las_point_reader;
namespace LAS_property = IO::LAS_property;
template <typename OutputIteratorValueType,
typename OutputIterator,
typename PointMap >
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_las_points(), please update your code")
bool read_las_points(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
{
return read_las_points<OutputIteratorValueType>(is, output, CGAL::parameters::point_map (point_map));
}
template <typename OutputIterator,
typename PointMap >
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_las_points(), please update your code")
bool read_las_points(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
{
return read_las_points<typename value_type_traits<OutputIterator>::type>(is, output,
CGAL::parameters::point_map(point_map));
}
/// \endcond
template <typename OutputIteratorValueType,
typename OutputIterator,
typename ... PropertyHandler>
CGAL_DEPRECATED bool read_las_points_with_properties(std::istream& is,
OutputIterator output,
PropertyHandler&& ... properties)
{
return IO::read_LAS_with_properties(is, output, std::forward<PropertyHandler>(properties)...);
}
/// \cond SKIP_IN_MANUAL
template <typename OutputIterator,
typename ... PropertyHandler>
CGAL_DEPRECATED bool read_las_points_with_properties(std::istream& is,
OutputIterator output,
PropertyHandler&& ... properties)
{
return IO::read_LAS_with_properties<typename value_type_traits<OutputIterator>::type>(is, output, std::forward<PropertyHandler>(properties)...);
}
/// \endcond
template <typename OutputIteratorValueType,
typename OutputIterator,
typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_las_points(std::istream& is,
OutputIterator output,
const CGAL_NP_CLASS& np = parameters::default_values())
{
using parameters::choose_parameter;
using parameters::get_parameter;
typename CGAL::GetPointMap<Point_set_processing_3::Fake_point_range<OutputIteratorValueType>, CGAL_NP_CLASS>::type point_map =
choose_parameter<typename CGAL::GetPointMap<Point_set_processing_3::Fake_point_range<OutputIteratorValueType>, CGAL_NP_CLASS>::type>(get_parameter(np, internal_np::point_map));
return IO::read_LAS(is, output, make_las_point_reader(point_map));
}
/// \cond SKIP_IN_MANUAL
// variant with default output iterator value type
template <typename OutputIterator, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_las_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::read_LAS<typename value_type_traits<OutputIterator>::type>(is, output, np);
}
/// \endcond
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
#endif // CGAL_POINT_SET_PROCESSING_READ_LAS_POINTS_H

View File

@ -271,174 +271,6 @@ bool read_OFF(const std::string& fname, OutputIterator output, const CGAL_NP_CLA
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/// \cond SKIP_IN_MANUAL
template <typename OutputIteratorValueType,
typename OutputIterator,
typename PointPMap,
typename NormalPMap,
typename Kernel>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code")
bool read_off_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3.
const Kernel& /*kernel*/) ///< geometric traits.
{
return IO::read_OFF<OutputIteratorValueType>(is, output,
parameters::point_map(point_map)
.normal_map(normal_map)
.geom_traits(Kernel()));
}
template <typename OutputIterator,
typename PointPMap,
typename NormalPMap,
typename Kernel>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code")
bool read_off_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3.
const Kernel& kernel) ///< geometric traits.
{
return IO::read_OFF<typename value_type_traits<OutputIterator>::type>(is, output,
parameters::point_map(point_map)
.normal_map(normal_map)
.geom_traits(kernel));
}
template <typename OutputIteratorValueType,
typename OutputIterator,
typename PointPMap,
typename NormalPMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code")
bool read_off_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
return IO::read_OFF<OutputIteratorValueType>(is, output, parameters::point_map(point_map)
.normal_map(normal_map));
}
template <typename OutputIterator,
typename PointPMap,
typename NormalPMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code")
bool read_off_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
return IO::read_OFF<typename value_type_traits<OutputIterator>::type>(is, output,
parameters::point_map(point_map)
.normal_map(normal_map));
}
template <typename OutputIteratorValueType,
typename OutputIterator,
typename NormalPMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code")
bool read_off_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
return IO::read_OFF<OutputIteratorValueType>(is, output, parameters::normal_map(normal_map));
}
template <typename OutputIterator,
typename NormalPMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code")
bool read_off_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
return IO::read_OFF<typename value_type_traits<OutputIterator>::type>(is, output, parameters::normal_map(normal_map));
}
template <typename OutputIteratorValueType,
typename OutputIterator,
typename PointPMap,
typename Kernel
>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code")
bool read_off_points(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
const Kernel& kernel) ///< geometric traits.
{
return read_off_points<OutputIteratorValueType>(is, output, parameters::point_map(point_map)
.geom_traits(kernel));
}
template <typename OutputIterator,
typename PointPMap,
typename Kernel>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code")
bool read_off_points(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
const Kernel& kernel) ///< geometric traits.
{
return read_off_points<typename value_type_traits<OutputIterator>::type>(is, output,
parameters::point_map(point_map)
.geom_traits (kernel));
}
template <typename OutputIteratorValueType,
typename OutputIterator,
typename PointPMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code")
bool read_off_points(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
{
return read_off_points<OutputIteratorValueType>(is, output, parameters::point_map (point_map));
}
template <typename OutputIterator, typename PointPMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code")
bool read_off_points(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
{
return read_off_points<typename value_type_traits<OutputIterator>::type>(is, output, parameters::point_map(point_map));
}
/// \endcond
template <typename OutputIteratorValueType,
typename OutputIterator,
typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_off_points(std::istream& is,
OutputIterator output,
const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::read_OFF(is, output, np);
}
/// \cond SKIP_IN_MANUAL
template <typename OutputIteratorValueType, typename OutputIterator>
CGAL_DEPRECATED bool read_off_points(std::istream& is, OutputIterator output)
{
return IO::read_OFF(is, output);
}
// variant with default output iterator value type
template <typename OutputIterator, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_off_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::read_OFF(is, output, np);
}
/// \endcond
#endif //CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
#endif // CGAL_POINT_SET_PROCESSING_READ_OFF_POINTS_H

View File

@ -358,114 +358,6 @@ bool read_PLY(const std::string& fname, OutputIterator output, const CGAL_NP_CLA
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/// \cond SKIP_IN_MANUAL
template <typename OutputIteratorValueType,
typename OutputIterator,
typename PointMap,
typename NormalMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code")
bool read_ply_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
return IO::read_PLY<OutputIteratorValueType>(is, output, parameters::point_map(point_map)
.normal_map(normal_map));
}
template <typename OutputIterator,
typename PointMap,
typename NormalMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code")
bool read_ply_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
return IO::read_PLY<typename value_type_traits<OutputIterator>::type>(is, output, parameters::point_map(point_map)
.normal_map(normal_map));
}
template <typename OutputIteratorValueType,
typename OutputIterator,
typename NormalMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code")
bool read_ply_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
return IO::read_PLY<OutputIteratorValueType>(is, output, parameters::normal_map(normal_map));
}
template <typename OutputIterator, typename NormalMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code")
bool read_ply_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
return IO::read_PLY<typename value_type_traits<OutputIterator>::type>(is, output, parameters::normal_map(normal_map));
}
template <typename OutputIteratorValueType,
typename OutputIterator,
typename PointMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points(), please update your code")
bool read_ply_points(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
{
return IO::read_PLY<OutputIteratorValueType>(is, output, parameters::point_map(point_map));
}
template <typename OutputIterator,
typename PointMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points(), please update your code")
bool read_ply_points(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
{
return IO::read_PLY<typename value_type_traits<OutputIterator>::type>(is, output, parameters::point_map(point_map));
}
/// \endcond
template <typename OutputIteratorValueType, typename OutputIterator, typename ... PropertyHandler>
CGAL_DEPRECATED bool read_ply_points_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties)
{
return IO::read_PLY_with_properties(is, output, std::forward<PropertyHandler>(properties)...);
}
template <typename OutputIteratorValueType, typename OutputIterator, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_ply_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::read_PLY(is, output, np);
}
/// \cond SKIP_IN_MANUAL
template <typename OutputIterator,
typename ... PropertyHandler>
CGAL_DEPRECATED bool read_ply_points_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties)
{
return IO::read_PLY_with_properties<typename value_type_traits<OutputIterator>::type>(is, output, std::forward<PropertyHandler>(properties)...);
}
// variant with default output iterator value type
template <typename OutputIterator,
typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_ply_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::read_PLY<typename value_type_traits<OutputIterator>::type>(is, output, np);
}
/// \endcond
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
#undef TRY_TO_GENERATE_POINT_PROPERTY

View File

@ -251,173 +251,6 @@ bool read_XYZ(const std::string& fname, OutputIterator output, const CGAL_NP_CLA
#ifndef CGAL_NO_DEPRECATED_CODE
/// \cond SKIP_IN_MANUAL
template <typename OutputIteratorValueType,
typename OutputIterator,
typename PointPMap,
typename NormalPMap,
typename Kernel>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code")
bool read_xyz_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3.
const Kernel& /*kernel*/) ///< geometric traits.
{
return IO::read_XYZ<OutputIteratorValueType>(is, output,
parameters::point_map(point_map)
.normal_map(normal_map)
.geom_traits(Kernel()));
}
template <typename OutputIterator,
typename PointPMap,
typename NormalPMap,
typename Kernel>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code")
bool read_xyz_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3.
const Kernel& kernel) ///< geometric traits.
{
return IO::read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output,
parameters::point_map(point_map)
.normal_map(normal_map)
.geom_traits(kernel));
}
template <typename OutputIteratorValueType,
typename OutputIterator,
typename PointPMap,
typename NormalPMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code")
bool read_xyz_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
return IO::read_XYZ<OutputIteratorValueType>(is, output,
parameters::point_map(point_map)
.normal_map(normal_map));
}
template <typename OutputIterator,
typename PointPMap,
typename NormalPMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code")
bool read_xyz_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
return IO::read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output,
parameters::point_map(point_map)
.normal_map(normal_map));
}
template <typename OutputIteratorValueType,
typename OutputIterator,
typename NormalPMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code")
bool read_xyz_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
return IO::read_XYZ<OutputIteratorValueType>(is, output, parameters::normal_map(normal_map));
}
template <typename OutputIterator,
typename NormalPMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code")
bool read_xyz_points_and_normals(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
return IO::read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output,
parameters::normal_map(normal_map));
}
template <typename OutputIteratorValueType,
typename OutputIterator,
typename PointPMap,
typename Kernel>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code")
bool read_xyz_points(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
const Kernel& kernel) ///< geometric traits.
{
return IO::read_XYZ<OutputIteratorValueType>(is, output,
parameters::point_map(point_map)
.geom_traits(kernel));
}
template <typename OutputIterator,
typename PointPMap,
typename Kernel>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code")
bool read_xyz_points(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
const Kernel& kernel) ///< geometric traits.
{
return IO::read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output,
parameters::point_map(point_map)
.geom_traits(kernel));
}
template <typename OutputIteratorValueType,
typename OutputIterator,
typename PointPMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code")
bool read_xyz_points(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
{
return IO::read_XYZ<OutputIteratorValueType>(is, output, parameters::point_map(point_map));
}
template <typename OutputIterator,
typename PointPMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code")
bool read_xyz_points(std::istream& is, ///< input stream.
OutputIterator output, ///< output iterator over points.
PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
{
return IO::read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output,
parameters::point_map(point_map));
}
/// \endcond
template <typename OutputIteratorValueType,
typename OutputIterator,
typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_xyz_points(std::istream& is,
OutputIterator output,
const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::read_XYZ(is, output, np);
}
/// \cond SKIP_IN_MANUAL
template <typename OutputIterator,
typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_xyz_points(std::istream& is,
OutputIterator output,
const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output, np);
}
/// \endcond
#endif //CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
#endif // CGAL_POINT_SET_PROCESSING_READ_XYZ_POINTS_H

View File

@ -379,59 +379,6 @@ bool write_LAS(const std::string& filename,
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
using IO::make_las_point_writer;
/// \cond SKIP_IN_MANUAL
template <typename ForwardIterator,
typename PointMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_las_points(), please update your code")
bool write_las_points(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond, ///< past-the-end input point.
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
{
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
return IO::write_LAS(os, points, parameters::point_map(point_map));
}
template <typename ForwardIterator>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_las_points(), please update your code")
bool write_las_points(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond) ///< past-the-end input point.
{
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
return IO::write_LAS(os, points);
}
/// \endcond
template <typename PointRange,
typename PointMap,
typename ... PropertyHandler>
CGAL_DEPRECATED bool write_las_points_with_properties(std::ostream& os,
const PointRange& points,
std::tuple<PointMap,
IO::LAS_property::X,
IO::LAS_property::Y,
IO::LAS_property::Z> point_property,
PropertyHandler&& ... properties)
{
return IO::write_LAS_with_properties(os, points, point_property, std::forward<PropertyHandler>(properties)...);
}
template <typename PointRange, typename CGAL_NP_TEMPLATE_PARAMETERS>
bool write_las_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::write_LAS(os, points, np);
}
#endif //CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
#endif // CGAL_POINT_SET_PROCESSING_WRITE_LAS_POINTS_H

View File

@ -198,107 +198,6 @@ bool write_OFF(const std::string& filename,
} // IO namespace
#ifndef CGAL_NO_DEPRECATED_CODE
/// \cond SKIP_IN_MANUAL
template <typename ForwardIterator,
typename PointMap,
typename NormalMap,
typename Kernel>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points_and_normals(), please update your code")
bool write_off_points_and_normals(std::ostream& os, ///< output stream.
ForwardIterator first, ///< iterator over the first input point.
ForwardIterator beyond, ///< past-the-end iterator over the input points.
PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3.
NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3.
const Kernel& /*kernel*/) ///< geometric traits.
{
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
return write_off_points(os, points,
CGAL::parameters::point_map(point_map)
.normal_map(normal_map)
.geom_traits(Kernel()));
}
template <typename ForwardIterator,
typename PointMap,
typename NormalMap
>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points_and_normals(), please update your code")
bool write_off_points_and_normals(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond, ///< past-the-end input point.
PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
return write_off_points(os, points,
parameters::point_map(point_map)
.normal_map(normal_map));
}
template <typename ForwardIterator,
typename NormalMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points_and_normals(), please update your code")
bool write_off_points_and_normals(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond, ///< past-the-end input point.
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
return write_off_points(os, points, parameters::normal_map (normal_map));
}
template <typename ForwardIterator,
typename PointMap,
typename Kernel>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points(), please update your code")
bool write_off_points(std::ostream& os, ///< output stream.
ForwardIterator first, ///< iterator over the first input point.
ForwardIterator beyond, ///< past-the-end iterator over the input points.
PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3.
const Kernel&) ///< geometric traits.
{
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
return write_off_points(os, points,
parameters::point_map(point_map)
.geom_traits(Kernel()));
}
template <typename ForwardIterator,
typename PointMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points(), please update your code")
bool write_off_points(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond, ///< past-the-end input point.
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
{
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
return write_off_points(os, points, parameters::point_map (point_map));
}
template <typename ForwardIterator
>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points(), please update your code")
bool write_off_points(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond) ///< past-the-end input point.
{
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
return write_off_points(os, points);
}
/// \endcond
template <typename PointRange, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool write_off_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::write_OFF(os, points, np);
}
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
#endif // CGAL_POINT_SET_PROCESSING_WRITE_OFF_POINTS_H

View File

@ -298,80 +298,6 @@ bool write_PLY(const std::string& filename,
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/// \cond SKIP_IN_MANUAL
template <typename ForwardIterator,
typename PointMap,
typename VectorMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points_and_normals(), please update your code")
bool write_ply_points_and_normals(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond, ///< past-the-end input point.
PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
VectorMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
return IO::write_PLY(os, points, parameters::point_map(point_map)
.normal_map(normal_map));
}
template <typename ForwardIterator,
typename VectorMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points_and_normals(), please update your code")
bool write_ply_points_and_normals(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond, ///< past-the-end input point.
VectorMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
return IO::write_PLY(os, points, parameters::normal_map (normal_map));
}
template <typename ForwardIterator,
typename PointMap >
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points(), please update your code")
bool write_ply_points(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond, ///< past-the-end input point.
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
{
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
return IO::write_PLY(os, points, parameters::point_map(point_map));
}
template <typename ForwardIterator >
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points(), please update your code")
bool write_ply_points(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond) ///< past-the-end input point.
{
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
return IO::write_PLY(os, points);
}
/// \endcond
template <typename PointRange,
typename ... PropertyHandler>
CGAL_DEPRECATED bool write_ply_points_with_properties(std::ostream& os, ///< output stream.
const PointRange& points, ///< input point range.
PropertyHandler&& ... properties) ///< parameter pack of property handlers
{
return IO::write_PLY_with_properties(os, points, std::forward<PropertyHandler>(properties)...);
}
template <typename PointRange, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool write_ply_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::write_PLY(os, points, np);
}
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
#endif // CGAL_POINT_SET_PROCESSING_WRITE_PLY_POINTS_H

View File

@ -189,106 +189,6 @@ bool write_XYZ(const std::string& filename,
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/// \cond SKIP_IN_MANUAL
template <typename ForwardIterator,
typename PointMap,
typename NormalMap,
typename Kernel>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points_and_normals(), please update your code")
bool write_xyz_points_and_normals(std::ostream& os, ///< output stream.
ForwardIterator first, ///< iterator over the first input point.
ForwardIterator beyond, ///< past-the-end iterator over the input points.
PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3.
NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3.
const Kernel& /*kernel*/) ///< geometric traits.
{
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
return IO::write_XYZ(os, points,
parameters::point_map(point_map)
.normal_map(normal_map)
.geom_traits(Kernel()));
}
template <typename ForwardIterator,
typename PointMap,
typename NormalMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points_and_normals(), please update your code")
bool write_xyz_points_and_normals(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond, ///< past-the-end input point.
PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
{
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
return IO::write_XYZ(os, points,
parameters::point_map(point_map)
.normal_map(normal_map));
}
template <typename ForwardIterator,
typename NormalMap
>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points_and_normals(), please update your code")
bool write_xyz_points_and_normals(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond, ///< past-the-end input point.
NormalMap normal_map) ///< property map: value_type of ForwardIterator -> Vector_3.
{
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
return IO::write_XYZ(os, points, parameters::normal_map(normal_map));
}
template <typename ForwardIterator,
typename PointMap,
typename Kernel>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points(), please update your code")
bool write_xyz_points(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond, ///< past-the-end input point.
PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
const Kernel& kernel)
{
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
return IO::write_XYZ(os, points, parameters::point_map(point_map)
.geom_traits (kernel));
}
template <typename ForwardIterator,
typename PointMap>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points(), please update your code")
bool write_xyz_points(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond, ///< past-the-end input point.
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
{
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
return IO::write_XYZ(os, points, parameters::point_map(point_map));
}
template <typename ForwardIterator>
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points(), please update your code")
bool write_xyz_points(std::ostream& os, ///< output stream.
ForwardIterator first, ///< first input point.
ForwardIterator beyond) ///< past-the-end input point.
{
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
return IO::write_XYZ(os, points);
}
/// \endcond
template <typename PointRange, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool write_xyz_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::write_XYZ(os, points, np);
}
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
#endif // CGAL_POINT_SET_PROCESSING_WRITE_XYZ_POINTS_H

View File

@ -22,7 +22,6 @@ endif()
# Executables that do *not* require Eigen
create_single_source_cgal_program( "read_test.cpp" )
create_single_source_cgal_program( "test_read_write_point_set.cpp" )
create_single_source_cgal_program( "test_deprecated_io_point_set.cpp" )
create_single_source_cgal_program( "test_poisson_eliminate.cpp" )
create_single_source_cgal_program( "read_test_with_different_pmaps.cpp" )
create_single_source_cgal_program( "analysis_test.cpp" )
@ -39,7 +38,6 @@ if(NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910
include(CGAL_LASLIB_support)
if (TARGET CGAL::LASLIB_support)
target_link_libraries(test_read_write_point_set PRIVATE ${CGAL_libs} CGAL::LASLIB_support)
target_link_libraries(test_deprecated_io_point_set PRIVATE ${CGAL_libs} CGAL::LASLIB_support)
else()
message(STATUS "NOTICE: the LAS reader test requires LASlib and will not be compiled.")
endif()

View File

@ -1,241 +0,0 @@
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Point_set_3.h>
#include <CGAL/IO/read_points.h>
#include <CGAL/IO/write_points.h>
// Just to try and create ambiguities
#include <CGAL/boost/graph/io.h>
#include <CGAL/IO/io.h>
#include <CGAL/property_map.h>
#include <vector>
#include <cassert>
#include <string>
#include <sstream>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point_3;
typedef Kernel::Vector_3 Vector_3;
typedef std::array<unsigned short, 4> Color;
typedef std::pair<Point_3, Color> PointWithColor;
typedef CGAL::Nth_of_tuple_property_map<1, PointWithColor> Color_map;
struct GetRedMap
{
typedef PointWithColor key_type;
typedef unsigned short value_type;
typedef const value_type& reference;
typedef boost::lvalue_property_map_tag category;
};
unsigned short get(const GetRedMap&, const PointWithColor& p)
{
return p.second[0];
}
struct GetGreenMap
{
typedef PointWithColor key_type;
typedef unsigned short value_type;
typedef const value_type& reference;
typedef boost::lvalue_property_map_tag category;
};
unsigned short get(const GetGreenMap&, const PointWithColor& p)
{
return p.second[1];
}
struct GetBlueMap
{
typedef PointWithColor key_type;
typedef unsigned short value_type;
typedef const value_type& reference;
typedef boost::lvalue_property_map_tag category;
};
unsigned short get(const GetBlueMap&, const PointWithColor& p)
{
return p.second[2];
}
struct GetAlphaMap
{
typedef PointWithColor key_type;
typedef unsigned short value_type;
typedef const value_type& reference;
typedef boost::lvalue_property_map_tag category;
};
unsigned short get(const GetAlphaMap&, const PointWithColor& p)
{
return p.second[3];
}
int main()
{
std::vector<PointWithColor> points(3);
points[0] = std::make_pair(Point_3(1,0,0), Color{255,0,0,255});
points[1] = std::make_pair(Point_3(0,1,0), Color{0,255,0,255});
points[2] = std::make_pair(Point_3(0,0,1), Color{0,0,255,255});
bool ok;
std::vector<Point_3> ps;
ps.push_back(Point_3(1,0,0));
ps.push_back(Point_3(0,1,0));
ps.push_back(Point_3(0,0,1));
std::string input;
//LAS
#ifdef CGAL_LINKED_WITH_LASLIB
{
std::ostringstream os(std::ios::binary);
ok = CGAL::write_las_points_with_properties(os, points,
CGAL::make_las_point_writer(CGAL::First_of_pair_property_map<PointWithColor>()),
std::make_pair(GetRedMap(),CGAL::LAS_property::R()),
std::make_pair(GetGreenMap(), CGAL::LAS_property::G()),
std::make_pair(GetBlueMap(), CGAL::LAS_property::B()),
std::make_pair(GetAlphaMap(), CGAL::LAS_property::I())
);
assert(ok);
os.flush();
input = os.str();
}
{
points.clear();
std::istringstream is(input, std::ios::binary);
ok = CGAL::read_las_points_with_properties(is, std::back_inserter (points),
CGAL::make_las_point_reader(CGAL::First_of_pair_property_map<PointWithColor>()),
std::make_tuple(CGAL::Second_of_pair_property_map<PointWithColor>(),
CGAL::Construct_array(),
CGAL::LAS_property::R(),
CGAL::LAS_property::G(),
CGAL::LAS_property::B(),
CGAL::LAS_property::I()));
assert(ok);
assert(points.size() == 3);
assert(points[1].second[1] == 255);
}
{
std::ostringstream os(std::ios_base::binary);
CGAL::write_las_points(os, ps);
assert(ok);
os.flush();
input = os.str();
}
{
ps.clear();
std::istringstream is(input, std::ios::binary);
ok = CGAL::read_las_points(is, std::back_inserter (ps));
assert(ok);
assert(ps.size() == 3);
}
#endif
//PLY
{
std::ostringstream os;
assert(os.good());
ok = CGAL::write_ply_points_with_properties(os, points,
CGAL::make_ply_point_writer (CGAL::First_of_pair_property_map<PointWithColor>()),
std::make_pair(GetRedMap(),CGAL::PLY_property<unsigned short>("red")),
std::make_pair(GetGreenMap(), CGAL::PLY_property<unsigned short>("green")),
std::make_pair(GetBlueMap(), CGAL::PLY_property<unsigned short>("blue")),
std::make_pair(GetAlphaMap(), CGAL::PLY_property<unsigned short>("alpha"))
);
assert(! os.fail());
assert(ok);
os.flush();
input = os.str();
}
{
std::istringstream is(input);
assert(is.good());
points.clear();
ok = CGAL::read_ply_points_with_properties(is, std::back_inserter (points),
CGAL::make_ply_point_reader(CGAL::First_of_pair_property_map<PointWithColor>()),
std::make_tuple(CGAL::Second_of_pair_property_map<PointWithColor>(),
CGAL::Construct_array(),
CGAL::PLY_property<unsigned short>("red"),
CGAL::PLY_property<unsigned short>("green"),
CGAL::PLY_property<unsigned short>("blue"),
CGAL::PLY_property<unsigned short>("alpha")));
assert(! is.fail());
assert(ok);
assert(points.size() == 3);
assert(points[1].second[1] == 255);
}
{
std::ostringstream os;
assert(os.good());
ok = CGAL::write_ply_points(os, ps);
assert(! os.fail());
assert(ok);
os.flush();
input = os.str();
}
{
std::istringstream is(input);
assert(is.good());
ps.clear();
ok = CGAL::read_ply_points(is, std::back_inserter (ps));
assert(! is.fail());
assert(ok);
assert(ps.size() == 3);
}
//OFF
{
std::ostringstream os;
assert(os.good());
ok = CGAL::write_off_points(os, ps);
assert(! os.fail());
assert(ok);
os.flush();
input = os.str();
}
{
std::istringstream is(input);
assert(is.good());
ps.clear();
ok = CGAL::read_off_points(is, std::back_inserter (ps));
assert(! is.fail());
assert(ok);
assert(ps.size() == 3);
}
//XYZ
{
std::ostringstream os;
assert(os.good());
ok = CGAL::write_xyz_points(os, ps);
assert(! os.fail());
assert(ok);
os.flush();
input = os.str();
}
{
std::istringstream is(input);
assert(is.good());
ps.clear();
ok = CGAL::read_xyz_points(is, std::back_inserter (ps));
assert(! is.fail());
assert(ok);
assert(ps.size() == 3);
}
std::cout << "Done" << std::endl;
return EXIT_SUCCESS;
}

View File

@ -278,6 +278,7 @@ template <typename PolygonMesh, typename FaceNormalVector, typename K>
bool does_enclose_other_normals(const std::size_t i, const std::size_t j, const std::size_t k,
const typename K::Vector_3& nb,
const typename K::FT sp_bi,
typename boost::graph_traits<PolygonMesh>::face_descriptor &not_enclose_normal,
const std::vector<typename boost::graph_traits<PolygonMesh>::face_descriptor>& incident_faces,
const FaceNormalVector& face_normals,
const K& traits)
@ -291,6 +292,7 @@ bool does_enclose_other_normals(const std::size_t i, const std::size_t j, const
// check that this min circle defined by the diameter contains the other points
const std::size_t nif = incident_faces.size();
bool enclose_other_normals=true;
for(std::size_t l=0; l<nif; ++l)
{
if(l == i || l == j || l == k)
@ -311,11 +313,18 @@ bool does_enclose_other_normals(const std::size_t i, const std::size_t j, const
if(CGAL::abs(sp_bi - sp_bl) <= sp_diff_bound)
continue;
if(sp_bl < sp_bi)
return false;
//Get the normal farthest from the center
if(sp_bl < sp_bi){
if(enclose_other_normals){
enclose_other_normals=false;
not_enclose_normal=incident_faces[l];
} else if(sp_bl < sp(nb, get(face_normals, not_enclose_normal))){
not_enclose_normal=incident_faces[l];
}
}
}
return true;
return enclose_other_normals;
}
template <typename GT>
@ -385,156 +394,160 @@ typename GT::Vector_3 compute_normals_bisector(const typename GT::Vector_3& ni,
return nb;
}
template <typename PolygonMesh, typename FaceNormalVector, typename GT>
typename GT::Vector_3
compute_most_visible_normal_2_points(std::vector<typename boost::graph_traits<PolygonMesh>::face_descriptor>& incident_faces,
const FaceNormalVector& face_normals,
const GT& traits)
{
typedef typename GT::FT FT;
typedef typename GT::Vector_3 Vector_3;
typedef typename boost::property_traits<FaceNormalVector>::reference Vector_ref;
typename GT::Compute_scalar_product_3 sp_3 = traits.compute_scalar_product_3_object();
typename GT::Construct_vector_3 cv_3 = traits.construct_vector_3_object();
#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP
std::cout << "Trying to find enclosing normal with 2 normals" << std::endl;
#endif
FT min_sp = -1;
Vector_3 n = cv_3(CGAL::NULL_VECTOR);
const std::size_t nif = incident_faces.size();
for(std::size_t i=0; i<nif; ++i)
{
for(std::size_t j=i+1; j<nif; ++j)
{
const Vector_ref ni = get(face_normals, incident_faces[i]);
const Vector_ref nj = get(face_normals, incident_faces[j]);
const Vector_3 nb = compute_normals_bisector(ni, nj, traits);
// Degeneracies like ni == -nj or a numerical error in the construction of 'nb' can happen.
if(traits.equal_3_object()(nb, CGAL::NULL_VECTOR))
return CGAL::NULL_VECTOR;
FT sp_bi = sp_3(nb, ni);
sp_bi = (std::max)(FT(0), sp_bi);
if(sp_bi <= min_sp)
continue;
if(!does_enclose_other_normals<PolygonMesh>(i, j, -1 /*NA*/, nb, sp_bi, incident_faces, face_normals, traits))
continue;
min_sp = sp_bi;
n = nb;
}
}
return n;
}
template <typename PolygonMesh, typename FaceNormalVector, typename GT>
typename GT::Vector_3
compute_most_visible_normal_3_points(const std::vector<typename boost::graph_traits<PolygonMesh>::face_descriptor>& incident_faces,
const FaceNormalVector& face_normals,
const GT& traits)
{
typedef typename GT::FT FT;
typedef typename GT::Vector_3 Vector_3;
typedef typename boost::property_traits<FaceNormalVector>::reference Vector_ref;
#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP
std::cout << "Trying to find enclosing normal with 3 normals" << std::endl;
#endif
FT min_sp = -1;
Vector_3 n = traits.construct_vector_3_object()(CGAL::NULL_VECTOR);
const std::size_t nif = incident_faces.size();
for(std::size_t i=0; i<nif; ++i)
{
for(std::size_t j=i+1; j<nif; ++j)
{
for(std::size_t k=j+1; k<nif; ++k)
{
const Vector_ref ni = get(face_normals, incident_faces[i]);
const Vector_ref nj = get(face_normals, incident_faces[j]);
const Vector_ref nk = get(face_normals, incident_faces[k]);
if(ni == CGAL::NULL_VECTOR || nj == CGAL::NULL_VECTOR || nk == CGAL::NULL_VECTOR)
continue;
Vector_3 nb = compute_normals_bisector(ni, nj, nk, traits);
if(traits.equal_3_object()(nb, CGAL::NULL_VECTOR))
return nb;
FT sp_bi = traits.compute_scalar_product_3_object()(nb, ni);
if(sp_bi < FT(0))
{
nb = traits.construct_opposite_vector_3_object()(nb);
sp_bi = - sp_bi;
}
if(sp_bi <= min_sp)
continue;
if(!does_enclose_other_normals<PolygonMesh>(i, j, k, nb, sp_bi, incident_faces, face_normals, traits))
continue;
min_sp = sp_bi;
n = nb;
}
}
}
#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP
std::cout << "Best normal from 3-normals-approach: " << n << std::endl;
#endif
return n;
}
// Inspired by Aubry et al. On the most 'normal' normal
template <typename PolygonMesh, typename FaceNormalVector, typename GT>
typename GT::Vector_3
compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits<PolygonMesh>::vertex_descriptor v,
const FaceNormalVector& face_normals,
const PolygonMesh& pmesh,
const GT& traits)
{
const GT& traits){
typedef typename boost::graph_traits<PolygonMesh>::face_descriptor face_descriptor;
typedef typename GT::FT FT;
typedef typename GT::Vector_3 Vector_3;
typedef typename boost::property_traits<FaceNormalVector>::reference Vector_ref;
typename GT::Compute_scalar_product_3 sp_3 = traits.compute_scalar_product_3_object();
typename GT::Construct_cross_product_vector_3 cp_3 = traits.construct_cross_product_vector_3_object();
std::vector<face_descriptor> incident_faces;
incident_faces.reserve(8);
for(face_descriptor f : CGAL::faces_around_target(halfedge(v, pmesh), pmesh))
{
if(f == boost::graph_traits<PolygonMesh>::null_face())
// Remove degenerate and redundant faces
if((f == boost::graph_traits<PolygonMesh>::null_face()) || (get(face_normals, f)==NULL_VECTOR) )
continue;
if(! incident_faces.empty()){
if(get(face_normals, incident_faces.back()) == get(face_normals, f) )
continue;
}
incident_faces.push_back(f);
}
if(incident_faces.size() == 0)
return NULL_VECTOR;
if(incident_faces.size() == 1)
return get(face_normals, incident_faces.front());
Vector_3 res = compute_most_visible_normal_2_points<PolygonMesh>(incident_faces, face_normals, traits);
std::array<face_descriptor, 3> circum_points;
short int circum_points_size=2;
circum_points[0]=incident_faces[0];
circum_points[1]=incident_faces[1];
if(res != CGAL::NULL_VECTOR) // found a valid normal through 2 point min circle
return res;
// Get the farthest point from circum_points[0]
const Vector_ref n0 = get(face_normals, circum_points[0]);
const Vector_ref n1 = get(face_normals, circum_points[1]);
FT sp_min = sp_3(n0, n1);
for(size_t i=2; i<incident_faces.size(); ++i){
const Vector_ref ni = get(face_normals, incident_faces[i]);
FT sp = sp_3(n0, ni);
if(sp < sp_min){
sp_min=sp;
circum_points[1]=incident_faces[i];
}
}
// The vertex has only two incident faces with opposite normals (fold)...
// @todo devise something based on the directions of the 2/3/4 incident edges?
if(incident_faces.size() == 2 && res == CGAL::NULL_VECTOR)
return res;
// At each step, we get a vertex outside of the current circumcircle to define a larger circumcircle
while(true)
{
Vector_3 center;
FT radius; //Here, 'radius' refers to the negative scalar product between one circum_point and the center.
const Vector_ref ni = get(face_normals, circum_points[0]);
const Vector_ref nj = get(face_normals, circum_points[1]);
CGAL_assertion(incident_faces.size() >= 2);
if(circum_points_size==2){
center = compute_normals_bisector(ni, nj, traits);
} else {
CGAL_assertion(circum_points_size==3);
const Vector_ref nk = get(face_normals, circum_points[2]);
center = compute_normals_bisector(ni, nj, nk, traits);
}
return compute_most_visible_normal_3_points<PolygonMesh>(incident_faces, face_normals, traits);
if(center==NULL_VECTOR)
return NULL_VECTOR;
radius = -sp_3(ni, center);
if(is_positive(radius))
return NULL_VECTOR; // The circle is larger than a hemisphere, so no normal is visible to all
face_descriptor f_out;
if(does_enclose_other_normals<PolygonMesh>(-1,-2,-3, center, -radius, f_out, incident_faces, face_normals, traits))
return center;
const Vector_ref no = get(face_normals, f_out);
if(circum_points_size==2){
circum_points[2]=f_out;
circum_points_size=3;
} else {
if(is_negative(sp_3(center, no)))
return NULL_VECTOR; // The circle will become bigger than a hemisphere, no normal visible by all
const Vector_ref nk = get(face_normals, circum_points[2]);
// We need to remove one of the previous points
// We keep the farthest point from the new one
// Then we divide the sphere in two along the equator that passes through the first point and the center
// We remove the previous point that lies in the same hemisphere as the new one
// move the farthest point to f_out at the beginning of circum_points
FT sp_ni_no = sp_3(ni, no);
FT sp_nj_no = sp_3(nj, no);
FT sp_nk_no = sp_3(nk, no);
if(sp_nj_no < sp_nk_no){
if(sp_nj_no < sp_ni_no){
std::swap(circum_points[0], circum_points[1]);
}
} else {
if(sp_nk_no < sp_ni_no){
std::swap(circum_points[0], circum_points[2]);
}
}
// Get the new vectors
const Vector_ref n0 = get(face_normals, circum_points[0]);
const Vector_ref n1 = get(face_normals, circum_points[1]);
const Vector_ref n2 = get(face_normals, circum_points[2]);
// Search for the points that lie in the same hemisphere as f_out compared to ni
Vector_3 n_middle = cp_3(n0, center);
FT sp_no_nm = sp_3(no, n_middle);
FT sp_n1_nm = sp_3(n1, n_middle);
FT sp_n2_nm = sp_3(n2, n_middle);
//We use the same bound than above in does_enclose_other_normals
const FT nmn = CGAL::approximate_sqrt(traits.compute_squared_length_3_object()(n_middle));
const FT sp_diff_bound = nmn*0.00017453292431333;
CGAL_assertion((CGAL::sign(sp_n1_nm)!=CGAL::sign(sp_n2_nm)) || (abs(sp_n1_nm)<=sp_diff_bound) || (abs(sp_n2_nm)<=sp_diff_bound));
if((abs(sp_n1_nm)<=sp_diff_bound) || (abs(sp_n2_nm)<=sp_diff_bound))
return NULL_VECTOR; // The case is nearly degenerate and leads to geometric inconsistencies due to numerical errors
if( CGAL::sign(sp_no_nm) == CGAL::sign(sp_n1_nm)){
circum_points[1]=f_out;
} else {
circum_points[2]=f_out;
}
}
// Delete one vertex if it is included in the circumcircle of the other two
const Vector_ref ni2 = get(face_normals, circum_points[0]);
const Vector_ref nj2 = get(face_normals, circum_points[1]);
const Vector_ref nk2 = get(face_normals, circum_points[2]);
Vector_3 center_ni_nj = compute_normals_bisector(ni2, nj2, traits);
Vector_3 center_ni_nk = compute_normals_bisector(ni2, nk2, traits);
Vector_3 center_nj_nk = compute_normals_bisector(nj2, nk2, traits);
if(sp_3(center_ni_nj, nk2) > sp_3(center_ni_nj, ni2)){
circum_points_size=2;
} else if(sp_3(center_ni_nk, nj2) > sp_3(center_ni_nk, ni2)){
std::swap(circum_points[1],circum_points[2]);
circum_points_size=2;
} else if(sp_3(center_nj_nk, ni2) > sp_3(center_nj_nk, nj2)){
std::swap(circum_points[0],circum_points[2]);
circum_points_size=2;
}
}
}
template <typename PolygonMesh, typename FaceNormalVector, typename VertexPointMap, typename GT>
@ -727,7 +740,6 @@ compute_vertex_normal(typename boost::graph_traits<PolygonMesh>::vertex_descript
std::cout << "get normal at f " << face(h, pmesh) << " : " << get(face_normals, face(h, pmesh)) << std::endl;
}
#endif
Vector_3 normal = internal::compute_vertex_normal_most_visible_min_circle(v, face_normals, pmesh, traits);
if(traits.equal_3_object()(normal, CGAL::NULL_VECTOR)) // can't always find a most visible normal
{

View File

@ -7,6 +7,7 @@ project(Polygon_mesh_processing_Tests)
# CGAL and its components
find_package(CGAL REQUIRED COMPONENTS Core)
create_single_source_cgal_program("slow_compute_normal.cpp")
create_single_source_cgal_program("test_pmp_triangle.cpp")
create_single_source_cgal_program("test_hausdorff_bounded_error_distance.cpp")
create_single_source_cgal_program("test_pmp_read_polygon_mesh.cpp")

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,39 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Timer.h>
#include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
#include <iostream>
#include <string>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_3 Point;
typedef K::Vector_3 Vector;
typedef CGAL::Surface_mesh<Point> Mesh;
typedef boost::graph_traits<Mesh>::vertex_descriptor vertex_descriptor;
typedef boost::graph_traits<Mesh>::face_descriptor face_descriptor;
namespace PMP = CGAL::Polygon_mesh_processing;
int main()
{
const std::string filename = "./data/slow_compute_normal.off";
Mesh mesh;
if(!PMP::IO::read_polygon_mesh(filename, mesh))
{
std::cerr << "Invalid input." << std::endl;
return 1;
}
CGAL::Timer t;
t.start();
std::cout << "compute_vertex_normal" << std::endl;
PMP::compute_vertex_normal(vertex_descriptor(523), mesh);
std::cout << t.time() << " sec." << std::endl;
return 0;
}

View File

@ -34,13 +34,6 @@ polyhedral surface.
template <class Traits>
bool read_OFF( std::istream& in, CGAL::Polyhedron_3<Traits>& P);
/*!
\deprecated This function is deprecated since \cgal 5.3,
\ref read_OFF(std::istream&, Polyhedron_3<Traits>&) should be used instead.
*/
template <class Traits>
bool read_off( std::istream& in, CGAL::Polyhedron_3<Traits>& P);
} // namespace IO
/*!
@ -79,12 +72,6 @@ This function overloads the generic function \link PkgBGLIoFuncsOFF `write_OFF(s
template <class Traits>
bool write_OFF( std::ostream& out, const CGAL::Polyhedron_3<Traits>& P);
/*!
\deprecated This function is deprecated since \cgal 5.3,
\ref CGAL::IO::write_OFF(std::ostream&, const Polyhedron_3<Traits>&) should be used instead.
*/
template <class Traits>
bool write_off( std::ostream& out, const CGAL::Polyhedron_3<Traits>& P);
} // namespace IO

View File

@ -21,6 +21,7 @@
#include <iostream>
#include <map>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/config.h>
namespace CGAL {
@ -30,7 +31,7 @@ namespace CGAL {
* @return A dart created during the conversion.
*/
template< class LCC, class Polyhedron >
typename LCC::Dart_descriptor import_from_polyhedron_3(LCC& alcc,
typename LCC::Dart_descriptor polyhedron_3_to_lcc(LCC& alcc,
const Polyhedron &apoly)
{
static_assert( LCC::dimension>=2 && LCC::ambient_dimension==3 );
@ -94,6 +95,21 @@ namespace CGAL {
return firstAll;
}
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\deprecated This function is deprecated since CGAL 6.2. Use `polyhedron_3_to_lcc()` instead.
*/
template< class LCC, class Polyhedron >
CGAL_DEPRECATED
typename LCC::Dart_descriptor
import_from_polyhedron_3(LCC& alcc, const Polyhedron &apoly)
{
return polyhedron_3_to_lcc<LCC, Polyhedron>(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.
@ -101,7 +117,7 @@ namespace CGAL {
*/
template < class LCC >
typename LCC::Dart_descriptor
import_from_polyhedron_3_flux(LCC& alcc, std::istream& ais)
polyhedron_3_flux_to_lcc(LCC& alcc, std::istream& ais)
{
if (!ais.good())
{
@ -110,7 +126,7 @@ namespace CGAL {
}
CGAL::Polyhedron_3<typename LCC::Traits> P;
ais >> P;
return import_from_polyhedron_3<LCC, CGAL::Polyhedron_3
return polyhedron_3_to_lcc<LCC, CGAL::Polyhedron_3
<typename LCC::Traits> > (alcc, P);
}

View File

@ -22,34 +22,5 @@
#include <CGAL/boost/graph/io.h>
#include <string>
namespace CGAL {
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgSurfaceMeshIOFuncDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_polygon_mesh()` should be used instead.
*/
template <typename K>
CGAL_DEPRECATED bool read_mesh(Surface_mesh<K>& sm, const std::string& filename)
{
return IO::read_polygon_mesh(filename, sm);
}
/*!
\ingroup PkgSurfaceMeshIOFuncDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_polygon_mesh()` should be used instead.
*/
template <typename K>
CGAL_DEPRECATED bool write_mesh(const Surface_mesh<K>& mesh, const std::string& filename)
{
return IO::write_polygon_mesh(filename, mesh);
}
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
#endif // CGAL_SURFACE_MESH_IO_H

View File

@ -137,20 +137,6 @@ bool read_3MF(const std::string& filename,
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgSurfaceMeshIOFuncDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_3MF()` should be used instead.
*/
template<typename Point>
CGAL_DEPRECATED int read_3mf(const std::string& filename, std::vector<CGAL::Surface_mesh<Point> >& output)
{
return IO::read_3MF(filename, output);
}
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
#endif // defined(CGAL_LINKED_WITH_3MF) || defined(DOXYGEN_RUNNING)

View File

@ -347,30 +347,6 @@ bool read_OFF(const std::string& fname,
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgSurfaceMeshIOFuncDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF(std::istream&, const Surface_mesh<Point>&)` should be used instead.
*/
template <typename Point, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_off(std::istream& is, Surface_mesh<Point>& sm, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::read_OFF(is, sm, np);
}
/*!
\ingroup PkgSurfaceMeshIOFuncDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF(std::istream&, const Surface_mesh<Point>&)` should be used instead.
*/
template <typename Point>
CGAL_DEPRECATED bool read_off(Surface_mesh<Point>& sm, const std::string& filename)
{
return IO::read_OFF(filename, sm, parameters::default_values());
}
#endif // CGAL_NO_DEPRECATED_CODE
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
// Write
@ -549,30 +525,6 @@ bool write_OFF(std::ostream& os,
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgSurfaceMeshIOFuncDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF(std::ostream&, const Surface_mesh<Point>&)` should be used instead.
*/
template <typename Point, typename CGAL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool write_off(std::ostream& os, const Surface_mesh<Point>& sm, const CGAL_NP_CLASS& np = parameters::default_values())
{
return IO::write_OFF(os, sm, np);
}
/*!
\ingroup PkgSurfaceMeshIOFuncDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF(std::ostream&, const Surface_mesh<Point>&)` should be used instead.
*/
template <typename Point>
CGAL_DEPRECATED bool write_off(const Surface_mesh<Point>& sm, const std::string& filename)
{
return IO::write_OFF(filename, sm, parameters::default_values());
}
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
#endif // CGAL_SURFACE_MESH_IO_OFF_H

View File

@ -169,10 +169,7 @@ public:
const std::string& name = property->name();
if(name == "vertex1" || name == "vertex2")
return true;
#ifndef CGAL_NO_DEPRECATED_CODE
if(name == "v0" || name == "v1")
return true;
#endif
return false;
}
@ -888,21 +885,7 @@ bool read_PLY(std::istream& is, Surface_mesh<P>& sm)
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgSurfaceMeshIOFuncDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_PLY(std::ostream&, const Surface_mesh<Point>&)` should be used instead.
*/
template <typename P>
CGAL_DEPRECATED bool read_ply(std::istream& is, Surface_mesh<P>& sm, std::string& comments)
{
return IO::read_PLY(is, sm, comments);
}
#endif // CGAL_NO_DEPRECATED_CODE
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
// Write
@ -1155,26 +1138,6 @@ bool write_PLY(std::ostream& os, const Surface_mesh<P>& sm, const CGAL_NP_CLASS&
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgSurfaceMeshIOFuncDeprecated
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_PLY(std::ostream&, const Surface_mesh<Point>&)` should be used instead.
*/
template <typename P>
CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh<P>& sm, const std::string& comments)
{
return IO::write_PLY(os, sm, comments);
}
template <typename P>
CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh<P>& sm)
{
return write_PLY(os, sm, "");
}
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
#endif // CGAL_SURFACE_MESH_IO_PLY_H

View File

@ -15,15 +15,3 @@ foreach(cppfile ${cppfiles})
create_single_source_cgal_program("${cppfile}")
endforeach()
find_path(3MF_INCLUDE_DIR
NAMES Model/COM/NMR_DLLInterfaces.h
DOC "Path to lib3MF headers"
)
find_library(3MF_LIBRARIES NAMES 3MF DOC "Path to the lib3MF library")
if(3MF_LIBRARIES AND 3MF_INCLUDE_DIR AND EXISTS "${3MF_INCLUDE_DIR}/Model/COM/NMR_DLLInterfaces.h")
include_directories(${3MF_INCLUDE_DIR})
target_link_libraries(test_deprecated_io_sm PRIVATE ${3MF_LIBRARIES})
target_compile_definitions(test_deprecated_io_sm PRIVATE -DCGAL_LINKED_WITH_3MF)
else()
message(STATUS "NOTICE: read_3mf requires the lib3MF library, and will not be tested.")
endif()

View File

@ -1,70 +0,0 @@
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
#include <fstream>
#include <iostream>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/boost/graph/generators.h>
#include <CGAL/Surface_mesh/IO/3MF.h>
#include <CGAL/Surface_mesh/IO/OFF.h>
#include <CGAL/Surface_mesh/IO/PLY.h>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point_3;
typedef CGAL::Surface_mesh<Point_3> SM;
int main()
{
// OFF
SM sm_in, sm_out;
Point_3 p0(0,0,0), p1(1,0,0), p2(0,1,0);
CGAL::make_triangle(p0, p1, p2, sm_out);
bool ok = CGAL::write_off(sm_out, "tmp.off");
assert(ok);
ok = CGAL::read_off(sm_in, "tmp.off");
assert(ok);
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
sm_in.clear();
std::ofstream os("tmp.off");
ok = CGAL::write_off(os, sm_out);
assert(ok);
os.close();
std::ifstream is("tmp.off");
ok = CGAL::read_off(is, sm_in);
assert(ok);
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
is.close();
sm_in.clear();
//PLY
os.open("tmp.ply");
std::string comments;
ok = CGAL::write_ply(os, sm_out, comments);
assert(ok);
os.close();
is.open("tmp.ply");
ok = CGAL::read_ply(is, sm_in, comments);
assert(ok);
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
is.close();
sm_in.clear();
#ifdef CGAL_LINKED_WITH_3MF
// 3mf
std::vector<SM> output_3mf;
ok = CGAL::read_3mf("test.3mf", output_3mf);
assert(ok);
assert(output_3mf.size() == 2);
sm_in.clear();
#endif
//others
ok = CGAL::write_mesh(sm_out, "tmp.off");
assert(ok);
ok = CGAL::read_mesh(sm_in, "tmp.ply");
assert(ok);
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
sm_in.clear();
return EXIT_SUCCESS;
}

View File

@ -1,5 +1,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/IO/polygon_mesh_io.h>
#include <CGAL/Timer.h>
#include <CGAL/Surface_mesh_simplification/edge_collapse.h>
@ -36,8 +37,8 @@ int main(int argc, char** argv)
{
Surface_mesh surface_mesh;
const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/fold.off");
std::ifstream is(filename);
if(!is || !(is >> surface_mesh))
if(!CGAL::IO::read_polygon_mesh(filename, surface_mesh))
{
std::cerr << "Failed to read input mesh: " << filename << std::endl;
return EXIT_FAILURE;

View File

@ -13,6 +13,8 @@
#include <CGAL/license/Surface_mesh_simplification.h>
#include <CGAL/internal/robust_cross_product.h>
#include <CGAL/determinant.h>
#include <CGAL/Null_matrix.h>
#include <CGAL/number_utils.h>
@ -183,17 +185,19 @@ MatrixC33<R> cofactors_matrix(const MatrixC33<R>& m)
{
typedef typename R::RT RT;
RT c00 = determinant(m.r1().y(),m.r1().z(),m.r2().y(),m.r2().z());
RT c01 = -determinant(m.r1().x(),m.r1().z(),m.r2().x(),m.r2().z());
RT c02 = determinant(m.r1().x(),m.r1().y(),m.r2().x(),m.r2().y());
using ::CGAL::Surface_mesh_simplification::internal::diff_of_products;
RT c10 = -determinant(m.r0().y(),m.r0().z(),m.r2().y(),m.r2().z());
RT c11 = determinant(m.r0().x(),m.r0().z(),m.r2().x(),m.r2().z());
RT c12 = -determinant(m.r0().x(),m.r0().y(),m.r2().x(),m.r2().y());
RT c00 = diff_of_products(m.r1().y(), m.r2().z(), m.r2().y(), m.r1().z());
RT c01 = -diff_of_products(m.r1().x(), m.r2().z(), m.r2().x(), m.r1().z());
RT c02 = diff_of_products(m.r1().x(), m.r2().y(), m.r2().x(), m.r1().y());
RT c20 = determinant(m.r0().y(),m.r0().z(),m.r1().y(),m.r1().z());
RT c21 = -determinant(m.r0().x(),m.r0().z(),m.r1().x(),m.r1().z());
RT c22 = determinant(m.r0().x(),m.r0().y(),m.r1().x(),m.r1().y());
RT c10 = -diff_of_products(m.r0().y(), m.r2().z(), m.r2().y(), m.r0().z());
RT c11 = diff_of_products(m.r0().x(), m.r2().z(), m.r2().x(), m.r0().z());
RT c12 = -diff_of_products(m.r0().x(), m.r2().y(), m.r2().x(), m.r0().y());
RT c20 = diff_of_products(m.r0().y(), m.r1().z(), m.r1().y(), m.r0().z());
RT c21 = -diff_of_products(m.r0().x(), m.r1().z(), m.r1().x(), m.r0().z());
RT c22 = diff_of_products(m.r0().x(), m.r1().y(), m.r1().x(), m.r0().y());
return MatrixC33<R>(c00,c01,c02,
c10,c11,c12,
@ -211,7 +215,9 @@ std::optional< MatrixC33<R> > inverse_matrix(const MatrixC33<R>& m)
{
typedef typename R::RT RT;
typedef MatrixC33<R> Matrix;
typedef std::optional<Matrix> result_type;
typedef std::optional<Matrix> result_type;
using ::CGAL::Surface_mesh_simplification::internal::diff_of_products;
result_type rInverse;
@ -219,17 +225,17 @@ std::optional< MatrixC33<R> > inverse_matrix(const MatrixC33<R>& m)
if(! CGAL_NTS is_zero(det))
{
RT c00 = (m.r1().y()*m.r2().z() - m.r1().z()*m.r2().y()) / det;
RT c01 = (m.r2().y()*m.r0().z() - m.r0().y()*m.r2().z()) / det;
RT c02 = (m.r0().y()*m.r1().z() - m.r1().y()*m.r0().z()) / det;
RT c00 = diff_of_products(m.r1().y(),m.r2().z(),m.r2().y(),m.r1().z()) / det;
RT c01 = diff_of_products(m.r2().y(),m.r0().z(),m.r0().y(),m.r2().z()) / det;
RT c02 = diff_of_products(m.r0().y(),m.r1().z(),m.r1().y(),m.r0().z()) / det;
RT c10 = (m.r1().z()*m.r2().x() - m.r1().x()*m.r2().z()) / det;
RT c11 = (m.r0().x()*m.r2().z() - m.r2().x()*m.r0().z()) / det;
RT c12 = (m.r1().x()*m.r0().z() - m.r0().x()*m.r1().z()) / det;
RT c10 = diff_of_products(m.r2().x(),m.r1().z(),m.r1().x(),m.r2().z()) / det;
RT c11 = diff_of_products(m.r0().x(),m.r2().z(),m.r2().x(),m.r0().z()) / det;
RT c12 = diff_of_products(m.r1().x(),m.r0().z(),m.r0().x(),m.r1().z()) / det;
RT c20 = (m.r1().x()*m.r2().y() - m.r2().x()*m.r1().y()) / det;
RT c21 = (m.r2().x()*m.r0().y() - m.r0().x()*m.r2().y()) / det;
RT c22 = (m.r0().x()*m.r1().y() - m.r0().y()*m.r1().x()) / det;
RT c20 = diff_of_products(m.r1().x(),m.r2().y(),m.r2().x(),m.r1().y()) / det;
RT c21 = diff_of_products(m.r2().x(),m.r0().y(),m.r0().x(),m.r2().y()) / det;
RT c22 = diff_of_products(m.r0().x(),m.r1().y(),m.r1().x(),m.r0().y()) / det;
rInverse = result_type(Matrix(c00,c01,c02,
c10,c11,c12,

View File

@ -18,6 +18,7 @@
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_profile.h>
#include <CGAL/Cartesian/MatrixC33.h>
#include <CGAL/internal/robust_cross_product.h>
#include <limits>
#include <vector>
@ -101,6 +102,8 @@ private :
void extract_triangle_data();
void extract_boundary_data();
double maxBb;
void add_boundary_preservation_constraints(const Boundary_data_vector& aBdry);
void add_volume_preservation_constraints(const Triangle_data_vector& triangles);
void add_boundary_and_volume_optimization_constraints(const Boundary_data_vector& aBdry,
@ -119,42 +122,6 @@ private :
const Geom_traits& geom_traits() const { return mProfile.geom_traits(); }
const TM& surface() const { return mProfile.surface(); }
#if 0
// a*b - c*d
// The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products
static double diff_of_products_kahan(const double a, const double b, const double c, const double d)
{
double w = d * c;
double e = std::fma(c, -d, w);
double f = std::fma(a, b, -w);
return f + e;
}
static double diff_of_products_cht(const double a, const double b, const double c, const double d)
{
double p1 = a * b;
double p2 = c * d;
double e1 = std::fma (a, b, -p1);
double e2 = std::fma (c, -d, p2);
double r = p1 - p2;
double e = e1 + e2;
return r + e;
}
static double diff_of_products(const double a, const double b, const double c, const double d)
{
// the next two are equivalent in results and speed
return diff_of_products_kahan(a, b, c, d);
// return diff_of_products_cht(a, b, c, d);
}
template <typename OFT>
static OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d)
{
return a*b - c*d;
}
#endif
#ifdef __AVX__
static Vector SL_cross_product_avx(const Vector& A, const Vector& B)
{
@ -185,67 +152,10 @@ private :
}
#endif
static Vector SL_cross_product(const Vector& a, const Vector& b)
{
const FT ax=a.x(), ay=a.y(), az=a.z();
const FT bx=b.x(), by=b.y(), bz=b.z();
auto compute_minor = [](double ai, double bi, double aj, double bj)
{
// The main idea is that we expect ai and bi (and aj and bj) to have roughly the same magnitude
// since this function is used to compute the cross product of two vectors that are defined
// as (ORIGIN, pa) and (ORIGIN, pb) and pa and pb are part of the same triangle.
//
// We can abuse this fact to trade 2 extra subtractions to lower the error.
return ai * (bj - aj) + aj * (ai - bi);
};
// ay*
FT x = compute_minor(ay, by, az, bz);
FT y = compute_minor(az, bz, ax, bx);
FT z = compute_minor(ax, bx, ay, by);
return Vector(x, y, z);
}
#if 0
static Vector exact_cross_product(const Vector& a, const Vector& b)
{
CGAL::Cartesian_converter<Geom_traits, CGAL::Exact_predicates_exact_constructions_kernel> to_exact;
CGAL::Cartesian_converter<CGAL::Exact_predicates_exact_constructions_kernel, Geom_traits> to_approx;
auto exv = cross_product(to_exact(a), to_exact(b));
exv.exact();
return to_approx(exv);
}
#endif
static Vector X_product(const Vector& u, const Vector& v)
{
#if 0
// this can create large errors and spiky meshes for kernels with inexact constructions
return CGAL::cross_product(u,v);
#elif 0
// improves the problem mentioned above a bit, but not enough
return { std::fma(u.y(), v.z(), -u.z()*v.y()),
std::fma(u.z(), v.x(), -u.x()*v.z()),
std::fma(u.x(), v.y(), -u.y()*v.x()) };
#elif 0
// this is the best without resorting to exact, but it inflicts a 20% slowdown
return { diff_of_products(u.y(), v.z(), u.z(), v.y()),
diff_of_products(u.z(), v.x(), u.x(), v.z()),
diff_of_products(u.x(), v.y(), u.y(), v.x()) };
#elif 1
// balanced solution based on abusing the fact that here we expect u and v to have similar coordinates
return SL_cross_product(u, v);
#elif 0
// obviously too slow
return exact_cross_product(u, v);
#endif
}
static Vector point_cross_product(const Point& a, const Point& b)
{
return X_product(a-ORIGIN, b-ORIGIN);
return robust_cross_product<Geom_traits>(a-ORIGIN, b-ORIGIN);
}
// This is the (uX)(Xu) product described in the Lindstrom-Turk paper
@ -352,17 +262,21 @@ LindstromTurkCore<TM,K>::
extract_triangle_data()
{
mTriangle_data.reserve(mProfile.triangles().size());
maxBb = 0.0;
for(const Triangle& tri : mProfile.triangles())
{
const Point_reference p0 = get_point(tri.v0);
const Point_reference p1 = get_point(tri.v1);
const Point_reference p2 = get_point(tri.v2);
maxBb=(std::max)({maxBb,CGAL::abs(p0.x()),CGAL::abs(p0.y()),CGAL::abs(p0.z()),
CGAL::abs(p1.x()),CGAL::abs(p1.y()),CGAL::abs(p1.z()),
CGAL::abs(p2.x()),CGAL::abs(p2.y()),CGAL::abs(p2.z())});
Vector v01 = p1 - p0;
Vector v02 = p2 - p0;
Vector lNormalV = cross_product(v01,v02);
Vector lNormalV = robust_cross_product<Geom_traits>(v01,v02);
FT lNormalL = point_cross_product(p0,p1) * (p2 - ORIGIN);
CGAL_SMS_LT_TRACE(1, " Extracting triangle v" << tri.v0 << "->v" << tri.v1 << "->v" << tri.v2
@ -370,6 +284,7 @@ extract_triangle_data()
mTriangle_data.push_back(Triangle_data(lNormalV,lNormalL));
}
maxBb *= 2.0; // to avoid numerical problems
}
template<class TM, class K>
@ -394,11 +309,12 @@ compute_placement()
// A1 * v = b1
// A2 * v = b2
//
// Which in matrix form is : A * v = b
// Which in matrix form is: A * v = b
//
// (with 'A' a 3x3 matrix and 'b' a vector)
//
// The member variable mConstrinas contains A and b. Indidivual constraints (Ai,bi) can be added to it.
// The member variables mConstraints_A and mConstraints_b contain A and b.
// Indidivual constraints (Ai,bi) can be added to it.
// Once 3 such constraints have been added 'v' is directly solved a:
//
// v = b*inverse(A)
@ -421,7 +337,7 @@ compute_placement()
// In that case there is simply no good vertex placement
if(mConstraints_n == 3)
{
// If the matrix is singular it's inverse cannot be computed so an 'absent' value is returned.
// If the matrix is singular its inverse cannot be computed so an 'absent' value is returned.
std::optional<Matrix> lOptional_Ai = inverse_matrix(mConstraints_A);
if(lOptional_Ai)
{
@ -686,7 +602,10 @@ add_constraint_if_alpha_compatible(const Vector& Ai,
FT l = CGAL_NTS sqrt(slai);
CGAL_SMS_LT_TRACE(3, " l: " << n_to_string(l));
if(!CGAL_NTS is_zero(l))
// Due to double number type, l may have a small value instead of zero (example sum of the face normals of a tetrahedron for volume constraint)
// if bi is greater than maxBb, we consider that l is zero
CGAL_SMS_LT_TRACE(3, " error consider: " << (CGAL::abs(bi) / maxBb));
if(l > (CGAL::abs(bi) / maxBb))
{
Vector Ain = Ai / l;
FT bin = bi / l;
@ -861,6 +780,7 @@ add_constraint_from_gradient(const Matrix& H,
}
break;
}
}
} // namespace internal

View File

@ -114,8 +114,9 @@ inline std::string optional_to_string(const std::optional<T>& o) {
namespace internal { namespace { bool cgal_enable_sms_trace = true; } }
#define CGAL_SMS_TRACE_IMPL(m) \
if(::internal::cgal_enable_sms_trace) { \
std::ostringstream ss; ss << m; std::string s = ss.str(); \
/*Surface_simplification_external_trace(s)*/ std::cerr << s << std::endl; \
std::ostringstream ss; ss << m; \
std::string s = ss.str(); \
Surface_simplification_external_trace(s); \
}
#define CGAL_SMS_DEBUG_CODE(code) code

View File

@ -296,6 +296,8 @@ private:
void insert_in_PQ(const halfedge_descriptor h, Edge_data& data)
{
CGAL_SMS_TRACE(5, "Insert " << edge_to_string(h) << " in PQ");
CGAL_assertion(is_primary_edge(h));
CGAL_expensive_assertion(!data.is_in_PQ());
CGAL_expensive_assertion(!mPQ->contains(h));
@ -594,12 +596,33 @@ loop()
std::optional<halfedge_descriptor> opt_h;
// #define CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING
#ifdef CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING
int i_rm = 0;
#endif
while((opt_h = pop_from_PQ()))
for(;;)
{
#ifdef CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE
if(5 <= CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE)
{
CGAL_SMS_TRACE_IMPL("== Current queue ==");
auto mPQ_clone = *mPQ;
std::optional<halfedge_descriptor> opt_th;
while((opt_th = mPQ_clone.extract_top()))
{
CGAL_SMS_TRACE_IMPL("\t" + edge_to_string(*opt_th));
Cost_type tcost = get_data(*opt_th).cost();
if(tcost)
CGAL_SMS_TRACE_IMPL("\t" + std::to_string(CGAL::to_double(*tcost)));
}
}
#endif
if(!(opt_h = pop_from_PQ()))
break;
CGAL_SMS_TRACE(1, "Popped " << edge_to_string(*opt_h));
CGAL_assertion(!is_constrained(*opt_h));
@ -639,7 +662,7 @@ loop()
m_visitor.OnNonCollapsable(profile);
CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible" );
CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible (filter)" );
}
#ifdef CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING
@ -660,7 +683,7 @@ loop()
m_visitor.OnNonCollapsable(profile);
CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible" );
CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible (topology)" );
}
}
else
@ -823,7 +846,10 @@ is_collapse_topologically_valid(const Profile& profile)
{
/// ensure two constrained edges cannot get merged
if(is_edge_adjacent_to_a_constrained_edge(profile, m_ecm))
{
CGAL_SMS_TRACE(3," edge to collapse is adjacent to a constrained edge.");
return false;
}
if(profile.is_v0_v1_a_border())
{

View File

@ -0,0 +1,143 @@
// Copyright (c) 2025 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Mael Rouxel-Labbé
//
#ifndef CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H
#define CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H
#include <CGAL/license/Surface_mesh_simplification.h>
#include <CGAL/Surface_mesh_simplification/internal/Common.h>
#include <optional>
namespace CGAL {
namespace Surface_mesh_simplification {
namespace internal {
// a*b - c*d
// The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products
inline double diff_of_products_kahan(const double a, const double b, const double c, const double d)
{
double w = d * c;
double e = std::fma(c, -d, w);
double f = std::fma(a, b, -w);
return f + e;
}
inline double diff_of_products_cht(const double a, const double b, const double c, const double d)
{
double p1 = a * b;
double p2 = c * d;
double e1 = std::fma (a, b, -p1);
double e2 = std::fma (c, -d, p2);
double r = p1 - p2;
double e = e1 + e2;
return r + e;
}
inline double diff_of_products(const double a, const double b, const double c, const double d)
{
#if 0
// this can create large errors with inexact constructions
return a*b - c*d;
// the next two are equivalent in results and speed
#elif 1
return diff_of_products_kahan(a, b, c, d);
#elif 0
return diff_of_products_cht(a, b, c, d);
#endif
}
template <typename OFT>
inline OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d)
{
return a*b - c*d;
}
// balanced solution based on abusing the fact that here we expect u and v to have similar coordinates
template<class GeomTraits>
typename GeomTraits::Vector_3 similar_coordinates_cross_product(const typename GeomTraits::Vector_3& u,
const typename GeomTraits::Vector_3& v)
{
using FT = typename GeomTraits::FT;
using Vector = typename GeomTraits::Vector_3;
const FT& ux = u.x();
const FT& uy = u.y();
const FT& uz = u.z();
const FT& vx = v.x();
const FT& vy = v.y();
const FT& vz = v.z();
auto minor = [](const FT& ui, const FT& vi, const FT& uj, const FT& vj)
{
// The main idea is that we expect ai and bi (and aj and bj) to have roughly the same magnitude
// since this function is used to compute the cross product of two vectors that are defined
// as (ORIGIN, pa) and (ORIGIN, pb) and pa and pb are part of the same triangle.
//
// We can abuse this fact to trade 2 extra subtractions to lower the error.
return ui * (vj - uj) + uj * (ui - vi);
};
// ay*
FT x = minor(uy, vy, uz, vz);
FT y = minor(uz, vz, ux, vx);
FT z = minor(ux, vx, uy, vy);
return Vector(x, y, z);
}
#if 0
template<class GeomTraits>
typename GeomTraits::Vector_3 exact_cross_product(const typename GeomTraits::Vector_3& a,
const typename GeomTraits::Vector_3& b)
{
CGAL::Cartesian_converter<GeomTraits, CGAL::Exact_predicates_exact_constructions_kernel> to_exact;
CGAL::Cartesian_converter<CGAL::Exact_predicates_exact_constructions_kernel, GeomTraits> to_approx;
auto exv = cross_product(to_exact(a), to_exact(b));
exv.exact();
return to_approx(exv);
}
#endif
template<class GeomTraits>
typename GeomTraits::Vector_3 robust_cross_product(const typename GeomTraits::Vector_3& u,
const typename GeomTraits::Vector_3& v)
{
#if 0
// this can create large errors and spiky meshes for kernels with inexact constructions
return CGAL::cross_product(u,v);
#elif 0
// improves the problem mentioned above a bit, but not enough
return { std::fma(u.y(), v.z(), -u.z()*v.y()),
std::fma(u.z(), v.x(), -u.x()*v.z()),
std::fma(u.x(), v.y(), -u.y()*v.x()) };
#elif 0
// this is the best without resorting to exact, but it inflicts a 20% slowdown
return { diff_of_products(u.y(), v.z(), u.z(), v.y()),
diff_of_products(u.z(), v.x(), u.x(), v.z()),
diff_of_products(u.x(), v.y(), u.y(), v.x()) };
#elif 0
// obviously too slow
return exact_cross_product(u, v);
#elif 1
// balanced solution based on abusing the fact that in this package, we usually have that
// u and v to have similar coordinates
return similar_coordinates_cross_product<GeomTraits>(u, v);
#endif
}
} // namespace CGAL
} // namespace Surface_mesh_simplification
} // namespace internal
#endif // CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H

View File

@ -6,6 +6,7 @@ project(Surface_mesh_simplification_Tests)
find_package(CGAL REQUIRED)
create_single_source_cgal_program("issue_8213.cpp")
create_single_source_cgal_program("edge_collapse_topology.cpp")
create_single_source_cgal_program("test_edge_collapse_bounded_distance.cpp")
create_single_source_cgal_program("test_edge_collapse_Envelope.cpp")

View File

@ -0,0 +1,13 @@
OFF
5 4 0
0.60153250345565623 3.2925554343503594 -0.93390733763467004
0.50125687092531912 3.266008536541555 -0.80580753798383942
0.57499779785916183 3.2558452065056969 -0.97860403852322797
0.56586410588624558 3.2541065339825863 -0.99341202997519495
0.56756366821062887 3.2478315549358072 -0.99100621040927039
3 0 1 2
3 1 3 2
3 1 0 3
3 0 4 3

View File

@ -0,0 +1,75 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#define CGAL_CHECK_EXPENSIVE
#define CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE 5
#define CGAL_SURFACE_SIMPLIFICATION_ENABLE_LT_TRACE 4
void Surface_simplification_external_trace(const std::string& s)
{
std::cout << s << std::endl;
}
#include <CGAL/Surface_mesh_simplification/edge_collapse.h>
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_filter.h>
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h>
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h>
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h>
#include <CGAL/Polygon_mesh_processing/bbox.h>
#include <cstdlib>
#include <iostream>
#include <fstream>
namespace SMS = CGAL::Surface_mesh_simplification;
namespace PMP = CGAL::Polygon_mesh_processing;
using Kernel = CGAL::Simple_cartesian<double>;
// using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
using Surface_mesh = CGAL::Surface_mesh<Kernel::Point_3>;
int main(int argc, char** argv)
{
std::cout.precision(17);
std::cerr.precision(17);
const char* filename = (argc > 1) ? argv[1] : "data/issue_8213.off";
Surface_mesh sm;
if(!CGAL::IO::read_polygon_mesh(filename, sm))
{
std::cerr << "Error: failed to read input data" << std::endl;
return EXIT_FAILURE;
}
CGAL::Bbox_3 bb = PMP::bbox(sm);
std::cout << "Bbox:" << bb << std::endl;
std::cout << "Input mesh has " << num_vertices(sm) << " vertices" << std::endl;
std::cout << "Input mesh has " << num_faces(sm) << " faces" << std::endl;
SMS::Face_count_stop_predicate<Surface_mesh> stop(1);
SMS::edge_collapse(sm, stop,
CGAL::parameters::get_cost(SMS::LindstromTurk_cost<Surface_mesh>())
.get_placement(SMS::LindstromTurk_placement<Surface_mesh>()));
CGAL::IO::write_OFF(std::cout, sm, CGAL::parameters::stream_precision(17));
for(auto v : vertices(sm))
{
// To be within the bounding box isn't a guarantee, but here it is a sufficient test
// to check if things went awry
if(!CGAL::do_overlap(bb, sm.point(v).bbox()))
{
std::cerr << "Error: " << sm.point(v) << " is outside the initial bbox" << std::endl;
return EXIT_FAILURE;
}
}
return EXIT_SUCCESS;
}

View File

@ -960,7 +960,7 @@ OutputIterator
adjacent_vertices(Vertex_handle v, OutputIterator vertices) const;
/*!
Returns the degree of a vertex, that is, the number of incident vertices.
Returns the degree of `v`, that is, the number of incident vertices.
\pre `v` \f$ \neq\f$ `Vertex_handle()`, `tds.is_vertex(v)`.
*/
size_type degree(Vertex_handle v) const;

View File

@ -91,6 +91,13 @@ private:
std::vector<bool> m_free_vertices{};
bool m_flip_smooth_steps{false};
struct Move
{
Vector_3 move;
int neighbors;
FT mass;
};
public:
Tetrahedral_remeshing_smoother(const SizingFunction& sizing,
const CellSelector& cell_selector,
@ -627,8 +634,8 @@ private:
const C3t3& c3t3,
const bool boundary_edge = false) const
{
const auto mwi = midpoint_with_info(e, boundary_edge, c3t3);
const FT s = sizing_at_midpoint(e, mwi.dim, mwi.index, m_sizing, c3t3, m_cell_selector);
const auto [pt, dim, index] = midpoint_with_info(e, boundary_edge, c3t3);
const FT s = sizing_at_midpoint(e, pt, dim, index, m_sizing, c3t3, m_cell_selector);
const FT density = 1. / s; //density = 1 / size^(dimension)
//edge dimension is 1, so density = 1 / size
//to have mass = length * density with no dimension
@ -655,9 +662,8 @@ private:
auto& tr = c3t3.triangulation();
const std::size_t nbv = tr.number_of_vertices();
std::vector<Vector_3> moves(nbv, CGAL::NULL_VECTOR);
std::vector<int> neighbors(nbv, 0);
std::vector<FT> masses(nbv, 0.);
const Move default_move{CGAL::NULL_VECTOR, 0 /*neighbors*/, 0. /*mass*/};
std::vector<Move> moves(nbv, default_move);
//collect neighbors
for (const Edge& e : c3t3.edges_in_complex())
@ -683,33 +689,35 @@ private:
if (vh0_moving)
{
moves[i0] += density * Vector_3(p0, p1);
neighbors[i0]++;
masses[i0] += density;
moves[i0].move += density * Vector_3(p0, p1);
moves[i0].mass += density;
++moves[i0].neighbors;
}
if (vh1_moving)
{
moves[i1] += density * Vector_3(p1, p0);
neighbors[i1]++;
masses[i1] += density;
moves[i1].move += density * Vector_3(p1, p0);
moves[i1].mass += density;
++moves[i1].neighbors;
}
}
// iterate over map of <vertex, id>
for (auto [v, vid] : m_vertex_id)
// iterate over vertices and move
for(Vertex_handle v : tr.finite_vertex_handles())
{
const std::size_t vid = vertex_id(v);
if (!is_free(vid) || !is_on_feature(v))
continue;
const Point_3 current_pos = point(v->point());
const std::size_t nb_neighbors = neighbors[vid];
const std::size_t nb_neighbors = moves[vid].neighbors;
if(nb_neighbors == 0)
continue;
CGAL_assertion(masses[vid] > 0);
CGAL_assertion(moves[vid].mass > 0);
const Vector_3 move = (nb_neighbors > 0)
? moves[vid] / masses[vid]
? moves[vid].move / moves[vid].mass
: CGAL::NULL_VECTOR;
const Point_3 smoothed_position = current_pos + move;
@ -771,9 +779,8 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3,
auto& tr = c3t3.triangulation();
const std::size_t nbv = tr.number_of_vertices();
std::vector<Vector_3> moves(nbv, CGAL::NULL_VECTOR);
std::vector<int> neighbors(nbv, 0);
std::vector<FT> masses(nbv, 0.);
const Move default_move{CGAL::NULL_VECTOR, 0 /*neighbors*/, 0. /*mass*/};
std::vector<Move> moves(nbv, default_move);
for (const Edge& e : tr.finite_edges())
{
@ -797,26 +804,28 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3,
if (vh0_moving)
{
moves[i0] += density * Vector_3(p0, p1);
neighbors[i0]++;
masses[i0] += density;
moves[i0].move += density * Vector_3(p0, p1);
moves[i0].mass += density;
++moves[i0].neighbors;
}
if (vh1_moving)
{
moves[i1] += density * Vector_3(p1, p0);
neighbors[i1]++;
masses[i1] += density;
moves[i1].move += density * Vector_3(p1, p0);
moves[i1].mass += density;
++moves[i1].neighbors;
}
}
}
// iterate over map of <vertex, id>
for (auto [v, vid] : m_vertex_id)
// iterate over vertices and move
for(Vertex_handle v : tr.finite_vertex_handles())
{
const std::size_t vid = vertex_id(v);
if (!is_free(vid) || v->in_dimension() != 2)
continue;
const std::size_t nb_neighbors = neighbors[vid];
const std::size_t nb_neighbors = moves[vid].neighbors;
const Point_3 current_pos = point(v->point());
const auto& incident_surface_patches = vertices_surface_indices.at(v);
@ -830,7 +839,7 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3,
if (nb_neighbors > 1)
{
const Vector_3 move = moves[vid] / masses[vid];
const Vector_3 move = moves[vid].move / moves[vid].mass;
const Point_3 smoothed_position = point(v->point()) + move;
#ifdef CGAL_TET_REMESHING_SMOOTHING_WITH_MLS
@ -969,9 +978,9 @@ std::size_t smooth_internal_vertices(C3t3& c3t3,
auto& tr = c3t3.triangulation();
const std::size_t nbv = tr.number_of_vertices();
std::vector<Vector_3> moves(nbv, CGAL::NULL_VECTOR);
std::vector<int> neighbors(nbv, 0);/*for dim 3 vertices, start counting directly from 0*/
std::vector<FT> masses(nbv, 0.);
const Move default_move{CGAL::NULL_VECTOR, 0 /*neighbors*/, 0. /*mass*/};
std::vector<Move> moves(nbv, default_move);
/*for dim 3 vertices, start counting neighbors directly from 0*/
for (const Edge& e : tr.finite_edges())
{
@ -979,8 +988,7 @@ std::size_t smooth_internal_vertices(C3t3& c3t3,
continue;
else
{
const Vertex_handle vh0 = e.first->vertex(e.second);
const Vertex_handle vh1 = e.first->vertex(e.third);
const auto [vh0, vh1] = make_vertex_pair(e);
const std::size_t& i0 = vertex_id(vh0);
const std::size_t& i1 = vertex_id(vh1);
@ -997,31 +1005,32 @@ std::size_t smooth_internal_vertices(C3t3& c3t3,
if (vh0_moving)
{
moves[i0] += density * Vector_3(p0, p1);
neighbors[i0]++;
masses[i0] += density;
moves[i0].move += density * Vector_3(p0, p1);
moves[i0].mass += density;
++moves[i0].neighbors;
}
if (vh1_moving)
{
moves[i1] += density * Vector_3(p1, p0);
neighbors[i1]++;
masses[i1] += density;
moves[i1].move += density * Vector_3(p1, p0);
moves[i1].mass += density;
++moves[i1].neighbors;
}
}
}
// iterate over map of <vertex, id>
for (auto [v, vid] : m_vertex_id)
// iterate over vertices and move
for(Vertex_handle v : tr.finite_vertex_handles())
{
const std::size_t vid = vertex_id(v);
if (!is_free(vid))
continue;
if (c3t3.in_dimension(v) == 3 && neighbors[vid] > 1)
if (c3t3.in_dimension(v) == 3 && moves[vid].neighbors > 1)
{
#ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG
os_vol << "2 " << point(v->point());
#endif
const Vector_3 move = moves[vid] / masses[vid];// static_cast<FT>(neighbors[vid]);
const Vector_3 move = moves[vid].move / moves[vid].mass;// static_cast<FT>(neighbors[vid]);
Point_3 new_pos = point(v->point()) + move;
if (check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){
nb_done_3d++;

View File

@ -1439,6 +1439,7 @@ auto sizing_at_vertex(const Vertex_handle v,
template<typename Sizing, typename C3t3, typename Cell_selector>
auto sizing_at_midpoint(const typename C3t3::Edge& e,
const typename C3t3::Triangulation::Geom_traits::Point_3& m, // edge midpoint
const int dim,
const typename C3t3::Index& index,
const Sizing& sizing,
@ -1446,17 +1447,13 @@ auto sizing_at_midpoint(const typename C3t3::Edge& e,
const Cell_selector& cell_selector)
{
using FT = typename C3t3::Triangulation::Geom_traits::FT;
using Point_3 = typename C3t3::Triangulation::Geom_traits::Point_3;
auto cp = c3t3.triangulation().geom_traits().construct_point_3_object();
const Point_3 m = CGAL::midpoint(cp(e.first->vertex(e.second)->point()),
cp(e.first->vertex(e.third)->point()));
const FT size = sizing(m, dim, index);
if (dim < 3 && size == 0)
{
const auto u = e.first->vertex(e.second);
const auto v = e.first->vertex(e.third);
const auto [u, v] = make_vertex_pair(e);
const FT size_at_u = sizing(cp(u->point()), u->in_dimension(), u->index());
const FT size_at_v = sizing(cp(v->point()), v->in_dimension(), v->index());
@ -1572,7 +1569,6 @@ auto midpoint_with_info(const typename C3t3::Edge& e,
const C3t3& c3t3)
{
using Tr = typename C3t3::Triangulation;
using Vertex_handle = typename Tr::Vertex_handle;
using Gt = typename Tr::Geom_traits;
using Point_3 = typename Gt::Point_3;
using Index = typename C3t3::Index;
@ -1584,9 +1580,7 @@ auto midpoint_with_info(const typename C3t3::Edge& e,
Index index;
};
const auto vs = c3t3.triangulation().vertices(e);
const Vertex_handle u = vs[0];
const Vertex_handle v = vs[1];
const auto [u, v] = make_vertex_pair(e);
const auto& gt = c3t3.triangulation().geom_traits();
auto cp = gt.construct_point_3_object();

View File

@ -16,6 +16,7 @@ create_single_source_cgal_program("test_tetrahedral_remeshing_with_features.cpp"
create_single_source_cgal_program("test_tetrahedral_remeshing_of_one_subdomain.cpp")
create_single_source_cgal_program("test_tetrahedral_remeshing_io.cpp")
create_single_source_cgal_program("test_tetrahedral_remeshing_from_mesh_file.cpp")
create_single_source_cgal_program("test_tetrahedral_remeshing_determinism.cpp")
# Test MLS projection
add_executable(test_tetrahedral_remeshing_mls

View File

@ -0,0 +1,104 @@
//#define CGAL_TETRAHEDRAL_REMESHING_VERBOSE
//#define CGAL_TETRAHEDRAL_REMESHING_DEBUG
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Tetrahedral_remeshing/Remeshing_triangulation_3.h>
#include <CGAL/tetrahedral_remeshing.h>
#include <CGAL/Tetrahedral_remeshing/tetrahedral_remeshing_io.h>
#include <CGAL/Random.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cassert>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Tetrahedral_remeshing::Remeshing_triangulation_3<K> Remeshing_triangulation;
template<typename T3>
void generate_input_one_subdomain(const std::size_t nbv, T3& tr)
{
CGAL::Random rng;
typedef typename T3::Point Point;
std::vector<Point> pts;
while (pts.size() < nbv)
{
const float x = rng.uniform_real(-10.f, 10.f);
const float y = rng.uniform_real(-10.f, 10.f);
const float z = rng.uniform_real(-10.f, 10.f);
pts.push_back(Point(x, y, z));
}
tr.insert(pts.begin(), pts.end());
for (typename T3::Cell_handle c : tr.finite_cell_handles())
c->set_subdomain_index(1);
assert(tr.is_valid(true));
#ifdef CGAL_TETRAHEDRAL_REMESHING_GENERATE_INPUT_FILES
std::ofstream out("data/triangulation_one_subdomain.binary.cgal",
std::ios_base::out | std::ios_base::binary);
CGAL::save_binary_triangulation(out, tr);
out.close();
#endif
}
int main(int argc, char* argv[])
{
std::cout << "CGAL Random seed = " << CGAL::get_default_random().get_seed() << std::endl;
// Collect options
std::size_t nb_runs = 5;
Remeshing_triangulation tr;
generate_input_one_subdomain(1000, tr);
const int target_edge_length = (argc > 1) ? atoi(argv[1]) : 1;
std::ofstream ofs0("in.mesh");
CGAL::IO::write_MEDIT(ofs0, tr);
ofs0.close();
const Remeshing_triangulation tr_ref = tr; // Keep a reference for comparison
std::vector<std::string> output_tr;
output_tr.reserve(nb_runs);
for(std::size_t i = 0; i < nb_runs; ++i)
{
std::cout << "Run " << i << " of " << nb_runs << std::endl;
tr = tr_ref; // Reset triangulation to reference
CGAL::tetrahedral_isotropic_remeshing(tr, target_edge_length);
std::ostringstream oss;
CGAL::IO::write_MEDIT(oss, tr);
output_tr.push_back(oss.str());
oss.clear();
if(i == 0)
continue; // skip first run, it is the reference
else
{
if(0 != output_tr[i-1].compare(output_tr[i]))
{
std::cerr << "******************************************" << std::endl;
std::cerr << "*** Run " << i << " differs from run " << i-1 << std::endl;
assert(false); // This should not happen
}
else
{
std::cout << "******************************************" << std::endl;
std::cout << "*** Run " << i << " is identical to run " << i - 1 << std::endl;
std::cout << "******************************************" << std::endl;
}
}
}
return EXIT_SUCCESS;
}

View File

@ -11,10 +11,17 @@ include(CGAL_Eigen3_support)
if(TARGET CGAL::Eigen3_support)
include_directories(BEFORE "include")
create_single_source_cgal_program("generate_d.cpp")
create_single_source_cgal_program("bench4d.cpp")
create_single_source_cgal_program("bench5d.cpp")
create_single_source_cgal_program("bench6d.cpp")
create_single_source_cgal_program("delaunay.cpp")
target_link_libraries(delaunay PRIVATE CGAL::Eigen3_support)
create_single_source_cgal_program("Td_vs_T2_and_T3.cpp")
target_link_libraries(Td_vs_T2_and_T3 PRIVATE CGAL::Eigen3_support)
target_link_libraries(bench4d PRIVATE CGAL::Eigen3_support)
target_link_libraries(bench5d PRIVATE CGAL::Eigen3_support)
target_link_libraries(bench6d PRIVATE CGAL::Eigen3_support)
else()
message("NOTICE: Executables in this directory require Eigen 3.1 (or greater), and will not be compiled.")
endif()

View File

@ -0,0 +1,64 @@
// Switch off the static filters for 4, 5, and 6 points.
// #define CGAL_NO_STATIC_FILTER_456
#include <CGAL/Epick_d.h>
#include <CGAL/Triangulation.h>
#include <CGAL/algorithm.h>
#include <CGAL/Timer.h>
#include <iostream>
#include <fstream>
#include <iterator>
#include <vector>
typedef CGAL::Epick_d< CGAL::Dimension_tag<4> > K;
typedef CGAL::Triangulation_vertex<K> Vertex;
typedef CGAL::Triangulation_ds_full_cell<void,CGAL::TDS_full_cell_mirror_storage_policy> DS_full_cell;
typedef CGAL::Triangulation_full_cell<K,CGAL::No_full_cell_data, DS_full_cell> Full_cell;
typedef CGAL::Triangulation_data_structure<CGAL::Dimension_tag<4>,
Vertex,
Full_cell> TDS;
typedef CGAL::Triangulation<K,TDS> Triangulation;
int main()
{
const int D = 4; // we work in Euclidean 4-space
std::vector<Triangulation::Point> points;
std::ifstream in("points_4.txt");
Triangulation::Point p;
int d;
in >> d;
assert(d == D);
int n;
in >> n;
std::cout << n << " points in dimension " << d << std::endl;
points.reserve(n);
while (in >> p) {
points.push_back(p);
}
CGAL::Timer timer;
timer.start();
Triangulation t(D); // create triangulation
assert(t.empty());
//std::array<double, 4> ar = { 0, 0, 0, 0};
//Triangulation::Point orig(ar.begin(), ar.end());
//t.insert(orig); // insert origin
t.insert(points.begin(), points.end()); // compute triangulation
std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl;
timer.reset();
assert( t.is_valid() );
// - - - - - - - - - - - - - - - - - - - - - - - - STEP 2
typedef Triangulation::Face Face;
typedef std::vector<Face> Faces;
Faces edges;
std::back_insert_iterator<Faces> out(edges);
t.tds().incident_faces(t.infinite_vertex(), 1, out);
// collect faces of dimension 1 (edges) incident to the infinite vertex
std::cout << "There are " << edges.size()
<< " vertices on the convex hull." << std::endl;
std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl;
return 0;
}

View File

@ -0,0 +1,64 @@
// Switch off the static filters for 4, 5, and 6 points.
// #define CGAL_NO_STATIC_FILTER_456
#include <CGAL/Epick_d.h>
#include <CGAL/Triangulation.h>
#include <CGAL/algorithm.h>
#include <CGAL/Timer.h>
#include <iostream>
#include <fstream>
#include <iterator>
#include <vector>
typedef CGAL::Epick_d< CGAL::Dimension_tag<5> > K;
typedef CGAL::Triangulation_vertex<K> Vertex;
typedef CGAL::Triangulation_ds_full_cell<void,CGAL::TDS_full_cell_mirror_storage_policy> DS_full_cell;
typedef CGAL::Triangulation_full_cell<K,CGAL::No_full_cell_data, DS_full_cell> Full_cell;
typedef CGAL::Triangulation_data_structure<CGAL::Dimension_tag<5>,
Vertex,
Full_cell> TDS;
typedef CGAL::Triangulation<K,TDS> Triangulation;
int main()
{
const int D = 5; // we work in Euclidean 5-space
std::vector<Triangulation::Point> points;
std::ifstream in("points_5.txt");
Triangulation::Point p;
int d;
in >> d;
assert(d == D);
int n;
in >> n;
points.reserve(n);
while (in >> p) {
points.push_back(p);
}
CGAL::Timer timer;
timer.start();
Triangulation t(D); // create triangulation
assert(t.empty());
//std::array<double, 5> ar = { 0, 0, 0, 0, 0 };
//Triangulation::Point orig(ar.begin(), ar.end());
//t.insert(orig); // insert origin
t.insert(points.begin(), points.end()); // compute triangulation
std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl;
timer.reset();
assert( t.is_valid() );
// - - - - - - - - - - - - - - - - - - - - - - - - STEP 2
typedef Triangulation::Face Face;
typedef std::vector<Face> Faces;
Faces edges;
std::back_insert_iterator<Faces> out(edges);
t.tds().incident_faces(t.infinite_vertex(), 1, out);
// collect faces of dimension 1 (edges) incident to the infinite vertex
std::cout << "There are " << edges.size()
<< " vertices on the convex hull." << std::endl;
std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl;
return 0;
}

View File

@ -0,0 +1,83 @@
#include <CGAL/Epick_d.h>
#include <CGAL/Triangulation.h>
#include <CGAL/algorithm.h>
#include <CGAL/Timer.h>
#include <iostream>
#include <fstream>
#include <iterator>
#include <vector>
typedef CGAL::Epick_d< CGAL::Dimension_tag<6> > K;
typedef CGAL::Triangulation_vertex<K, std::ptrdiff_t> Vertex;
typedef CGAL::Triangulation_ds_full_cell<void,CGAL::TDS_full_cell_mirror_storage_policy> DS_full_cell;
typedef CGAL::Triangulation_full_cell<K,CGAL::No_full_cell_data, DS_full_cell> Full_cell;
typedef CGAL::Triangulation_data_structure<CGAL::Dimension_tag<6>,
Vertex,
Full_cell> TDS;
typedef CGAL::Triangulation<K,TDS> Triangulation;
int main(int argc, char* argv[])
{
const int D = 6; // we work in Euclidean 6-space
std::vector<Triangulation::Point> points;
std::ifstream in(argv[1]);
Triangulation::Point p;
int d;
in >> d;
assert(d == D);
int n;
in >> n;
points.reserve(n);
while (in >> p) {
points.push_back(p);
}
CGAL::Timer timer;
timer.start();
Triangulation t(D); // create triangulation
assert(t.empty());
t.insert_and_index(points.begin(), points.end()); // compute triangulation
std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl;
timer.reset();
assert( t.is_valid() );
std::vector<Triangulation::Full_cell_handle> infinite_cells;
t.tds().incident_full_cells(t.infinite_vertex(), std::back_inserter(infinite_cells));
return 0;
std::set<std::pair<std::ptrdiff_t, std::ptrdiff_t>> edges;
for(auto ch : infinite_cells) {
std::vector<Triangulation::Vertex_handle> vertices;
std::cout << "cell" << std::endl;
vertices.reserve(D);
for(int i = 0; i < D + 1; ++i) {
if(ch->vertex(i) != t.infinite_vertex()) {
vertices.push_back(ch->vertex(i));
std::cout << ch->vertex(i)->data() << " ";
}
}
std::cout << std::endl;
for (int i = 0; i < D-1; i++) {
for (int j = 0; j < D-1; j++) {
if((i != j) && (vertices[i]->data() < vertices[j]->data())) {
edges.insert(std::make_pair(vertices[i]->data(), vertices[j]->data()));
}
}
}
}
for(auto pair : edges) {
std::cout << "edge between vertices " << pair.first << " and " << pair.second << std::endl;
}
std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl;
return 0;
}

View File

@ -0,0 +1,24 @@
#include <CGAL/Random.h>
#include <array>
#include <iostream>
int main() {
CGAL::Random rng;
std::cout.precision(17);
std ::cout << 4 << std::endl;
std::cout << 100000 << std::endl;
for(int i = 0; i < 100000; ++i) {
std::array<double, 4> arr;
double slength = 0;
for(int i = 0; i < arr.size(); ++i) {
arr[i] = rng.get_double(-1, 1);
slength += arr[i] * arr[i];
}
slength = std::sqrt(slength);
for(int i = 0; i < arr.size(); ++i) {
arr[i] /= slength;
}
std::cout << "4 " << arr[0] << " " << arr[1] << " " << arr[2] << " " << arr[3] /* << " " << arr[4] /* << " " << arr[5] */ << std::endl;
}
return 0;
}

View File

@ -0,0 +1,10 @@
namespace CGAL {
/*!
\ingroup PkgTriangulationsRef
A tag class to indicate that no mirror indices are stored in full cells.
*/
class TDS_full_cell_default_storage_policy
{};
}

View File

@ -0,0 +1,11 @@
namespace CGAL {
/*!
\ingroup PkgTriangulationsRef
A tag class to indicate that mirror indices are stored in full cells.
\pre The dimension is not larger than 127.
*/
class TDS_full_cell_mirror_storage_policy
{};
}

View File

@ -520,7 +520,7 @@ position `p`. Returns a handle to that vertex.
\pre The boundary of the union of full cells incident to `f` must be a triangulation of a
sphere of dimension `tr`.`current_dimension()`).
*/
Vertex_handle collapse_face(const Point & p, const Face & f);
Vertex_handle contract_face(const Point & p, const Face & f);
/// @}

View File

@ -26,8 +26,8 @@ which is also the unique vertex and the unique full cell in the
`TriangulationDataStructure`.
In a
geometric realization of the `TriangulationDataStructure` (<I>e.g.</I>, in a
`Triangulation<TriangulationTraits_, TriangulationDataStructure_>` or a
`Delaunay_triangulation<DelaunayTriangulationTraits_, TriangulationDataStructure_>`), this vertex
`CGAL::Triangulation<TriangulationTraits_, TriangulationDataStructure_>` or a
`CGAL::Delaunay_triangulation<DelaunayTriangulationTraits_, TriangulationDataStructure_>`), this vertex
corresponds to <I>the vertex at infinity</I>.
<DT><B>0</B><DD> This corresponds to two vertices, each incident to one \f$ 0\f$-face;
@ -456,14 +456,14 @@ Insertion in a hole, \f$ d=2\f$
\cgalAdvancedEnd
*/
template< class ForwardIterator > Vertex_handle
insert_in_hole(ForwardIterator start, ForwardIterator end, Facet f);
insert_in_hole(ForwardIterator s, ForwardIterator e, Facet f);
/*!
Same as above, but handles to the new full cells are
appended to the `out` output iterator.
*/
template< class ForwardIterator, class OutputIterator >
Vertex_handle insert_in_hole(ForwardIterator start, ForwardIterator end, Facet
Vertex_handle insert_in_hole(ForwardIterator s, ForwardIterator e, Facet
f, OutputIterator out);
/*!
@ -594,7 +594,7 @@ Calls `delete_full_cell` over an iterator range of value type `Full_cell_handle`
\cgalAdvancedEnd
*/
template< typename ForwardIterator > void
delete_full_cells(ForwardIterator start, ForwardIterator end);
delete_full_cells(ForwardIterator s, ForwardIterator e);
/// @}

View File

@ -101,6 +101,8 @@ The latter two concepts are also abbreviated respectively as `TrVertex` and `TrF
- `CGAL::Triangulation_ds_vertex<TriangulationDataStructure_>`
- `CGAL::Triangulation_ds_full_cell<TriangulationDataStructure_, TriangulationDSFullCellStoragePolicy>`
- `CGAL::Triangulation_face<TriangulationDataStructure_>`
- `CGAL::TDS_full_cell_default_storage_policy`
- `CGAL::TDS_full_cell_mirror_storage_policy`
\cgalCRPSection{(Geometric) Triangulations}

View File

@ -22,6 +22,8 @@
#include <CGAL/Triangulation_vertex.h>
#include <CGAL/Iterator_project.h>
#include <CGAL/spatial_sort.h>
#include <CGAL/Spatial_sort_traits_adapter_d.h>
#include <CGAL/property_map.h> // for CGAL::Identity_property_map
#include <CGAL/Dimension.h>
#include <CGAL/iterator.h>
#include <CGAL/Default.h>
@ -721,6 +723,34 @@ public:
}
return number_of_vertices() - n;
}
template< typename RandomAccessIterator >
size_type insert_and_index(RandomAccessIterator start, RandomAccessIterator end)
{
size_type n = number_of_vertices();
std::vector<std::ptrdiff_t> indices(boost::counting_iterator<std::ptrdiff_t>(0),
boost::counting_iterator<std::ptrdiff_t>(end - start));
using Point_property_map = boost::iterator_property_map<RandomAccessIterator,
CGAL::Identity_property_map<std::ptrdiff_t>>;
using Search_traits_d = CGAL::Spatial_sort_traits_adapter_d<Geom_traits, Point_property_map>;
CGAL::spatial_sort(indices.begin(), indices.end(), Search_traits_d(start));
Full_cell_handle hint = Full_cell_handle();
for (auto index : indices) {
typename Triangulation::Vertex_handle pos = insert(*(start+index), hint);
if (pos != nullptr) {
// Save index value as data to retrieve it after insertion
pos->data() = n+index;
hint = pos->full_cell();
}
}
return number_of_vertices() - n;
}
Vertex_handle insert(const Point &, Locate_type, const Face &, const Facet &, Full_cell_handle);
Vertex_handle insert(const Point &, Full_cell_handle start = Full_cell_handle());
Vertex_handle insert(const Point &, Vertex_handle);

View File

@ -30,8 +30,11 @@
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <boost/iterator/counting_iterator.hpp>
namespace CGAL {
template< class Dimen,
@ -138,7 +141,7 @@ protected: // DATA MEMBERS
int dmax_, dcur_; // dimension of the current triangulation
Vertex_container vertices_; // list of all vertices
Full_cell_container full_cells_; // list of all full cells
mutable std::vector<Full_cell_handle> visited;
private:
void clean_dynamic_memory()
@ -306,10 +309,10 @@ public:
return s->mirror_index(i);
}
int mirror_vertex(Full_cell_handle s, int i) const /* Concept */
Vertex_handle mirror_vertex(Full_cell_handle s, int i) const /* Concept */
{
CGAL_precondition(Full_cell_handle() != s && check_range(i));
return s->mirror_vertex(i);
return s->mirror_vertex(i, current_dimension());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FACETS OPERATIONS
@ -365,7 +368,7 @@ protected:
public:
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REMOVALS
Vertex_handle collapse_face(const Face &); /* Concept */
Vertex_handle contract_face(const Face &); /* Concept */
void remove_decrease_dimension(Vertex_handle, Vertex_handle); /* Concept */
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERTIONS
@ -374,12 +377,12 @@ public:
Vertex_handle insert_in_face(const Face &); /* Concept */
Vertex_handle insert_in_facet(const Facet &); /* Concept */
template< typename Forward_iterator >
Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, Facet); /* Concept */
Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, const Facet&); /* Concept */
template< typename Forward_iterator, typename OutputIterator >
Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, Facet, OutputIterator); /* Concept */
Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, const Facet&, OutputIterator); /* Concept */
template< typename OutputIterator >
Full_cell_handle insert_in_tagged_hole(Vertex_handle, Facet, OutputIterator);
Full_cell_handle insert_in_tagged_hole(Vertex_handle, const Facet&, OutputIterator);
Vertex_handle insert_increase_dimension(Vertex_handle=Vertex_handle()); /* Concept */
@ -667,8 +670,10 @@ Triangulation_data_structure<Dim, Vb, Fcb>
TraversalPredicate & tp,
OutputIterator & out) const /* Concept */
{
CGAL_precondition(visited.empty());
std::queue<Full_cell_handle> queue;
set_visited(start, true);
visited.push_back(start);
queue.push(start);
const int cur_dim = current_dimension();
Facet ft;
@ -684,6 +689,7 @@ Triangulation_data_structure<Dim, Vb, Fcb>
if( ! get_visited(n) )
{
set_visited(n, true);
visited.push_back(n);
if( tp(Facet(s, i)) )
queue.push(n);
else
@ -691,7 +697,9 @@ Triangulation_data_structure<Dim, Vb, Fcb>
}
}
}
clear_visited_marks(start);
for(auto fch : visited)
set_visited(fch, false);
visited.clear();
return ft;
}
@ -776,13 +784,13 @@ Triangulation_data_structure<Dim, Vb, Fcb>
template <class Dim, class Vb, class Fcb>
typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
Triangulation_data_structure<Dim, Vb, Fcb>
::collapse_face(const Face & f) /* Concept */
::contract_face(const Face & f) /* Concept */
{
const int fd = f.face_dimension();
CGAL_precondition( (1 <= fd ) && (fd < current_dimension()));
std::vector<Full_cell_handle> simps;
// save the Face's vertices:
Full_cell s;
Full_cell s(current_dimension());
for( int i = 0; i <= fd; ++i )
s.set_vertex(i, f.vertex(i));
// compute the star of f
@ -926,7 +934,7 @@ template <class Dim, class Vb, class Fcb >
template < typename OutputIterator >
typename Triangulation_data_structure<Dim, Vb, Fcb>::Full_cell_handle
Triangulation_data_structure<Dim, Vb, Fcb>
::insert_in_tagged_hole(Vertex_handle v, Facet f,
::insert_in_tagged_hole(Vertex_handle v, const Facet& f,
OutputIterator new_full_cells)
{
CGAL_assertion_msg(is_boundary_facet(f), "starting facet should be on the hole boundary");
@ -934,13 +942,13 @@ Triangulation_data_structure<Dim, Vb, Fcb>
const int cur_dim = current_dimension();
Full_cell_handle new_s;
std::queue<IITH_task> task_queue;
std::stack<IITH_task, std::vector<IITH_task>> task_queue;
task_queue.push(
IITH_task(f, mirror_index(full_cell(f), index_of_covertex(f))) );
while (!task_queue.empty())
{
IITH_task task = task_queue.front();
IITH_task task = task_queue.top();
task_queue.pop();
Full_cell_handle old_s = full_cell(task.boundary_facet);
@ -1028,7 +1036,7 @@ template< class Dim, class Vb, class Fcb >
template< typename Forward_iterator, typename OutputIterator >
typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
Triangulation_data_structure<Dim, Vb, Fcb>
::insert_in_hole(Forward_iterator start, Forward_iterator end, Facet f,
::insert_in_hole(Forward_iterator start, Forward_iterator end, const Facet& f,
OutputIterator out) /* Concept */
{
CGAL_expensive_precondition(
@ -1047,7 +1055,7 @@ template< class Dim, class Vb, class Fcb >
template< typename Forward_iterator >
typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
Triangulation_data_structure<Dim, Vb, Fcb>
::insert_in_hole(Forward_iterator start, Forward_iterator end, Facet f) /* Concept */
::insert_in_hole(Forward_iterator start, Forward_iterator end, const Facet& f) /* Concept */
{
Emptyset_iterator out;
return insert_in_hole(start, end, f, out);

Some files were not shown because too many files have changed in this diff Show More