Visualization Library 2.1.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vl::PolygonSimplifier Class Reference

The PolygonSimplifier class reduces the amount of polygons present in a Geometry using a quadric error metric. More...

#include <PolygonSimplifier.hpp>

+ Inheritance diagram for vl::PolygonSimplifier:

Classes

class  QErr
 The quadric error metric as defined by PolygonSimplifier. More...
 
class  Triangle
 A Triangle as defined by PolygonSimplifier. More...
 
class  Vertex
 A Vertex as defined by PolygonSimplifier. More...
 

Public Member Functions

 PolygonSimplifier ()
 
void simplify ()
 
void simplify (const std::vector< fvec3 > &in_verts, const std::vector< int > &in_tris)
 
void setIntput (Geometry *geom)
 
Geometryinput ()
 
const Geometryinput () const
 
std::vector< u32 > & targets ()
 
const std::vector< u32 > & targets () const
 
std::vector< ref< Geometry > > & output ()
 
const std::vector< ref< Geometry > > & output () const
 
void setProtectedVertices (const std::vector< int > &protected_verts)
 
int simplifiedVerticesCount () const
 
VertexsimplifiedVertices (int index) const
 
int simplifiedTrianglesCount () const
 
TrianglesimplifiedTriangles (int index) const
 
void clearTrianglesAndVertices ()
 
bool removeDoubles () const
 
void setRemoveDoubles (bool remove_doubles)
 
bool verbose () const
 
void setVerbose (bool verbose)
 
bool quick () const
 
void setQuick (bool quick)
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Objectoperator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Protected Member Functions

void outputSimplifiedGeometry ()
 
void collapse (Vertex *v)
 
void computeCollapseInfo (Vertex *v)
 
- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Protected Attributes

ref< GeometrymInput
 
std::vector< ref< Geometry > > mOutput
 
std::vector< u32mTargets
 
std::vector< Vertex * > mSimplifiedVertices
 
std::vector< Triangle * > mSimplifiedTriangles
 
std::vector< int > mProtectedVerts
 
bool mRemoveDoubles
 
bool mVerbose
 
bool mQuick
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Detailed Description

The PolygonSimplifier class reduces the amount of polygons present in a Geometry using a quadric error metric.

The algorithm simplifies only the position array of the Geometry all the other vertex attributes will be discarded.

Definition at line 52 of file PolygonSimplifier.hpp.

Constructor & Destructor Documentation

◆ PolygonSimplifier()

vl::PolygonSimplifier::PolygonSimplifier ( )
inline

Definition at line 321 of file PolygonSimplifier.hpp.

Member Function Documentation

◆ clearTrianglesAndVertices()

void PolygonSimplifier::clearTrianglesAndVertices ( )

Definition at line 408 of file PolygonSimplifier.cpp.

◆ collapse()

void vl::PolygonSimplifier::collapse ( Vertex v)
inlineprotected

◆ computeCollapseInfo()

void vl::PolygonSimplifier::computeCollapseInfo ( Vertex v)
inlineprotected

◆ input() [1/2]

Geometry* vl::PolygonSimplifier::input ( )
inline

Definition at line 327 of file PolygonSimplifier.hpp.

◆ input() [2/2]

const Geometry* vl::PolygonSimplifier::input ( ) const
inline

Definition at line 328 of file PolygonSimplifier.hpp.

◆ output() [1/2]

std::vector< ref<Geometry> >& vl::PolygonSimplifier::output ( )
inline

Definition at line 333 of file PolygonSimplifier.hpp.

◆ output() [2/2]

const std::vector< ref<Geometry> >& vl::PolygonSimplifier::output ( ) const
inline

Definition at line 334 of file PolygonSimplifier.hpp.

◆ outputSimplifiedGeometry()

void PolygonSimplifier::outputSimplifiedGeometry ( )
protected

◆ quick()

bool vl::PolygonSimplifier::quick ( ) const
inline

Definition at line 352 of file PolygonSimplifier.hpp.

◆ removeDoubles()

bool vl::PolygonSimplifier::removeDoubles ( ) const
inline

Definition at line 346 of file PolygonSimplifier.hpp.

◆ setIntput()

void vl::PolygonSimplifier::setIntput ( Geometry geom)
inline

Definition at line 326 of file PolygonSimplifier.hpp.

◆ setProtectedVertices()

void vl::PolygonSimplifier::setProtectedVertices ( const std::vector< int > &  protected_verts)
inline

Definition at line 336 of file PolygonSimplifier.hpp.

◆ setQuick()

void vl::PolygonSimplifier::setQuick ( bool  quick)
inline

Definition at line 353 of file PolygonSimplifier.hpp.

◆ setRemoveDoubles()

void vl::PolygonSimplifier::setRemoveDoubles ( bool  remove_doubles)
inline

Definition at line 347 of file PolygonSimplifier.hpp.

◆ setVerbose()

void vl::PolygonSimplifier::setVerbose ( bool  verbose)
inline

Definition at line 350 of file PolygonSimplifier.hpp.

◆ simplifiedTriangles()

Triangle* vl::PolygonSimplifier::simplifiedTriangles ( int  index) const
inline

Definition at line 342 of file PolygonSimplifier.hpp.

◆ simplifiedTrianglesCount()

int vl::PolygonSimplifier::simplifiedTrianglesCount ( ) const
inline

Definition at line 341 of file PolygonSimplifier.hpp.

◆ simplifiedVertices()

Vertex* vl::PolygonSimplifier::simplifiedVertices ( int  index) const
inline

Definition at line 339 of file PolygonSimplifier.hpp.

◆ simplifiedVerticesCount()

int vl::PolygonSimplifier::simplifiedVerticesCount ( ) const
inline

Definition at line 338 of file PolygonSimplifier.hpp.

◆ simplify() [1/2]

void PolygonSimplifier::simplify ( )

◆ simplify() [2/2]

void PolygonSimplifier::simplify ( const std::vector< fvec3 > &  in_verts,
const std::vector< int > &  in_tris 
)

◆ targets() [1/2]

std::vector< u32 >& vl::PolygonSimplifier::targets ( )
inline

Definition at line 330 of file PolygonSimplifier.hpp.

◆ targets() [2/2]

const std::vector< u32 >& vl::PolygonSimplifier::targets ( ) const
inline

Definition at line 331 of file PolygonSimplifier.hpp.

◆ verbose()

bool vl::PolygonSimplifier::verbose ( ) const
inline

Definition at line 349 of file PolygonSimplifier.hpp.

Member Data Documentation

◆ mInput

ref<Geometry> vl::PolygonSimplifier::mInput
protected

Definition at line 361 of file PolygonSimplifier.hpp.

◆ mOutput

std::vector< ref<Geometry> > vl::PolygonSimplifier::mOutput
protected

Definition at line 362 of file PolygonSimplifier.hpp.

◆ mProtectedVerts

std::vector<int> vl::PolygonSimplifier::mProtectedVerts
protected

Definition at line 366 of file PolygonSimplifier.hpp.

◆ mQuick

bool vl::PolygonSimplifier::mQuick
protected

Definition at line 369 of file PolygonSimplifier.hpp.

◆ mRemoveDoubles

bool vl::PolygonSimplifier::mRemoveDoubles
protected

Definition at line 367 of file PolygonSimplifier.hpp.

◆ mSimplifiedTriangles

std::vector<Triangle*> vl::PolygonSimplifier::mSimplifiedTriangles
protected

Definition at line 365 of file PolygonSimplifier.hpp.

◆ mSimplifiedVertices

std::vector<Vertex*> vl::PolygonSimplifier::mSimplifiedVertices
protected

Definition at line 364 of file PolygonSimplifier.hpp.

◆ mTargets

std::vector< u32 > vl::PolygonSimplifier::mTargets
protected

Definition at line 363 of file PolygonSimplifier.hpp.

◆ mVerbose

bool vl::PolygonSimplifier::mVerbose
protected

Definition at line 368 of file PolygonSimplifier.hpp.


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