mirror of https://github.com/CGAL/cgal
changed mirror_index, mirror_vertex in Triangulation_ds_face_2.h
and calls to index(Face_handle ) in Triangulation_data_structure_2.h to fit the needs of the extended triangulatin data structure of additively weighted Voronoi diagram
This commit is contained in:
parent
537186c86c
commit
a6735191ba
|
|
@ -1,6 +1,12 @@
|
|||
Package triangulation: provides triangulations Delaunay triangulations,
|
||||
constrained and regular triangulations with tests and examples.
|
||||
|
||||
Ver 6.02 ()
|
||||
- changed mirror_index() amd mirror_vertex() in Triangulation_ds_face_2
|
||||
and all the calls to f->index(Face_handle) in Triangulation_data_structure_2
|
||||
to fit the needs of the extended triangulatin data structure of
|
||||
additively weighted Voronoi diagram
|
||||
|
||||
Ver 6.01 (21/1/02)
|
||||
- major change in Triangulation package :
|
||||
-suppression of Triangulation_face_2 and Triangulation_vertex_2 classes
|
||||
|
|
|
|||
|
|
@ -563,18 +563,17 @@ flip(Face_handle f, int i)
|
|||
{
|
||||
CGAL_triangulation_precondition( dimension()==2);
|
||||
Face_handle n = f->neighbor(i);
|
||||
int ni = n->index(f);
|
||||
int ni = f->mirror_index(i); //ni = n->index(f);
|
||||
|
||||
Vertex_handle v_cw = f->vertex(cw(i));
|
||||
Vertex_handle v_ccw = f->vertex(ccw(i));
|
||||
|
||||
// bl == bottom left, tr == top right
|
||||
Face_handle tr = f->neighbor(ccw(i));
|
||||
int tri = f->mirror_index(ccw(i)); //tri = tr->index(f);
|
||||
Face_handle bl = n->neighbor(ccw(ni));
|
||||
int bli, tri;
|
||||
bli = bl->index(n);
|
||||
tri = tr->index(f);
|
||||
|
||||
int bli = n->mirror_index(ccw(ni)); //bli = bl->index(n);
|
||||
|
||||
f->set_vertex(cw(i), n->vertex(ni));
|
||||
n->set_vertex(cw(ni), f->vertex(i));
|
||||
|
||||
|
|
@ -641,11 +640,11 @@ insert_in_face(Face_handle f)
|
|||
f1->set_neighbor(2, f2);
|
||||
f2->set_neighbor(1, f1);
|
||||
if (n1 != NULL) {
|
||||
int i1 = n1->index(f);
|
||||
int i1 = f->mirror_index(1); //int i1 = n1->index(f);
|
||||
n1->set_neighbor(i1,f1);
|
||||
}
|
||||
if (n2 != NULL) {
|
||||
int i2 = n2->index(f);
|
||||
int i2 = f->mirror_index(2);//int i2 = n2->index(f);
|
||||
n2->set_neighbor(i2,f2);}
|
||||
|
||||
f->set_vertex(0, v);
|
||||
|
|
@ -684,7 +683,7 @@ insert_in_edge(Face_handle f, int i)
|
|||
|
||||
else { //dimension() ==2
|
||||
Face_handle n = f->neighbor(i);
|
||||
int in = n->index(f);
|
||||
int in = f->mirror_index(i); //n->index(f);
|
||||
v = insert_in_face(f);
|
||||
flip(n,in);
|
||||
}
|
||||
|
|
@ -779,8 +778,8 @@ insert_dim_up(Vertex_handle w, bool orient)
|
|||
int j ;
|
||||
if (f->vertex(0) == w) {j=0;}
|
||||
else {j=1;}
|
||||
f1= f->neighbor(i); i1= f1->index(f);
|
||||
f2= f->neighbor(j); i2 = f2->index(f);
|
||||
f1= f->neighbor(i); i1= f->mirror_index(i); //f1->index(f);
|
||||
f2= f->neighbor(j); i2= f->mirror_index(j); //f2->index(f);
|
||||
f1->set_neighbor(i1,f2);
|
||||
f2->set_neighbor(i2,f1);
|
||||
delete_face(f);
|
||||
|
|
@ -811,17 +810,17 @@ remove_degree_3(Vertex_handle v, Face_handle f)
|
|||
|
||||
int i = f->index(v);
|
||||
Face_handle left = f->neighbor(cw(i));
|
||||
int li = f->mirror_index(cw(i)); //left->index(f);
|
||||
Face_handle right = f->neighbor(ccw(i));
|
||||
int ri = f->mirror_index(ccw(i)); //right->index(f);
|
||||
|
||||
Face_handle ll, rr;
|
||||
|
||||
int li = left->index(f);
|
||||
int ri = right->index(f);
|
||||
Vertex_handle q = left->vertex(li);
|
||||
CGAL_triangulation_assertion( left->vertex(li) == right->vertex(ri));
|
||||
|
||||
ll = left->neighbor(cw(li));
|
||||
if(ll != NULL) {
|
||||
int lli = ll->index(left);
|
||||
int lli = left->mirror_index(cw(li)); //ll->index(left);
|
||||
ll->set_neighbor(lli, f);
|
||||
}
|
||||
f->set_neighbor(cw(i), ll);
|
||||
|
|
@ -829,7 +828,7 @@ remove_degree_3(Vertex_handle v, Face_handle f)
|
|||
|
||||
rr = right->neighbor(ccw(ri));
|
||||
if(rr != NULL) {
|
||||
int rri = rr->index(right);
|
||||
int rri = right->mirror_index(ccw(ri)); //rr->index(right);
|
||||
rr->set_neighbor(rri, f);
|
||||
}
|
||||
f->set_neighbor(ccw(i), rr);
|
||||
|
|
@ -998,7 +997,7 @@ make_hole(Vertex_handle v, List_edges& hole)
|
|||
f = &(*fc);
|
||||
i = f->index(v);
|
||||
fn = f->neighbor(i);
|
||||
in = fn->index(f);
|
||||
in = f->mirror_index(i); //fn->index(f);
|
||||
vv = f->vertex(cw(i));
|
||||
if( vv->face()== f) vv->set_face(fn);
|
||||
vv = fc->vertex(ccw(i));
|
||||
|
|
|
|||
|
|
@ -135,7 +135,8 @@ Triangulation_ds_face_2<Tds>::
|
|||
mirror_vertex(int i) const
|
||||
{
|
||||
CGAL_triangulation_precondition ( &*neighbor(i) != NULL);
|
||||
return neighbor(i)->vertex(neighbor(i)->index(this->handle()));
|
||||
//return neighbor(i)->vertex(neighbor(i)->index(this->handle()));
|
||||
return neighbor(i)->vertex(mirror_index(i));
|
||||
}
|
||||
|
||||
template < class Tds >
|
||||
|
|
@ -144,7 +145,8 @@ Triangulation_ds_face_2<Tds>::
|
|||
mirror_index(int i) const
|
||||
{
|
||||
CGAL_triangulation_precondition (neighbor(i) != NULL);
|
||||
return neighbor(i)->index(this->handle());
|
||||
//return neighbor(i)->index(this->handle());
|
||||
return ccw( neighbor(i)->index(vertex(ccw(i))));
|
||||
}
|
||||
|
||||
template < class Tds >
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ clean:
|
|||
test_triangulation_geom_traits \
|
||||
test_triangulation_2 \
|
||||
test_triangulation_tds \
|
||||
test_triangulation_2_bis
|
||||
test_triangulation_2_bis \
|
||||
core \
|
||||
T??.triangulation file_tds?
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,10 @@ LDFLAGS = $(TESTSUITE_LDFLAGS) \
|
|||
#---------------------------------------------------------------------#
|
||||
# target entries
|
||||
#---------------------------------------------------------------------#
|
||||
|
||||
all: \
|
||||
test_delaunay_triangulation_2 \
|
||||
test_regular_triangulation_2 \
|
||||
test_delaunay_hierarchy_2
|
||||
|
||||
test_delaunay_triangulation_2: test_delaunay_triangulation_2.o
|
||||
$(CGAL_CXX) -o test_delaunay_triangulation_2 test_delaunay_triangulation_2.o $(LDFLAGS)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#---------------------------------------------------------------------#
|
||||
# Choose the right include file from the <cgalroot>/make directory.
|
||||
|
||||
CGAL_MAKEFILE = /0/prisme_util/CGAL/CGAL-I/make/makefile_i686_Linux-2.2.18_g++-2.95.3_LEDA
|
||||
CGAL_MAKEFILE = /0/prisme_util/CGAL/CGAL-I/make/makefile_i686_Linux-2.2.18_g++-2.95_LEDA
|
||||
include $(CGAL_MAKEFILE)
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
|
|
@ -14,6 +14,7 @@ include $(CGAL_MAKEFILE)
|
|||
#---------------------------------------------------------------------#
|
||||
|
||||
CXXFLAGS = \
|
||||
-I../../include \
|
||||
$(TESTSUITE_CXXFLAGS) \
|
||||
$(EXTRA_FLAGS) \
|
||||
$(CGAL_CXXFLAGS) \
|
||||
|
|
|
|||
|
|
@ -22,12 +22,10 @@ public:
|
|||
typedef typename Gt::Point_2 Point;
|
||||
typedef Triangulation_vertex_base_2<Gt> Vertex_base;
|
||||
|
||||
typedef typename Ref::Face Tds_Face;
|
||||
typedef typename Ref::Vertex Tds_Vertex;
|
||||
typedef Triangulation_face_2<Gt,Ref> Face;
|
||||
typedef Triangulation_vertex_2<Gt,Ref> Vertex;
|
||||
typedef Triangulation_face_handle_2<Gt,Ref> Face_handle;
|
||||
typedef Triangulation_vertex_handle_2<Gt,Ref> Vertex_handle;
|
||||
typedef typename Ref::Face Face;
|
||||
typedef typename Ref::Vertex Vertex;
|
||||
typedef typename Ref::Face_handle Face_handle;
|
||||
typedef typename Ref::Vertex_handle Vertex_handle;
|
||||
|
||||
My_vertex() : Vertex_base (){}
|
||||
|
||||
|
|
@ -55,13 +53,11 @@ class My_face : public Triangulation_face_base_2<Gt>
|
|||
public:
|
||||
typedef Triangulation_face_base_2<Gt> Face_base;
|
||||
|
||||
typedef typename Ref::Face Tds_Face;
|
||||
typedef typename Ref::Vertex Tds_Vertex;
|
||||
typedef Triangulation_face_2<Gt,Ref> Face;
|
||||
typedef Triangulation_vertex_2<Gt,Ref> Vertex;
|
||||
typedef Triangulation_face_handle_2<Gt,Ref> Face_handle;
|
||||
typedef Triangulation_vertex_handle_2<Gt,Ref> Vertex_handle;
|
||||
|
||||
typedef typename Ref::Face Face;
|
||||
typedef typename Ref::Vertex Vertex;
|
||||
typedef typename Ref::Face_handle Face_handle;
|
||||
typedef typename Ref::Vertex_handle Vertex_handle;
|
||||
|
||||
My_face() : Face_base (){}
|
||||
|
||||
My_face (void* v0, void* v1, void* v2) : Face_base (v0, v1, v2){}
|
||||
|
|
@ -90,12 +86,8 @@ private:
|
|||
// has to rewrite this class
|
||||
template <class Gt>
|
||||
class My_TDS:
|
||||
public Triangulation_default_data_structure_2 <
|
||||
Gt ,
|
||||
My_vertex <Gt, My_TDS<Gt> > ,
|
||||
My_face <Gt, My_TDS<Gt> >
|
||||
>
|
||||
|
||||
public Triangulation_data_structure_2 < My_vertex <Gt, My_TDS<Gt> > ,
|
||||
My_face <Gt, My_TDS<Gt> > >
|
||||
{
|
||||
public: // CREATION
|
||||
My_TDS() {}
|
||||
|
|
|
|||
|
|
@ -87,8 +87,7 @@ private:
|
|||
|
||||
template <class Gt>
|
||||
class My_TDS:
|
||||
public Triangulation_default_data_structure_2 <
|
||||
Gt ,
|
||||
public Triangulation_data_structure_2 <
|
||||
My_vertex <Gt, Triangulation_2<Gt, My_TDS<Gt> > > ,
|
||||
My_face <Gt, Triangulation_2<Gt, My_TDS<Gt> > >
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in New Issue