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

MeshCheckerT.hh

00001 //=============================================================================
00002 //                                                                            
00003 //                               OpenMesh                                     
00004 //      Copyright (C) 2001-2005 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.2 $
00027 //   $Date: 2004/10/14 12:44:51 $
00028 //                                                                            
00029 //=============================================================================
00030 
00031 
00032 #ifndef OPENMESH_MESHCHECKER_HH
00033 #define OPENMESH_MESHCHECKER_HH
00034 
00035 
00036 //== INCLUDES =================================================================
00037 
00038 
00039 #include <OpenMesh/Core/System/config.hh>
00040 #include <OpenMesh/Core/System/omstream.hh>
00041 #include <OpenMesh/Core/Utils/GenProg.hh>
00042 #include <OpenMesh/Core/Attributes/Attributes.hh>
00043 #include <iostream>
00044 
00045 
00046 //== NAMESPACES ===============================================================
00047 
00048 
00049 namespace OpenMesh {
00050 namespace Utils {
00051 
00052 //== CLASS DEFINITION =========================================================
00053 
00054               
00059 template <class Mesh>
00060 class MeshCheckerT
00061 {
00062 public:
00063    
00065   MeshCheckerT(const Mesh& _mesh) : mesh_(_mesh) {}
00066  
00068   ~MeshCheckerT() {}
00069 
00070 
00072   enum CheckTargets
00073   {
00074     CHECK_EDGES     = 1,
00075     CHECK_VERTICES  = 2,
00076     CHECK_FACES     = 4,
00077     CHECK_ALL       = 255,
00078   };
00079 
00080   
00082   bool check( unsigned int _targets=CHECK_ALL,
00083               std::ostream&  _os=omerr() );
00084 
00085 
00086 private:
00087 
00088   bool is_deleted(typename Mesh::VertexHandle _vh) 
00089   { return (mesh_.has_vertex_status() ? mesh_.status(_vh).deleted() : false); }
00090 
00091   bool is_deleted(typename Mesh::EdgeHandle _eh) 
00092   { return (mesh_.has_edge_status() ? mesh_.status(_eh).deleted() : false); }
00093 
00094   bool is_deleted(typename Mesh::FaceHandle _fh) 
00095   { return (mesh_.has_face_status() ? mesh_.status(_fh).deleted() : false); }
00096 
00097 
00098   // ref to mesh
00099   const Mesh&  mesh_;
00100 };
00101 
00102 
00103 //=============================================================================
00104 } // namespace Utils
00105 } // namespace OpenMesh
00106 //=============================================================================
00107 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_MESHCHECKER_C)
00108 #define OPENMESH_MESHCHECKER_TEMPLATES
00109 #include "MeshCheckerT.cc"
00110 #endif
00111 //=============================================================================
00112 #endif // OPENMESH_MESHCHECKER_HH defined
00113 //=============================================================================
00114 

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