OMToolkit  1.0
The polygonal mesh processing tool.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Protected Types | List of all members
OMToolkit::OMFilter< Mesh, MatrixT > Class Template Reference

#include <OMFilter.h>

Public Member Functions

 OMFilter (Mesh *mesh)
 
bool LoadFile (std::string filename)
 
bool SaveFile (std::string filename)
 
bool FilterAll (const OpenMesh::VPropHandleT< MatrixT > &matrixHandle)
 
bool WeightAll (const OpenMesh::VPropHandleT< MatrixT > &matrixHandle)
 
bool MeanAll (const OpenMesh::VPropHandleT< MatrixT > &matrixHandle)
 
bool MedianAll (const OpenMesh::VPropHandleT< MatrixT > &matrixHandle)
 
bool MinAll (const OpenMesh::VPropHandleT< MatrixT > &matrixHandle)
 
bool MaxAll (const OpenMesh::VPropHandleT< MatrixT > &matrixHandle)
 
bool AbsAll (const OpenMesh::VPropHandleT< MatrixT > &matrixHandle)
 
bool VarianceAll (const OpenMesh::VPropHandleT< MatrixT > &matrixHandle)
 

Protected Types

typedef MatrixT::Scalar Scalar
 

Detailed Description

template<class Mesh, class MatrixT>
class OMToolkit::OMFilter< Mesh, MatrixT >

Class filtering informations saved in vertex projection matrix

Template Parameters
MeshMesh type to work with
MatrixTType of vertex matrix property

Member Typedef Documentation

template<class Mesh, class MatrixT>
typedef MatrixT::Scalar OMToolkit::OMFilter< Mesh, MatrixT >::Scalar
protected

Scalar type in matrices

Constructor & Destructor Documentation

template<class Mesh, class MatrixT>
OMFilter::OMFilter ( Mesh *  mesh)

Constructor - initializes vital variables and makes a liaison with target mesh

Parameters
meshMesh to work with

Member Function Documentation

template<class Mesh, class MatrixT>
bool OMFilter::AbsAll ( const OpenMesh::VPropHandleT< MatrixT > &  matrixHandle)

Saves a max distance of attached vertex matrix from a plane into attribute vector Save is done by push back

Parameters
matrixHandleHandle to a matrix - universal property handle
Returns
True if all computation completed successfully
template<class Mesh, class MatrixT>
bool OMFilter::FilterAll ( const OpenMesh::VPropHandleT< MatrixT > &  matrixHandle)

Filters matrices attached to each vertex and returns value in the middle Provides only fast filtering - computes only value in the middle of a matrix Vertex matrix must have the same size asi filter kernel Kernel must be loaded from file before calling this function Result is saved into attribute vector (push back) If there is multiple filtering kernels, result is computed as eucleidian norm of result vector (result = sqrt(x^2 + y^2 + ... + z^2))

Parameters
matrixHandleHandle to a matrix - universal property handle
Returns
True if all computation completed successfully
template<class Mesh, class MatrixT>
bool OMFilter::LoadFile ( std::string  filename)

Function loads a file with saved filter matrix File can contain multiple matrices - all are loaded Structure of a file is following:

Matrix 2 2 3 4 1 2

First row contains keyword Matrix with specified dimensions, the other rows contains values After this, another header can follow with second matrix

Parameters
filenameFile name
Returns
True, if loaded successfully
template<class Mesh, class MatrixT>
bool OMFilter::MaxAll ( const OpenMesh::VPropHandleT< MatrixT > &  matrixHandle)

Saves maximal value of attached vertex matrix into attribute vector Save is done by push back

Parameters
matrixHandleHandle to a matrix - universal property handle
Returns
True if all computation completed successfully
template<class Mesh, class MatrixT>
bool OMFilter::MeanAll ( const OpenMesh::VPropHandleT< MatrixT > &  matrixHandle)

Saves mean value of attached vertex matrix into attribute vector Save is done by push back

Parameters
matrixHandleHandle to a matrix - universal property handle
Returns
True if all computation completed successfully
template<class Mesh, class MatrixT>
bool OMFilter::MedianAll ( const OpenMesh::VPropHandleT< MatrixT > &  matrixHandle)

Saves median value of attached vertex matrix into attribute vector Save is done by push back

Parameters
matrixHandleHandle to a matrix - universal property handle
Returns
True if all computation completed successfully
template<class Mesh, class MatrixT>
bool OMFilter::MinAll ( const OpenMesh::VPropHandleT< MatrixT > &  matrixHandle)

Saves minimal value of attached vertex matrix into attribute vector Save is done by push back

Parameters
matrixHandleHandle to a matrix - universal property handle
Returns
True if all computation completed successfully
template<class Mesh, class MatrixT>
bool OMFilter::SaveFile ( std::string  filename)

Function saves internal matrices into file

Parameters
filenameFile name
Returns
True, if saved successfully
template<class Mesh, class MatrixT>
bool OMFilter::VarianceAll ( const OpenMesh::VPropHandleT< MatrixT > &  matrixHandle)

Saves a variance of attached vertex matrix from a plane into attribute vector Save is done by push back

Parameters
matrixHandleHandle to a matrix - universal property handle
Returns
True if all computation completed successfully
template<class Mesh, class MatrixT>
bool OMFilter::WeightAll ( const OpenMesh::VPropHandleT< MatrixT > &  matrixHandle)

Multiplies each element of the matrix with corresponding weight in filter matrix Vertex matrix must have the same size asi filter kernel Kernel must be loaded from file before calling this function If there is multiple filtering kernels, weighting is computed in series

Parameters
matrixHandleHandle to a matrix - universal property handle
Returns
True if all computation completed successfully

The documentation for this class was generated from the following files: