Visual Computing Library
|
The MeshPos class describes a "Position in a Mesh" that can be identified with a triplet of Face-Vertex-Edge, where: More...
#include <vclib/space/complex/mesh_pos.h>
Public Types | |
using | VertexType = FaceType::VertexType |
Public Member Functions | |
MeshPos ()=default | |
Empty constructor that creates a null (invalid) MeshPos. | |
MeshPos (const FaceType *f, short e) | |
MeshPos (const FaceType *f, const VertexType *v) | |
MeshPos (const FaceType *f, const VertexType *v, short e) | |
Constructor that creates a MeshPos with the given facem vertex and edge. The given triplet must describe a valid MeshPos. The constructor asserts this condition. | |
const FaceType * | face () const |
const VertexType * | vertex () const |
short | edge () const |
const FaceType * | adjFace () const |
const VertexType * | adjVertex () const |
short | adjEdge () const |
bool | isValid () const |
Returns true if this MeshPos is valid. | |
bool | isNull () const |
Returns true if this is null, non initialized, MeshPos. The result of this function is different from calling !isValid(). | |
bool | isEdgeOnBorder () const |
Returns true if the current edge of this MeshPos is on a border. To check if is on border, this function checks wheter exists an adjacent face to the current face along the current edge of this MeshPos. It does not use border flags. | |
bool | isCCWOriented () const |
Returns true if the current vertex of the MeshPos corresponts to the first vertex of the current edge. If this member function returns true , the next operations performed on the MeshPos will move in CounderClockWise order. | |
bool | flipFace () |
Moves this MeshPos to the face adjacent to the current face that shares the same vertex and the same edge of this MeshPos. The function returns true if the current face is changed. If the adjacent face does not exist because the edge of the current face is on border, the current face does not change, and the MeshPos remains valid. In this case, the function returns false . | |
void | flipVertex () |
Moves this MeshPos to the vertex adjacent to the current vertex that shares the same face and the same edge of this MeshPos. | |
void | flipEdge () |
Moves this MeshPos to the edge adjacent to the current edge that shares the same face and the same vertex of this MeshPos. | |
void | nextEdgeAdjacentToV () |
Moves this MeshPos to the next edge that is adjacent to the current vertex of the MeshPos. This Move corresponds to make a flipEdge() and then a flipFace() moves. Using this move, it is possible to visit the next face and the next edge adjacent to the current vertex, and can be used to navigate in the star of the current vertex. | |
bool | nextEdgeOnBorderAdjacentToV () |
Moves the MeshPos to the next edge on border that is adjacent to the current vertex of the MeshPos. Basically, cycles on the edges adjacent to the current vertex, and stops when finds a border edge. | |
uint | numberOfAdjacentFacesToV () const |
Returns the number of adjacent faces to the current vertex of this MeshPos. This works also for vertices that are on a border, and the starting edge and face is ininfluent. The only requirement is that this MeshPos is valid. | |
bool | operator== (const MeshPos &op) const |
bool | operator!= (const MeshPos &op) const |
bool | operator< (const MeshPos &op) const |
Static Public Member Functions | |
static bool | isValid (const FaceType *f, const VertexType *v, short e) |
Helper function to check if a MeshPos is valid, that is if: | |
Private Member Functions | |
uint | countAdjacentFacesToV (bool &onBorder) const |
Private Attributes | |
const FaceType * | mFace = nullptr |
const FaceType::VertexType * | mVertex = nullptr |
short | mEdge = -1 |
The MeshPos class describes a "Position in a Mesh" that can be identified with a triplet of Face-Vertex-Edge, where:
Its utility is to navigate the topology of the Mesh trough a set of well-defined operations that allow to "move" the MeshPos object.
To be used, the MeshPos requires that the Mesh on which the given Face-Vertex-Edge triplet is defined, has per Face Adjacent Faces topology informtion.
|
inline |
|
inline |
Moves this MeshPos to the face adjacent to the current face that shares the same vertex and the same edge of this MeshPos. The function returns true
if the current face is changed. If the adjacent face does not exist because the edge of the current face is on border, the current face does not change, and the MeshPos remains valid. In this case, the function returns false
.
true
if the current face is changed, false
otherwise (because the current edge is on border).
|
inline |
|
inline |
Returns true
if the current edge of this MeshPos is on a border. To check if is on border, this function checks wheter exists an adjacent face to the current face along the current edge of this MeshPos. It does not use border flags.
true
if the current edge in the current face is on a border.
|
inline |
|
inline |
|
inlinestatic |
Helper function to check if a MeshPos is valid, that is if:
f | a face pointer |
v | a vertex pointer |
e | an integer that represents the edge position in the face f |
true
if the triple (f,v,e) is a valid MeshPos.
|
inline |
Moves this MeshPos to the next edge that is adjacent to the current vertex of the MeshPos. This Move corresponds to make a flipEdge()
and then a flipFace()
moves. Using this move, it is possible to visit the next face and the next edge adjacent to the current vertex, and can be used to navigate in the star of the current vertex.
Note that if a "next face" does not exists because we are on border, the MeshPos flips only the current edge, staying on the same face (see the flipFace()
function for more details).
|
inline |
Moves the MeshPos to the next edge on border that is adjacent to the current vertex of the MeshPos. Basically, cycles on the edges adjacent to the current vertex, and stops when finds a border edge.
true
if it finds a border edge that is different to the current one. Return false
if no border edge was found.
|
inline |