VCG Library
Functions
Face

Functions

template<class FaceType >
bool vcg::face::IsManifold (FaceType const &f, const int j)
 
template<class FaceType >
bool vcg::face::IsBorder (FaceType const &f, const int j)
 
template<class FaceType >
FaceType::ScalarType vcg::face::DihedralAngleRad (FaceType &f, const int i)
 Compute the signed dihedral angle between the normals of two adjacent faces.
 
template<class FaceType >
FaceType::ScalarType vcg::face::WedgeAngleRad (FaceType &f, const int i)
 Return the internal angle (in radians) of the i-th wedge of the triangle.
 
template<class FaceType >
int vcg::face::BorderCount (FaceType const &f)
 Count border edges of the face.
 
template<class FaceType >
int vcg::face::ComplexSize (FaceType &f, const int e)
 Counts the number of incident faces in a complex edge.
 
template<class FaceType >
bool vcg::face::FFCorrectness (FaceType &f, const int e)
 
template<class FaceType >
void vcg::face::FFDetachManifold (FaceType &f, const int e)
 
template<class FaceType >
void vcg::face::FFDetach (FaceType &f, const int e)
 
template<class FaceType >
void vcg::face::FFAttach (FaceType *&f, int z1, FaceType *&f2, int z2)
 
template<class FaceType >
void vcg::face::FFAttachManifold (FaceType *&f1, int z1, FaceType *&f2, int z2)
 
template<class FaceType >
bool vcg::face::CheckOrientation (FaceType &f, int z)
 
template<class FaceType >
void vcg::face::SwapEdge (FaceType &f, const int z)
 
template<class FaceType >
bool vcg::face::FFLinkCondition (FaceType &f, const int z)
 
template<class MeshType >
void vcg::face::FFEdgeCollapse (MeshType &m, typename MeshType::FaceType &f, const int z)
 
template<class FaceType >
bool vcg::face::CheckFlipEdgeNormal (FaceType &f, const int z, const float angleRad)
 
template<class FaceType >
bool vcg::face::CheckFlipEdge (FaceType &f, int z)
 
template<class FaceType >
void vcg::face::FlipEdge (FaceType &f, const int z)
 
template<class FaceType >
void vcg::face::VFAppend (FaceType *&f, int z)
 Append a face in VF list of vertex f->V(z)
 
template<class FaceType >
void vcg::face::VVStarVF (typename FaceType::VertexType *vp, std::vector< typename FaceType::VertexType * > &starVec)
 Compute the set of vertices adjacent to a given vertex using VF adjacency.
 
template<class FaceType >
void vcg::face::VVExtendedStarVF (typename FaceType::VertexType *vp, const int num_step, std::vector< typename FaceType::VertexType * > &vertVec)
 Compute the set of vertices adjacent to a given vertex using VF adjacency.
 
template<class FaceType >
void vcg::face::VFStarVF (typename FaceType::VertexType *vp, std::vector< FaceType * > &faceVec, std::vector< int > &indexes)
 Compute the set of faces adjacent to a given vertex using VF adjacency.
 
template<class FaceType >
void vcg::face::EFStarFF (FaceType *fp, int ei, std::vector< FaceType * > &faceVec, std::vector< int > &indVed)
 Compute the set of faces incident onto a given edge using FF adjacency.
 
template<class FaceType >
void vcg::face::VFExtendedStarVF (typename FaceType::VertexType *vp, const int num_step, std::vector< FaceType * > &faceVec)
 Compute the set of faces adjacent to a given vertex using VF adjacency.
 
template<class FaceType >
void vcg::face::VVOrderedStarFF (Pos< FaceType > &startPos, std::vector< typename FaceType::VertexType * > &vertexVec)
 Compute the ordered set of vertices adjacent to a given vertex using FF adiacency.
 
template<class FaceType >
void vcg::face::VFOrderedStarFF (const Pos< FaceType > &startPos, std::vector< Pos< FaceType > > &posVec)
 Compute the ordered set of faces adjacent to a given vertex using FF adiacency.
 
template<class FaceType >
void vcg::face::VFOrderedStarFF (const Pos< FaceType > &startPos, std::vector< FaceType * > &faceVec, std::vector< int > &edgeVec)
 Compute the ordered set of faces adjacent to a given vertex using FF adiacency.
 
template<class FaceType >
bool vcg::face::ShareEdgeFF (FaceType *f0, FaceType *f1, int *i0=0, int *i1=0)
 
