Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Defines one or more concatenated bicubic Bézier patches to be used with the BezierSurface class. More...
#include <BezierSurface.hpp>
Public Types | |
typedef std::vector< vec3 > | Points |
The control points grid defining the bicubic Bézier patch(es). More... | |
Public Member Functions | |
BezierPatch () | |
Constructor. More... | |
BezierPatch (int x, int y) | |
Constructor. More... | |
void | resize (int x, int y) |
Defines the x and y dimensions of the control point grid defining the patch. More... | |
int | x () const |
Returns the x dimension of the patch as specified by resize(). More... | |
int | y () const |
Returns the y dimension of the patch as specified by resize(). More... | |
Points & | points () |
The control points grid defining the bicubic Bézier patch(es). More... | |
const Points & | points () const |
The control points grid defining the bicubic Bézier patch(es). More... | |
vec3 & | at (int i, int j) |
Returns the i/j control point. More... | |
const vec3 & | at (int i, int j) const |
Returns the i/j control point. More... | |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Protected Attributes | |
Points | mControlPoints |
int | mX |
int | mY |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Defines one or more concatenated bicubic Bézier patches to be used with the BezierSurface class.
See also:
Definition at line 44 of file BezierSurface.hpp.
typedef std::vector< vec3 > vl::BezierPatch::Points |
The control points grid defining the bicubic Bézier patch(es).
Definition at line 50 of file BezierSurface.hpp.
|
inline |
Constructor.
Definition at line 52 of file BezierSurface.hpp.
|
inline |
Constructor.
Definition at line 57 of file BezierSurface.hpp.
|
inline |
Returns the i/j control point.
Definition at line 74 of file BezierSurface.hpp.
Referenced by vl::BezierSurface::updateBezierSurface().
|
inline |
Returns the i/j control point.
Definition at line 76 of file BezierSurface.hpp.
|
inline |
The control points grid defining the bicubic Bézier patch(es).
Definition at line 70 of file BezierSurface.hpp.
Referenced by vl::makeTeapot().
|
inline |
The control points grid defining the bicubic Bézier patch(es).
Definition at line 72 of file BezierSurface.hpp.
void BezierPatch::resize | ( | int | x, |
int | y | ||
) |
Defines the x and y dimensions of the control point grid defining the patch.
The x
and y
parameters must be of the form 3*n+1 with n
integer positive, i.e 4 (n=1), 7 (n=2), 10 (n=3) and so on.
- The simplest bicubic Bézier patch requires 4x4 = 16 control points: A, B, C, D, E, F, G, H, I, L, M, N, O, P, Q, R - The Bézier surface is guaranteed to touch only the 4 corner control points A, D, O and R. A---B---C---D | | | | E---F---G---H | | | | I---L---M---N | | | | O---P---Q---R In this case we would call "resize(4,4)" - You can concatenate two bicubic Bézier patches to form a larger suface by sharing their control points like this: patch 1 patch 2 A---+---+---B---+---+---G | | | | | | | +---+---+---C---+---+---+ | | | | | | | +---+---+---D---+---+---+ | | | | | | | F---+---+---E---+---+---H In this case we would call "resize(7,4)" - In this case the two patches share the control points B, C, D and E. - As we can see the total control points needed are 28 = (2 (patches along x) * 3 + 1) * (1 (patches along y) * 3 + 1) - Also in this case the Bézier surface is guaranteed to touch only the 6 corner control points A, B, E, F, G and H.
Definition at line 70 of file BezierSurface.cpp.
References vl::Log::error(), mControlPoints, mX, mY, VL_CHECK, x(), and y().
|
inline |
Returns the x
dimension of the patch as specified by resize().
Definition at line 66 of file BezierSurface.hpp.
Referenced by resize(), and vl::BezierSurface::updateBezierSurface().
|
inline |
Returns the y
dimension of the patch as specified by resize().
Definition at line 68 of file BezierSurface.hpp.
Referenced by resize(), and vl::BezierSurface::updateBezierSurface().
|
protected |
Definition at line 78 of file BezierSurface.hpp.
Referenced by resize().
|
protected |
Definition at line 79 of file BezierSurface.hpp.
Referenced by resize().
|
protected |
Definition at line 80 of file BezierSurface.hpp.
Referenced by resize().
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:48.
© Copyright Michele Bosi. All rights reserved.