mirror of https://github.com/CGAL/cgal
Added new functions point(Vertex_handle) and point(Face_handle, int)
This commit is contained in:
parent
e5eab9fe46
commit
21b841c9f4
|
|
@ -754,9 +754,9 @@ private:
|
||||||
{
|
{
|
||||||
Is_Delaunay_hyperbolic del;
|
Is_Delaunay_hyperbolic del;
|
||||||
int idx;
|
int idx;
|
||||||
bool flag = del(f->vertex(0)->point(),
|
bool flag = del(point(f,0),
|
||||||
f->vertex(1)->point(),
|
point(f,1),
|
||||||
f->vertex(2)->point(),
|
point(f,2),
|
||||||
idx);
|
idx);
|
||||||
|
|
||||||
Face_data fd;
|
Face_data fd;
|
||||||
|
|
@ -782,8 +782,8 @@ public:
|
||||||
|
|
||||||
Hyperbolic_segment hyperbolic_segment(const Face_handle f, const int i) const
|
Hyperbolic_segment hyperbolic_segment(const Face_handle f, const int i) const
|
||||||
{
|
{
|
||||||
return geom_traits().construct_hyperbolic_segment_2_object()(f->vertex(cw(i))->point(),
|
return geom_traits().construct_hyperbolic_segment_2_object()(point(f,cw(i)),
|
||||||
f->vertex(ccw(i))->point());
|
point(f,ccw(i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Hyperbolic_segment hyperbolic_segment(const Edge& e) const
|
Hyperbolic_segment hyperbolic_segment(const Edge& e) const
|
||||||
|
|
@ -818,9 +818,9 @@ public:
|
||||||
Hyperbolic_Voronoi_point dual(Face_handle f) const
|
Hyperbolic_Voronoi_point dual(Face_handle f) const
|
||||||
{
|
{
|
||||||
CGAL_triangulation_precondition(is_Delaunay_hyperbolic(f));
|
CGAL_triangulation_precondition(is_Delaunay_hyperbolic(f));
|
||||||
return geom_traits().construct_hyperbolic_circumcenter_2_object()(f->vertex(0)->point(),
|
return geom_traits().construct_hyperbolic_circumcenter_2_object()(point(f,0),
|
||||||
f->vertex(1)->point(),
|
point(f,1),
|
||||||
f->vertex(2)->point());
|
point(f,2));
|
||||||
}
|
}
|
||||||
|
|
||||||
Hyperbolic_segment dual(const Edge& e) const { return dual(e.first, e.second); }
|
Hyperbolic_segment dual(const Edge& e) const { return dual(e.first, e.second); }
|
||||||
|
|
@ -831,8 +831,8 @@ public:
|
||||||
|
|
||||||
if(dimension() == 1)
|
if(dimension() == 1)
|
||||||
{
|
{
|
||||||
const Point& p = f->vertex(cw(i))->point();
|
const Point& p = point(f,cw(i));
|
||||||
const Point& q = f->vertex(ccw(i))->point();
|
const Point& q = point(f,ccw(i));
|
||||||
|
|
||||||
// hyperbolic line
|
// hyperbolic line
|
||||||
Hyperbolic_segment line = geom_traits().construct_hyperbolic_bisector_2_object()(p, q);
|
Hyperbolic_segment line = geom_traits().construct_hyperbolic_bisector_2_object()(p, q);
|
||||||
|
|
@ -848,8 +848,8 @@ public:
|
||||||
// both faces are non_hyperbolic, but the incident edge is hyperbolic
|
// both faces are non_hyperbolic, but the incident edge is hyperbolic
|
||||||
if(!fhyp && !nhyp)
|
if(!fhyp && !nhyp)
|
||||||
{
|
{
|
||||||
const Point& p = f->vertex(ccw(i))->point();
|
const Point& p = point(f,ccw(i));
|
||||||
const Point& q = f->vertex(cw(i))->point();
|
const Point& q = point(f,cw(i));
|
||||||
|
|
||||||
// hyperbolic line
|
// hyperbolic line
|
||||||
Hyperbolic_segment line = geom_traits().construct_hyperbolic_bisector_2_object()(p, q);
|
Hyperbolic_segment line = geom_traits().construct_hyperbolic_bisector_2_object()(p, q);
|
||||||
|
|
@ -859,11 +859,11 @@ public:
|
||||||
// both faces are hyperbolic
|
// both faces are hyperbolic
|
||||||
if(fhyp && nhyp)
|
if(fhyp && nhyp)
|
||||||
{
|
{
|
||||||
const Point& p = f->vertex(ccw(i))->point();
|
const Point& p = point(f,ccw(i));
|
||||||
const Point& q = f->vertex(cw(i))->point();
|
const Point& q = point(f,cw(i));
|
||||||
|
|
||||||
Hyperbolic_segment s = geom_traits().construct_hyperbolic_bisector_2_object()(
|
Hyperbolic_segment s = geom_traits().construct_hyperbolic_bisector_2_object()(
|
||||||
p, q, f->vertex(i)->point(), n->vertex(in)->point());
|
p, q, point(f,i), point(n,in));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -876,16 +876,43 @@ public:
|
||||||
i = in;
|
i = in;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Point& p = hyp_face->vertex(ccw(i))->point();
|
const Point& p = point(hyp_face,ccw(i));
|
||||||
const Point& q = hyp_face->vertex(cw(i))->point();
|
const Point& q = point(hyp_face,cw(i));
|
||||||
|
|
||||||
Hyperbolic_segment ray = geom_traits().construct_hyperbolic_bisector_2_object()(
|
Hyperbolic_segment ray = geom_traits().construct_hyperbolic_bisector_2_object()(
|
||||||
p, q, hyp_face->vertex(i)->point());
|
p, q, point(hyp_face,i));
|
||||||
return ray;
|
return ray;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
const Point point(const Vertex_handle vh) const
|
||||||
|
{
|
||||||
|
return vh->point();
|
||||||
|
}
|
||||||
|
|
||||||
|
const Point point(const Face_handle fh, const int i) const
|
||||||
|
{
|
||||||
|
CGAL_triangulation_precondition(0 <= i);
|
||||||
|
CGAL_triangulation_precondition(i <= 2);
|
||||||
|
return fh->vertex(i)->point();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Point point(const Vertex_handle vh)
|
||||||
|
{
|
||||||
|
return vh->point();
|
||||||
|
}
|
||||||
|
|
||||||
|
Point point(const Face_handle fh, const int i)
|
||||||
|
{
|
||||||
|
CGAL_triangulation_precondition(0 <= i);
|
||||||
|
CGAL_triangulation_precondition(i <= 2);
|
||||||
|
return fh->vertex(i)->point();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool is_valid()
|
bool is_valid()
|
||||||
{
|
{
|
||||||
if (Base::is_valid())
|
if (Base::is_valid())
|
||||||
|
|
@ -949,9 +976,9 @@ public:
|
||||||
// This case corresponds to when the point is located on an Euclidean edge.
|
// This case corresponds to when the point is located on an Euclidean edge.
|
||||||
if(lt == EDGE)
|
if(lt == EDGE)
|
||||||
{
|
{
|
||||||
Point p = fh->vertex(0)->point();
|
Point p = point(fh, 0);
|
||||||
Point q = fh->vertex(1)->point();
|
Point q = point(fh, 1);
|
||||||
Point r = fh->vertex(2)->point();
|
Point r = point(fh, 2);
|
||||||
|
|
||||||
if(geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r))
|
if(geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r))
|
||||||
{
|
{
|
||||||
|
|
@ -969,9 +996,9 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p = fh->vertex(ccw(li))->point();
|
p = point(fh, ccw(li));
|
||||||
q = Base::mirror_vertex(fh, li)->point(); //fh->mirror_vertex(li)->point();
|
q = point(Base::mirror_vertex(fh, li));
|
||||||
r = fh->vertex(cw(li))->point();
|
r = point(fh, cw(li));
|
||||||
|
|
||||||
if(geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r))
|
if(geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r))
|
||||||
{
|
{
|
||||||
|
|
@ -993,9 +1020,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Here, the face has been located in the Euclidean face lh
|
// Here, the face has been located in the Euclidean face lh
|
||||||
const Point& p = fh->vertex(0)->point();
|
const Point& p = point(fh, 0);
|
||||||
const Point& q = fh->vertex(1)->point();
|
const Point& q = point(fh, 1);
|
||||||
const Point& r = fh->vertex(2)->point();
|
const Point& r = point(fh, 2);
|
||||||
if(!geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r))
|
if(!geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r))
|
||||||
{
|
{
|
||||||
lt = OUTSIDE_CONVEX_HULL;
|
lt = OUTSIDE_CONVEX_HULL;
|
||||||
|
|
@ -1014,13 +1041,13 @@ public:
|
||||||
// Here, the point lies in a face that is a neighbor to fh
|
// Here, the point lies in a face that is a neighbor to fh
|
||||||
for(int i = 0; i < 3; i++) {
|
for(int i = 0; i < 3; i++) {
|
||||||
Face_handle nfh = fh->neighbor(i);
|
Face_handle nfh = fh->neighbor(i);
|
||||||
if(geom_traits().is_Delaunay_hyperbolic_2_object()(nfh->vertex(0)->point(),
|
if(geom_traits().is_Delaunay_hyperbolic_2_object()(point(nfh,0),
|
||||||
nfh->vertex(1)->point(),
|
point(nfh,1),
|
||||||
nfh->vertex(2)->point()))
|
point(nfh,2)))
|
||||||
{
|
{
|
||||||
Oriented_side nside = side_of_hyperbolic_triangle(nfh->vertex(0)->point(),
|
Oriented_side nside = side_of_hyperbolic_triangle(point(nfh,0),
|
||||||
nfh->vertex(1)->point(),
|
point(nfh,1),
|
||||||
nfh->vertex(2)->point(),
|
point(nfh,2),
|
||||||
query, lt, li);
|
query, lt, li);
|
||||||
if(nside == ON_POSITIVE_SIDE) {
|
if(nside == ON_POSITIVE_SIDE) {
|
||||||
lt = FACE;
|
lt = FACE;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue