# Visualization Library A lightweight C++ OpenGL middleware for 2D/3D graphics | [Home] [Tutorials] [All Classes] [Grouped Classes]

# 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:

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 ()
virtual const char * | className ()
| Returns the name of the class.
void | simplify (float simplification_ratio, Geometry *geom)
void | simplify (int target_vertex_count, Geometry *geom)
void | simplify (int target_vertex_count, std::vector< fvec3 > &in_out_verts, std::vector< int > &in_out_tris)
void | setProtectedVertices (const std::vector< int > &protected_verts)
int | simplifiedVerticesCount () const
Vertex * | simplifiedVertices (int index) const
int | simplifiedTrianglesCount () const
Triangle * | simplifiedTriangles (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 | collapse (Vertex *v)
void | computeCollapseInfo (Vertex *v)
## Protected Attributes
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.

## Constructor & Destructor Documentation

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

## Member Function Documentation

virtual const char* vl::PolygonSimplifier::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

void PolygonSimplifier::simplify | ( | float | simplification_ratio,
|  | Geometry * | geom |
| ) |  |  |

void PolygonSimplifier::simplify | ( | int | target_vertex_count,
|  | Geometry * | geom |
| ) |  |  |

void PolygonSimplifier::simplify | ( | int | target_vertex_count,
|  | std::vector< fvec3 > & | in_out_verts,
|  | std::vector< int > & | in_out_tris |
| ) |  |  |

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

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

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

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

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

void PolygonSimplifier::clearTrianglesAndVertices | ( |  | ) |

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

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

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

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

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

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

void vl::PolygonSimplifier::collapse | ( | Vertex * | v | ) | `[inline, protected]`

void vl::PolygonSimplifier::computeCollapseInfo | ( | Vertex * | v | ) | `[inline, protected]`

## Member Data Documentation

std::vector<Vertex*> vl::PolygonSimplifier::mSimplifiedVertices`[protected]`

std::vector<Triangle*> vl::PolygonSimplifier::mSimplifiedTriangles`[protected]`

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

bool vl::PolygonSimplifier::mRemoveDoubles`[protected]`

bool vl::PolygonSimplifier::mVerbose`[protected]`

bool vl::PolygonSimplifier::mQuick`[protected]`

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

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/PolygonSimplifier.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/PolygonSimplifier.cpp

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Sun Nov 8 14:29:01 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.