PLib::ParaSurface< T, N > Class Template Reference

An abstract parametric surface class. More...

#include <surface.h>

Inheritance diagram for PLib::ParaSurface< T, N >:

PLib::NurbsSurface< T, N > PLib::NurbsSurface< float, 3 > PLib::NurbsSurface< float, N > PLib::HNurbsSurface< T, N > PLib::HNurbsSurface< float, N > PLib::NurbsSurfaceSP< T, N > PLib::NurbsSurfaceSP< float, 3 > PLib::HNurbsSurfaceSP< T, N > PLib::HNurbsSurfaceSP< float, 3 > PLib::NurbsSurfaceGL PLib::HNurbsSurfaceGL List of all members.

Public Member Functions

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
template<>
int intersectWith (const ParaSurface< double, 2 > &S, Point_nD< double, 2 > &p, double &u, double &v, double &s, double &t, int maxI, double um, double uM, double vm, double vM) const
template<>
int intersectWith (const ParaSurface< double, 2 > &S, struct InterPoint< double, 2 > &iter, int maxI, double um, double uM, double vm, double vM) const
template<>
int writeVRML97 (ostream &fout, const Color &color, int Nu, int Nv, double uS, double uE, double vS, double vE) const
template<>
int intersectWith (const ParaSurface< float, 2 > &S, Point_nD< float, 2 > &p, float &u, float &v, float &s, float &t, int maxI, float um, float uM, float vm, float vM) const
template<>
int intersectWith (const ParaSurface< float, 2 > &S, struct InterPoint< float, 2 > &iter, int maxI, float um, float uM, float vm, float vM) const
template<>
int writeVRML97 (ostream &fout, const Color &color, int Nu, int Nv, float uS, float uE, float vS, float vE) const

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


Member Function Documentation

template<class T, int N>
virtual HPoint_nD<T,N> PLib::ParaSurface< T, N >::operator() ( u,
v 
) const [pure virtual]

an abstract function

Implemented in PLib::HNurbsSurface< T, N >, PLib::NurbsSurface< T, N >, and PLib::NurbsSurface< T, 3 >.

template<class T, int N>
HPoint_nD<T,N> PLib::ParaSurface< T, N >::hpointAt ( u,
v 
) const [inline]

< Calls operator()

template<class T, int N>
Point_nD<T,N> PLib::ParaSurface< T, N >::pointAt ( u,
v 
) const [inline]

< Projects the point in the normal space

template<class T, int N>
virtual void PLib::ParaSurface< T, N >::deriveAtH ( u,
v,
int  d,
Matrix< HPoint_nD< T, N > > &  skl 
) const [pure virtual]

the derivative in homogenous space

Implemented in PLib::NurbsSurface< T, 3 >.

template<class T, int N>
virtual void PLib::ParaSurface< T, N >::deriveAt ( u,
v,
int  d,
Matrix< Point_nD< T, N > > &  skl 
) const [pure virtual]

the derivative in normal space

Implemented in PLib::NurbsSurface< T, N >, and PLib::NurbsSurface< T, 3 >.

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

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

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

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

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

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

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

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< T, N >, and PLib::NurbsSurface< T, 3 >.

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< T, N >, and PLib::NurbsSurface< T, 3 >.

template<class T, int N>
virtual int PLib::ParaSurface< T, N >::writeVRML ( const char *  filename,
const Color color = whiteColor,
int  Nu = 20,
int  Nv = 20 
) const [pure virtual]

an abstract function

Implemented in PLib::NurbsSurface< T, N >, PLib::NurbsSurface< T, 3 >, PLib::NurbsSurface< float, 3 >, and PLib::NurbsSurface< float, N >.

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< T, N >, and PLib::NurbsSurface< T, 3 >.

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< T, N >, and PLib::NurbsSurface< T, 3 >.

template<class T, int N>
virtual int PLib::ParaSurface< T, N >::writeVRML97 ( const char *  filename,
const Color color = whiteColor,
int  Nu = 20,
int  Nv = 20 
) const [pure virtual]

an abstract function

Implemented in PLib::NurbsSurface< T, N >, PLib::NurbsSurface< T, 3 >, PLib::NurbsSurface< float, 3 >, and PLib::NurbsSurface< float, N >.


The documentation for this class was generated from the following files:
Generated on Sun Apr 29 10:03:50 2007 for NURBS++ by  doxygen 1.5.1