Developer Documentation
OpenMesh::Decimater::ModProgMeshT< MeshT > Class Template Reference

#include <OpenFlipper/libs_required/OpenMesh/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh>

Inheritance diagram for OpenMesh::Decimater::ModProgMeshT< MeshT >:
OpenMesh::Decimater::ModBaseT< MeshT >

Classes

struct  Info
 

Public Types

typedef std::vector< InfoInfoList
 Type of the list storing the progressive mesh info Info. More...
 
- Public Types inherited from OpenMesh::Decimater::ModBaseT< MeshT >
enum  { ILLEGAL_COLLAPSE = -1 , LEGAL_COLLAPSE = 0 }
 
typedef MeshT Mesh
 
typedef CollapseInfoT< MeshTCollapseInfo
 

Public Member Functions

 DECIMATING_MODULE (ModProgMeshT, MeshT, ProgMesh)
 
 ModProgMeshT (MeshT &_mesh)
 Constructor. More...
 
 ~ModProgMeshT ()
 Destructor. More...
 
const InfoListpmi () const
 
void postprocess_collapse (const CollapseInfo &_ci) override
 
bool is_binary (void) const
 
bool write (const std::string &_ofname)
 
const InfoListinfolist () const
 Reference to collected information. More...
 
- Public Member Functions inherited from OpenMesh::Decimater::ModBaseT< MeshT >
virtual ~ModBaseT ()
 Virtual desctructor. More...
 
virtual const std::string & name () const
 Set module's name. More...
 
bool is_binary (void) const
 Returns true if criteria returns a binary value. More...
 
void set_binary (bool _b)
 Set whether module is binary or not. More...
 
virtual void initialize ()
 Initialize module-internal stuff. More...
 
virtual float collapse_priority (const CollapseInfoT< MeshT > &)
 
virtual void preprocess_collapse (const CollapseInfoT< MeshT > &)
 
virtual void postprocess_collapse (const CollapseInfoT< MeshT > &)
 
virtual void set_error_tolerance_factor (double _factor)
 

Private Attributes

InfoList pmi_
 
VPropHandleT< size_t > idx_
 

Additional Inherited Members

- Protected Member Functions inherited from OpenMesh::Decimater::ModBaseT< MeshT >
 ModBaseT (MeshT &_mesh, bool _is_binary)
 
MeshTmesh ()
 Access the mesh associated with the decimater. More...
 
- Protected Attributes inherited from OpenMesh::Decimater::ModBaseT< MeshT >
double error_tolerance_factor_
 

Detailed Description

template<class MeshT>
class OpenMesh::Decimater::ModProgMeshT< MeshT >

Collect progressive mesh information while decimating.

The progressive mesh data is stored in an internal structure, which can be evaluated after the decimation process and (!) before calling the garbage collection of the decimated mesh.

Definition at line 80 of file ModProgMeshT.hh.

Member Typedef Documentation

◆ InfoList

template<class MeshT >
typedef std::vector<Info> OpenMesh::Decimater::ModProgMeshT< MeshT >::InfoList

Type of the list storing the progressive mesh info Info.

Definition at line 105 of file ModProgMeshT.hh.

Constructor & Destructor Documentation

◆ ModProgMeshT()

template<class MeshT >
OpenMesh::Decimater::ModProgMeshT< MeshT >::ModProgMeshT ( MeshT _mesh)
inlineexplicit

Constructor.

Definition at line 111 of file ModProgMeshT.hh.

◆ ~ModProgMeshT()

template<class MeshT >
OpenMesh::Decimater::ModProgMeshT< MeshT >::~ModProgMeshT ( )
inline

Destructor.

Definition at line 118 of file ModProgMeshT.hh.

Member Function Documentation

◆ infolist()

template<class MeshT >
const InfoList & OpenMesh::Decimater::ModProgMeshT< MeshT >::infolist ( ) const
inline

Reference to collected information.

Definition at line 170 of file ModProgMeshT.hh.

◆ is_binary()

template<class MeshT >
bool OpenMesh::Decimater::ModProgMeshT< MeshT >::is_binary ( void  ) const
inline

Definition at line 139 of file ModProgMeshT.hh.

◆ pmi()

template<class MeshT >
const InfoList & OpenMesh::Decimater::ModProgMeshT< MeshT >::pmi ( ) const
inline

Definition at line 123 of file ModProgMeshT.hh.

◆ postprocess_collapse()

template<class MeshT >
void OpenMesh::Decimater::ModProgMeshT< MeshT >::postprocess_collapse ( const CollapseInfo _ci)
inlineoverride

Stores collapse information in a queue.

See also
infolist()

Definition at line 133 of file ModProgMeshT.hh.

◆ write()

template<class MeshT >
bool OpenMesh::Decimater::ModProgMeshT< MeshT >::write ( const std::string &  _ofname)

Write progressive mesh data to a file in proprietary binary format .pm.

The methods uses the collected data to write a progressive mesh file. It's a binary format with little endian byte ordering:

  • The first 8 bytes contain the word "ProgMesh".
  • 32-bit int for the number of vertices NV in the base mesh.
  • 32-bit int for the number of faces in the base mesh.
  • 32-bit int for the number of halfedge collapses (now vertex splits)
  • Positions of vertices of the base mesh (32-bit float triplets).
    [x,y,z][x,y,z]...
  • Triplets of indices (32-bit int) for each triangle (index in the list of vertices of the base mesh defined by the positions.
    [v0,v1,v2][v0,v1,v2]...
  • For each collapse/split a detail information package made of 3 32-bit floats for the positions of vertex v0, and 3 32-bit int indices for v1, vl, and vr. The index for vl or vr might be -1, if the face on this side of the edge does not exists.
Remarks
Write file before calling the garbage collection of the mesh.
Parameters
_ofnameName of the file, where to write the progressive mesh
Returns
true on success of the operation, else false.

Definition at line 81 of file ModProgMeshT_impl.hh.

Member Data Documentation

◆ idx_

template<class MeshT >
VPropHandleT<size_t> OpenMesh::Decimater::ModProgMeshT< MeshT >::idx_
private

Definition at line 175 of file ModProgMeshT.hh.

◆ pmi_

template<class MeshT >
InfoList OpenMesh::Decimater::ModProgMeshT< MeshT >::pmi_
private

Definition at line 174 of file ModProgMeshT.hh.


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