Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

ModProgMeshT.hh

Go to the documentation of this file.
00001 //=============================================================================
00002 //                                                                            
00003 //                               OpenMesh                                     
00004 //        Copyright (C) 2003 by Computer Graphics Group, RWTH Aachen          
00005 //                           www.openmesh.org                                 
00006 //                                                                            
00007 //-----------------------------------------------------------------------------
00008 //                                                                            
00009 //                                License                                     
00010 //                                                                            
00011 //   This library is free software; you can redistribute it and/or modify it 
00012 //   under the terms of the GNU Library General Public License as published  
00013 //   by the Free Software Foundation, version 2.                             
00014 //                                                                             
00015 //   This library is distributed in the hope that it will be useful, but       
00016 //   WITHOUT ANY WARRANTY; without even the implied warranty of                
00017 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         
00018 //   Library General Public License for more details.                          
00019 //                                                                            
00020 //   You should have received a copy of the GNU Library General Public         
00021 //   License along with this library; if not, write to the Free Software       
00022 //   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 
00023 //                                                                            
00024 //-----------------------------------------------------------------------------
00025 //                                                                            
00026 //   $Revision: 1.5 $
00027 //   $Date: 2004/01/13 15:23:09 $
00028 //                                                                            
00029 //=============================================================================
00030 
00035 //=============================================================================
00036 //
00037 //  CLASS ModProgMeshT
00038 //
00039 //=============================================================================
00040 
00041 #ifndef OPENMESH_TOOLS_MODPROGMESHT_HH
00042 #define OPENMESH_TOOLS_MODPROGMESHT_HH
00043 
00044 
00045 //== INCLUDES =================================================================
00046 
00047 #include <OpenMesh/Tools/Decimater/ModBaseT.hh>
00048 #include <OpenMesh/Core/Utils/Property.hh>
00049 
00050 
00051 //== NAMESPACE ================================================================
00052 
00053 namespace OpenMesh  {
00054 namespace Decimater {
00055 
00056 
00057 //== CLASS DEFINITION =========================================================
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: // inherited
00112 
00113 
00116   void postprocess_collapse(const CollapseInfo& _ci)
00117   { 
00118     pmi_.push_back( Info( _ci ) );
00119   }
00120 
00121 public: // specific methods
00122 
00147   bool write( const std::string& _ofname );
00148 
00149 
00151   const InfoList& infolist() const { return pmi_; }
00152 
00153 private:
00154   
00155   // hide this method form user
00156   void set_binary(bool _b) {}
00157 
00158   InfoList          pmi_;
00159   VPropHandleT<int> idx_;
00160 };
00161 
00162 
00163 //=============================================================================
00164 } // END_NS_DECIMATER
00165 } // END_NS_OPENMESH
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 

acg pic Project OpenMesh, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .