Documentation for decimater modules, updated decimater, more modules
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@460 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -30,18 +30,18 @@
|
||||
* License along with OpenMesh. If not, *
|
||||
* see <http://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
\*===========================================================================*/
|
||||
\*===========================================================================*/
|
||||
|
||||
/*===========================================================================*\
|
||||
* *
|
||||
* $Revision$ *
|
||||
* $Date$ *
|
||||
* *
|
||||
\*===========================================================================*/
|
||||
\*===========================================================================*/
|
||||
|
||||
/** \file CollapseInfoT.hh
|
||||
Provides data class CollapseInfoT for storing all information
|
||||
about a halfedge collapse.
|
||||
Provides data class CollapseInfoT for storing all information
|
||||
about a halfedge collapse.
|
||||
*/
|
||||
|
||||
//=============================================================================
|
||||
@@ -49,129 +49,111 @@
|
||||
// STRUCT CollpaseInfoT
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef OPENMESH_DECIMATER_COLLAPSEINFOT_HH
|
||||
#define OPENMESH_DECIMATER_COLLAPSEINFOT_HH
|
||||
|
||||
|
||||
//== INCLUDES =================================================================
|
||||
|
||||
|
||||
//== NAMESPACE ================================================================
|
||||
|
||||
namespace OpenMesh {
|
||||
namespace OpenMesh {
|
||||
namespace Decimater {
|
||||
|
||||
|
||||
//== CLASS DEFINITION =========================================================
|
||||
|
||||
/** Stores information about a halfedge collapse.
|
||||
|
||||
The class stores information about a halfedge collapse. The most
|
||||
important information is \c v0v1, \c v1v0, \c v0, \c v1, \c vl,
|
||||
\c vr, which you can lookup in the following image:
|
||||
\image html collapse_info.png
|
||||
\see ModProgMeshT::Info
|
||||
The class stores information about a halfedge collapse. The most
|
||||
important information is \c v0v1, \c v1v0, \c v0, \c v1, \c vl,
|
||||
\c vr, which you can lookup in the following image:
|
||||
\image html collapse_info.png
|
||||
\see ModProgMeshT::Info
|
||||
*/
|
||||
template <class Mesh>
|
||||
struct CollapseInfoT
|
||||
{
|
||||
public:
|
||||
/** Initializing constructor.
|
||||
*
|
||||
* Given a mesh and a halfedge handle of the halfedge to be collapsed
|
||||
* all important information of a halfedge collapse will be stored.
|
||||
* \param _mesh Mesh source
|
||||
* \param _heh Halfedge to collapse. The direction of the halfedge
|
||||
* defines the direction of the collapse, i.e. the from-vertex
|
||||
* will be removed and the to-vertex remains.
|
||||
*/
|
||||
CollapseInfoT(Mesh& _mesh, typename Mesh::HalfedgeHandle _heh);
|
||||
template<class Mesh>
|
||||
struct CollapseInfoT {
|
||||
public:
|
||||
/** Initializing constructor.
|
||||
*
|
||||
* Given a mesh and a halfedge handle of the halfedge to be collapsed
|
||||
* all important information of a halfedge collapse will be stored.
|
||||
* \param _mesh Mesh source
|
||||
* \param _heh Halfedge to collapse. The direction of the halfedge
|
||||
* defines the direction of the collapse, i.e. the from-vertex
|
||||
* will be removed and the to-vertex remains.
|
||||
*/
|
||||
CollapseInfoT(Mesh& _mesh, typename Mesh::HalfedgeHandle _heh);
|
||||
|
||||
Mesh& mesh;
|
||||
Mesh& mesh;
|
||||
|
||||
typename Mesh::HalfedgeHandle v0v1; ///< Halfedge to be collapsed
|
||||
typename Mesh::HalfedgeHandle v1v0; ///< Reverse halfedge
|
||||
typename Mesh::VertexHandle v0; ///< Vertex to be removed
|
||||
typename Mesh::VertexHandle v1; ///< Remaining vertex
|
||||
typename Mesh::Point p0; ///< Position of removed vertex
|
||||
typename Mesh::Point p1; ///< Positions of remaining vertex
|
||||
typename Mesh::FaceHandle fl; ///< Left face
|
||||
typename Mesh::FaceHandle fr; ///< Right face
|
||||
typename Mesh::VertexHandle vl; ///< Left vertex
|
||||
typename Mesh::VertexHandle vr; ///< Right vertex
|
||||
//@{
|
||||
/** Outer remaining halfedge of diamond spanned by \c v0, \c v1,
|
||||
* \c vl, and \c vr
|
||||
*/
|
||||
typename Mesh::HalfedgeHandle vlv1, v0vl, vrv0, v1vr;
|
||||
//@}
|
||||
typename Mesh::HalfedgeHandle v0v1; ///< Halfedge to be collapsed
|
||||
typename Mesh::HalfedgeHandle v1v0; ///< Reverse halfedge
|
||||
typename Mesh::VertexHandle v0; ///< Vertex to be removed
|
||||
typename Mesh::VertexHandle v1; ///< Remaining vertex
|
||||
typename Mesh::Point p0; ///< Position of removed vertex
|
||||
typename Mesh::Point p1; ///< Positions of remaining vertex
|
||||
typename Mesh::FaceHandle fl; ///< Left face
|
||||
typename Mesh::FaceHandle fr; ///< Right face
|
||||
typename Mesh::VertexHandle vl; ///< Left vertex
|
||||
typename Mesh::VertexHandle vr; ///< Right vertex
|
||||
//@{
|
||||
/** Outer remaining halfedge of diamond spanned by \c v0, \c v1,
|
||||
* \c vl, and \c vr
|
||||
*/
|
||||
typename Mesh::HalfedgeHandle vlv1, v0vl, vrv0, v1vr;
|
||||
//@}
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// CollapseInfoT::CollapseInfoT( _mesh, _heh )
|
||||
//
|
||||
// Local configuration of halfedge collapse to be stored in CollapseInfoT:
|
||||
/*
|
||||
vl
|
||||
*
|
||||
/ \
|
||||
/ \
|
||||
/ fl \
|
||||
v0 *------>* v1
|
||||
\ fr /
|
||||
\ /
|
||||
\ /
|
||||
*
|
||||
vr
|
||||
/**
|
||||
* Local configuration of halfedge collapse to be stored in CollapseInfoT:
|
||||
*
|
||||
* vl
|
||||
* *
|
||||
* / \
|
||||
* / \
|
||||
* / fl \
|
||||
* v0 *------>* v1
|
||||
* \ fr /
|
||||
* \ /
|
||||
* \ /
|
||||
* *
|
||||
* vr
|
||||
*
|
||||
*
|
||||
* @param _mesh Reference to mesh
|
||||
* @param _heh The halfedge (v0 -> v1) defining the collapse
|
||||
*/
|
||||
// Parameters:
|
||||
// _mesh Reference to mesh
|
||||
// _heh The halfedge (v0 -> v1) defining the collapse
|
||||
//
|
||||
template <class Mesh>
|
||||
inline
|
||||
CollapseInfoT<Mesh>::
|
||||
CollapseInfoT(Mesh& _mesh, typename Mesh::HalfedgeHandle _heh) :
|
||||
|
||||
mesh(_mesh),
|
||||
v0v1(_heh),
|
||||
v1v0(_mesh.opposite_halfedge_handle(v0v1)),
|
||||
v0(_mesh.to_vertex_handle(v1v0)),
|
||||
v1(_mesh.to_vertex_handle(v0v1)),
|
||||
p0(_mesh.point(v0)),
|
||||
p1(_mesh.point(v1)),
|
||||
fl(_mesh.face_handle(v0v1)),
|
||||
fr(_mesh.face_handle(v1v0))
|
||||
template<class Mesh>
|
||||
inline CollapseInfoT<Mesh>::CollapseInfoT(Mesh& _mesh,
|
||||
typename Mesh::HalfedgeHandle _heh) :
|
||||
mesh(_mesh), v0v1(_heh), v1v0(_mesh.opposite_halfedge_handle(v0v1)), v0(
|
||||
_mesh.to_vertex_handle(v1v0)), v1(_mesh.to_vertex_handle(v0v1)), p0(
|
||||
_mesh.point(v0)), p1(_mesh.point(v1)), fl(_mesh.face_handle(v0v1)), fr(
|
||||
_mesh.face_handle(v1v0))
|
||||
|
||||
{
|
||||
// get vl
|
||||
if (fl.is_valid())
|
||||
{
|
||||
if (fl.is_valid()) {
|
||||
vlv1 = mesh.next_halfedge_handle(v0v1);
|
||||
v0vl = mesh.next_halfedge_handle(vlv1);
|
||||
vl = mesh.to_vertex_handle(vlv1);
|
||||
vl = mesh.to_vertex_handle(vlv1);
|
||||
vlv1 = mesh.opposite_halfedge_handle(vlv1);
|
||||
v0vl = mesh.opposite_halfedge_handle(v0vl);
|
||||
}
|
||||
|
||||
|
||||
// get vr
|
||||
if (fr.is_valid())
|
||||
{
|
||||
if (fr.is_valid()) {
|
||||
vrv0 = mesh.next_halfedge_handle(v1v0);
|
||||
v1vr = mesh.next_halfedge_handle(vrv0);
|
||||
vr = mesh.to_vertex_handle(vrv0);
|
||||
vr = mesh.to_vertex_handle(vrv0);
|
||||
vrv0 = mesh.opposite_halfedge_handle(vrv0);
|
||||
v1vr = mesh.opposite_halfedge_handle(v1vr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
} // END_NS_DECIMATER
|
||||
}// END_NS_DECIMATER
|
||||
} // END_NS_OPENMESH
|
||||
//=============================================================================
|
||||
#endif // OPENMESH_DECIMATER_COLLAPSEINFOT_HH defined
|
||||
|
||||
Reference in New Issue
Block a user