Main Page   Class Hierarchy   Compound List   File List   Compound Members  

PLib::ParaSurface Class Template Reference

An abstract parametric surface class. More...

#include <surface.h>

Inheritance diagram for PLib::ParaSurface:

PLib::NurbsSurface PLib::HNurbsSurface PLib::NurbsSurfaceSP PLib::HNurbsSurfaceSP List of all members.

Public Methods

 ParaSurface ()
virtual HPoint_nD< T, N > operator() (T u, T v) const=0
HPoint_nD< T, N > hpointAt (T u, T v) const
Point_nD< T, N > pointAt (T u, T v) const
virtual void deriveAtH (T u, T v, int d, Matrix< HPoint_nD< T, N > > &skl) const=0
virtual void deriveAt (T u, T v, int d, Matrix< Point_nD< T, N > > &skl) const=0
virtual T minDist2 (const Point_nD< T, N > &p, T &guessU, T &guessV, T error=0.001, T s=0.2, int sep=9, int maxIter=10, T um=0.0, T uM=1.0, T vm=0.0, T vM=1.0) const
virtual T minDist2b (const Point_nD< T, N > &p, T &guessU, T &guessV, T error=0.001, T s=0.3, int sep=5, int maxIter=10, T um=0.0, T uM=1.0, T vm=0.0, T vM=1.0) const
virtual T minDist2xy (const Point_nD< T, N > &p, T &guessU, T &guessV, T error=0.01, T dU=0.0001, T s=0.3, int sepU=5, int sepV=5, int maxIter=10, T um=0.0, T uM=1.0, T vm=0.0, T vM=1.0) const
int projectOn (const Point_nD< T, N > &p, T &u, T &v, int maxI=100, const T um=0.0, const T uM=1.0, const T vm=0.0, const T vM=1.0) const
extremum (int findMin, CoordinateType coord, T minDu=0.0001, int sepU=5, int sepV=5, int maxIter=10, T um=0.0, T uM=1.0, T vm=0.0, T vM=1.0) const
int intersectWith (const ParaSurface< T, N > &S, Point_nD< T, N > &p, T &u, T &v, T &s, T &t, int maxI=100, T um=0.0, T uM=1.0, T vm=0.0, T vM=1.0) const
int intersectWith (const ParaSurface< T, N > &S, InterPoint< T, N > &iter, int maxI=100, T um=0.0, T uM=1.0, T vm=0.0, T vM=1.0) const
virtual int writeVRML (ostream &fout, const Color &color, int Nu, int Nv, T u_s, T u_e, T v_s, T v_e) const
virtual int writeVRML (const char *filename, const Color &color, int Nu, int Nv, T u_s, T u_e, T v_s, T v_e) const
virtual int writeVRML (const char *filename, const Color &color=whiteColor, int Nu=20, int Nv=20) const=0
virtual int writeVRML97 (ostream &fout, const Color &color, int Nu, int Nv, T u_s, T u_e, T v_s, T v_e) const
virtual int writeVRML97 (const char *filename, const Color &color, int Nu, int Nv, T u_s, T u_e, T v_s, T v_e) const
virtual int writeVRML97 (const char *filename, const Color &color=whiteColor, int Nu=20, int Nv=20) const=0

Detailed Description

template<class T, int N>
class PLib::ParaSurface< T, N >

An abstract parametric surface class.

This is an abstract class used as a basis for NURBS and HNURBS surfaces.

Author:
Philippe Lavoie
Date:
4 Oct. 1996

Definition at line 68 of file surface.h.


Member Function Documentation

template<class T, int N>
T PLib::ParaSurface< T, N >::extremum int    findMin,
CoordinateType    coord,
  minDu = 0.0001,
int    sepU = 5,
int    sepV = 5,
int    maxIter = 10,
  um = 0.0,
  uM = 1.0,
  vm = 0.0,
  vM = 1.0
const
 

Finds the minimal or maximal value on the curve of the x,y or z coordinate.

Parameters:
findMin  a flag indicatinf if we're looking for the minimal value or the maximal value.
coord  Which coordinate to find: x,y or z.
minDu  The minimal distance between iterations in the parametric space.
sepU  the number of points initially looked at to find a minimal distance in the U direction
sepV  the number of points initially looked at to find a minimal distance in the U direction
maxiter  the maximal number of iterations
um  the minimal parametric value for u
uM  the maximal parametric value for u
vm  the minimal parametric value for v
vM  the maximal parametric value for v
Returns:
The minimal value of $z$ along the curve
Warning:
It has not been tested with closed loop curves.
Author:
Philippe Lavoie
Date:
24 January 1997

Definition at line 479 of file surface.cpp.

References pointAt.

Referenced by PLib::NurbsSurface::writePOVRAY, and PLib::NurbsSurface::writeRIB.

template<class T, int N>
int PLib::ParaSurface< T, N >::intersectWith const ParaSurface< T, N > &    S,
InterPoint< T, N > &    iter,
int    maxI = 100,
  um = 0.0,
  uM = 1.0,
  vm = 0.0,
  vM = 1.0
const
 

Finds the intersection of two surfaces near a point.

