Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] mark edges with Unique_hash_map

Subject: CGAL users discussion list

List archive

[cgal-discuss] mark edges with Unique_hash_map


Chronological Thread 
  • From: Song Lin <>
  • To:
  • Subject: [cgal-discuss] mark edges with Unique_hash_map
  • Date: Thu, 22 Apr 2010 17:26:01 +0800

Hi,

I'm trying to mark the edges of an alpha shape using Unique_hash_map.
Part of my codes are:

typedef Alpha_shape_3::Edge Edge;
typedef CGAL::Unique_hash_map<Edge,int> UhmEdge2int; << this line is ok

list<Weighted_point> lwp;
Alpha_shape_3 as(lwp.begin(), lwp.end(), 0, Alpha_shape_3::GENERAL);

Alpha_shape_3::Finite_edges_iterator eit;
UhmEdge2int uhmedge2int;

for (eit = as.finite_edges_begin(); eit != as.finite_edges_end();eit++)
{
if(as.classify(*eit,0)==Alpha_shape_3::REGULAR)
{
uhmedge2int[eit]=1; << there is an error with this line.
error: no
match for ‘operator[]’ in ‘uhmedge2int[eit]’
}
}

I also tried "uhmedge2int[*eit]" and it doesn't work.

But I thought I'm using it as the same way like in the example 51.4.2.

In example 51.4.2: "Example with edges marked as non-removable" a class
was build like this:

class Constrains_map : public boost::put_get_helper<bool,Constrains_map>
{
public:

typedef boost::readable_property_map_tag category;
typedef bool value_type;
typedef bool reference;
typedef boost::graph_traits<Surface const>::edge_descriptor key_type;

Constrains_map() : mConstrains(false) {}

reference operator[](key_type const& e) const { return e->is_border() ||
is_constrained(e) ; }

void set_is_constrained ( key_type const& e, bool is ) {
mConstrains[e]=is; }

bool is_constrained( key_type const& e ) const { return
mConstrains.is_defined(e) ? mConstrains[e] : false ; }

private:

CGAL::Unique_hash_map<key_type,bool> mConstrains ;

};


Can anyone tell me what's wrong with my codes?

Best regards,

Lin

--
Center of Computational and Systems Biology,
Institute of Biophysics, CAS.
15 Datun Road, Chaoyang District
Beijing, 100101
P.R.China





Archive powered by MHonArc 2.6.16.

Top of Page