Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Access CGAL vertex(n).point() from face

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Access CGAL vertex(n).point() from face


Chronological Thread 
  • From: Sylvain Pion <>
  • To:
  • Subject: Re: [cgal-discuss] Access CGAL vertex(n).point() from face
  • Date: Wed, 23 Jul 2014 15:50:13 -0700

vertex() returns a Vertex_handle, not a Vertex.  So, you need to do vertex(0)->point() instead of vertex(0).point().


2014-07-23 15:29 GMT-07:00 chrism <>:
Hi,

I have subclassed Triangulation_face_base_2 in order to provide additional
funcitonality and wrap some of the CGAL calls.

template < class Gt, class Fb = CGAL::Triangulation_face_base_2<Gt> >
class face
: public Fb
{
public:
    typedef typename Fb::Vertex_handle Vertex_handle;
    typedef typename Fb::Face_handle Face_handle;

    template < typename TDS2 >
    struct Rebind_TDS
    {
        typedef typename Fb::template Rebind_TDS<TDS2>::Other Fb2;
        typedef face<Gt, Fb2> Other;
    };
...
}

I then use this is create a triangulation:

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_3 Point;

typedef CGAL::Projection_traits_xy_3<K> Gt; //allows for using 2D algorithms
on the 3D points
typedef ex_vertex<Gt> Vb; //custom vertex class
typedef face<Gt> Fb; //custom face class
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> Tds; //our data
structure that is using the custom classes
typedef CGAL::Delaunay_triangulation_2<Gt, Tds> Delaunay; //specify a
delauany triangulation

Within my 'face' class, I wish to do the following:

template < class Gt, class Fb>
double face<Gt, Fb>::get_x()
{
    return CGAL::circumcenter(
this->vertex(0).point(),this->vertex(1).point(),this->vertex(2).point()).x();
}

however, I end up with this compiler error:
 error: class
"CGAL::internal::CC_iterator<CGAL::Compact_container&lt;ex_vertex&lt;Gt,
CGAL::Triangulation_vertex_base_2&lt;Gt,
CGAL::Triangulation_ds_vertex_base_2&lt;CGAL::Triangulation_data_structure_2&lt;Vb,
Fb>>>>, CGAL::Default>, false>" has no member "point"

So, the question is: how do I access the 3 vertex's points from within my
face class?



--
View this message in context: http://cgal-discuss.949826.n4.nabble.com/Access-CGAL-vertex-n-point-from-face-tp4659597.html
Sent from the cgal-discuss mailing list archive at Nabble.com.

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss






Archive powered by MHonArc 2.6.18.

Top of Page