00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00035
00036
00037
00038
00039
00040
00041 #ifndef OPENMESH_TOOLS_MODPROGMESHT_HH
00042 #define OPENMESH_TOOLS_MODPROGMESHT_HH
00043
00044
00045
00046
00047 #include <OpenMesh/Tools/Decimater/ModBaseT.hh>
00048 #include <OpenMesh/Core/Utils/Property.hh>
00049
00050
00051
00052
00053 namespace OpenMesh {
00054 namespace Decimater {
00055
00056
00057
00058
00059
00066 template <class DecimaterType>
00067 class ModProgMeshT : public ModBaseT<DecimaterType>
00068 {
00069 public:
00070
00071 DECIMATING_MODULE( ModProgMeshT, DecimaterType, ProgMesh );
00072
00076 struct Info
00077 {
00080 Info( const CollapseInfo& _ci )
00081 : v0(_ci.v0), v1(_ci.v1), vl(_ci.vl),vr(_ci.vr)
00082 {}
00083
00084 typename Mesh::VertexHandle v0;
00085 typename Mesh::VertexHandle v1;
00086 typename Mesh::VertexHandle vl;
00087 typename Mesh::VertexHandle vr;
00088
00089 };
00090
00092 typedef std::vector<Info> InfoList;
00093
00094
00095 public:
00096
00098 ModProgMeshT( DecimaterType &_dec ) : Base(_dec, true)
00099 {
00100 mesh().add_property( idx_ );
00101 }
00102
00103
00105 ~ModProgMeshT()
00106 {
00107 mesh().remove_property( idx_ );
00108 }
00109
00110
00111 public:
00112
00113
00116 void postprocess_collapse(const CollapseInfo& _ci)
00117 {
00118 pmi_.push_back( Info( _ci ) );
00119 }
00120
00121 public:
00122
00147 bool write( const std::string& _ofname );
00148
00149
00151 const InfoList& infolist() const { return pmi_; }
00152
00153 private:
00154
00155
00156 void set_binary(bool _b) {}
00157
00158 InfoList pmi_;
00159 VPropHandleT<int> idx_;
00160 };
00161
00162
00163
00164 }
00165 }
00166
00167 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_DECIMATER_MODPROGMESH_CC)
00168 #define OSG_MODPROGMESH_TEMPLATES
00169 #include "ModProgMeshT.cc"
00170 #endif
00171
00172 #endif // OPENMESH_TOOLS_PROGMESHT_HH defined
00173
00174