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:
Jan Möbius
2011-11-16 09:45:08 +00:00
parent bbf5e47a82
commit d4487aaa79
15 changed files with 698 additions and 817 deletions

View File

@@ -30,14 +30,14 @@
* License along with OpenMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 448 $ *
* $Date: 2011-11-04 13:59:37 +0100 (Fri, 04 Nov 2011) $ *
* *
\*===========================================================================*/
\*===========================================================================*/
/** \file ModEdgeLengthT.hh
*/
@@ -47,72 +47,73 @@
// CLASS ModEdgeLengthT
//
//=============================================================================
#ifndef MODEDGELENGTHT_HH
#define MODEDGELENGTHT_HH
#ifndef OPENMESH_DECIMATER_MODEDGELENGTHT_HH
#define OPENMESH_DECIMATER_MODEDGELENGTHT_HH
//== INCLUDES =================================================================
#include <OpenMesh/Tools/Decimater/ModBaseT.hh>
#include <float.h>
//== NAMESPACES ===============================================================
namespace OpenMesh {
namespace OpenMesh {
namespace Decimater {
//== CLASS DEFINITION =========================================================
/** \brief Use edge length to control decimation
*
* This module computes the edge length.
*
* In binary and continuous mode, the collapse is legal if:
* - The length after the collapse is lower than the given tolerance
*
*/
template<class DecimaterT>
class ModEdgeLengthT: public ModBaseT<DecimaterT> {
public:
template <class DecimaterT>
class ModEdgeLengthT : public ModBaseT<DecimaterT>
{
public:
DECIMATING_MODULE( ModEdgeLengthT, DecimaterT, EdgeLength );
DECIMATING_MODULE( ModEdgeLengthT, DecimaterT, EdgeLength )
;
/// Constructor
ModEdgeLengthT(DecimaterT& _dec,
float _edge_length = FLT_MAX,
bool _is_binary = true);
/// Constructor
ModEdgeLengthT(DecimaterT& _dec, float _edge_length = FLT_MAX,
bool _is_binary = true);
/// get edge_length
float edge_length() const { return edge_length_; }
/// get edge_length
float edge_length() const {
return edge_length_;
}
/// set edge_length
void set_edge_length(float _f)
{ edge_length_ = _f; sqr_edge_length_ = _f*_f; }
/// set edge_length
void set_edge_length(float _f) {
edge_length_ = _f;
sqr_edge_length_ = _f * _f;
}
/** Compute priority:
Binary mode: Don't collapse edges longer then edge_length_
Cont. mode: Collapse smallest edge first, but
don't collapse edges longer as edge_length_
*/
float collapse_priority(const CollapseInfo& _ci);
/** Compute priority:
Binary mode: Don't collapse edges longer then edge_length_
Cont. mode: Collapse smallest edge first, but
don't collapse edges longer as edge_length_
*/
float collapse_priority(const CollapseInfo& _ci);
private:
private:
Mesh& mesh_;
typename Mesh::Scalar edge_length_, sqr_edge_length_;
Mesh& mesh_;
typename Mesh::Scalar edge_length_, sqr_edge_length_;
};
//=============================================================================
} // END_NS_DECIMATER
}// END_NS_DECIMATER
} // END_NS_OPENMESH
//=============================================================================
#if defined(INCLUDE_TEMPLATES) && !defined(MODEDGELENGTHT_C)
#if defined(INCLUDE_TEMPLATES) && !defined(OPENMESH_DECIMATER_MODEDGELENGTHT_C)
#define MODEDGELENGTHT_TEMPLATES
#include "ModEdgeLengthT.cc"
#endif
//=============================================================================
#endif // MODEDGELENGTHT_HH defined
#endif // OPENMESH_DECIMATER_MODEDGELENGTHT_HH defined
//=============================================================================