Reputation: 3
I am implementing some code in CGAL. I made an arrangement. Now I want to add some data to every face in arrangement. So i access a face by below method. It return const handle. So i try to convert this to non_const_handle. But it show error that " cannot call member function without object."
const Face_const_handle* f;
if(f = boost::get<Face_const_handle>(&(it->second))){
Arrangement_2::Face_handle fh = Arrangement_2::non_const_handle(*f); // ERROR HERE
for(int i=1;i<convexPts.size();i++){
CGAL::Gmpq temp = CGAL::squared_distance(convexPts[0],convexPts[i]);
if(temp>max){
max = temp;
fh->set_data(max);
}
}
}
Upvotes: 0
Views: 83
Reputation: 1395
Vertex_handle arr.non_const_handle(Vertex_const_handle v)
Halfedge_handle arr.non_const_handle(Halfedge_const_handle e)
Face_handle non_arr.const_handle(Face_const_handle f)
See Arangement_2 template and look for "Casting Away Constness"
Upvotes: 1