Main Page   Class Hierarchy   Compound List   File List   Compound Members  

PLib::NurbsSurfaceGL Class Reference

A NURBS surface class for OpenGL. More...

#include <nurbsGL.hh>

Inheritance diagram for PLib::NurbsSurfaceGL::

PLib::NurbsSurfaceSP< float, 3 > PLib::NurbsGL PLib::NurbsSurface< float, N > PLib::ObjectGL PLib::ParaSurface< float, N > List of all members.

Public Methods

 NurbsSurfaceGL ()
 NurbsSurfaceGL (const NurbsSurface &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)
 ~NurbsSurfaceGL ()
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 NurbsSurface &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
ObjectGLcopy ()
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

list< NurbsCurve_2Df *> trimmedCurves

Protected Attributes

GLubyte * image
GLint imgW
GLint imgH

Detailed Description

A NURBS surface class for OpenGL.

Author:
Philippe Lavoie
Date:
23 September 1997


Member Function Documentation

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.

Author:
Philippe Lavoie
Date:
23 September 1997

Reimplemented from PLib::ObjectGL.

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.

Author:
Philippe Lavoie
Date:
23 September 1997

Reimplemented from PLib::NurbsGL.

void PLib::NurbsSurfaceGL::modifyPoint float    u,
float    v,
float    dx,
float    dy,
float    dz
[virtual]
 

Modifies a point on the surface.

Parameters:
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
Author:
Philippe Lavoie
Date:
7 November 1997

Reimplemented from PLib::NurbsGL.

NurbsSurfaceGL & PLib::NurbsSurfaceGL::operator= const NurbsSurface   a [virtual]
 

Copies another Nurbs Curve GL.

Parameters:
a  the Nurbs curve to copy
Author:
Philippe Lavoie
Date:
6 November 1997

NurbsSurfaceGL & PLib::NurbsSurfaceGL::operator= const NurbsSurfaceGL &    a [virtual]
 

Copies another Nurbs Curve GL.

Parameters:
a  the Nurbs curve to copy
Author:
Philippe Lavoie
Date:
6 November 1997

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.

Parameters:
u  the U parametric value
v  the V parametric value
psize  the size of the control points
colorP  the color of the control points
Author:
Philippe Lavoie
Date:
23 September 1997

Reimplemented from PLib::NurbsGL.

int PLib::NurbsSurfaceGL::read ifstream &    fin [virtual]
 

Reads the information from a stream.

Parameters:
fin  the input stream
Returns:
1 on sucess, 0 on failure
Author:
Philippe Lavoie
Date:
19 June 1998

Reimplemented from PLib::ObjectGL.

void PLib::NurbsSurfaceGL::resetBoundingBox   [virtual]
 

resets the minP and maxP values of bbox.

Resets the minP and maxP values for the bouding box.

Warning:
Calling this function without a proper surface initialized might result in strange results.
Author:
Philippe Lavoie
Date:
23 September 1997

Reimplemented from PLib::NurbsGL.

void PLib::NurbsSurfaceGL::resetCPoints   [virtual]
 

Reset the control point information.

Reset the control point information stored in cpoints.

Author:
Philippe Lavoie
Date:
23 September 1997

Reimplemented from PLib::NurbsGL.

void PLib::NurbsSurfaceGL::resetKnots   [virtual]
 

reset the knots information.

Reset the knots information stored in knots.

Author:
Philippe Lavoie
Date:
23 September 1997

Reimplemented from 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.

Parameters:
img  a pointer to the image data
w  the width of the image
h  the height of the image
Author:
Philippe Lavoie
Date:
5 February 1998

void PLib::NurbsSurfaceGL::setSym int    set,
int    uDir,
float    x,
float    y,
float    z,
float    w
[virtual]
 

Sets the symmetry for the control points.

Parameters:
true  1 if it should be in symmetrical mode
Author:
Philippe Lavoie
Date:
2 July 1998

Reimplemented from PLib::NurbsGL.

int PLib::NurbsSurfaceGL::write ofstream &    fout const [virtual]
 

Writes a NurbsCurveGL to an output stream.

Parameters:
fout  the output stream
Returns:
0 if an error occurs, 1 otherwise
Author:
Philippe Lavoie
Date:
19 June 1998

Reimplemented from PLib::ObjectGL.


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 02:53:35 2002 for NURBS++ by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001