00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
#ifndef _nurbs_hnurbs_h_
00026
#define _nurbs_hnurbs_h_
00027
00028
#include "nurbs.h"
00029
00030
class PlHNurbsCurveNode ;
00031
00032
class PlHNurbsCurve :
public PlParaCurve {
00033
public:
00034 PlHNurbsCurve() ;
00035
virtual ~PlHNurbsCurve() { reset() ; }
00036
00037
void add(
const PlNurbsCurve& curve, T uS, T uE) ;
00038
void remove(
void) ;
00039
void reset(
void) ;
00040
00041 T minKnot()
const {
return 0.0 ; }
00042 T maxKnot()
const {
return 1.0 ; }
00043
00044 HPoint_nD<T,N> operator()(T u)
const;
00045
void deriveAt(T u,
int, PlVector< HPoint_nD<T,N> >&)
const;
00046
void deriveAt(T u,
int, PlVector< Point_nD<T,N> >&)
const;
00047
00048
void interpolate(
const PlVector< Point_nD<T,N> > &Pts,
int deg, T acceptError=0.5,
int nSample=100,
int maxTries=100,
int nInitPoints=-1,
int nPoints=-1);
00049
00050
void draw(
Image_Color& img,
const Color& col)
const ;
00051
void draw(
Image_UBYTE& img,
unsigned char col)
const ;
00052
private:
00053 PlHNurbsCurveNode *first, *last ;
00054 };
00055
00056
class PlHNurbsCurveNode:
public PlParaCurve{
00057
public:
00058 T &u0, &u1 ;
00059
00060
00061 PlHNurbsCurveNode *prev,*next ;
00062 PlNurbsCurve *curve ;
00063
00064 PlHNurbsCurveNode() ;
00065 PlHNurbsCurveNode(
const PlNurbsCurve& c, T uS, T uE) ;
00066
00067
00068 T minKnot()
const {
return u0_ ; }
00069 T maxKnot()
const {
return u1_ ; }
00070
00071 HPoint_nD<T,N> operator()(T u)
const;
00072
void deriveAt(T u,
int, PlVector< HPoint_nD<T,N> >&)
const;
00073
void deriveAt(T u,
int, PlVector< Point_nD<T,N> >&)
const;
00074
00075
protected:
00076 T u0_,u1_ ;
00077 T uD ;
00078 };
00079
00080
00081
#endif // _nurbs_hnurbs_h_