Parameters:
S  the surface to intersect with
iter  the iteration point
maxI  the maximal number of iterations
um  the minimal parametric value for u
uM  the maximal parametric value for u
vm  the minimal parametric value for v
vM  the maximal parametric value for v
Returns:
1 on sucess, 0 if their was a singularity in computation
Author:
Philippe Lavoie
Date:
6 July 1998

Definition at line 892 of file surface.cpp.

References deriveAt.

template<class T, int N>
int PLib::ParaSurface< T, N >::intersectWith const ParaSurface< T, N > &    S,
Point_nD< T, N > &    p,
T &    u,
T &    v,
T &    s,
T &    t,
int    maxI = 100,
  um = 0.0,
  uM = 1.0,
  vm = 0.0,
  vM = 1.0
const
 

Finds the intersection of two surfaces near a point.

The method used is similar to the one used to project a point on a surface. It's a modified Newton-Raphson's method.

Parameters:
S  the surface to intersect with
P  the point for the intersection
u  the u parametric value of the intersection
v  the v parametric value of the intersection
s  the u parametric value of the intersection for S
t  the v parametric value of the intersection for S
maxI  the maximal number of iterations
um  the minimal parametric value for u
uM  the maximal parametric value for u
vm  the minimal parametric value for v
vM  the maximal parametric value for v
Returns:
1 on sucess, 0 if their was a singularity in computation
Author:
Philippe Lavoie
Date:
6 July 1998

Definition at line 709 of file surface.cpp.

References deriveAt.

template<class T, int N>
T PLib::ParaSurface< T, N >::minDist2 const Point_nD< T, N > &    p,
T &    guessU,
T &    guessV,
  error = 0.001,
  s = 0.2,
int    sep = 9,
int    maxIter = 10,
  um = 0.0,
  uM = 1.0,
  vm = 0.0,
  vM = 1.0
const [virtual]
 

Find the minimal distance between a point and the surface.

This is an iterative method to find the closest point to a surface.

Parameters:
p  the minimal distance from that point
guessU  a starting value for the parameter u, on exit this will be set to the value of the point on the surface closest to p.
guessV  a starting value for the parameter v, on exit this will be set to the value of the point on the surface closest to p.
error  when iterations have an error smaller than this value, the function exits
s  the size of the search in the parametric space.
sep  the number of points initially looked at to find a minimal distance.
maxiter  the maximal number of iterations
um  the minimal parametric value for u
uM  the maximal parametric value for u
vm  the minimal parametric value for v
vM  the maximal parametric value for v
Returns:
The value of the minimal distance between p and the surface. The variables guessU and guessV now holds the parametric value of the surface point closest to p.
Warning:
It has not been tested with closed loop surfaces.
Author:
Philippe Lavoie
Date:
24 January 1997

Definition at line 72 of file surface.cpp.

References pointAt.

template<class T, int N>
T PLib::ParaSurface< T, N >::minDist2b const Point_nD< T, N > &    p,
T &    guessU,
T &    guessV,
  error = 0.001,
  s = 0.3,
int    sep = 5,
int    maxIter = 10,
  um = 0.0,
  uM = 1.0,
  vm = 0.0,
  vM = 1.0
const [virtual]
 

Find the minimal distance between a point and the surface.

This is an iterative method to find the closest point to a surface. The method is slightly different than minDist2.

Parameters:
p  the minimal distance from that point
guessU  a starting value for the parameter u, on exit this will be set to the value of the point on the surface closest to p.
guessV  a starting value for the parameter v, on exit this will be set to the value of the point on the surface closest to p.
error  when iterations have an error smaller than this value, the function exits
s  the size of the search in the parametric space.
sep  the number of points initially looked at to find a minimal distance.
maxiter  the maximal number of iterations
um  the minimal parametric value for u
uM  the maximal parametric value for u
vm  the minimal parametric value for v
vM  the maximal parametric value for v
Returns:
The value of the minimal distance between p and the surface. The variables guessU and guessV now holds the parametric value of the surface point closest to p.
Warning:
It has not been tested with closed loop surfaces.
Author:
Philippe Lavoie
Date:
24 January 1997

Definition at line 155 of file surface.cpp.

References pointAt.

template<class T, int N>
T PLib::ParaSurface< T, N >::minDist2xy const Point_nD< T, N > &    p,
T &    guessU,
T &    guessV,
  error = 0.01,
  dU = 0.0001,
  s = 0.3,
int    sepU = 5,
int    sepV = 5,
int    maxIter = 10,
  um = 0.0,
  uM = 1.0,
  vm = 0.0,
  vM = 1.0
const [virtual]
 

Find the minimal distance between a point and the surface in the x-y plane.

This is an iterative method to find the closest point to a surface. The distance is search in the x-y plane. The z component is not taken into account for the search.

