22 #include <dtkCoreSupport/dtkGlobal.h>
27 typedef QMap<double, axlPoint>
Sample;
31 class axlAbstractCurveBSplinePrivate
34 QHash<int, QList<int> > connect;
51 DTK_DEFAULT_IMPLEMENTATION;
58 DTK_DEFAULT_IMPLEMENTATION;
65 DTK_DEFAULT_IMPLEMENTATION;
72 DTK_DEFAULT_IMPLEMENTATION;
80 DTK_DEFAULT_IMPLEMENTATION;
86 DTK_DEFAULT_IMPLEMENTATION;
93 DTK_DEFAULT_IMPLEMENTATION;
100 DTK_DEFAULT_IMPLEMENTATION;
105 DTK_DEFAULT_IMPLEMENTATION;
112 DTK_DEFAULT_IMPLEMENTATION;
120 DTK_DEFAULT_IMPLEMENTATION;
127 DTK_DEFAULT_IMPLEMENTATION;
134 DTK_DEFAULT_IMPLEMENTATION;
142 DTK_DEFAULT_IMPLEMENTATION;
150 DTK_DEFAULT_IMPLEMENTATION;
155 DTK_DEFAULT_IMPLEMENTATION;
172 DTK_DEFAULT_IMPLEMENTATION;
179 DTK_DEFAULT_IMPLEMENTATION;
186 DTK_DEFAULT_IMPLEMENTATION;
196 return !d->connect.isEmpty();
213 return d->connect.value(i);
223 qDebug() <<
"The two indices must be different.";
225 int mini = std::min(i,j);
226 int maxi = std::max(i,j);
228 if(d->connect.keys().contains(mini)){
229 QList<int> list = d->connect.value(mini);
231 if(!list.contains(maxi) ){
233 d->connect.insert(mini, list);
238 d->connect.insert(mini,list);
245 list.append(identifier());
248 QVariant ord = QVariant::fromValue(
order());
250 QVariant
dimension = QVariant::fromValue(3);
251 list.append(dimension);
253 for(
int i = 0; i < n.toInt()+
order();i++){
257 for(
int i = 0; i < n.toInt();i++){
260 QVariant name = QVariant::fromValue(objectName());
266 int n = data.at(1).toInt();
267 int order = data.at(2).toInt();
270 double *knots =
new double[n+
order];
271 for(
int i = 0; i < n+
order;i++){
272 knots[i] = data.at(i+4).toDouble();
276 int indice = 4 +n+
order;
277 double *CP =
new double[3*n];
278 for(
int i = 0; i < n;i++){
280 list.append(data.at(indice));
281 list.append(data.at(indice+1));
282 list.append(data.at(indice+2));
283 list.append(data.at(indice+3));
284 list.append(data.at(indice+4));
288 CP[3*i] = point->
x();
289 CP[3*i+1] = point->
y();
290 CP[3*i+2] = point->
z();
294 setCurve(n ,order,dimension,knots,CP,
false);
295 QString name = data.last().toString();
Class axlPoint defines 3D points.
virtual bool rational(void) const
virtual double startParam(void)
virtual void updateRcoeff()
virtual axlPoint getCoef(int n) const
QVariantList convertDataToQVariant(void) const
Convert an axlAbstractData into a QVariantList that specifies all properties of the axlAbstractData...
virtual void defineControlPointConnection(int i, int j)
Define connection between the ith and the jth coefficient.
axlAbstractCurveBSpline(void)
virtual QString printCoeffs(bool print) const
virtual bool setCoef(int n, double *controlPoint)
virtual double closestParameter(const axlPoint &pt)
virtual axlPoint closestPoint(const axlPoint &pt)
QMap< double, axlPoint > Sample
virtual void insertKnot(double k)
virtual bool connectionsAreDefined(void)
Return true if control points connections were defined by developers. False if there are default conn...
virtual int knotVectorSize(void) const
Generic interface for parametric curve.
virtual QList< int > getControlPointConnection(int i)
The list returned contains all indices of coefficients that are still to be connected to the ith coef...
virtual double getWeight(int n) const
virtual QString printKnotsVector(bool print) const
virtual void setCurve(int pointsCount, int order, int dimension, double *knots, double *points, bool rational)
virtual double endParam(void)
virtual Sample sampling(int n)
QMap< double, axlPoint > Sample
virtual void resetControlPointConnections(void)
Removes all control point connections.
virtual int numCoefs() const
virtual void removeKnot(double k)
virtual double getKnot(int n) const
virtual int order(void) const
virtual int countControlPoints(void) const
int convertQVariantToData(const QVariantList &data)
Modify properties and geometry variables of the axlAbstractData. Return 1 if the modification was suc...
virtual QString description(void) const
int convertQVariantToData(const QVariantList &data)
Modify properties and geometry variables of the axlAbstractData. Return 1 if the modification was suc...
virtual int dimension(void) const
virtual ~axlAbstractCurveBSpline(void)