mirror of https://github.com/CGAL/cgal
try to make gcc 4.3 happy by direct reference to masked class
This commit is contained in:
parent
c428d0070d
commit
ee367b4b0e
|
|
@ -42,7 +42,7 @@ int run(int argc, char *argv[], int n, int d, int seed, std::string file) {
|
|||
|
||||
|
||||
if (file.empty()) {
|
||||
typename CGAL::Random rand(seed);
|
||||
typename CGAL::Random rand= CGAL::Random(seed);
|
||||
typename Traits::Active_points_2_table::Key lk;
|
||||
std::vector<typename Traits::Kinetic_kernel::Point_2> pts;
|
||||
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ public:
|
|||
/*!
|
||||
There is one notifaction type, TRIANGULATION.
|
||||
*/
|
||||
typedef Listener<Listener_core> Listener;
|
||||
typedef CGAL::Kinetic::Listener<Listener_core> Listener;
|
||||
|
||||
void write(std::ostream &out) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@
|
|||
|
||||
CGAL_KINETIC_BEGIN_NAMESPACE
|
||||
//! A class to track labels of edges of faces in a triangulation
|
||||
template <class SimulationTraits, class Cell_base= CGAL::Triangulation_cell_base_3<typename SimulationTraits::Instantaneous_kernel> >
|
||||
template <class SimulationTraits,
|
||||
class Cell_base= CGAL::Triangulation_cell_base_3<typename SimulationTraits::Instantaneous_kernel> >
|
||||
class Delaunay_triangulation_cell_base_3: public Cell_base
|
||||
{
|
||||
private:
|
||||
|
|
@ -38,19 +39,28 @@ public:
|
|||
typedef typename TDS::Vertex_handle Vertex_handle;
|
||||
typedef typename Cell_base::Geom_traits Traits;
|
||||
|
||||
void clear_elabels() {
|
||||
for (unsigned int i=0; i< 4; ++i) {
|
||||
elabels_[i]=false;
|
||||
}
|
||||
}
|
||||
|
||||
typedef typename SimulationTraits::Simulator::Event_key Edge_label;
|
||||
typedef Edge_label Facet_label;
|
||||
Delaunay_triangulation_cell_base_3(): Cell_base() {
|
||||
clear_elabels();
|
||||
}
|
||||
|
||||
Delaunay_triangulation_cell_base_3(Vertex_handle v0, Vertex_handle v1,
|
||||
Vertex_handle v2, Vertex_handle v3): Cell_base(v0, v1, v2, v3) {
|
||||
clear_elabels();
|
||||
}
|
||||
|
||||
Delaunay_triangulation_cell_base_3(Vertex_handle v0, Vertex_handle v1,
|
||||
Vertex_handle v2, Vertex_handle v3,
|
||||
Cell_handle f0, Cell_handle f1,
|
||||
Cell_handle f2, Cell_handle f3): Cell_base(v0,v1,v2, v3, f0,f1,f2, f3) {
|
||||
clear_elabels();
|
||||
}
|
||||
|
||||
template < typename TDS3 >
|
||||
|
|
@ -61,45 +71,93 @@ public:
|
|||
};
|
||||
|
||||
//! Set the label for edge i
|
||||
void set_edge_label(unsigned int i, unsigned int j, const Edge_label l) {
|
||||
elabels_[edge_index(i,j)]=l;
|
||||
void set_edge_certificate(unsigned int i, unsigned int j, const Edge_label l) {
|
||||
std::pair<int,int> lp= both_edge_indices(i,j);
|
||||
CGAL_precondition(flabels_[lp.first]== Facet_label() || elabels_[lp.first]);
|
||||
elabels_[lp.first]=true;
|
||||
flabels_[lp.first]=l;
|
||||
CGAL_precondition(flabels_[lp.second]== Facet_label() || elabels_[lp.second]);
|
||||
elabels_[lp.second]=true;
|
||||
flabels_[lp.second]=l;
|
||||
}
|
||||
|
||||
bool has_edge_certificate(unsigned int i, unsigned int j) const {
|
||||
std::pair<int,int> l= both_edge_indices(i,j);
|
||||
return elabels_[l.first] && elabels_.[l.second];
|
||||
}
|
||||
|
||||
|
||||
//! Get the label
|
||||
Edge_label edge_label(unsigned int i, unsigned int j) const
|
||||
{
|
||||
return elabels_[edge_index(i,j)];
|
||||
CGAL_precondition(has_edge_label(i,j));
|
||||
CGAL_precondition(elabels_[first_edge_index(i,j)]);
|
||||
CGAL_precondition(flabels_[first_edge_index(i,j) ]
|
||||
== flabels_[second_edge_index(i,j)]);
|
||||
return flabels_[first_edge_index(i,j)];
|
||||
}
|
||||
|
||||
//! Set the label for edge i
|
||||
void set_facet_label(unsigned int i, const Facet_label l) {
|
||||
CGAL_assertion(elabels_[i]== false || flabels_[i] == Edge_label());
|
||||
CGAL_assertion(i<4);
|
||||
flabels_[i]=l;
|
||||
elabels_[i]=false;
|
||||
}
|
||||
|
||||
//! Get the label
|
||||
Facet_label facet_label(unsigned int i) const
|
||||
{
|
||||
CGAL_assertion(elabels_[i]== false || flabels_[i] == Edge_label());
|
||||
CGAL_assertion(i<4);
|
||||
return flabels_[i];
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
int edge_index(unsigned int i, unsigned int j) const
|
||||
{
|
||||
CGAL_precondition(i<4);
|
||||
CGAL_precondition(j<4);
|
||||
CGAL_precondition(i!= j);
|
||||
//if (i <j) std::swap(i,j);
|
||||
unsigned int sum= i+j;
|
||||
if ((std::max)(i,j) != 3) --sum;
|
||||
CGAL_assertion( sum <6);
|
||||
return sum;
|
||||
/*
|
||||
need a hash which takes any tripple of faces to a
|
||||
|
||||
1: nope
|
||||
2: 0,1
|
||||
3: 0,2
|
||||
4: 0,3
|
||||
5: prime
|
||||
6: 1,2
|
||||
7: prime
|
||||
8: 1,3
|
||||
9: square
|
||||
10: nope
|
||||
11: prime
|
||||
12: 2,3
|
||||
*/
|
||||
|
||||
int first_edge_index(unsigned int i, unsigned int j) const {
|
||||
const static int lu0[]={-1,-1,0,0,0,-1,1,-1,1,-1,-1,-1,2};
|
||||
int r= lu0[(i+1)*(j+1)];
|
||||
CGAL_postcondition(r != -1);
|
||||
return r;
|
||||
}
|
||||
|
||||
Edge_label elabels_[6];
|
||||
int second_edge_index(unsigned int i, unsigned int j) const {
|
||||
const static int lu1[]={-1,-1,1,2,3,-1,2,-1,3,-1,-1,-1,3};
|
||||
int r= lu1[(i+1)*(j+1)];
|
||||
CGAL_postcondition(r != -1);
|
||||
return r;
|
||||
}
|
||||
std::pair<int,int> both_edge_indices(unsigned int i, unsigned int j) const {
|
||||
CGAL_precondition(i != j);
|
||||
int a= first_edge_index(i,j);
|
||||
int b= second_edge_index(i,j);
|
||||
CGAL_postcondition(a != -1);
|
||||
CGAL_postcondition(b != -1);
|
||||
CGAL_postcondition(a != b);
|
||||
return std::make_pair(a,b);
|
||||
}
|
||||
|
||||
//Edge_label elabels_[6];
|
||||
Facet_label flabels_[4];
|
||||
bool elabels_[4];
|
||||
};
|
||||
|
||||
template <class Tr, class Fb>
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ bool sort_test(Traits &tr, double max_events=std::numeric_limits<double>::infini
|
|||
{
|
||||
|
||||
std::string etag="WARNING: ";
|
||||
CGAL_exactness_assertion_code(bool fail=false);
|
||||
//CGAL_exactness_assertion_code(bool fail=false);
|
||||
CGAL_exactness_assertion_code(etag="ERROR: ");
|
||||
CGAL_exactness_assertion_code(fail=true);
|
||||
//CGAL_exactness_assertion_code(fail=true);
|
||||
//CGAL_exactness_assertion_code(bool test_compiled_with_exact_checks;);
|
||||
|
||||
typedef CGAL::Kinetic::Sort<Traits> Sort;
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ int main(int argc, char *argv[])
|
|||
degree= std::atoi(argv[2]);
|
||||
}
|
||||
|
||||
bool error;
|
||||
|
||||
std::cout << "Using " << num_points << " degree " << degree << " points."
|
||||
<< std::endl;
|
||||
//CGAL_KINETIC_SET_LOG_LEVEL(CGAL::Kinetic::LOG_SOME);
|
||||
|
|
@ -49,7 +47,7 @@ int main(int argc, char *argv[])
|
|||
tr.active_points_1_table_handle()));
|
||||
}
|
||||
|
||||
error= sort_test<Tr>(tr, 3000);
|
||||
bool error= sort_test<Tr>(tr, 3000);
|
||||
|
||||
|
||||
/*if (error || CGAL::Kinetic::internal::audit_failures__ != 0) {
|
||||
|
|
|
|||
|
|
@ -9,9 +9,11 @@ sired. Make the tables simply an event manager rather than owning the points (so
|
|||
- make sorting general- solve linking first
|
||||
- times can generate certificate func and solve. Queue checks if they are dirty (a point changed--when check? that is hard--maybe collapse to front of interval if need exact and is dirty) and reinserts them if they are. Points are ref counted pointers. With interval rep and way to generate exact. Then just insert notifications. Dirty is keept by generation count per point. Time is k ints, k points, inexact func, interval--broken-what if time moves up? Need linear scans.
|
||||
- Delaunay/Regular 3D does all sorts of extra walking around the mesh.
|
||||
- pull edge data into faces (since those must be empty and it is just as easy
|
||||
to walk around them)
|
||||
- resolve IK using sign_after. probably should be sign_at with a flag
|
||||
- pull edge data into faces (since those must be empty and it is just as easy
|
||||
to walk around them)-- this does not work trivially, perhaps not
|
||||
at all as there can be more than one edge certificate per cell, and they
|
||||
mostly collide
|
||||
|
||||
Easy:
|
||||
- pull static_pred/IP into kinetic pred to get result types right and things
|
||||
|
|
|
|||
Loading…
Reference in New Issue