Subject: CGAL users discussion list
List archive
- From: Matthias Teich <>
- To:
- Subject: [cgal-discuss] Custom Vertex type in Polyhedron_3
- Date: Wed, 13 May 2009 14:04:55 +0200
Hi again!
I need your help once again :(
I am trying to store normals in the vertices of a polyhedron_3, so I have written the following Items class:
#include <CGAL/Polyhedron_3.h>
#include <CGAL/HalfedgeDS_vertex_base.h>
#include <CGAL/HalfedgeDS_halfedge_base.h>
#include <CGAL/HalfedgeDS_face_base.h>
struct MyPolyhedronItems{
template < class Refs, class Traits>
struct Vertex_wrapper{
typedef typename Traits::Vector_3 Normal;
typedef typename Traits::Point_3 Point;
typedef CGAL::HalfedgeDS_vertex_base< Refs, CGAL::Tag_true, Point> Vertex;
};
template < class Refs, class Traits>
struct Halfedge_wrapper {
typedef CGAL::HalfedgeDS_halfedge_base< Refs> Halfedge;
};
template < class Refs, class Traits>
struct Face_wrapper {
typedef typename Traits::Plane_3 Plane;
typedef CGAL::HalfedgeDS_face_base< Refs, CGAL::Tag_true, Plane> Face;
};
};
My Polyhedron is defined as
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Polyhedron_3<Kernel, MyPolyhedronItems> Polyhedron;
Everything seems to be fine, but I cant access the normals.
This is how I tried:
Vertex_iterator cv_it = polyhedron.vertices_begin();
Vector_3 n = cv_it->Normal;
Can anyone please tell me how to access them? It cannot be too hard I guess, but I dont get it.
Best regards,
Matthias
- [cgal-discuss] a question concerning the union of polygons, Dietrich Bollmann, 05/07/2009
- Re: [cgal-discuss] a question concerning the union of polygons, Ben Supnik, 05/07/2009
- Re: [cgal-discuss] a question concerning the union of polygons, Jens K. Becker, 05/12/2009
- Re: [cgal-discuss] a question concerning the union of polygons, efif, 05/13/2009
- [cgal-discuss] Custom Vertex type in Polyhedron_3, Matthias Teich, 05/13/2009
- Re: [cgal-discuss] a question concerning the union of polygons, efif, 05/13/2009
- Re: [cgal-discuss] a question concerning the union of polygons, Dietrich Bollmann, 05/24/2009
- Re: [cgal-discuss] a question concerning the union of polygons, Jens K. Becker, 05/12/2009
- Re: [cgal-discuss] a question concerning the union of polygons, Ben Supnik, 05/07/2009
Archive powered by MHonArc 2.6.16.