CGAL 5.1.1 - Surface Mesh Topology
|
#include <CGAL/Path_on_surface.h>
The class Path_on_surface
represents a walk in a mesh which is either a model of CombinatorialMap
, a model of GeneralizedMap
or a model of a FaceGraph
.
Each object of this class is constructed from an external mesh on which the path should lie. A path is represented as a sequence of darts or halfedges, each one representing an oriented edge in the path. The class Path_on_surface
behaves as a container for this sequence of darts/halfedges. Elements are added in the path one at a time to the path thanks to the push_back()
method.
Mesh | a model of CombinatorialMap , GeneralizedMap or of FaceGraph |
Public Types | |
typedef unspecified_type | halfedge_descriptor |
A handle to Dart for combinatorial/generalized maps, or a halfedge descriptor for models of the FaceGraph concept. | |
Public Member Functions | |
Path_on_surface (const Mesh &amesh) | |
creates an empty path object which lies on amesh . | |
bool | is_empty () const |
returns true iff this path is empty | |
bool | is_closed () const |
returns true iff this path is closed. | |
bool | is_simple () const |
returns true iff this path does not pass twice through a same edge or a same vertex. | |
std::size_t | length () const |
returns the length of the path, i.e. its number of edges. | |
halfedge_descriptor | operator[] (std::size_t i) const |
returns the ith dart of the path. More... | |
void | clear () |
clears this path. | |
bool | can_be_pushed (halfedge_descriptor hd, bool flip=false) const |
returns true iff hd can be added at the end of this path. If flip is true, the direction of hd is reversed before checking | |
void | push_back (halfedge_descriptor hd, bool flip=false) |
adds hd at the end of this path. More... | |
bool | can_be_pushed_by_index (std::size_t i) const |
returns true iff the dart/halfedge with index i can be added at the end of this path. More... | |
void | push_back_by_index (std::size_t i) |
adds the dart/halfedge with index i at the end of this path. More... | |
void | push_back_by_index (std::initializer_list< std::size_t > l) |
adds successively all dart/halfedges in l (a sequence of indices), at the end of the path. More... | |
void | extend_positive_turn (std::size_t nb) |
adds the dart/halfedge obtained by turning nb times around the target vertex of the last dart/halfedge in this path, in the positive circular order. More... | |
void | extend_negative_turn (std::size_t nb) |
adds the dart/halfedge obtained by turning nb times around the target vertex of the last dart/halfedge in this path, in the negative circular order. More... | |
bool | can_be_pushed_by_label (const std::string &l) const |
returns true iff the dart/halfedge with label l can be added at the end of this path. More... | |
void | push_back_by_label (const std::string &s) |
adds successively all darts/halfedges in s (a sequence of labels separated by spaces) at the end of this path. More... | |
Self & | operator+= (const Self &other) |
concatenates other to this path. More... | |
void | reverse () |
reverses this path (i.e. negates its orientation). | |
void | generate_random_path (std::size_t length, Random &random=get_default_random()) |
creates a random open path with length darts/halfedges. | |
void | generate_random_closed_path (std::size_t length, Random &random=get_default_random()) |
creates a random closed path with at least length darts/halfedges. | |
bool CGAL::Surface_mesh_topology::Path_on_surface< Mesh >::can_be_pushed_by_index | ( | std::size_t | i | ) | const |
returns true
iff the dart/halfedge with index i
can be added at the end of this path.
If Mesh is a Polyhedron_3
, takes time proportional to the number of darts/halfedges.
bool CGAL::Surface_mesh_topology::Path_on_surface< Mesh >::can_be_pushed_by_label | ( | const std::string & | l | ) | const |
returns true
iff the dart/halfedge with label l
can be added at the end of this path.
PolygonalSchema
concept. void CGAL::Surface_mesh_topology::Path_on_surface< Mesh >::extend_negative_turn | ( | std::size_t | nb | ) |
adds the dart/halfedge obtained by turning nb
times around the target vertex of the last dart/halfedge in this path, in the negative circular order.
To extend with a negative 1 turn thus amounts to extend with the composite pointer: opposite(prev(opposite()))
.
is_empty()
void CGAL::Surface_mesh_topology::Path_on_surface< Mesh >::extend_positive_turn | ( | std::size_t | nb | ) |
adds the dart/halfedge obtained by turning nb
times around the target vertex of the last dart/halfedge in this path, in the positive circular order.
To extend with a positive 1 turn thus amounts to extend with the next()
pointer. (A zero turn corresponds to the opposite()
pointer.)
is_empty()
Self& CGAL::Surface_mesh_topology::Path_on_surface< Mesh >::operator+= | ( | const Self & | other | ) |
concatenates other
to this path.
other
. halfedge_descriptor CGAL::Surface_mesh_topology::Path_on_surface< Mesh >::operator[] | ( | std::size_t | i | ) | const |
returns the ith dart of the path.
length()
. void CGAL::Surface_mesh_topology::Path_on_surface< Mesh >::push_back | ( | halfedge_descriptor | hd, |
bool | flip = false |
||
) |
adds hd
at the end of this path.
If flip
is true, the opposite of hd
is considered.
can_be_pushed(hd)
void CGAL::Surface_mesh_topology::Path_on_surface< Mesh >::push_back_by_index | ( | std::size_t | i | ) |
adds the dart/halfedge with index i
at the end of this path.
If Mesh is a Polyhedron_3
, takes time proportional to the number of halfedges.
can_be_pushed_by_index(i)
void CGAL::Surface_mesh_topology::Path_on_surface< Mesh >::push_back_by_index | ( | std::initializer_list< std::size_t > | l | ) |
adds successively all dart/halfedges in l
(a sequence of indices), at the end of the path.
If Mesh is a Polyhedron_3
, takes time proportional to the number of halfedges. For each index i
, can_be_pushed_by_index(i)
should be true.
void CGAL::Surface_mesh_topology::Path_on_surface< Mesh >::push_back_by_label | ( | const std::string & | s | ) |
adds successively all darts/halfedges in s
(a sequence of labels separated by spaces) at the end of this path.
For each label, l, can_be_pushed_by_label(l)
should be true.
PolygonalSchema
concept.