# Visualization Library

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

[Home] [Tutorials] [All Classes] [Grouped Classes]

# vl::EdgeExtractor Class Reference

The EdgeExtractor class extracts the edges from one or more Geometry objects. More...

`#include <EdgeExtractor.hpp>`

Inheritance diagram for vl::EdgeExtractor:

List of all members.

## Classes

class | Edge
| A single edge as extracted from the EdgeExtractor class. More...

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| EdgeExtractor ()
void | extractEdges (Geometry *geom)
| Extracts the edges from the given Geometry and appends them to edges().
bool | extractEdges (Actor *actor)
void | extractEdges (ActorCollection *actors)
void | extractEdges (SceneManager *scenemanager)
void | extractEdges (Rendering *rendering)
ref< Geometry > | generateEdgeGeometry () const
const std::vector< Edge > & | edges () const
std::vector< Edge > & | edges ()
void | reset ()
float | creaseAngle () const
| The minimum angle (in degrees) considered to generate crease-edges.
void | setCreaseAngle (float a)
| The minimum angle (in degrees) considered to generate crease-edges.
bool | warnNonManifold () const
void | setWarnNonManifold (bool warn_on)

## Protected Member Functions

void | addEdge (std::set< EdgeExtractor::Edge > &edges, const EdgeExtractor::Edge &e, const fvec3 &n)

## Protected Attributes

std::vector< Edge > | mEdges
float | mCreaseAngle
bool | mWarnNonManifold

## Detailed Description

The EdgeExtractor class extracts the edges from one or more Geometry objects.

The edges are always extracted from the triangles or quads that are part of a vl::Geometry and can be of three types: silhouette edges, crease edges and boundary edges.

- Silhouette edges are those edges that are shared by a backfacing and front facing quad or triangle.

- Crease edges are those edges that are shared by two triangles or quads and that form an angle >= creaseAngle(), ie: 0 means that the two triangles or quads are coplanar; the edges of a cube define 90 degrees angles; the lateral edges of a 10 faces cylinder define 36 (360/10) degrees angles and so on.

- Boundary edges are those edges that belong to a single triangle or quad.

Usage
  - Extract the edges from one or more Geometry objects using one of the extractEdges() methods.
  - Assign the Geometry returned by generateEdgeGeometry() to a new Actor. This geometry will contain the edges previously extracted ready to be rendered.
  - Assign a new EdgeUpdateCallback to the previously created Actor, using the Actor::renderingCallbacks() method.
  - Initialize the previously created EdgeUpdateCallback edges with the edges extracted by the EdgeExtractor, that is, assign EdgeExtractor::edges() to EdgeUpdateCallback::edges().

See also:
  - Edge Enhancement and Wireframe Rendering Tutorial
  - vl::EdgeRenderer

## Constructor & Destructor Documentation

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

## Member Function Documentation

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

Returns the name of the class.

Reimplemented from vl::Object.

void EdgeExtractor::extractEdges | ( | Geometry * | geom | ) |

Extracts the edges from the given Geometry and appends them to edges().

The given geometry must have a vertex array of format ArrayFVec3.

bool EdgeExtractor::extractEdges | ( | Actor * | actor | ) |

void EdgeExtractor::extractEdges | ( | ActorCollection * | actors | ) |

void EdgeExtractor::extractEdges | ( | SceneManager * | scenemanager | ) |

void EdgeExtractor::extractEdges | ( | Rendering * | rendering | ) |

ref< Geometry > EdgeExtractor::generateEdgeGeometry | ( |  | ) | const

const std::vector<Edge>& vl::EdgeExtractor::edges | ( |  | ) | const`[inline]`

std::vector<Edge>& vl::EdgeExtractor::edges | ( |  | ) | `[inline]`

void vl::EdgeExtractor::reset | ( |  | ) | `[inline]`

float vl::EdgeExtractor::creaseAngle | ( |  | ) | const`[inline]`

The minimum angle (in degrees) considered to generate crease-edges.

void vl::EdgeExtractor::setCreaseAngle | ( | float | a | ) | `[inline]`

The minimum angle (in degrees) considered to generate crease-edges.

bool vl::EdgeExtractor::warnNonManifold | ( |  | ) | const`[inline]`

void vl::EdgeExtractor::setWarnNonManifold | ( | bool | warn_on | ) | `[inline]`

void EdgeExtractor::addEdge | ( | std::set< EdgeExtractor::Edge > & | edges,
|  | const EdgeExtractor::Edge & | e,
|  | const fvec3 & | n |
| ) |  |  | `[protected]`

## Member Data Documentation

std::vector<Edge> vl::EdgeExtractor::mEdges`[protected]`

float vl::EdgeExtractor::mCreaseAngle`[protected]`

bool vl::EdgeExtractor::mWarnNonManifold`[protected]`

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

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

Visualization Library v2009.07 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Mon Aug 10 21:41:34 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.