Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Trying to add info to a vertex in a segment Delaunay graph fails compilation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Trying to add info to a vertex in a segment Delaunay graph fails compilation


Chronological Thread 
  • From: Zohar Levi <>
  • To:
  • Subject: Re: [cgal-discuss] Trying to add info to a vertex in a segment Delaunay graph fails compilation
  • Date: Fri, 28 Aug 2009 20:16:36 -0700 (PDT)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=qQikGkrbcXQyzo2v8nYXSMAXWp2bVjksCid2Xl/8iZEaRLhCBF8mEvrEbrPOtcnxN7lW1N5otVoukvyBJEqvuZ6uDliZ1ogeX3SBzIEo5g48N7ouNVyu0d2X0C59+T3ajnAsIFnrwRWIlkKqdkd8fSpR8Z69oc8OjRwbh6ciDK8=;


I didn't follow everything but it seems too complicated if you just wanted to add data to a vertex. You don't need to derive anything. I did something similar:

typedef CGAL::Triangulation_vertex_base_with_info_2<int, Kernel> Vb;
typedef CGAL::Triangulation_face_base_2<Kernel> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds;

typedef CGAL::Delaunay_triangulation_2<Kernel, Tds> DT;
typedef CGAL::Delaunay_triangulation_adaptation_traits_2<DT> AT;
typedef CGAL::Delaunay_triangulation_caching_degeneracy_removal_policy_2<DT> AP;
typedef CGAL::Voronoi_diagram_2<DT, AT, AP> VD;

----

Maybe you should try first, just to use cgal basic vertex class with info, and just add an integer. If it works, in the worst case you could hold a pointer to your data there.




From: "" <>
To:
Sent: Friday, August 28, 2009 4:52:00 PM
Subject: [cgal-discuss] Trying to add info to a vertex in a segment Delaunay graph fails compilation


Hello,

I am trying to add information to a vertex in a SDG. For that matter, I took
some code from the SDG demo and tryed to incorporate it, but obviously I am
doing something wrong, because it doesn't compile. The code is:

template < class Vbb, class Info_ >
class Segment_Delaunay_graph_vertex_base_with_info_2
  : public Vbb
{
public:
  // TYPES
  //------
  typedef Vbb                                      Base;
  typedef Info_                                    Info;

  typedef typename Base::Storage_traits            Storage_traits;
  typedef typename Base::Geom_traits              Geom_traits;
  typedef typename Base::Site_2                    Site_2;
  typedef typename Base::Storage_site_2            Storage_site_2;
  typedef typename Base::Data_structure            Data_structure;

  typedef typename Data_structure::Face_handle    Face_handle;
  typedef typename Data_structure::Vertex_handle  Vertex_handle;


  template < typename DS2 >
  struct Rebind_TDS {
    typedef typename Vbb::template Rebind_TDS<DS2>::Other            Vb2;
    typedef Segment_Delaunay_graph_vertex_base_with_info_2<Vb2,Info> Other;
  };


  Segment_Delaunay_graph_vertex_base_with_info_2 () : Vbb(), info_() {}

  Segment_Delaunay_graph_vertex_base_with_info_2(const Storage_site_2& ss,
                        Face_handle f)
    : Vbb(ss, f), info_()  {}

  void set_info(const Info& info) { info_ = info; }
  const Info& info() const { return info_; }

private:
  Info info_;
};

struct SiteInfo{
    Number v;
    SiteInfo(){}
};

typedef CGAL::Segment_Delaunay_graph_traits_without_intersections_2<Kernel>
SDGTraits;
typedef CGAL::Segment_Delaunay_graph_storage_traits_2<SDGTraits>               
ST;
typedef CGAL::Segment_Delaunay_graph_vertex_base_2<ST>                    Vb;
typedef CGAL::Segment_Delaunay_graph_vertex_base_with_info_2<Vb,SiteInfo>        Vbi;
typedef CGAL::Triangulation_face_base_2<SDGTraits>                                Fb;
typedef CGAL::Triangulation_data_structure_2<Vbi,Fb>                            DS;
typedef CGAL::Segment_Delaunay_graph_2<ST,DS>                            SDG;
typedef SDG::Site_2                                                                SDGSite;
typedef
CGAL::Segment_Delaunay_graph_degeneracy_removal_policy_2<SDG>            SDGPolicy;
typedef
CGAL::Segment_Delaunay_graph_adaptation_traits_2<SDG>                    SDGAdaptTraits;
typedef CGAL::Voronoi_diagram_2<SDG,SDGAdaptTraits,SDGPolicy>                    VD; 


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




Archive powered by MHonArc 2.6.16.

Top of Page