00001
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00018
00019
#ifndef BSPLINE_H
00020
#define BSPLINE_H
00021
00022
#include<iostream>
00023
#include <qpainter.h>
00024
#include <vector>
00025
#include "primitive.h"
00026
00027
using namespace std;
00028
00037
00038
00040
00041 class Bspline :
public Primitive
00042 {
00043
00044
public :
00045
00047
Bspline();
00048
00052
Bspline(
const vector<Point3D *>& lPoints);
00053
00057
Bspline(
const Bspline& spl);
00058
00059
00060 ~Bspline() {};
00061
00065
virtual void display(QPainter& paint);
00066
00071
virtual void setPrimitive(QPoint & refPoint, QPoint & modifPoint);
00072
00076
virtual void toXML(QDomElement &elem);
00077
00081 vector<Point3D *>
getCtrlPointsList() const;
00082
00086
void addPoint(
Point3D * point);
00087
00092
void addPointPosI(
Point3D *point, const
unsigned int pos);
00093
00094 private :
00095
00096
00097
double blend(
int k,
int t,
int * u,
double v);
00098
Point3D calculatePoint(
int * u,
int n,
int t,
double v);
00099
void calculateNodes(
int * u,
int n,
int t);
00100
00101 };
00102
00103 #endif
00104