Parameters:
p  the minimal distance from that point
guessU  a starting value for the parameter u, on exit this will be set to the value of the point on the surface closest to p.
guessV  a starting value for the parameter v, on exit this will be set to the value of the point on the surface closest to p.
error  when iterations have an error smaller than this value, the function exits
dU  if a parametric delta is smaller than this value, the function stops.
s  the size of the search in the parametric space.
sepU  the number of points initially looked at to find a minimal distance in the u direction
sepV  the number of points initially looked at to find a minimal distance in the v direction
maxiter  the maximal number of iterations
um  the minimal parametric value for u
uM  the maximal parametric value for u
vm  the minimal parametric value for v
vM  the maximal parametric value for v
Returns:
The value of the minimal distance between p and the surface. The variables guessU and guessV now holds the parametric value of the surface point closest to p.
Warning:
It has not been tested with closed loop surfaces.
Author:
Philippe Lavoie
Date:
24 January 1997

Definition at line 250 of file surface.cpp.

References pointAt.

template<class T, int N>
int PLib::ParaSurface< T, N >::projectOn const Point_nD< T, N > &    p,
T &    u,
T &    v,
int    maxI = 100,
const T    um = 0.0,
const T    uM = 1.0,
const T    vm = 0.0,
const T    vM = 1.0
const
 

projects a point onto the surface.

Projects a point using Newton-Raphson's method. There is more information available in the LaTeX version

Parameters:
P  the point to project
u  the u parametric value of the result
v  the v parametric value of the result
maxI  the maximal number of iterations
um  the minimal parametric value for u
uM  the maximal parametric value for u
vm  the minimal parametric value for v
vM  the maximal parametric value for v
Returns:
1 on sucess, 0 if their was a singularity in computation
Author:
Philippe Lavoie
Date:
24 January 1997

Definition at line 614 of file surface.cpp.

References deriveAt.

template<class T, int N>
int PLib::ParaSurface< T, N >::writeVRML const char *    filename,
const Color   color,
int    Nu,
int    Nv,
  uS,
  uE,
  vS,
  vE
const [virtual]
 

Write the NURBS surface to a VRML file.

Writes a VRML file which represents the surface for the parametric space [uS,uE] and [vS,vE]. It does not optimize the number of points required to represent the surface.

Parameters:
filename  the file name for the output VRML file
Nu  the number of points in the u direction
Nv  the number of points in the v direction
uS  the starting value of u
uE  the end value of u
vS  the starting value of v
vE  the end value of v
Returns:
1 on success, 0 otherwise
Warning:
The parametric surface must be valid
Author:
Philippe Lavoie
Date:
24 January, 1997

Reimplemented in PLib::NurbsSurface.

Definition at line 344 of file surface.cpp.

References writeVRML.

template<class T, int N>
int PLib::ParaSurface< T, N >::writeVRML ostream &    fout,
const Color   color,
int    Nu,
int    Nv,
  uS,
  uE,
  vS,
  vE
const [virtual]
 

Write the NURBS surface to a VRML file.

Writes a VRML file which represents the surface for the parametric space [uS,uE] and [vS,vE]. It does not optimize the number of points required to represent the surface.

Parameters:
filename  the file name for the output VRML file
Nu  the number of points in the u direction
Nv  the number of points in the v direction
uS  the starting value of u
uE  the end value of u
vS  the starting value of v
vE  the end value of v
Returns:
1 on success, 0 otherwise
Warning:
The parametric surface must be valid
Author:
Philippe Lavoie
Date:
24 January, 1997

Reimplemented in PLib::NurbsSurface.

Definition at line 377 of file surface.cpp.

References pointAt.

Referenced by writeVRML.

template<class T, int N>
int PLib::ParaSurface< T, N >::writeVRML97 const char *    filename,
const Color   color,
int    Nu,
int    Nv,
  uS,
  uE,
  vS,
  vE
const [virtual]
 

Write the NURBS surface to a VRML file.

Writes a VRML file which represents the surface for the parametric space [uS,uE] and [vS,vE]. It does not optimize the number of points required to represent the surface.

Parameters:
filename  the file name for the output VRML file
Nu  the number of points in the u direction
Nv  the number of points in the v direction
uS  the starting value of u
uE  the end value of u
vS  the starting value of v
vE  the end value of v
Returns:
1 on success, 0 otherwise
Warning:
The parametric surface must be valid
Author:
Philippe Lavoie
Date:
30 April, 1999

Reimplemented in PLib::NurbsSurface.

Definition at line 1203 of file surface.cpp.

References writeVRML97.

template<class T, int N>
int PLib::ParaSurface< T, N >::writeVRML97 ostream &    fout,
const Color   color,
int    Nu,
int    Nv,
  uS,
  uE,
  vS,
  vE
const [virtual]
 

Write the NURBS surface to a VRML97 file.

Writes a VRML97 file which represents the surface for the parametric space [uS,uE] and [vS,vE]. It does not optimize the number of points required to represent the surface.

Parameters:
filename  the file name for the output VRML file
Nu  the number of points in the u direction
Nv  the number of points in the v direction
uS  the starting value of u
uE  the end value of u
vS  the starting value of v
vE  the end value of v
Returns:
1 on success, 0 otherwise
Warning:
The parametric surface must be valid
Author:
Philippe Lavoie
Date:
30 April, 1999

Reimplemented in PLib::NurbsSurface.

Definition at line 1236 of file surface.cpp.

References pointAt.

Referenced by writeVRML97.


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