0

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?

akappa
  • 10,220
  • 3
  • 39
  • 56

1 Answers1

1

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.

Efi Fogel
  • 730
  • 5
  • 11