template<class FaceType >
int vcg::face::CountSharedVertex (FaceType *f0, FaceType *f1)
 
template<class FaceType >
bool vcg::face::FindSharedVertex (FaceType *f0, FaceType *f1, int &i, int &j)
 
template<class FaceType >
bool vcg::face::FindSharedEdge (FaceType *f0, FaceType *f1, int &i, int &j)
 
template<class FaceType >
bool vcg::face::FindSharedFaces (typename FaceType::VertexType *v0, typename FaceType::VertexType *v1, FaceType *&f0, FaceType *&f1, int &e0, int &e1)
 

Detailed Description

Function Documentation

template<class FaceType >
int vcg::face::BorderCount ( FaceType const &  f)
inline

Count border edges of the face.

Definition at line 124 of file simplex/face/topology.h.

template<class FaceType >
bool vcg::face::CheckFlipEdge ( FaceType &  f,
int  z 
)

Perform a Topological check to see if the z-th edge of the face f can be flipped. No Geometric test are done. (see CheckFlipEdgeNormal)

Parameters
fpointer to the face
zthe edge index

Definition at line 595 of file simplex/face/topology.h.

template<class FaceType >
bool vcg::face::CheckFlipEdgeNormal ( FaceType &  f,
const int  z,
const float  angleRad 
)

Perform a Geometric Check about the normals of a edge flip. return trues if after the flip the normals does not change more than the given threshold angle; it assumes that the flip is topologically correct.

  \param f  the face
  \param z  the edge index
Parameters
angleRadthe threshold angle

oldD1 ___________ newD1 |\ | | \ | | \ | | f z\ | | \ | |__________| newD0 oldD0

Definition at line 563 of file simplex/face/topology.h.

template<class FaceType >
bool vcg::face::CheckOrientation ( FaceType &  f,
int  z 
)

Check if the given face is oriented as the one adjacent to the specified edge.

Parameters
fFace to check the orientation
zIndex of the edge

Definition at line 370 of file simplex/face/topology.h.

template<class FaceType >
int vcg::face::ComplexSize ( FaceType &  f,
const int  e 
)
inline

Counts the number of incident faces in a complex edge.

Definition at line 140 of file simplex/face/topology.h.

template<class FaceType >
int vcg::face::CountSharedVertex ( FaceType *  f0,
FaceType *  f1 
)

Count the number of vertices shared between two faces.

Parameters
f0,f1the two face to be checked ;

Definition at line 1087 of file simplex/face/topology.h.

template<class FaceType >
FaceType::ScalarType vcg::face::DihedralAngleRad ( FaceType &  f,
const int  i 
)
inline

Compute the signed dihedral angle between the normals of two adjacent faces.

The angle between the normal is signed according to the concavity/convexity of the dihedral angle: negative if the edge shared between the two faces is concave, positive otherwise. The surface it is assumend to be oriented. It simply use the projection of the opposite vertex onto the plane of the other one. It does not assume anything on face normals.

v0 ___________ vf1 |\ | | f1 | | \ | |f0 i0\ | | \ | |__________| vf0 v1

Definition at line 80 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::EFStarFF ( FaceType *  fp,
int  ei,
std::vector< FaceType * > &  faceVec,
std::vector< int > &  indVed 
)

Compute the set of faces incident onto a given edge using FF adjacency.

\param fp pointer to the face whose star has to be computed
\param ei the index of the edge
\param faceVec a std::vector of Face pointer that is filled with the faces incident on that edge.
Parameters
indexesa std::vector of integer of the edge position as it is seen from the faces

Definition at line 881 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::FFAttach ( FaceType *&  f,
int  z1,
FaceType *&  f2,
int  z2 
)

This function attach the face (via the edge z1) to another face (via the edge z2). It's possible to use it also in non-two manifold situation. The function cannot be applicated if the adjacencies among faces aren't define.

Parameters
z1Index of the edge
f2Pointer to the face
z2The edge of the face f2

Definition at line 298 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::FFAttachManifold ( FaceType *&  f1,
int  z1,
FaceType *&  f2,
int  z2 
)

This function attach the face (via the edge z1) to another face (via the edge z2). It is not possible to use it also in non-two manifold situation. The function cannot be applicated if the adjacencies among faces aren't define.

Parameters
z1Index of the edge
f2Pointer to the face
z2The edge of the face f2

Definition at line 329 of file simplex/face/topology.h.

template<class FaceType >
bool vcg::face::FFCorrectness ( FaceType &  f,
const int  e 
)

This function check the FF topology correctness for an edge of a face. It's possible to use it also in non-two manifold situation. The function cannot be applicated if the adjacencies among faces aren't defined.

Parameters
fthe face to be checked
eIndex of the edge to be checked

Definition at line 173 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::FFDetach ( FaceType &  f,
const int  e 
)

This function detach the face from the adjacent face via the edge e. It's possible to use it also in non-two manifold situation. The function cannot be applicated if the adjacencies among faces aren't defined.

Parameters
fthe face to be detached
eIndex of the edge to be detached

Definition at line 245 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::FFDetachManifold ( FaceType &  f,
const int  e 
)

This function detach the face from the adjacent face via the edge e. It's possible to use this function it ONLY in non-two manifold situation. The function cannot be applicated if the adjacencies among faces aren't defined.

Parameters
fthe face to be detached
eIndex of the edge to be detached
Note
it updates border flag and faux flags (the detached edge has it border bit flagged and faux bit cleared)

Definition at line 215 of file simplex/face/topology.h.

template<class MeshType >
void vcg::face::FFEdgeCollapse ( MeshType &  m,
typename MeshType::FaceType &  f,
const int  z 
)

Perform a simple edge collapse The edge z is collapsed and the vertex V(z) is collapsed onto the vertex V1(Z) vertex V(z) is deleted and vertex V1(z) survives. It assumes that the mesh is Manifold. Note that it preserves manifoldness only if FFLinkConditions are satisfied If the mesh is not manifold it will crash (there will be faces with deleted vertexes around) f12 surV ___________ |\ | | \ f1 | f01 | \ z1 | f11 | f0 z0\ | | \ | |__________| f02 delV

Definition at line 493 of file simplex/face/topology.h.

template<class FaceType >
bool vcg::face::FFLinkCondition ( FaceType &  f,
const int  z 
)

Perform a simple edge collapse Basic link conditions

Definition at line 448 of file simplex/face/topology.h.

template<class FaceType >
bool vcg::face::FindSharedEdge ( FaceType *  f0,
FaceType *  f1,
int &  i,
int &  j 
)

find the first shared edge between two faces.

Parameters
f0,f1the two face to be checked
i,jthe indexes of the shared edge in the two faces. Meaningful only if there is a shared edge

Definition at line 1122 of file simplex/face/topology.h.

template<class FaceType >
bool vcg::face::FindSharedFaces ( typename FaceType::VertexType *  v0,
typename FaceType::VertexType *  v1,
FaceType *&  f0,
FaceType *&  f1,
int &  e0,
int &  e1 
)

find the faces that shares the two vertices

Parameters
v0,v1the two vertices
f0,f1the two faces , counterclokwise order

then find the intersection

no pair of faces share the 2 vertices

and finally check if the order is right

Definition at line 1140 of file simplex/face/topology.h.

template<class FaceType >
bool vcg::face::FindSharedVertex ( FaceType *  f0,
FaceType *  f1,
int &  i,
int &  j 
)

find the first shared vertex between two faces.

Parameters
f0,f1the two face to be checked
i,jthe indexes of the shared vertex in the two faces. Meaningful only if there is one single shared vertex ;

Definition at line 1105 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::FlipEdge ( FaceType &  f,
const int  z 
)

Flip the z-th edge of the face f. Check for topological correctness first using CheckFlipEdge().

Parameters
fpointer to the face
zthe edge index

Note: For edge flip we intend the swap of the diagonal of the quadrilater formed by the face f and the face adjacent to the specified edge.

0__________ 2 0__________2 -> 1|\ | | /|1 | \ g | | g / | | \ | |w / | | f z | | / f z| | \ | | / | |__________|1 <- 1|/__________| 2 0 2 0

Note that, after an operation FlipEdge(f,z) to topologically revert it should be sufficient to do FlipEdge(f,z+1) (even if the mesh is actually different: f and g will be swapped)

Definition at line 662 of file simplex/face/topology.h.

template<class FaceType >
bool vcg::face::IsBorder ( FaceType const &  f,
const int  j 
)
inline

Return a boolean that indicate if the j-th edge of the face is a border.

Parameters
jIndex of the edge
Returns
true if j is an edge of border, false otherwise

Definition at line 51 of file simplex/face/topology.h.

