Commit a093b541 authored by Matthias Möller's avatar Matthias Möller
Browse files

- rename module template parameters

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@650 fdac6126-5c0c-442c-9429-916003d36597
parent 54fafe05
...@@ -60,8 +60,8 @@ namespace Decimater { ...@@ -60,8 +60,8 @@ namespace Decimater {
//== IMPLEMENTATION ========================================================== //== IMPLEMENTATION ==========================================================
template<class DecimaterT> template<class MeshT>
typename ModAspectRatioT<DecimaterT>::Scalar ModAspectRatioT<DecimaterT>::aspectRatio( typename ModAspectRatioT<MeshT>::Scalar ModAspectRatioT<MeshT>::aspectRatio(
const Point& _v0, const Point& _v1, const Point& _v2) { const Point& _v0, const Point& _v1, const Point& _v2) {
Point d0 = _v0 - _v1; Point d0 = _v0 - _v1;
Point d1 = _v1 - _v2; Point d1 = _v1 - _v2;
...@@ -91,8 +91,8 @@ typename ModAspectRatioT<DecimaterT>::Scalar ModAspectRatioT<DecimaterT>::aspect ...@@ -91,8 +91,8 @@ typename ModAspectRatioT<DecimaterT>::Scalar ModAspectRatioT<DecimaterT>::aspect
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template<class DecimaterT> template<class MeshT>
void ModAspectRatioT<DecimaterT>::initialize() { void ModAspectRatioT<MeshT>::initialize() {
typename Mesh::FaceIter f_it, f_end(mesh_.faces_end()); typename Mesh::FaceIter f_it, f_end(mesh_.faces_end());
typename Mesh::FVIter fv_it; typename Mesh::FVIter fv_it;
...@@ -107,8 +107,8 @@ void ModAspectRatioT<DecimaterT>::initialize() { ...@@ -107,8 +107,8 @@ void ModAspectRatioT<DecimaterT>::initialize() {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template<class DecimaterT> template<class MeshT>
void ModAspectRatioT<DecimaterT>::preprocess_collapse(const CollapseInfo& _ci) { void ModAspectRatioT<MeshT>::preprocess_collapse(const CollapseInfo& _ci) {
typename Mesh::FaceHandle fh; typename Mesh::FaceHandle fh;
typename Mesh::FVIter fv_it; typename Mesh::FVIter fv_it;
...@@ -126,8 +126,8 @@ void ModAspectRatioT<DecimaterT>::preprocess_collapse(const CollapseInfo& _ci) { ...@@ -126,8 +126,8 @@ void ModAspectRatioT<DecimaterT>::preprocess_collapse(const CollapseInfo& _ci) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template<class DecimaterT> template<class MeshT>
float ModAspectRatioT<DecimaterT>::collapse_priority(const CollapseInfo& _ci) { float ModAspectRatioT<MeshT>::collapse_priority(const CollapseInfo& _ci) {
typename Mesh::VertexHandle v2, v3; typename Mesh::VertexHandle v2, v3;
typename Mesh::FaceHandle fh; typename Mesh::FaceHandle fh;
const typename Mesh::Point *p1(&_ci.p1), *p2, *p3; const typename Mesh::Point *p1(&_ci.p1), *p2, *p3;
......
...@@ -76,20 +76,20 @@ namespace Decimater { ...@@ -76,20 +76,20 @@ namespace Decimater {
* *
* *
*/ */
template<class DecimaterT> template<class MeshT>
class ModAspectRatioT: public ModBaseT<DecimaterT> { class ModAspectRatioT: public ModBaseT<MeshT> {
public: public:
DECIMATING_MODULE( ModAspectRatioT, DecimaterT, Roundness ) DECIMATING_MODULE( ModAspectRatioT, MeshT, Roundness )
; ;
typedef typename Mesh::Scalar Scalar; typedef typename Mesh::Scalar Scalar;
typedef typename Mesh::Point Point; typedef typename Mesh::Point Point;
/// constructor /// constructor
ModAspectRatioT(DecimaterT& _dec, float _min_aspect = 5.0, bool _is_binary = ModAspectRatioT(MeshT& _mesh, float _min_aspect = 5.0, bool _is_binary =
true) : true) :
Base(_dec, _is_binary), mesh_(Base::mesh()), min_aspect_( Base(_mesh, _is_binary), mesh_(Base::mesh()), min_aspect_(
1.0 / _min_aspect) { 1.0 / _min_aspect) {
mesh_.add_property(aspect_); mesh_.add_property(aspect_);
} }
......
...@@ -60,17 +60,17 @@ namespace Decimater { ...@@ -60,17 +60,17 @@ namespace Decimater {
//== IMPLEMENTATION ========================================================== //== IMPLEMENTATION ==========================================================
template<class DecimaterT> template<class MeshT>
ModEdgeLengthT<DecimaterT>::ModEdgeLengthT(DecimaterT &_dec, float _edge_length, ModEdgeLengthT<MeshT>::ModEdgeLengthT(MeshT &_mesh, float _edge_length,
bool _is_binary) : bool _is_binary) :
Base(_dec, _is_binary), mesh_(Base::mesh()) { Base(_mesh, _is_binary), mesh_(Base::mesh()) {
set_edge_length(_edge_length); set_edge_length(_edge_length);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template<class DecimaterT> template<class MeshT>
float ModEdgeLengthT<DecimaterT>::collapse_priority(const CollapseInfo& _ci) { float ModEdgeLengthT<MeshT>::collapse_priority(const CollapseInfo& _ci) {
typename Mesh::Scalar sqr_length = (_ci.p0 - _ci.p1).sqrnorm(); typename Mesh::Scalar sqr_length = (_ci.p0 - _ci.p1).sqrnorm();
return ( (sqr_length <= sqr_edge_length_) ? sqr_length : float(Base::ILLEGAL_COLLAPSE)); return ( (sqr_length <= sqr_edge_length_) ? sqr_length : float(Base::ILLEGAL_COLLAPSE));
......
...@@ -70,15 +70,15 @@ namespace Decimater { ...@@ -70,15 +70,15 @@ namespace Decimater {
* - The length after the collapse is lower than the given tolerance * - The length after the collapse is lower than the given tolerance
* *
*/ */
template<class DecimaterT> template<class MeshT>
class ModEdgeLengthT: public ModBaseT<DecimaterT> { class ModEdgeLengthT: public ModBaseT<MeshT> {
public: public:
DECIMATING_MODULE( ModEdgeLengthT, DecimaterT, EdgeLength ) DECIMATING_MODULE( ModEdgeLengthT, MeshT, EdgeLength )
; ;
/// Constructor /// Constructor
ModEdgeLengthT(DecimaterT& _dec, float _edge_length = FLT_MAX, ModEdgeLengthT(MeshT& _mesh, float _edge_length = FLT_MAX,
bool _is_binary = true); bool _is_binary = true);
/// get edge_length /// get edge_length
......
...@@ -64,9 +64,9 @@ namespace Decimater { ...@@ -64,9 +64,9 @@ namespace Decimater {
//== IMPLEMENTATION ========================================================== //== IMPLEMENTATION ==========================================================
template <class DecimaterT> template <class MeshT>
typename ModHausdorffT<DecimaterT>::Scalar typename ModHausdorffT<MeshT>::Scalar
ModHausdorffT<DecimaterT>:: ModHausdorffT<MeshT>::
distPointTriangleSquared( const Point& _p, distPointTriangleSquared( const Point& _p,
const Point& _v0, const Point& _v0,
const Point& _v1, const Point& _v1,
...@@ -191,9 +191,9 @@ distPointTriangleSquared( const Point& _p, ...@@ -191,9 +191,9 @@ distPointTriangleSquared( const Point& _p,
} }
template <class DecimaterT> template <class MeshT>
void void
ModHausdorffT<DecimaterT>:: ModHausdorffT<MeshT>::
initialize() initialize()
{ {
typename Mesh::FIter f_it(mesh_.faces_begin()), f_end(mesh_.faces_end()); typename Mesh::FIter f_it(mesh_.faces_begin()), f_end(mesh_.faces_end());
...@@ -206,9 +206,9 @@ initialize() ...@@ -206,9 +206,9 @@ initialize()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <class DecimaterT> template <class MeshT>
float float
ModHausdorffT<DecimaterT>:: ModHausdorffT<MeshT>::
collapse_priority(const CollapseInfo& _ci) collapse_priority(const CollapseInfo& _ci)
{ {
static Points points; points.clear(); static Points points; points.clear();
...@@ -268,9 +268,9 @@ collapse_priority(const CollapseInfo& _ci) ...@@ -268,9 +268,9 @@ collapse_priority(const CollapseInfo& _ci)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <class DecimaterT> template <class MeshT>
void void
ModHausdorffT<DecimaterT>:: ModHausdorffT<MeshT>::
postprocess_collapse(const CollapseInfo& _ci) postprocess_collapse(const CollapseInfo& _ci)
{ {
static Points points; static Points points;
...@@ -351,9 +351,9 @@ postprocess_collapse(const CollapseInfo& _ci) ...@@ -351,9 +351,9 @@ postprocess_collapse(const CollapseInfo& _ci)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <class DecimaterT> template <class MeshT>
typename ModHausdorffT<DecimaterT>::Scalar typename ModHausdorffT<MeshT>::Scalar
ModHausdorffT<DecimaterT>:: ModHausdorffT<MeshT>::
compute_sqr_error(FaceHandle _fh, const Point& _p) const compute_sqr_error(FaceHandle _fh, const Point& _p) const
{ {
typename Mesh::CFVIter fv_it = mesh_.cfv_iter(_fh); typename Mesh::CFVIter fv_it = mesh_.cfv_iter(_fh);
......
...@@ -74,11 +74,11 @@ namespace Decimater { ...@@ -74,11 +74,11 @@ namespace Decimater {
* *
* No continuous mode * No continuous mode
*/ */
template<class DecimaterT> template<class MeshT>
class ModHausdorffT: public ModBaseT<DecimaterT> { class ModHausdorffT: public ModBaseT<MeshT> {
public: public:
DECIMATING_MODULE( ModHausdorffT, DecimaterT, Roundness ); DECIMATING_MODULE( ModHausdorffT, MeshT, Roundness );
typedef typename Mesh::Scalar Scalar; typedef typename Mesh::Scalar Scalar;
typedef typename Mesh::Point Point; typedef typename Mesh::Point Point;
...@@ -86,8 +86,8 @@ class ModHausdorffT: public ModBaseT<DecimaterT> { ...@@ -86,8 +86,8 @@ class ModHausdorffT: public ModBaseT<DecimaterT> {
typedef std::vector<Point> Points; typedef std::vector<Point> Points;
/// Constructor /// Constructor
ModHausdorffT(DecimaterT& _dec, Scalar _error_tolerance = FLT_MAX) : ModHausdorffT(MeshT& _mesh, Scalar _error_tolerance = FLT_MAX) :
Base(_dec, true), mesh_(Base::mesh()), tolerance_(_error_tolerance) { Base(_mesh, true), mesh_(Base::mesh()), tolerance_(_error_tolerance) {
mesh_.add_property(points_); mesh_.add_property(points_);
} }
......
...@@ -65,15 +65,15 @@ namespace Decimater { // BEGIN_NS_DECIMATER ...@@ -65,15 +65,15 @@ namespace Decimater { // BEGIN_NS_DECIMATER
/** Lock one-ring around remaining vertex after a collapse to prevent /** Lock one-ring around remaining vertex after a collapse to prevent
* further collapses of halfedges incident to the one-ring vertices. * further collapses of halfedges incident to the one-ring vertices.
*/ */
template<class DecimaterType> template<class MeshT>
class ModIndependentSetsT: public ModBaseT<DecimaterType> { class ModIndependentSetsT: public ModBaseT<MeshT> {
public: public:
DECIMATING_MODULE( ModIndependentSetsT, DecimaterType, IndependentSets ) DECIMATING_MODULE( ModIndependentSetsT, MeshT, IndependentSets )
; ;
/// Constructor /// Constructor
ModIndependentSetsT(DecimaterType &_dec) : ModIndependentSetsT(MeshT &_mesh) :
Base(_dec, true) { Base(_mesh, true) {
} }
/// override /// override
......
...@@ -83,12 +83,12 @@ namespace Decimater { ...@@ -83,12 +83,12 @@ namespace Decimater {
* *
* In continuous mode the maximal deviation is returned * In continuous mode the maximal deviation is returned
*/ */
template <class DecimaterT> template <class MeshT>
class ModNormalDeviationT : public ModBaseT< DecimaterT > class ModNormalDeviationT : public ModBaseT< MeshT >
{ {
public: public:
DECIMATING_MODULE( ModNormalDeviationT, DecimaterT, NormalDeviation ); DECIMATING_MODULE( ModNormalDeviationT, MeshT, NormalDeviation );
typedef typename Mesh::Scalar Scalar; typedef typename Mesh::Scalar Scalar;
typedef typename Mesh::Point Point; typedef typename Mesh::Point Point;
...@@ -103,8 +103,8 @@ public: ...@@ -103,8 +103,8 @@ public:
public: public:
/// Constructor /// Constructor
ModNormalDeviationT(DecimaterT& _dec, float _max_dev = 180.0) ModNormalDeviationT(MeshT& _mesh, float _max_dev = 180.0)
: Base(_dec, true), mesh_(Base::mesh()) : Base(_mesh, true), mesh_(Base::mesh())
{ {
set_normal_deviation(_max_dev); set_normal_deviation(_max_dev);
mesh_.add_property(normal_cones_); mesh_.add_property(normal_cones_);
......
...@@ -74,17 +74,17 @@ namespace Decimater { // BEGIN_NS_DECIMATER ...@@ -74,17 +74,17 @@ namespace Decimater { // BEGIN_NS_DECIMATER
* collapse. The collapse will pass the test, if the deviation is below * collapse. The collapse will pass the test, if the deviation is below
* a given threshold. * a given threshold.
*/ */
template <typename DecimaterT> template <typename MeshT>
class ModNormalFlippingT : public ModBaseT< DecimaterT > class ModNormalFlippingT : public ModBaseT< MeshT >
{ {
public: public:
DECIMATING_MODULE( ModNormalFlippingT, DecimaterT, NormalFlipping ); DECIMATING_MODULE( ModNormalFlippingT, MeshT, NormalFlipping );
public: public:
/// Constructor /// Constructor
ModNormalFlippingT( DecimaterT &_dec) : Base(_dec, true) ModNormalFlippingT( MeshT &_mesh) : Base(_mesh, true)
{ {
set_max_normal_deviation( 90.0f ); set_max_normal_deviation( 90.0f );
} }
......
...@@ -74,9 +74,9 @@ namespace Decimater { ...@@ -74,9 +74,9 @@ namespace Decimater {
//== IMPLEMENTATION ========================================================== //== IMPLEMENTATION ==========================================================
template <class DecimaterType> template <class MeshT>
bool bool
ModProgMeshT<DecimaterType>:: ModProgMeshT<MeshT>::
write( const std::string& _ofname ) write( const std::string& _ofname )
{ {
// sort vertices // sort vertices
......
...@@ -74,12 +74,12 @@ namespace Decimater { ...@@ -74,12 +74,12 @@ namespace Decimater {
* can be evaluated after the decimation process and (!) before calling * can be evaluated after the decimation process and (!) before calling
* the garbage collection of the decimated mesh. * the garbage collection of the decimated mesh.
*/ */
template <class DecimaterType> template <class MeshT>
class ModProgMeshT : public ModBaseT<DecimaterType> class ModProgMeshT : public ModBaseT<MeshT>
{ {
public: public:
DECIMATING_MODULE( ModProgMeshT, DecimaterType, ProgMesh ); DECIMATING_MODULE( ModProgMeshT, MeshT, ProgMesh );
/** Struct storing progressive mesh information /** Struct storing progressive mesh information
* \see CollapseInfoT, ModProgMeshT * \see CollapseInfoT, ModProgMeshT
...@@ -106,7 +106,7 @@ public: ...@@ -106,7 +106,7 @@ public:
public: public:
/// Constructor /// Constructor
ModProgMeshT( DecimaterType &_dec ) : Base(_dec, true) ModProgMeshT( MeshT &_mesh ) : Base(_mesh, true)
{ {
Base::mesh().add_property( idx_ ); Base::mesh().add_property( idx_ );
} }
......
...@@ -72,22 +72,22 @@ namespace Decimater { ...@@ -72,22 +72,22 @@ namespace Decimater {
* *
* This module can be used as a binary and non-binary module. * This module can be used as a binary and non-binary module.
*/ */
template <class DecimaterType> template <class MeshT>
class ModQuadricT : public ModBaseT<DecimaterType> class ModQuadricT : public ModBaseT<MeshT>
{ {
public: public:
// Defines the types Self, Handle, Base, Mesh, and CollapseInfo // Defines the types Self, Handle, Base, Mesh, and CollapseInfo
// and the memberfunction name() // and the memberfunction name()
DECIMATING_MODULE( ModQuadricT, DecimaterType, Quadric ); DECIMATING_MODULE( ModQuadricT, MeshT, Quadric );
public: public:
/** Constructor /** Constructor
* \internal * \internal
*/ */
ModQuadricT( DecimaterType &_dec ) ModQuadricT( MeshT &_mesh )
: Base(_dec, false) : Base(_mesh, false)
{ {
unset_max_err(); unset_max_err();
Base::mesh().add_property( quadrics_ ); Base::mesh().add_property( quadrics_ );
......
...@@ -80,11 +80,11 @@ namespace Decimater { // BEGIN_NS_DECIMATER ...@@ -80,11 +80,11 @@ namespace Decimater { // BEGIN_NS_DECIMATER
* *
* In continuous mode the roundness after the collapse is returned * In continuous mode the roundness after the collapse is returned
*/ */
template <class DecimaterType> template <class MeshT>
class ModRoundnessT : public ModBaseT<DecimaterType> class ModRoundnessT : public ModBaseT<MeshT>
{ {
public: public:
DECIMATING_MODULE( ModRoundnessT, DecimaterType, Roundness ); DECIMATING_MODULE( ModRoundnessT, MeshT, Roundness );
public: public:
...@@ -95,7 +95,7 @@ class ModRoundnessT : public ModBaseT<DecimaterType> ...@@ -95,7 +95,7 @@ class ModRoundnessT : public ModBaseT<DecimaterType>
public: public:
/// Constructor /// Constructor
ModRoundnessT( DecimaterType &_dec ) : ModRoundnessT( MeshT &_dec ) :
Base(_dec, false), Base(_dec, false),
min_r_(-1.0) min_r_(-1.0)
{ } { }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment