HEKTO
HEKTO

Reputation: 4191

CGAL: Using the type `Mark` while exploring a plane map

The CGAL online documentation about CGAL::Nef_polyhedron_2<T>::Topological_explorer (please see here) mentions a type Mark and a number of functions, which return a value of this type:

const Mark &    mark (Vertex_const_handle v)
    returns the mark of v.

const Mark &    mark (Halfedge_const_handle e)
    returns the mark of e.

const Mark &    mark (Face_const_handle f)
    returns the mark of f.

The documentation says: "Plane maps are attributed, for each object we attribute an information mark(u) of type Mark. Mark fits the concepts assignable, default-constructible, and equal-comparable."

What's the idea behind this type and values? How am I supposed to use them?

Upvotes: 1

Views: 41

Answers (1)

gdamiand
gdamiand

Reputation: 681

When you want to explore a plane map, you need to traverse elements (halfedges and/or vertices and/or faces). You can for example use a depth search first algorithm as for graph traversal.

During such traversal, it is often necessary to test if an element is already discovered of not. This can be achieved thanks to a Boolean mark which is set to true when an element is discovered.

By default in Nef_2, Mark is a bool, but this can be changed thanks to an undocumented template parameter (see here). For example you can use an int if you want to store the time where an element is discovered.

See also this example.

Upvotes: 1

Related Questions