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

# vl::BezierSurface Class Reference

The BezierSurface class implements a Geometry that is capable of visualizing multiple bicubic Bézier patches (see BezierPatch). More...

`#include <BezierSurface.hpp>`

Inheritance diagram for vl::BezierSurface:

List of all members.

## Public Member Functions
virtual const char * | className ()
| Returns the name of the class.
| BezierSurface ()
| Constructor.
std::vector< ref< BezierPatch > > & | patches ()
| Returns the Bézier patches that are part of this Bézier surface.
const std::vector< ref < BezierPatch > > & | patches () const
| Returns the Bézier patches that are part of this Bézier surface.
void | setDetail (unsigned i)
| The sampling level of the patch, must not be less than 2. The higher the sampling level, the more detailed the patch will be.
unsigned | detail () const
| The sampling level of the patch, must not be less than 2. The higher the sampling level, the more detailed the patch will be.
void | updateBezierSurface (bool gen_tex_coords=true)
| Generates the Bézier surface geometry based on the current patches and detail.
## Protected Attributes
std::vector< ref< BezierPatch > > | mPatches
unsigned | mDetail

## Detailed Description

The BezierSurface class implements a Geometry that is capable of visualizing multiple bicubic Bézier patches (see BezierPatch).

From Wikipedia [http://en.wikipedia.org/wiki/Bézier_surface]:

"Bézier surfaces are a species of mathematical spline used in computer graphics, computer-aided design, and finite element modelling. As with the Bézier curve, a Bézier surface is defined by a set of control points. Similar to interpolation in many respects, a key difference is that the surface does not, in general, pass through the central control points; rather, it is "stretched" toward them as though each were an attractive force. They are visually intuitive, and for many applications, mathematically convenient."

"Bézier surfaces were first described in 1972 by the French engineer Pierre Bézier who used them to design automobile bodies. Bézier surfaces can be of any degree, but bicubic Bézier surfaces generally provide enough degrees of freedom for most applications."

See also:

- Bézier Patches and Surfaces Tutorial for a practical example on how to use the BezierSurface class.
- BezierPatch

## Constructor & Destructor Documentation

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

Constructor.

## Member Function Documentation

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

Returns the name of the class.

Reimplemented from vl::Geometry.

std::vector< ref<BezierPatch> >& vl::BezierSurface::patches | ( |  | ) | `[inline]`

Returns the Bézier patches that are part of this Bézier surface.

const std::vector< ref<BezierPatch> >& vl::BezierSurface::patches | ( |  | ) | const`[inline]`

Returns the Bézier patches that are part of this Bézier surface.

void vl::BezierSurface::setDetail | ( | unsigned | i | ) | `[inline]`

The sampling level of the patch, must not be less than 2. The higher the sampling level, the more detailed the patch will be.

unsigned vl::BezierSurface::detail | ( |  | ) | const`[inline]`

The sampling level of the patch, must not be less than 2. The higher the sampling level, the more detailed the patch will be.

void BezierSurface::updateBezierSurface | ( | bool | gen_tex_coords = `true` | ) |

Generates the Bézier surface geometry based on the current patches and detail.

Note that this method does not recompte the normals of the mesh, this means that if you are using the OpenGL lighting or other techniques requiring vertex normals you should call computeNormals() right after calling this function.

Parameters:

  | gen_tex_coords | If set to `true` the function will also generate normalized (0..1) texture coordinates.

## Member Data Documentation

std::vector< ref<BezierPatch> > vl::BezierSurface::mPatches`[protected]`

unsigned vl::BezierSurface::mDetail`[protected]`

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

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

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