Main Page   Class Hierarchy   Compound List   File List   Compound Members  

PLib::NurbsSurfaceGL Class Reference

A NURBS surface class for OpenGL. More...

#include <nurbsGL.h>

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 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)
 ~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 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
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

std::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

Definition at line 871 of file nurbsGL.h.


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.

Definition at line 1717 of file nurbsGL.cpp.

References PLib::MatrixRT::scale, and PLib::NurbsSurface< float, N >::transform.

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

Implements PLib::NurbsGL.

Definition at line 2147 of file nurbsGL.cpp.

References PLib::NurbsSurface< float, N >::degU, PLib::NurbsSurface< float, N >::degV, PLib::NurbsSurface< float, N >::isoCurveU, PLib::NurbsSurface< float, N >::isoCurveV, PLib::NurbsSurface< float, N >::P, PLib::NurbsSurface< float, N >::U, and PLib::NurbsSurface< float, N >::V.

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

Implements PLib::NurbsGL.

Definition at line 3033 of file nurbsGL.cpp.

References PLib::NurbsSurface< float, N >::knotU, PLib::NurbsSurface< float, N >::knotV, and PLib::NurbsSurface< float, N >::movePoint.

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

Copies another Nurbs Curve GL.

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

Definition at line 2997 of file nurbsGL.cpp.

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

Definition at line 2982 of file nurbsGL.cpp.

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

Implements PLib::NurbsGL.

Definition at line 2505 of file nurbsGL.cpp.

References PLib::ParaSurface< float, N >::hpointAt, PLib::NurbsSurface< float, N >::isoCurveU, PLib::NurbsSurface< float, N >::isoCurveV, PLib::NurbsSurface< float, N >::U, and PLib::NurbsSurface< float, N >::V.

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::NurbsSurfaceSP< float, 3 >.

Definition at line 3734 of file nurbsGL.cpp.

References PLib::ObjectGL::setName.

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.

Definition at line 1563 of file nurbsGL.cpp.

References PLib::ParaSurface< float, N >::extremum.

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.

Definition at line 1878 of file nurbsGL.cpp.

References PLib::NurbsSurface< float, N >::degU, PLib::NurbsSurface< float, N >::degV, PLib::ObjectGL::ObjectGL, and PLib::NurbsSurface< float, N >::P.

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.

Definition at line 2004 of file nurbsGL.cpp.

References PLib::NurbsSurface< float, N >::P, PLib::ParaSurface< float, N >::pointAt, PLib::NurbsSurface< float, N >::U, and PLib::NurbsSurface< float, N >::V.

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

Definition at line 3369 of file nurbsGL.cpp.

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

Implements PLib::NurbsGL.

Definition at line 3300 of file nurbsGL.cpp.

References PLib::NurbsSurface< float, N >::ctrlPnts, and PLib::ObjectGL::ObjectGL.

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.

Definition at line 3818 of file nurbsGL.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 13:27:01 2003 for NURBS++ by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002