template<class FaceType >
bool vcg::face::IsManifold ( FaceType const &  f,
const int  j 
)
inline

Return a boolean that indicate if the face is complex.

Parameters
jIndex of the edge
Returns
true se la faccia e' manifold, false altrimenti

Definition at line 37 of file simplex/face/topology.h.

template<class FaceType >
bool vcg::face::ShareEdgeFF ( FaceType *  f0,
FaceType *  f1,
int *  i0 = 0,
int *  i1 = 0 
)

Check if two faces share and edge through the FF topology.

Parameters
f0,f1the two face to be checked
i0,i1the index of the shared edge;

Definition at line 1066 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::SwapEdge ( FaceType &  f,
const int  z 
)

This function change the orientation of the face by inverting the index of two vertex.

Parameters
zIndex of the edge

Definition at line 391 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::VFAppend ( FaceType *&  f,
int  z 
)

Append a face in VF list of vertex f->V(z)

Definition at line 771 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::VFExtendedStarVF ( typename FaceType::VertexType *  vp,
const int  num_step,
std::vector< FaceType * > &  faceVec 
)

Compute the set of faces adjacent to a given vertex using VF adjacency.

The set is faces is extended of a given number of step

Parameters
vppointer to the vertex whose star has to be computed.
num_stepthe number of step to extend the star
faceVeca std::vector of Face pointer that is filled with the adjacent faces.

initialize front

then dilate front for each step

Definition at line 947 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::VFOrderedStarFF ( const Pos< FaceType > &  startPos,
std::vector< Pos< FaceType > > &  posVec 
)

Compute the ordered set of faces adjacent to a given vertex using FF adiacency.

Parameters
startPosa Pos<FaceType> indicating the vertex whose star has to be computed.
posVeca std::vector of Pos filled with Pos arranged around the passed vertex.

Definition at line 1004 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::VFOrderedStarFF ( const Pos< FaceType > &  startPos,
std::vector< FaceType * > &  faceVec,
std::vector< int > &  edgeVec 
)

Compute the ordered set of faces adjacent to a given vertex using FF adiacency.

Parameters
startPosa Pos<FaceType> indicating the vertex whose star has to be computed.
faceVeca std::vector of Face pointer that is filled with the adjacent faces.
edgeVeca std::vector of indexes filled with the indexes of the corresponding edges shared between the faces.

Definition at line 1044 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::VFStarVF ( typename FaceType::VertexType *  vp,
std::vector< FaceType * > &  faceVec,
std::vector< int > &  indexes 
)

Compute the set of faces adjacent to a given vertex using VF adjacency.

\param vp pointer to the vertex whose star has to be computed.
\param faceVec a std::vector of Face pointer that is filled with the adjacent faces.
Parameters
indexesa std::vector of integer of the vertex as it is seen from the faces

Definition at line 856 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::VVExtendedStarVF ( typename FaceType::VertexType *  vp,
const int  num_step,
std::vector< typename FaceType::VertexType * > &  vertVec 
)

Compute the set of vertices adjacent to a given vertex using VF adjacency.

The set is faces is extended of a given number of step

Parameters
vppointer to the vertex whose star has to be computed.
num_stepthe number of step to extend the star
vertVeca std::vector of Ve pointer that is filled with the adjacent faces.

initialize front

then dilate front for each step

Definition at line 821 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::VVOrderedStarFF ( Pos< FaceType > &  startPos,
std::vector< typename FaceType::VertexType * > &  vertexVec 
)

Compute the ordered set of vertices adjacent to a given vertex using FF adiacency.

Parameters
startPosa Pos<FaceType> indicating the vertex whose star has to be computed.
vertexVeca std::vector of VertexPtr filled vertices around the given vertex.

Definition at line 986 of file simplex/face/topology.h.

template<class FaceType >
void vcg::face::VVStarVF ( typename FaceType::VertexType *  vp,
std::vector< typename FaceType::VertexType * > &  starVec 
)

Compute the set of vertices adjacent to a given vertex using VF adjacency.

Parameters
vppointer to the vertex whose star has to be computed.
starVeca std::vector of Vertex pointer that is filled with the adjacent vertices.

Definition at line 795 of file simplex/face/topology.h.

template<class FaceType >
FaceType::ScalarType vcg::face::WedgeAngleRad ( FaceType &  f,
const int  i 
)
inline

Return the internal angle (in radians) of the i-th wedge of the triangle.

Definition at line 114 of file simplex/face/topology.h.