Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] [HELP] about some advice related to the usage of the derived class of CGAL::Triangulation_vertex_base_3<GT>

Subject: CGAL users discussion list

List archive

[cgal-discuss] [HELP] about some advice related to the usage of the derived class of CGAL::Triangulation_vertex_base_3<GT>


Chronological Thread 
  • From: Kwok Jasper <>
  • To: <>
  • Subject: [cgal-discuss] [HELP] about some advice related to the usage of the derived class of CGAL::Triangulation_vertex_base_3<GT>
  • Date: Wed, 4 Feb 2009 22:03:47 +0800
  • Importance: Normal

Excuse me,
I have the class below

pedef CGAL::Vector_3<Rep_class> Vector;
typedef CGAL::Point_3<Rep_class> Point_3;

typedef CGAL::Object CGAL_object;


template < class GT, class Vb = CGAL::Triangulation_vertex_base_3<GT> >
class Vertex_base_for_ssr
  : public Vb
{
public:
  typedef typename Vb::Vertex_handle  Vertex_handle;
  typedef typename Vb::Cell_handle    Cell_handle;
  typedef typename Vb::Point          Point;

  template < class TDS2 >
  struct Rebind_TDS {
    typedef typename Vb::template Rebind_TDS<TDS2>::Other  Vb2;
    typedef Vertex_base_for_ssr<GT, Vb2>                        Other;
  };


  vector<Vertex_handle> neighbor_vertex_handle;

  Vertex_base_for_ssr() {}

  Vertex_base_for_ssr(const Point& p)
    : Vb(p) {}

  Vertex_base_for_ssr(const Point& p, Cell_handle c)
    : Vb(p, c) {}


  Point point()
  {
      return Vb::point();
  }

};

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;

//typedef CGAL::Cartesian<double> K;
typedef CGAL::Triangulation_data_structure_3<Vertex_base_for_ssr<K> > Tds;
typedef CGAL::Delaunay_triangulation_3<K, Tds> Delaunay_triangulation;

typedef Delaunay_triangulation::Vertex_handle Vertex_handle;
typedef Delaunay_triangulation::Point Point;


In the class Vertex_base_for_ssr, it has the member vector<Vertex_handle> neighbor_vertex_handle

I have first insert points into a Triangulation, then
for each vertex in the triangulation, I set its neighbor_vertex_handle to contain the vertex handle of the its neighbor points

However, after that, when I use the following code, it have exception


   Finite_vertices_iterator initial = Dt.finite_vertices_begin();
   Finite_vertices_iterator final = Dt.finite_vertices_end();
   Finite_vertices_iterator curr;

   vector<Vertex_handle>::iterator nv_itr;

for (curr = initial; curr != final; ++curr)
{
        for(nv_itr = (curr -> neighbor_vertex_handle).begin(); nv_itr != (curr -> neighbor_vertex_handle).end(); ++nv_itr)
        {
              Vector v = Vector(((*nv_itr) -> point()).x(), ((*nv_itr) -> point()).x(), ((*nv_itr) -> point()).x());
        }
}


May I ask if it is that I should not put the vector<Vertex_handle> neighbor_vertex_handle into the class Vertex_base_for_ssr??
Is it in the above code, I have declared and used the class  Vertex_base_for_ssr in a wrong way ??

Or the problem should related to some other parts of the C++ code that I have written?

May any one give me the direction about what I should do?

Thank you very much


Hotmail NOW! 沒有任何信箱比那會令您發熱發亮的來得吸引。



Archive powered by MHonArc 2.6.16.

Top of Page