can't add attribute to vertices

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

can't add attribute to vertices

Shi Yan
hello guys,

could you please show me an example of adding new attributes to the
vertex data structure.

i did this like this:

template < class Refs, class P >
struct My_vertex: public CGAL::HalfedgeDS_vertex_base<Refs,CGAL::Tag_true,P>
{
  bool isSplitted;
  My_vertex():CGAL::HalfedgeDS_vertex_base<Refs,CGAL::Tag_true,P>(),isSplitted(false)
  {};
};

struct My_items: public CGAL::Polyhedron_items_3
{
  template <class Refs, class Traits>
  struct Halfedge_wrapper
  {
    typedef My_edge<Refs> Halfedge;
  };

  template <class Refs, class Traits>
  struct Vertex_wrapper
  {
    typedef typename Traits::Point_3 Point;
    typedef My_vertex<Refs,Point> Vertex;
  };
};


but i won't compile giving the error under visual studio:

 Error 4 error C2664: 'My_vertex<Refs,P>::My_vertex(const
My_vertex<Refs,P> &)' : cannot convert parameter 1 from 'const
CGAL::Point_3<R_>' to 'const My_vertex<Refs,P> &' c:\program
files\cgal-3.3.1\include\cgal\polyhedron_3.h 106 CGAL


the problematic function is this      I_Polyhedron_vertex( const
Point_3& p) : VertexBase(p) {}     under the file polyhedron_3.h

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