#include <nurbsGL.h>
Inheritance diagram for PLib::NurbsSurfaceGL:
Public Member Functions | |
NurbsSurfaceGL (const NurbsSurfacef &nS) | |
NurbsSurfaceGL (const NurbsSurfaceGL &nS) | |
NurbsSurfaceGL (int DegU, int DegV, const Vector< float > &Uk, const Vector< float > &Vk, const Matrix< HPoint3Df > &Cp) | |
NurbsSurfaceGL (int DegU, int DegV, Vector< float > &Uk, Vector< float > &Vk, Matrix< Point3Df > &Cp, Matrix< float > &W) | |
void | gluNurbs () const |
void | point (float &u, float &v, int pSize, const Color &colorP, int cp_flag=0) const |
virtual NurbsSurfaceGL & | operator= (const NurbsSurfaceGL &a) |
virtual NurbsSurfaceGL & | operator= (const NurbsSurfacef &a) |
void | resetBoundingBox () |
void | resetCPoints () |
void | resetPolygon () |
void | resetKnots () |
int | read (ifstream &fin) |
int | write (ofstream &fout) const |
int | writeRIB (ofstream &fout) const |
int | writePOVRAY (ofstream &fout) const |
ObjectGL * | copy () |
void | applyTransform () |
void | modifyPoint (float u, float v, float dx, float dy, float dz) |
void | setImage (GLubyte *img, GLint w, GLint h) |
void | setSym (int set, int uDir, float x, float y, float z, float w) |
Public Attributes | |
std::list< NurbsCurve_2Df * > | trimmedCurves |
Protected Attributes | |
GLubyte * | image |
GLint | imgW |
GLint | imgH |
void PLib::NurbsSurfaceGL::gluNurbs | ( | ) | const [virtual] |
creates a nurbs surface for OpenGL
This function calls between a gluBeginSurface/gluEndSurface the proper functions to generate a NURBS surface.
Implements PLib::NurbsGL.
void PLib::NurbsSurfaceGL::point | ( | float & | u, | |
float & | v, | |||
int | pSize, | |||
const Color & | colorP, | |||
int | cp_flag = 0 | |||
) | const [virtual] |
draws a point at the location C(u)
This function calls between a glBegin/glEnd the proper functions to represent the point which is at S(u,v) on the surface.
u | the U parametric value | |
v | the V parametric value | |
psize | the size of the control points | |
colorP | the color of the control points |
Implements PLib::NurbsGL.
NurbsSurfaceGL & PLib::NurbsSurfaceGL::operator= | ( | const NurbsSurfaceGL & | a | ) | [virtual] |
Copies another Nurbs Curve GL.
a | the Nurbs curve to copy |
NurbsSurfaceGL & PLib::NurbsSurfaceGL::operator= | ( | const NurbsSurfacef & | a | ) | [virtual] |
Copies another Nurbs Curve GL.
a | the Nurbs curve to copy |
void PLib::NurbsSurfaceGL::resetBoundingBox | ( | ) | [virtual] |
resets the minP and maxP values of bbox
Resets the minP and maxP values for the bouding box.
Reimplemented from PLib::NurbsGL.
void PLib::NurbsSurfaceGL::resetCPoints | ( | ) | [virtual] |
Reset the control point information.
Reset the control point information stored in cpoints.
Reimplemented from PLib::NurbsGL.
void PLib::NurbsSurfaceGL::resetKnots | ( | ) | [virtual] |
reset the knots information
Reset the knots information stored in knots.
Reimplemented from PLib::NurbsGL.
int PLib::NurbsSurfaceGL::read | ( | ifstream & | fin | ) | [virtual] |
Reads the information from a stream.
fin | the input stream |
Reimplemented from PLib::NurbsSurfaceSP< T, N >.
int PLib::NurbsSurfaceGL::write | ( | ofstream & | fout | ) | const [virtual] |
Writes a NurbsCurveGL to an output stream.
fout | the output stream |
Reimplemented from PLib::ObjectGL.
void PLib::NurbsSurfaceGL::applyTransform | ( | ) | [virtual] |
apply the local transformation to the surface.
Apply the local transformation to the surface. This is necessary if you want to get the proper position for the control points before doing anymore processing on them.
Reimplemented from PLib::ObjectGL.
void PLib::NurbsSurfaceGL::modifyPoint | ( | float | u, | |
float | v, | |||
float | dx, | |||
float | dy, | |||
float | dz | |||
) | [virtual] |
Modifies a point on the surface.
u | the u parametric value | |
v | the v parametric value | |
dx | the delta value in the $x$-axis direction | |
dy | the delta value in the $y$-axis direction | |
dz | the delta value in the $z$-axis direction |
Implements PLib::NurbsGL.
void PLib::NurbsSurfaceGL::setImage | ( | GLubyte * | img, | |
GLint | w, | |||
GLint | h | |||
) |
attach an image to a surface
Attach an image to a surface. The image must contain the red, green and blue component in succesive GLubyte of data. The image data must be sent row wise.
OpenGL only uses images which are 2^n pixels in width or height. If the image is not of the proper size, it will be padded to be acceptable by OpenGL. If you want to center the image, you have to provide an already centered image.
The image data is reversed so that it shows upside up when mapped to a NURBS surface. The img data is copied into a new vector so it is safe to delete it once it has been passed to this routine.
img | a pointer to the image data | |
w | the width of the image | |
h | the height of the image |
void PLib::NurbsSurfaceGL::setSym | ( | int | set, | |
int | uDir, | |||
float | x, | |||
float | y, | |||
float | z, | |||
float | w | |||
) | [virtual] |
Sets the symmetry for the control points.
true | 1 if it should be in symmetrical mode |
Implements PLib::NurbsGL.