30
30
#include < CGAL/tuple.h>
31
31
#include < CGAL/iterator.h>
32
32
#include < CGAL/array.h>
33
+ #include < CGAL/type_traits.h>
33
34
#include < CGAL/Handle_hash_function.h>
34
35
35
36
#ifdef CGAL_MESH_3_PROFILING
@@ -376,8 +377,7 @@ class C3T3_helpers_base
376
377
{
377
378
protected:
378
379
typedef typename Tr::Geom_traits GT;
379
- typedef typename Tr::Bare_point Bare_point;
380
- typedef typename Tr::Weighted_point Weighted_point;
380
+ typedef typename Tr::Point Weighted_point;
381
381
typedef typename GT::FT FT;
382
382
typedef typename Tr::Vertex_handle Vertex_handle;
383
383
typedef typename Tr::Cell_handle Cell_handle;
@@ -448,8 +448,8 @@ class C3T3_helpers_base<Tr, Parallel_tag>
448
448
{
449
449
protected:
450
450
typedef typename Tr::Geom_traits GT;
451
- typedef typename Tr::Bare_point Bare_point;
452
- typedef typename Tr::Weighted_point Weighted_point;
451
+ typedef Bare_point_type_t<Tr> Bare_point;
452
+ typedef typename Tr::Point Weighted_point;
453
453
typedef typename Tr::Vertex_handle Vertex_handle;
454
454
typedef typename Tr::Cell_handle Cell_handle;
455
455
typedef typename Tr::Facet Facet;
@@ -609,7 +609,8 @@ template <typename C3T3,
609
609
typename MeshDomain>
610
610
class C3T3_helpers
611
611
: public C3T3_helpers_base<typename C3T3::Triangulation,
612
- typename C3T3::Concurrency_tag>
612
+ typename C3T3::Concurrency_tag>,
613
+ public CGAL::Mesh_3::Triangulation_helpers<typename C3T3::Triangulation>
613
614
{
614
615
// -----------------------------------
615
616
// Private types
@@ -625,8 +626,8 @@ class C3T3_helpers
625
626
typedef typename Tr::Geom_traits GT;
626
627
627
628
typedef typename GT::FT FT;
628
- typedef typename Tr::Bare_point Bare_point ;
629
- typedef typename Tr::Weighted_point Weighted_point ;
629
+ typedef typename Tr::Point Weighted_point ;
630
+ typedef Bare_point_type_t<Tr> Bare_point ;
630
631
typedef typename GT::Vector_3 Vector_3;
631
632
typedef typename GT::Plane_3 Plane_3;
632
633
typedef typename GT::Tetrahedron_3 Tetrahedron;
@@ -640,8 +641,8 @@ class C3T3_helpers
640
641
typedef typename C3T3::Subdomain_index Subdomain_index;
641
642
typedef typename C3T3::Index Index;
642
643
643
- typedef std::optional<Surface_patch_index> Surface_patch;
644
- typedef std::optional<Subdomain_index> Subdomain;
644
+ typedef std::optional<Surface_patch_index> Surface_patch;
645
+ typedef std::optional<Subdomain_index> Subdomain;
645
646
646
647
typedef std::vector<Cell_handle> Cell_vector;
647
648
typedef std::set<Cell_handle> Cell_set;
@@ -735,7 +736,7 @@ class C3T3_helpers
735
736
/* * @brief tries to move `old_vertex` to `new_position` in the mesh
736
737
*
737
738
* Same as update_mesh, but with the precondition that
738
- * Th(). no_topological_change(tr_, old_vertex, new_position,
739
+ * this-> no_topological_change(tr_, old_vertex, new_position,
739
740
* incident_cells_) return false.
740
741
*/
741
742
template <typename SliverCriterion, typename OutputIterator>
@@ -2149,15 +2150,13 @@ class C3T3_helpers
2149
2150
2150
2151
template <typename CellForwardIterator>
2151
2152
void reset_circumcenter_cache (CellForwardIterator cells_begin,
2152
- CellForwardIterator cells_end) const
2153
+ CellForwardIterator cells_end) const
2153
2154
{
2154
- while (cells_begin != cells_end) {
2155
- (*cells_begin)->invalidate_weighted_circumcenter_cache ();
2156
- ++cells_begin;
2157
- }
2155
+ if constexpr (is_regular_triangulation_v<Tr>)
2156
+ for (auto it = cells_begin; it != cells_end; ++it)
2157
+ (*it)->invalidate_weighted_circumcenter_cache ();
2158
2158
}
2159
2159
2160
-
2161
2160
private:
2162
2161
2163
2162
// Functor for update_facets function (base)
@@ -2436,7 +2435,7 @@ update_mesh(const Vertex_handle& old_vertex,
2436
2435
Cell_vector incident_cells_;
2437
2436
incident_cells_.reserve (64 );
2438
2437
tr_.incident_cells (old_vertex, std::back_inserter (incident_cells_));
2439
- if ( Th (). no_topological_change (tr_, old_vertex, move, new_position, incident_cells_) )
2438
+ if ( this -> no_topological_change (tr_, old_vertex, move, new_position, incident_cells_) )
2440
2439
{
2441
2440
return update_mesh_no_topo_change (old_vertex, move, new_position, criterion,
2442
2441
modified_vertices, incident_cells_);
@@ -2674,7 +2673,7 @@ C3T3_helpers<C3T3,MD>::
2674
2673
rebuild_restricted_delaunay (OutdatedCells& outdated_cells,
2675
2674
Moving_vertices_set& moving_vertices)
2676
2675
{
2677
- typename GT::Construct_point_3 cp = tr_. geom_traits (). construct_point_3_object ( );
2676
+ auto cp = this -> construct_bare_point_object (tr_ );
2678
2677
2679
2678
typename OutdatedCells::iterator first_cell = outdated_cells.begin ();
2680
2679
typename OutdatedCells::iterator last_cell = outdated_cells.end ();
@@ -2804,7 +2803,7 @@ rebuild_restricted_delaunay(ForwardIterator first_cell,
2804
2803
ForwardIterator last_cell,
2805
2804
Moving_vertices_set& moving_vertices)
2806
2805
{
2807
- typename GT::Construct_point_3 cp = tr_. geom_traits (). construct_point_3_object ( );
2806
+ auto cp = this -> construct_bare_point_object (tr_ );
2808
2807
typename GT::Construct_vector_3 vector = tr_.geom_traits ().construct_vector_3_object ();
2809
2808
typename GT::Equal_3 equal = tr_.geom_traits ().equal_3_object ();
2810
2809
@@ -2943,29 +2942,29 @@ move_point(const Vertex_handle& old_vertex,
2943
2942
#endif
2944
2943
2945
2944
typename GT::Construct_translated_point_3 translate = tr_.geom_traits ().construct_translated_point_3_object ();
2946
- typename GT::Construct_point_3 cp = tr_. geom_traits (). construct_point_3_object ( );
2947
- typename GT::Construct_weighted_point_3 cwp = tr_. geom_traits (). construct_weighted_point_3_object ( );
2945
+ auto cp = this -> construct_bare_point_object (tr_ );
2946
+ auto cwp = this -> construct_triangulation_point_object (tr_ );
2948
2947
2949
2948
Cell_vector incident_cells_;
2950
2949
incident_cells_.reserve (64 );
2951
2950
2952
- # ifdef CGAL_LINKED_WITH_TBB
2951
+ #ifdef CGAL_LINKED_WITH_TBB
2953
2952
// Parallel
2954
2953
if (std::is_convertible<Concurrency_tag, Parallel_tag>::value)
2955
2954
{
2956
2955
tr_.incident_cells_threadsafe (old_vertex, std::back_inserter (incident_cells_));
2957
2956
}
2958
2957
// Sequential
2959
2958
else
2960
- # endif // CGAL_LINKED_WITH_TBB
2959
+ #endif // CGAL_LINKED_WITH_TBB
2961
2960
{
2962
2961
tr_.incident_cells (old_vertex, std::back_inserter (incident_cells_));
2963
2962
}
2964
2963
2965
2964
const Weighted_point& position = tr_.point (old_vertex);
2966
2965
const Weighted_point& new_position = cwp (translate (cp (position), move));
2967
2966
2968
- if ( Th (). no_topological_change (tr_, old_vertex, move, new_position, incident_cells_) )
2967
+ if ( this -> no_topological_change (tr_, old_vertex, move, new_position, incident_cells_) )
2969
2968
{
2970
2969
reset_circumcenter_cache (incident_cells_);
2971
2970
reset_sliver_cache (incident_cells_);
@@ -2994,8 +2993,8 @@ move_point(const Vertex_handle& old_vertex,
2994
2993
#endif
2995
2994
2996
2995
typename GT::Construct_translated_point_3 translate = tr_.geom_traits ().construct_translated_point_3_object ();
2997
- typename GT::Construct_point_3 cp = tr_. geom_traits (). construct_point_3_object ( );
2998
- typename GT::Construct_weighted_point_3 cwp = tr_. geom_traits (). construct_weighted_point_3_object ( );
2996
+ auto cp = this -> construct_bare_point_object (tr_ );
2997
+ auto cwp = this -> construct_triangulation_point_object (tr_ );
2999
2998
3000
2999
Cell_vector incident_cells_;
3001
3000
incident_cells_.reserve (64 );
@@ -3004,7 +3003,7 @@ move_point(const Vertex_handle& old_vertex,
3004
3003
const Weighted_point& position = tr_.point (old_vertex);
3005
3004
const Weighted_point& new_position = cwp (translate (cp (position), move));
3006
3005
3007
- if ( Th (). no_topological_change (tr_, old_vertex, move, new_position, incident_cells_) )
3006
+ if ( this -> no_topological_change (tr_, old_vertex, move, new_position, incident_cells_) )
3008
3007
{
3009
3008
reset_circumcenter_cache (incident_cells_);
3010
3009
reset_sliver_cache (incident_cells_);
@@ -3058,8 +3057,8 @@ move_point(const Vertex_handle& old_vertex,
3058
3057
// ======= /Get incident cells ==========
3059
3058
3060
3059
typename GT::Construct_translated_point_3 translate = tr_.geom_traits ().construct_translated_point_3_object ();
3061
- typename GT::Construct_point_3 cp = tr_. geom_traits (). construct_point_3_object ( );
3062
- typename GT::Construct_weighted_point_3 cwp = tr_. geom_traits (). construct_weighted_point_3_object ( );
3060
+ auto cp = this -> construct_bare_point_object (tr_ );
3061
+ auto cwp = this -> construct_triangulation_point_object (tr_ );
3063
3062
3064
3063
const Weighted_point& position = tr_.point (old_vertex);
3065
3064
const Weighted_point& new_position = cwp (translate (cp (position), move));
@@ -3071,7 +3070,7 @@ move_point(const Vertex_handle& old_vertex,
3071
3070
return Vertex_handle ();
3072
3071
}
3073
3072
3074
- if ( Th (). no_topological_change (tr_, old_vertex, move, new_position, incident_cells_) )
3073
+ if ( this -> no_topological_change (tr_, old_vertex, move, new_position, incident_cells_) )
3075
3074
{
3076
3075
reset_circumcenter_cache (incident_cells_);
3077
3076
reset_sliver_cache (incident_cells_);
@@ -3349,7 +3348,7 @@ move_point_no_topo_change(const Vertex_handle& old_vertex,
3349
3348
const Weighted_point& new_position) const
3350
3349
{
3351
3350
// Change vertex position
3352
- tr_. set_point (old_vertex, move, new_position);
3351
+ this -> set_point (tr_, old_vertex, move, new_position);
3353
3352
CGAL_expensive_postcondition (tr_.is_valid ());
3354
3353
return old_vertex;
3355
3354
}
@@ -3427,7 +3426,7 @@ get_least_square_surface_plane(const Vertex_handle& v,
3427
3426
{
3428
3427
typedef typename C3T3::Triangulation::Triangle Triangle;
3429
3428
3430
- typename GT::Construct_point_3 cp = tr_. geom_traits (). construct_point_3_object ( );
3429
+ auto cp = this -> construct_bare_point_object (tr_ );
3431
3430
3432
3431
// Get incident facets
3433
3432
Facet_vector facets;
@@ -3459,7 +3458,7 @@ get_least_square_surface_plane(const Vertex_handle& v,
3459
3458
if (ref_facet.first == Cell_handle ())
3460
3459
ref_facet = f;
3461
3460
3462
- const Triangle ct = tr_. get_incident_triangle (f, v);
3461
+ const Triangle ct = this -> get_incident_triangle (tr_, f, v);
3463
3462
triangles.push_back (ct);
3464
3463
}
3465
3464
}
@@ -3481,7 +3480,7 @@ get_least_square_surface_plane(const Vertex_handle& v,
3481
3480
3482
3481
// The surface center of a facet might have an offset in periodic triangulations
3483
3482
const Bare_point& ref_facet_scp = ref_facet.first ->get_facet_surface_center (ref_facet.second );
3484
- const Bare_point& ref_point = tr_. get_closest_point (cp (position), ref_facet_scp);
3483
+ const Bare_point& ref_point = this -> get_closest_point (tr_, cp (position), ref_facet_scp);
3485
3484
return std::make_pair (plane, ref_point);
3486
3485
}
3487
3486
@@ -3509,7 +3508,7 @@ project_on_surface_if_possible(const Vertex_handle& v,
3509
3508
// @todo should call below if it's available...
3510
3509
// return domain_.project_on_surface(p);
3511
3510
3512
- typename GT::Construct_point_3 cp = tr_. geom_traits (). construct_point_3_object ( );
3511
+ auto cp = this -> construct_bare_point_object (tr_ );
3513
3512
typename GT::Equal_3 equal = tr_.geom_traits ().equal_3_object ();
3514
3513
3515
3514
// Get plane
@@ -3904,7 +3903,7 @@ get_conflict_zone_after_move_topo_change(const Vertex_handle& new_vertex,
3904
3903
// `remove_cells_and_facets_from_c3t3()`
3905
3904
if (lt == Tr::VERTEX)
3906
3905
{
3907
- CGAL_assertion ((std::is_same< typename Tr::Periodic_tag, CGAL::Tag_true>::value) );
3906
+ CGAL_assertion (is_periodic_triangulation_v<Tr> );
3908
3907
tr_.incident_cells (cell->vertex (li), std::back_inserter (deleted_cells));
3909
3908
}
3910
3909
else
0 commit comments