mirror of https://github.com/CGAL/cgal
Changed the way we activate concurrency in Triangulation_3 + Code clean-up
This commit is contained in:
parent
c4859681e3
commit
eb2ed63d8b
|
|
@ -1289,8 +1289,7 @@ public:
|
|||
{
|
||||
// Lock the element area on the grid
|
||||
Element element = derivd.extract_element_from_container_value(ce);
|
||||
bool locked = triangulation().try_lock_element(element,
|
||||
FIRST_GRID_LOCK_RADIUS);
|
||||
bool locked = derivd.try_lock_element(element, FIRST_GRID_LOCK_RADIUS);
|
||||
|
||||
if( locked )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@
|
|||
|
||||
#include <CGAL/Mesh_3/Robust_intersection_traits_3.h>
|
||||
#include <CGAL/Polyhedral_mesh_domain_3.h>
|
||||
#include <CGAL/Polyhedral_mesh_domain_with_features_3.h>
|
||||
#ifdef CGAL_MESH_3_DEMO_ACTIVATE_SHARP_FEATURES_IN_POLYHEDRAL_DOMAIN
|
||||
# include <CGAL/Polyhedral_mesh_domain_with_features_3.h>
|
||||
#endif
|
||||
#include <CGAL/Labeled_image_mesh_domain_3.h>
|
||||
#include <CGAL/tags.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,14 +22,11 @@
|
|||
|
||||
#ifdef CGAL_LINKED_WITH_TBB
|
||||
|
||||
#include <CGAL/Mesh_3/Concurrent_mesher_config.h>
|
||||
|
||||
#include <CGAL/Bbox_3.h>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
#include <tbb/atomic.h>
|
||||
|
||||
#if TBB_IMPLEMENT_CPP0X
|
||||
# include <tbb/compat/thread>
|
||||
#else
|
||||
|
|
@ -44,7 +41,7 @@ namespace CGAL {
|
|||
namespace Mesh_3 {
|
||||
|
||||
//******************************************************************************
|
||||
// class Grid_locking_ds_base
|
||||
// class Grid_locking_ds_base_3
|
||||
// (Uses Curiously recurring template pattern)
|
||||
//******************************************************************************
|
||||
|
||||
|
|
@ -59,7 +56,7 @@ static bool *init_TLS_grid(int num_cells_per_axis)
|
|||
}
|
||||
|
||||
template <typename Derived>
|
||||
class Grid_locking_ds_base
|
||||
class Grid_locking_ds_base_3
|
||||
{
|
||||
|
||||
#ifdef CGAL_DEBUG_GLOBAL_LOCK_DS
|
||||
|
|
@ -67,17 +64,17 @@ class Grid_locking_ds_base
|
|||
// for debugging purpose...
|
||||
|
||||
private:
|
||||
static Grid_locking_ds_base<Derived>*& debug_global_lock_ds()
|
||||
static Grid_locking_ds_base_3<Derived>*& debug_global_lock_ds()
|
||||
{
|
||||
static Grid_locking_ds_base<Derived> *p_g_lock_ds = 0;
|
||||
static Grid_locking_ds_base_3<Derived> *p_g_lock_ds = 0;
|
||||
return p_g_lock_ds;
|
||||
}
|
||||
public:
|
||||
static Grid_locking_ds_base<Derived>* get_global_lock_ds()
|
||||
static Grid_locking_ds_base_3<Derived>* get_global_lock_ds()
|
||||
{
|
||||
return debug_global_lock_ds();
|
||||
}
|
||||
static void set_global_lock_ds(Grid_locking_ds_base<Derived> *ds)
|
||||
static void set_global_lock_ds(Grid_locking_ds_base_3<Derived> *ds)
|
||||
{
|
||||
debug_global_lock_ds() = ds;
|
||||
}
|
||||
|
|
@ -116,18 +113,7 @@ public:
|
|||
{
|
||||
return m_tls_grids.local()[get_grid_index(point)];
|
||||
}
|
||||
|
||||
template <typename Tetrahedra>
|
||||
bool is_tetrahedra_locked_by_this_thread(const Tetrahedra &tet)
|
||||
{
|
||||
bool locked = true;
|
||||
for (int iVertex = 0 ; locked && iVertex < 4 ; ++iVertex)
|
||||
{
|
||||
locked = is_locked_by_this_thread(tet.vertex(iVertex)->point());
|
||||
}
|
||||
return locked;
|
||||
}
|
||||
|
||||
|
||||
bool try_lock(int cell_index, bool no_spin = false)
|
||||
{
|
||||
return m_tls_grids.local()[cell_index]
|
||||
|
|
@ -290,7 +276,7 @@ public:
|
|||
protected:
|
||||
|
||||
// Constructor
|
||||
Grid_locking_ds_base(const Bbox_3 &bbox,
|
||||
Grid_locking_ds_base_3(const Bbox_3 &bbox,
|
||||
int num_grid_cells_per_axis)
|
||||
: m_num_grid_cells_per_axis(num_grid_cells_per_axis),
|
||||
m_tls_grids(boost::bind(init_TLS_grid, num_grid_cells_per_axis))
|
||||
|
|
@ -299,7 +285,7 @@ protected:
|
|||
}
|
||||
|
||||
/// Destructor
|
||||
virtual ~Grid_locking_ds_base()
|
||||
virtual ~Grid_locking_ds_base_3()
|
||||
{
|
||||
for( TLS_grid::iterator it_grid = m_tls_grids.begin() ;
|
||||
it_grid != m_tls_grids.end() ;
|
||||
|
|
@ -358,17 +344,17 @@ protected:
|
|||
|
||||
|
||||
//******************************************************************************
|
||||
// class Simple_grid_locking_ds
|
||||
// class Simple_grid_locking_ds_3
|
||||
//******************************************************************************
|
||||
|
||||
class Simple_grid_locking_ds
|
||||
: public Grid_locking_ds_base<Simple_grid_locking_ds>
|
||||
class Simple_grid_locking_ds_3
|
||||
: public Grid_locking_ds_base_3<Simple_grid_locking_ds_3>
|
||||
{
|
||||
public:
|
||||
typedef Grid_locking_ds_base<Simple_grid_locking_ds> Base;
|
||||
typedef Grid_locking_ds_base_3<Simple_grid_locking_ds_3> Base;
|
||||
|
||||
// Constructors
|
||||
Simple_grid_locking_ds(const Bbox_3 &bbox,
|
||||
Simple_grid_locking_ds_3(const Bbox_3 &bbox,
|
||||
int num_grid_cells_per_axis)
|
||||
: Base(bbox, num_grid_cells_per_axis)
|
||||
{
|
||||
|
|
@ -381,7 +367,7 @@ public:
|
|||
m_grid[i] = false;
|
||||
}
|
||||
|
||||
virtual ~Simple_grid_locking_ds()
|
||||
virtual ~Simple_grid_locking_ds_3()
|
||||
{
|
||||
delete [] m_grid;
|
||||
}
|
||||
|
|
@ -409,7 +395,7 @@ protected:
|
|||
|
||||
|
||||
//******************************************************************************
|
||||
// class Simple_grid_locking_ds_with_thread_ids
|
||||
// class Simple_grid_locking_ds_with_thread_ids_3
|
||||
//******************************************************************************
|
||||
|
||||
static unsigned int init_TLS_thread_ids()
|
||||
|
|
@ -420,15 +406,15 @@ static unsigned int init_TLS_thread_ids()
|
|||
return (1 + id%(std::numeric_limits<unsigned int>::max()));
|
||||
}
|
||||
|
||||
class Simple_grid_locking_ds_with_thread_ids
|
||||
: public Grid_locking_ds_base<Simple_grid_locking_ds_with_thread_ids>
|
||||
class Simple_grid_locking_ds_with_thread_ids_3
|
||||
: public Grid_locking_ds_base_3<Simple_grid_locking_ds_with_thread_ids_3>
|
||||
{
|
||||
public:
|
||||
typedef Grid_locking_ds_base<Simple_grid_locking_ds_with_thread_ids> Base;
|
||||
typedef Grid_locking_ds_base_3<Simple_grid_locking_ds_with_thread_ids_3> Base;
|
||||
|
||||
// Constructors
|
||||
|
||||
Simple_grid_locking_ds_with_thread_ids(const Bbox_3 &bbox,
|
||||
Simple_grid_locking_ds_with_thread_ids_3(const Bbox_3 &bbox,
|
||||
int num_grid_cells_per_axis)
|
||||
: Base(bbox, num_grid_cells_per_axis),
|
||||
m_tls_thread_ids(init_TLS_thread_ids)
|
||||
|
|
@ -442,7 +428,7 @@ public:
|
|||
}
|
||||
|
||||
/// Destructor
|
||||
virtual ~Simple_grid_locking_ds_with_thread_ids()
|
||||
virtual ~Simple_grid_locking_ds_with_thread_ids_3()
|
||||
{
|
||||
delete [] m_grid;
|
||||
}
|
||||
|
|
@ -508,17 +494,17 @@ protected:
|
|||
};
|
||||
|
||||
//******************************************************************************
|
||||
// class Simple_grid_locking_ds_with_mutex
|
||||
// class Simple_grid_locking_ds_with_mutex_3
|
||||
//******************************************************************************
|
||||
|
||||
class Simple_grid_locking_ds_with_mutex
|
||||
: public Grid_locking_ds_base<Simple_grid_locking_ds_with_mutex>
|
||||
class Simple_grid_locking_ds_with_mutex_3
|
||||
: public Grid_locking_ds_base_3<Simple_grid_locking_ds_with_mutex_3>
|
||||
{
|
||||
public:
|
||||
typedef Grid_locking_ds_base<Simple_grid_locking_ds_with_mutex> Base;
|
||||
typedef Grid_locking_ds_base_3<Simple_grid_locking_ds_with_mutex_3> Base;
|
||||
|
||||
// Constructors
|
||||
Simple_grid_locking_ds_with_mutex(const Bbox_3 &bbox,
|
||||
Simple_grid_locking_ds_with_mutex_3(const Bbox_3 &bbox,
|
||||
int num_grid_cells_per_axis)
|
||||
: Base(bbox, num_grid_cells_per_axis)
|
||||
{
|
||||
|
|
@ -528,7 +514,7 @@ public:
|
|||
}
|
||||
|
||||
/// Destructor
|
||||
virtual ~Simple_grid_locking_ds_with_mutex()
|
||||
virtual ~Simple_grid_locking_ds_with_mutex_3()
|
||||
{
|
||||
delete [] m_grid;
|
||||
}
|
||||
|
|
@ -557,9 +543,9 @@ protected:
|
|||
};
|
||||
|
||||
|
||||
//typedef Simple_grid_locking_ds LockDataStructureType;
|
||||
//typedef Simple_grid_locking_ds_with_mutex LockDataStructureType;
|
||||
typedef Simple_grid_locking_ds_with_thread_ids LockDataStructureType;
|
||||
//typedef Simple_grid_locking_ds_3 LockDataStructureType;
|
||||
//typedef Simple_grid_locking_ds_with_mutex_3 LockDataStructureType;
|
||||
typedef Simple_grid_locking_ds_with_thread_ids_3 LockDataStructureType;
|
||||
|
||||
} } //namespace CGAL::Mesh_3
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,11 @@
|
|||
#endif
|
||||
|
||||
#ifdef CGAL_LINKED_WITH_TBB
|
||||
# include <tbb/compat/thread>
|
||||
# if TBB_IMPLEMENT_CPP0X
|
||||
# include <tbb/compat/thread>
|
||||
# else
|
||||
# include <thread>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <boost/format.hpp>
|
||||
|
|
|
|||
|
|
@ -440,6 +440,11 @@ public:
|
|||
/// Handle cells contained in \c zone (before their destruction by insertion)
|
||||
void before_insertion_handle_cells_in_conflict_zone(Zone& zone);
|
||||
|
||||
bool try_lock_element(const Cell_handle &ch, int lock_radius = 0) const
|
||||
{
|
||||
return triangulation().try_lock_cell(ch, lock_radius);
|
||||
}
|
||||
|
||||
/// debug info: class name
|
||||
std::string debug_info_class_name_impl() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -565,6 +565,11 @@ public:
|
|||
|
||||
/// Restore restricted Delaunay ; may be call by Cells_mesher visitor
|
||||
void restore_restricted_Delaunay(const Vertex_handle& v);
|
||||
|
||||
bool try_lock_element(const Facet &f, int lock_radius = 0) const
|
||||
{
|
||||
return triangulation().try_lock_facet(f, lock_radius);
|
||||
}
|
||||
|
||||
/// debug info: class name
|
||||
std::string debug_info_class_name_impl() const
|
||||
|
|
|
|||
|
|
@ -679,9 +679,11 @@ private:
|
|||
// Timer
|
||||
double time_limit_;
|
||||
CGAL::Timer running_time_;
|
||||
|
||||
|
||||
#ifdef CGAL_LINKED_WITH_TBB
|
||||
// CJTOTO: change this for a better solution
|
||||
tbb::atomic<bool> m_lets_start_the_tasks;
|
||||
#endif
|
||||
|
||||
#ifdef CGAL_MESH_3_DEBUG_SLIVERS_EXUDER
|
||||
// -----------------------------------
|
||||
|
|
@ -772,8 +774,6 @@ Slivers_exuder<C3T3,Md,SC,V_,FT>::
|
|||
pump_vertices(double sliver_criterion_limit,
|
||||
Visitor& visitor)
|
||||
{
|
||||
m_lets_start_the_tasks = false;
|
||||
|
||||
#ifdef MESH_3_PROFILING
|
||||
WallClockTimer t;
|
||||
#endif
|
||||
|
|
@ -805,8 +805,9 @@ pump_vertices(double sliver_criterion_limit,
|
|||
// Parallel
|
||||
if (boost::is_base_of<Parallel_tag, Concurrency_tag>::value)
|
||||
{
|
||||
m_lets_start_the_tasks = false;
|
||||
this->create_root_task();
|
||||
|
||||
|
||||
while (!cells_queue_.empty())
|
||||
{
|
||||
typename Tet_priority_queue::Reverse_entry front = *(cells_queue_.front());
|
||||
|
|
@ -1133,7 +1134,7 @@ get_best_weight(const Vertex_handle& v, bool *p_could_lock_zone) const
|
|||
Facet link = pre_star.front()->second;
|
||||
const Cell_handle& opposite_cell = tr_.mirror_facet(link).first;
|
||||
// CJTODO: useless?
|
||||
if (p_could_lock_zone && !tr_.try_lock_element(opposite_cell))
|
||||
if (p_could_lock_zone && !tr_.try_lock_cell(opposite_cell))
|
||||
{
|
||||
*p_could_lock_zone = false;
|
||||
return 0.;
|
||||
|
|
@ -1404,7 +1405,7 @@ enqueue_task(Cell_handle ch, double value)
|
|||
if (ch->get_erase_counter() != erase_counter)
|
||||
break;
|
||||
|
||||
if (!tr_.try_lock_element(ch))
|
||||
if (!tr_.try_lock_cell(ch))
|
||||
{
|
||||
#ifdef CGAL_CONCURRENT_MESH_3_PROFILING
|
||||
bcounter.increment_branch_2(); // THIS is an early withdrawal!
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
#include <CGAL/Mesh_vertex_base_3.h>
|
||||
#include <CGAL/Mesh_cell_base_3.h>
|
||||
|
||||
#include <CGAL/Mesh_3/Locking_data_structures.h>
|
||||
|
||||
#ifdef CGAL_COMPACT_MESH_VERTEX_CELL
|
||||
#include <CGAL/Compact_mesh_vertex_base_3.h>
|
||||
#include <CGAL/Compact_mesh_cell_base_3.h>
|
||||
|
|
@ -123,7 +125,8 @@ private:
|
|||
|
||||
typedef Triangulation_data_structure_3<
|
||||
Vertex_base, Cell_base, true> Tds;
|
||||
typedef Regular_triangulation_3<Geom_traits, Tds, true> Triangulation;
|
||||
typedef Regular_triangulation_3<
|
||||
Geom_traits, Tds, Mesh_3::LockDataStructureType> Triangulation;
|
||||
|
||||
#else // !CGAL_LINKED_WITH_TBB
|
||||
|
||||
|
|
|
|||
|
|
@ -54,29 +54,30 @@ namespace CGAL {
|
|||
/************************************************
|
||||
*
|
||||
* Regular_triangulation_3 class
|
||||
* used_by_parallel_mesh_3: for parallel Mesh_3
|
||||
*
|
||||
************************************************/
|
||||
|
||||
template < class Gt, class Tds_ = Default, bool used_by_parallel_mesh_3 = false >
|
||||
template < class Gt, class Tds_ = Default, class Locking_data_structure = void >
|
||||
class Regular_triangulation_3
|
||||
: public Triangulation_3<
|
||||
Gt,
|
||||
typename Default::Get<Tds_, Triangulation_data_structure_3 <
|
||||
Triangulation_vertex_base_3<Gt>,
|
||||
Regular_triangulation_cell_base_3<Gt> > >::type,
|
||||
used_by_parallel_mesh_3>
|
||||
Locking_data_structure>
|
||||
{
|
||||
typedef Regular_triangulation_3<Gt, Tds_, used_by_parallel_mesh_3> Self;
|
||||
typedef Regular_triangulation_3<Gt, Tds_, Locking_data_structure> Self;
|
||||
|
||||
typedef typename Default::Get<Tds_, Triangulation_data_structure_3 <
|
||||
Triangulation_vertex_base_3<Gt>,
|
||||
Regular_triangulation_cell_base_3<Gt> > >::type Tds;
|
||||
|
||||
typedef Triangulation_3<Gt,Tds,used_by_parallel_mesh_3> Tr_Base;
|
||||
typedef Triangulation_3<Gt,Tds,Locking_data_structure> Tr_Base;
|
||||
|
||||
public:
|
||||
|
||||
static const bool Is_for_parallel_mesh_3 = used_by_parallel_mesh_3;
|
||||
static const bool Is_for_parallel_mesh_3 =
|
||||
!boost::is_same<Locking_data_structure, void>::value; // CJTODO: remove this Mesh_3 thing
|
||||
|
||||
typedef Tds Triangulation_data_structure;
|
||||
typedef Gt Geom_traits;
|
||||
|
|
@ -967,7 +968,7 @@ namespace CGAL {
|
|||
};
|
||||
#endif // CGAL_LINKED_WITH_TBB
|
||||
|
||||
Hidden_point_visitor<used_by_parallel_mesh_3> &get_hidden_point_visitor()
|
||||
Hidden_point_visitor<Is_for_parallel_mesh_3> &get_hidden_point_visitor() // CJTODO: remove this Mesh_3 thing
|
||||
{
|
||||
return hidden_point_visitor;
|
||||
}
|
||||
|
|
@ -978,13 +979,13 @@ namespace CGAL {
|
|||
template < class RegularTriangulation_3 >
|
||||
class Vertex_inserter;
|
||||
|
||||
Hidden_point_visitor<used_by_parallel_mesh_3> hidden_point_visitor;
|
||||
Hidden_point_visitor<Is_for_parallel_mesh_3> hidden_point_visitor; // CJTODO: remove this Mesh_3 thing
|
||||
};
|
||||
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
typename Regular_triangulation_3<Gt,Tds,Upm>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
template < class Gt, class Tds, class Lds >
|
||||
typename Regular_triangulation_3<Gt,Tds,Lds>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
nearest_power_vertex_in_cell(const Bare_point& p,
|
||||
Cell_handle c) const
|
||||
// Returns the finite vertex of the cell c with smaller
|
||||
|
|
@ -1003,9 +1004,9 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
typename Regular_triangulation_3<Gt,Tds,Upm>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
template < class Gt, class Tds, class Lds >
|
||||
typename Regular_triangulation_3<Gt,Tds,Lds>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
nearest_power_vertex(const Bare_point& p, Cell_handle start) const
|
||||
{
|
||||
if (number_of_vertices() == 0)
|
||||
|
|
@ -1047,9 +1048,9 @@ namespace CGAL {
|
|||
return nearest;
|
||||
}
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
typename Regular_triangulation_3<Gt,Tds,Upm>::Bare_point
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
template < class Gt, class Tds, class Lds >
|
||||
typename Regular_triangulation_3<Gt,Tds,Lds>::Bare_point
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
dual(Cell_handle c, bool force_exact) const
|
||||
{
|
||||
CGAL_triangulation_precondition(dimension()==3);
|
||||
|
|
@ -1061,9 +1062,9 @@ namespace CGAL {
|
|||
force_exact);
|
||||
}
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
typename Regular_triangulation_3<Gt,Tds,Upm>::Object
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
template < class Gt, class Tds, class Lds >
|
||||
typename Regular_triangulation_3<Gt,Tds,Lds>::Object
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
dual(Cell_handle c, int i, bool force_exact) const
|
||||
{
|
||||
CGAL_triangulation_precondition(dimension()>=2);
|
||||
|
|
@ -1106,9 +1107,9 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
Oriented_side
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
side_of_oriented_power_sphere(const Weighted_point &p0,
|
||||
const Weighted_point &p1,
|
||||
const Weighted_point &p2,
|
||||
|
|
@ -1155,9 +1156,9 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
Bounded_side
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
side_of_power_sphere(Cell_handle c, const Weighted_point &p,
|
||||
bool perturb) const
|
||||
{
|
||||
|
|
@ -1198,9 +1199,9 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
Bounded_side
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
side_of_bounded_power_circle(const Weighted_point &p0,
|
||||
const Weighted_point &p1,
|
||||
const Weighted_point &p2,
|
||||
|
|
@ -1217,9 +1218,9 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
Oriented_side
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
side_of_oriented_power_circle(const Weighted_point &p0,
|
||||
const Weighted_point &p1,
|
||||
const Weighted_point &p2,
|
||||
|
|
@ -1264,9 +1265,9 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
Bounded_side
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
side_of_power_circle(Cell_handle c, int i, const Weighted_point &p,
|
||||
bool perturb) const
|
||||
{
|
||||
|
|
@ -1334,9 +1335,9 @@ namespace CGAL {
|
|||
p, perturb);
|
||||
}
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
Bounded_side
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
side_of_bounded_power_segment(const Weighted_point &p0,
|
||||
const Weighted_point &p1,
|
||||
const Weighted_point &p, bool perturb) const
|
||||
|
|
@ -1361,9 +1362,9 @@ namespace CGAL {
|
|||
return ON_UNBOUNDED_SIDE;
|
||||
}
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
Bounded_side
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
side_of_power_segment(Cell_handle c, const Weighted_point &p,
|
||||
bool perturb) const
|
||||
{
|
||||
|
|
@ -1384,17 +1385,17 @@ namespace CGAL {
|
|||
p, perturb);
|
||||
}
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
bool
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
is_Gabriel(const Facet& f) const
|
||||
{
|
||||
return is_Gabriel(f.first, f.second);
|
||||
}
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
bool
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
is_Gabriel(Cell_handle c, int i) const
|
||||
{
|
||||
CGAL_triangulation_precondition(dimension() == 3 && !is_infinite(c,i));
|
||||
|
|
@ -1423,17 +1424,17 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
bool
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
is_Gabriel(const Edge& e) const
|
||||
{
|
||||
return is_Gabriel(e.first, e.second, e.third);
|
||||
}
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
bool
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
is_Gabriel(Cell_handle c, int i, int j) const
|
||||
{
|
||||
CGAL_triangulation_precondition(dimension() == 3 && !is_infinite(c,i,j));
|
||||
|
|
@ -1459,25 +1460,31 @@ namespace CGAL {
|
|||
return true;
|
||||
}
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
bool
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
is_Gabriel(Vertex_handle v) const
|
||||
{
|
||||
return nearest_power_vertex( v->point().point(), v->cell()) == v;
|
||||
}
|
||||
|
||||
// Returns
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
typename Regular_triangulation_3<Gt,Tds,Upm>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
template < class Gt, class Tds, class Lds >
|
||||
typename Regular_triangulation_3<Gt,Tds,Lds>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
insert(const Weighted_point & p, Cell_handle start)
|
||||
{
|
||||
Locate_type lt;
|
||||
int li, lj;
|
||||
|
||||
// Sequential
|
||||
if (boost::is_same<Lds, void>::value)
|
||||
{
|
||||
Cell_handle c = locate(p, lt, li, lj, start);
|
||||
return insert(p, lt, c, li, lj);
|
||||
}
|
||||
// Parallel
|
||||
if (Upm)
|
||||
else
|
||||
{
|
||||
bool could_lock_zone;
|
||||
Cell_handle c = locate(p, lt, li, lj, start, &could_lock_zone);
|
||||
|
|
@ -1486,17 +1493,11 @@ namespace CGAL {
|
|||
else
|
||||
return Vertex_handle();
|
||||
}
|
||||
// Sequential
|
||||
else
|
||||
{
|
||||
Cell_handle c = locate(p, lt, li, lj, start);
|
||||
return insert(p, lt, c, li, lj);
|
||||
}
|
||||
}
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
typename Regular_triangulation_3<Gt,Tds,Upm>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
template < class Gt, class Tds, class Lds >
|
||||
typename Regular_triangulation_3<Gt,Tds,Lds>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
insert(const Weighted_point & p, Locate_type lt, Cell_handle c, int li, int lj)
|
||||
{
|
||||
switch (dimension()) {
|
||||
|
|
@ -1522,10 +1523,10 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
template <class CellIt>
|
||||
typename Regular_triangulation_3<Gt,Tds,Upm>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
typename Regular_triangulation_3<Gt,Tds,Lds>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
insert_in_hole(const Weighted_point & p, CellIt cell_begin, CellIt cell_end,
|
||||
Cell_handle begin, int i)
|
||||
{
|
||||
|
|
@ -1543,10 +1544,10 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
template <class CellIt>
|
||||
typename Regular_triangulation_3<Gt,Tds,Upm>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
typename Regular_triangulation_3<Gt,Tds,Lds>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
insert_in_hole(const Weighted_point & p, CellIt cell_begin, CellIt cell_end,
|
||||
Cell_handle begin, int i, Vertex_handle newv)
|
||||
{
|
||||
|
|
@ -1563,9 +1564,9 @@ namespace CGAL {
|
|||
return v;
|
||||
}
|
||||
|
||||
template <class Gt, class Tds, bool Upm >
|
||||
template <class Gt, class Tds, class Lds >
|
||||
template <class RegularTriangulation_3>
|
||||
class Regular_triangulation_3<Gt, Tds, Upm>::Vertex_remover {
|
||||
class Regular_triangulation_3<Gt, Tds, Lds>::Vertex_remover {
|
||||
typedef RegularTriangulation_3 Regular;
|
||||
typedef typename Gt::Point_3 Point;
|
||||
public:
|
||||
|
|
@ -1603,9 +1604,9 @@ namespace CGAL {
|
|||
// on regular triangulation without hidden points at any time
|
||||
// the vertex inserter is used only
|
||||
// for the purpose of displacements
|
||||
template <class Gt, class Tds, bool Upm >
|
||||
template <class Gt, class Tds, class Lds >
|
||||
template <class RegularTriangulation_3>
|
||||
class Regular_triangulation_3<Gt, Tds, Upm>::Vertex_inserter {
|
||||
class Regular_triangulation_3<Gt, Tds, Lds>::Vertex_inserter {
|
||||
typedef RegularTriangulation_3 Regular;
|
||||
public:
|
||||
typedef Nullptr_t Hidden_points_iterator;
|
||||
|
|
@ -1632,9 +1633,9 @@ namespace CGAL {
|
|||
}
|
||||
};
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
void
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
remove(Vertex_handle v)
|
||||
{
|
||||
Cell_handle c;
|
||||
|
|
@ -1656,9 +1657,9 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
// Again, verbatim copy from Delaunay.
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
typename Regular_triangulation_3<Gt,Tds,Upm>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
template < class Gt, class Tds, class Lds >
|
||||
typename Regular_triangulation_3<Gt,Tds,Lds>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
move_point(Vertex_handle v, const Weighted_point & p)
|
||||
{
|
||||
CGAL_triangulation_precondition(! is_infinite(v));
|
||||
|
|
@ -1681,9 +1682,9 @@ namespace CGAL {
|
|||
|
||||
// Displacement works only for Regular triangulation
|
||||
// without hidden points at any time
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
typename Regular_triangulation_3<Gt,Tds,Upm>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
template < class Gt, class Tds, class Lds >
|
||||
typename Regular_triangulation_3<Gt,Tds,Lds>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
move_if_no_collision(Vertex_handle v, const Weighted_point &p)
|
||||
{
|
||||
Self tmp;
|
||||
|
|
@ -1695,9 +1696,9 @@ namespace CGAL {
|
|||
return res;
|
||||
}
|
||||
|
||||
template <class Gt, class Tds, bool Upm >
|
||||
typename Regular_triangulation_3<Gt,Tds,Upm>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
template <class Gt, class Tds, class Lds >
|
||||
typename Regular_triangulation_3<Gt,Tds,Lds>::Vertex_handle
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
move(Vertex_handle v, const Weighted_point &p) {
|
||||
CGAL_triangulation_precondition(!is_infinite(v));
|
||||
if(v->point() == p) return v;
|
||||
|
|
@ -1707,9 +1708,9 @@ namespace CGAL {
|
|||
return Tr_Base::move(v,p,remover,inserter);
|
||||
}
|
||||
|
||||
template < class Gt, class Tds, bool Upm >
|
||||
template < class Gt, class Tds, class Lds >
|
||||
bool
|
||||
Regular_triangulation_3<Gt,Tds,Upm>::
|
||||
Regular_triangulation_3<Gt,Tds,Lds>::
|
||||
is_valid(bool verbose, int level) const
|
||||
{
|
||||
if ( ! Tr_Base::is_valid(verbose,level) ) {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue