OpenMesh

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MixedDecimaterT.hh
1 /*===========================================================================*\
2 * *
3 * OpenMesh *
4 * Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
5 * www.openmesh.org *
6 * *
7 *---------------------------------------------------------------------------*
8 * This file is part of OpenMesh. *
9 * *
10 * OpenMesh is free software: you can redistribute it and/or modify *
11 * it under the terms of the GNU Lesser General Public License as *
12 * published by the Free Software Foundation, either version 3 of *
13 * the License, or (at your option) any later version with the *
14 * following exceptions: *
15 * *
16 * If other files instantiate templates or use macros *
17 * or inline functions from this file, or you compile this file and *
18 * link it with other files to produce an executable, this file does *
19 * not by itself cause the resulting executable to be covered by the *
20 * GNU Lesser General Public License. This exception does not however *
21 * invalidate any other reasons why the executable file might be *
22 * covered by the GNU Lesser General Public License. *
23 * *
24 * OpenMesh is distributed in the hope that it will be useful, *
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
27 * GNU Lesser General Public License for more details. *
28 * *
29 * You should have received a copy of the GNU LesserGeneral Public *
30 * License along with OpenMesh. If not, *
31 * see <http://www.gnu.org/licenses/>. *
32 * *
33 \*===========================================================================*/
34
35 /*===========================================================================*\
36 * *
37 * $Revision: 990 $ *
38 * $Date: 2014-02-05 10:01:07 +0100 (Mi, 05. Feb 2014) $ *
39 * *
40 \*===========================================================================*/
41
45 //=============================================================================
46 //
47 // CLASS MixedDecimaterT - IMPLEMENTATION
48 //
49 //=============================================================================
50
51 #ifndef OPENMESH_MIXED_DECIMATER_DECIMATERT_HH
52 #define OPENMESH_MIXED_DECIMATER_DECIMATERT_HH
53
54
55 //== INCLUDES =================================================================
56
57 #include <memory>
58 #include <OpenMesh/Tools/Decimater/McDecimaterT.hh>
59 #include <OpenMesh/Tools/Decimater/DecimaterT.hh>
60
61
62
63 //== NAMESPACE ================================================================
64
65 namespace OpenMesh {
66 namespace Decimater {
67
68
69 //== CLASS DEFINITION =========================================================
70
71
75 template < typename MeshT >
76 class MixedDecimaterT : public McDecimaterT<MeshT>, public DecimaterT<MeshT>
77 {
78 public: //-------------------------------------------------------- public types
79
80 typedef McDecimaterT< MeshT > Self;
81 typedef MeshT Mesh;
82 typedef CollapseInfoT<MeshT> CollapseInfo;
83 typedef ModBaseT<MeshT> Module;
84 typedef std::vector< Module* > ModuleList;
85 typedef typename ModuleList::iterator ModuleListIterator;
86
87 public: //------------------------------------------------------ public methods
88
90 MixedDecimaterT( Mesh& _mesh );
91
93 ~MixedDecimaterT();
94
95 public:
96
100 size_t decimate( const size_t _n_collapses, const float _mc_factor );
101
103 size_t decimate_to( size_t _n_vertices, const float _mc_factor )
104 {
105 return ( (_n_vertices < this->mesh().n_vertices()) ?
106 decimate( this->mesh().n_vertices() - _n_vertices, _mc_factor ) : 0 );
107 }
108
113 size_t decimate_to_faces( const size_t _n_vertices=0, const size_t _n_faces=0 , const float _mc_factor = 0.8);
114
115 private: //------------------------------------------------------- private data
116
117 };
118
119 //=============================================================================
120 } // END_NS_DECIMATER
121 } // END_NS_OPENMESH
122 //=============================================================================
123 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_MIXED_DECIMATER_DECIMATERT_CC)
124 #define OPENMESH_MIXED_DECIMATER_TEMPLATES
125 #include "MixedDecimaterT.cc"
126 #endif
127 //=============================================================================
128 #endif // OPENMESH_MIXED_DECIMATER_DECIMATERT_HH
129 //=============================================================================
OpenMesh::Decimater::MixedDecimaterT::~MixedDecimaterT
~MixedDecimaterT()
Destructor.
Definition: MixedDecimaterT.cc:78
OpenMesh::Decimater::CollapseInfoT
Stores information about a halfedge collapse.
Definition: CollapseInfoT.hh:73
OpenMesh::Decimater::MixedDecimaterT::decimate_to_faces
size_t decimate_to_faces(const size_t _n_vertices=0, const size_t _n_faces=0, const float _mc_factor=0.8)
Decimate to target complexity (vertices and faces).
Definition: MixedDecimaterT.cc:103
OpenMesh::Decimater::MixedDecimaterT::decimate
size_t decimate(const size_t _n_collapses, const float _mc_factor)
Decimate (perform _n_collapses collapses).
Definition: MixedDecimaterT.cc:84
OpenMesh::Decimater::MixedDecimaterT
Mixed decimater framework.
Definition: MixedDecimaterT.hh:76
OpenMesh::Decimater::BaseDecimaterT
Definition: BaseDecimaterT.hh:82
OpenMesh::Decimater::MixedDecimaterT::MixedDecimaterT
MixedDecimaterT(Mesh &_mesh)
Constructor.
Definition: MixedDecimaterT.cc:70
OpenMesh::Decimater::McDecimaterT
Multiple choice decimater framework.
Definition: McDecimaterT.hh:75
OpenMesh::Decimater::DecimaterT
Decimater framework.
Definition: DecimaterT.hh:78
OpenMesh::Decimater::ModBaseT
Base class for all decimation modules.
Definition: ModBaseT.hh:190
OpenMesh::Decimater::BaseDecimaterT::mesh
Mesh & mesh()
access mesh. used in modules.
Definition: BaseDecimaterT.hh:117
OpenMesh::Decimater::MixedDecimaterT::decimate_to
size_t decimate_to(size_t _n_vertices, const float _mc_factor)
Decimate to target complexity, returns number of collapses.
Definition: MixedDecimaterT.hh:103
DecimaterT.hh
MixedDecimaterT.cc
McDecimaterT.hh