Visualization Library v1.0.3

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

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:
vl::Object

List of all members.

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)

Protected Member Functions

void outputSimplifiedGeometry ()
void collapse (Vertex *v)
void computeCollapseInfo (Vertex *v)

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

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

vl::PolygonSimplifier::PolygonSimplifier (  ) [inline]

Definition at line 321 of file PolygonSimplifier.hpp.


Member Function Documentation

void PolygonSimplifier::simplify (  )
void PolygonSimplifier::simplify ( const std::vector< fvec3 > &  in_verts,
const std::vector< int > &  in_tris 
)
void vl::PolygonSimplifier::setIntput ( Geometry geom ) [inline]

Definition at line 326 of file PolygonSimplifier.hpp.

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

Definition at line 327 of file PolygonSimplifier.hpp.

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

Definition at line 328 of file PolygonSimplifier.hpp.

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

Definition at line 330 of file PolygonSimplifier.hpp.

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

Definition at line 331 of file PolygonSimplifier.hpp.

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

Definition at line 333 of file PolygonSimplifier.hpp.

Referenced by simplify().

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

Definition at line 334 of file PolygonSimplifier.hpp.

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

Definition at line 336 of file PolygonSimplifier.hpp.

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

Definition at line 338 of file PolygonSimplifier.hpp.

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

Definition at line 339 of file PolygonSimplifier.hpp.

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

Definition at line 341 of file PolygonSimplifier.hpp.

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

Definition at line 342 of file PolygonSimplifier.hpp.

void PolygonSimplifier::clearTrianglesAndVertices (  )

Definition at line 412 of file PolygonSimplifier.cpp.

References mProtectedVerts, mSimplifiedTriangles, and mSimplifiedVertices.

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

Definition at line 346 of file PolygonSimplifier.hpp.

Referenced by simplify().

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

Definition at line 347 of file PolygonSimplifier.hpp.

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

Definition at line 349 of file PolygonSimplifier.hpp.

Referenced by simplify().

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

Definition at line 350 of file PolygonSimplifier.hpp.

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

Definition at line 352 of file PolygonSimplifier.hpp.

Referenced by collapse(), and computeCollapseInfo().

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

Definition at line 353 of file PolygonSimplifier.hpp.

void PolygonSimplifier::outputSimplifiedGeometry (  ) [protected]
void vl::PolygonSimplifier::collapse ( Vertex v ) [inline, protected]
void vl::PolygonSimplifier::computeCollapseInfo ( Vertex v ) [inline, protected]

Member Data Documentation

Definition at line 361 of file PolygonSimplifier.hpp.

Referenced by outputSimplifiedGeometry(), and simplify().

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

Definition at line 362 of file PolygonSimplifier.hpp.

Referenced by outputSimplifiedGeometry().

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

Definition at line 363 of file PolygonSimplifier.hpp.

Referenced by simplify().

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

Definition at line 366 of file PolygonSimplifier.hpp.

Referenced by clearTrianglesAndVertices(), and simplify().

Definition at line 367 of file PolygonSimplifier.hpp.

Definition at line 368 of file PolygonSimplifier.hpp.

Definition at line 369 of file PolygonSimplifier.hpp.


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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:11.
Permission is granted to use this page to write and publish articles regarding Visualization Library.