Entire Class Index | Main Class Index | Cross Index | Global Index

# Class CL_BezierSurface

Class for Bezier surfaces
Contained in: global
Derived from: none
Derived by: none
Group: Core (Math)

#include <ClanLib/core.h>

### public function member index:

### Construction:

`` | `CL_BezierSurface` | `(`const` `CL_Vector`* `cp`, `int` `xs`, `int` `ys`, `int` `xsteps`, `int` `ysteps`, `bool` `stepping` = true)`;
``virtual`` | `~CL_BezierSurface` | `()`;

### Attributes:

``virtual` `int`` | `get_xsteps` | `() `const``;
``virtual` `int`` | `get_ysteps` | `() `const``;
``virtual` `int`` | `get_xs` | `() `const``;
``virtual` `int`` | `get_ys` | `() `const``;
``virtual` `bool`` | `get_stepping` | `() `const``;
``virtual` `CL_Vector`*` | `get_surface` | `() `const``;
``virtual` `CL_Vector`*` | `get_control_points` | `() `const``;

### Operations:

``virtual` `void`` | `set_xsteps` | `(`int` `xsteps`)`;
``virtual` `void`` | `set_ysteps` | `(`int` `ysteps`)`;
``virtual` `void`` | `set_stepping` | `(`bool` `stepping`)`;

### Operators:

``CL_Vector`` | `operator``[]` | `(`int` `n`)`;

### protected function member index:

``virtual` `CL_Vector`` | `evaluate` | `(`float`, `float`, `int`)`;
``virtual` `void`` | `make_surface` | `()`;

## Description:

This class generates points on a Bezier surface from given control points
USE AT YOUR OWN RISK TILL THIS CLASS IS EXTENSIVELY TESTED!!! I WILL REMOVE THIS WARNING ONCE IT BASICALLY WORKS.
I hate documentation work and I won't document this code before any one besides me actually uses it. So if you want to use it simply write a mail on the ClanLib User list and I will do what I can :-)
1999/12/30 vogel renamed CL_Bezier to CL_BezierCurve
added CL_BezierSurface
1999/07/07 vogel initial version
BezierCurve TODO:
- length and stepping per curve
stepping per curve means that the generated points are equidistant to each other and this requires get_length() working. So at the moment all that is working is having 'n' equidistant points per segment.
same applies to BezierSurface.

## Function Member Descriptions:

CL_BezierSurface::CL_BezierSurface - Constructor
`` `CL_BezierSurface` `(`const` `CL_Vector`* `cp`, `int` `xs`, `int` `ys`, `int` `xsteps`, `int` `ysteps`, `bool` `stepping` = true)`;

> cp - an array of control points with size (16 * xs * ys)
> xs - number of surface segments on x direction
> ys - number of surface segments on y direction
> xsteps - number of points to generate on x direction
> ysteps - number of points to generate on x direction
> stepping - whether steps is the number of points per segment or per surface.

CL_BezierSurface::get_control_points - Returns the 16 * xs * ys control points
``virtual` `CL_Vector`*` `get_control_points` `() `const``;

> Returns - the 16 * xs * ys control points

CL_BezierSurface::get_stepping - Returns whether steps is the number of points per segment or per curve.
``virtual` `bool`` `get_stepping` `() `const``;

> Returns - stepping

CL_BezierSurface::get_surface - Nak Nak - don't expect it to be implemented too soon...
Returns the length of a segment (or the surface)
Returns an array of xs * xsteps * ys * ysteps CL_Vectors -> the surface
``virtual` `CL_Vector`*` `get_surface` `() `const``;

> Returns - the curve (xs * xsteps * ys * ystepes CL_Vectors)

CL_BezierSurface::get_xs - Returns the number of steps
Returns the number of surface segments
``virtual` `int`` `get_xs` `() `const``;

> Returns - number of surface segments

CL_BezierSurface::get_xsteps - Returns the number of steps
``virtual` `int`` `get_xsteps` `() `const``;

> Returns - number of steps

CL_BezierSurface::get_ys - Returns the number of surface segments
``virtual` `int`` `get_ys` `() `const``;

> Returns - number of surface segments

CL_BezierSurface::operator [] - Returns the n-th vector of the curve (_doesn't_ return a reference)
``CL_Vector`` `operator``[]` `(`int` `n`)`;

> n - the vector to return (counting starts at 0)
> Returns - the n-th vector of the curve (_doesn't_ return a reference)

CL_BezierSurface::set_stepping - Sets the stepping
``virtual` `void`` `set_stepping` `(`bool` `stepping`)`;

> stepping - whether steps is the number of points per segment or per curve.

CL_BezierSurface::set_xsteps - Sets the number of steps
``virtual` `void`` `set_xsteps` `(`int` `xsteps`)`;

> steps - number of steps

CL_BezierSurface::set_ysteps - Sets the number of steps
``virtual` `void`` `set_ysteps` `(`int` `ysteps`)`;

> steps - number of steps

CL_BezierSurface::~CL_BezierSurface - Destructor
``virtual`` `~CL_BezierSurface` `()`;

## Variable Member Descriptions: