OMToolkit  1.0
The polygonal mesh processing tool.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
OMFilter.h
Go to the documentation of this file.
1 //==============================================================================
14 #ifndef _OM_FILTER_H_
15 #define _OM_FILTER_H_
16 
17 #include <OpenMesh\Core\Utils\Property.hh>
18 #include <fstream>
19 
20 namespace OMToolkit
21 {
27  template <class Mesh, class MatrixT>
28  class OMFilter
29  {
30  protected:
34  typedef typename MatrixT::Scalar Scalar;
35 
36  public:
41  OMFilter(Mesh *mesh);
42 
57  bool LoadFile(std::string filename);
58 
64  bool SaveFile(std::string filename);
65 
77  bool FilterAll(const OpenMesh::VPropHandleT<MatrixT> &matrixHandle);
78 
87  bool WeightAll(const OpenMesh::VPropHandleT<MatrixT> &matrixHandle);
88 
95  bool MeanAll(const OpenMesh::VPropHandleT<MatrixT> &matrixHandle);
96 
103  bool MedianAll(const OpenMesh::VPropHandleT<MatrixT> &matrixHandle);
104 
111  bool MinAll(const OpenMesh::VPropHandleT<MatrixT> &matrixHandle);
112 
119  bool MaxAll(const OpenMesh::VPropHandleT<MatrixT> &matrixHandle);
120 
127  bool AbsAll(const OpenMesh::VPropHandleT<MatrixT> &matrixHandle);
128 
135  bool VarianceAll(const OpenMesh::VPropHandleT<MatrixT> &matrixHandle);
136 
137  private:
138 
145  inline Scalar filterOne(typename Mesh::VertexHandle &vertex, const OpenMesh::VPropHandleT<MatrixT> &matrixHandle);
146 
152  inline void filterOneSmall(typename Mesh::VertexHandle &vertex, const OpenMesh::VPropHandleT<MatrixT> &matrixHandle);
153 
159  inline void weightOne(typename Mesh::VertexHandle &vertex, const OpenMesh::VPropHandleT<MatrixT> &matrixHandle);
160 
161 
165  std::vector<MatrixT> m_filterKernel;
166 
170  unsigned int m_numKernels;
171 
175  Mesh *m_mesh;
176 
180  bool m_loaded;
181  };
182 
183  #include <OMToolkit\OMFilter.hxx>
184 } // namespace OMToolkit
185 
186 #endif