CGAL: Modify an extended DCEL fetched from a locate call

54 views Asked by At

I have an Arrangement_2 class, instantiated with a custom Arr_face_extended_dcel to map some data to each cell.

I'd like to find some cells with a locate invocation and change their associated data, but unfortunately locate returns an iterator to some Face_const_handles, so I can't invoke set_data(...) because that would break the constness.

So, my question: is there a way to efficiently change the data mapped to a face found with a locate without resorting to nasty const_casts?

1

There are 1 answers

0
Efi Fogel On BEST ANSWER

You have to use the overloaded member template functions non_const_handle() of the Arrangement_2 template class. There are 3 versions, which accept Vertex_const_handle, Halfedge_const_handle, and Face_const_handle, respectively; see the manual.

BW, const_cast<> will not work. because, for example, Vertex_const_handle and Vertex_handle are simply different types.