22 #include <dtkCoreSupport/dtkGlobal.h>
27 class axlAbstractSurfaceBSplinePrivate
30 QMap<QPair<double, double>,
double> scalar_values;
31 QHash<int, QList<int> > connect;
47 DTK_DEFAULT_IMPLEMENTATION;
53 DTK_DEFAULT_IMPLEMENTATION;
59 DTK_DEFAULT_IMPLEMENTATION;
65 DTK_DEFAULT_IMPLEMENTATION;
72 DTK_DEFAULT_IMPLEMENTATION;
78 DTK_DEFAULT_IMPLEMENTATION;
85 DTK_DEFAULT_IMPLEMENTATION;
91 DTK_DEFAULT_IMPLEMENTATION;
98 DTK_DEFAULT_IMPLEMENTATION;
104 DTK_DEFAULT_IMPLEMENTATION;
110 DTK_DEFAULT_IMPLEMENTATION;
116 DTK_DEFAULT_IMPLEMENTATION;
123 DTK_DEFAULT_IMPLEMENTATION;
129 DTK_DEFAULT_IMPLEMENTATION;
135 DTK_DEFAULT_IMPLEMENTATION;
141 DTK_DEFAULT_IMPLEMENTATION;
147 DTK_DEFAULT_IMPLEMENTATION;
153 DTK_DEFAULT_IMPLEMENTATION;
160 DTK_DEFAULT_IMPLEMENTATION;
161 QVector<axlPoint *> qVect;
167 DTK_DEFAULT_IMPLEMENTATION;
190 DTK_DEFAULT_IMPLEMENTATION;
196 DTK_DEFAULT_IMPLEMENTATION;
222 DTK_DEFAULT_IMPLEMENTATION;
228 DTK_DEFAULT_IMPLEMENTATION;
234 DTK_DEFAULT_IMPLEMENTATION;
240 return d->scalar_values.value(qMakePair<double, double>(u, v));
245 d->scalar_values.insert(qMakePair<double, double>(u, v), value);
253 return !d->connect.isEmpty();
270 return d->connect.value(i);
280 qDebug() <<
"The two indices must be different.";
282 int mini = std::min(i,j);
283 int maxi = std::max(i,j);
285 if(d->connect.keys().contains(mini)){
286 QList<int> list = d->connect.value(mini);
288 if(!list.contains(maxi) ){
290 d->connect.insert(mini, list);
295 d->connect.insert(mini,list);
304 dtkWarn()<<
"axlAbstractSurfaceBSpline::convertDataToQVariant not working for rational";
306 list.append(identifier());
311 QVariant orderu = QVariant::fromValue(
order_u());
313 QVariant orderv = QVariant::fromValue(
order_v());
315 QVariant
dimension = QVariant::fromValue(3);
316 list.append(dimension);
319 for(
int i = 0; i < nu.toInt()+
order_u();i++){
323 for(
int i = 0; i < nv.toInt()+
order_v();i++){
327 for(
int i = 0; i < nu.toInt()*nv.toInt();i++){
330 QVariant name = QVariant::fromValue(objectName());
336 dtkWarn()<<
"axlAbstractSurfaceBSpline::convertQVariantToData not working for rational";
337 int nu = data.at(1).toInt();
338 int nv = data.at(2).toInt();
339 int orderu = data.at(3).toInt();
340 int orderv = data.at(4).toInt();
344 double *knotsU =
new double[nu+orderu];
345 for(
int i = 0; i < nu+orderu;i++){
346 knotsU[i] = data.at(i+6).toDouble();
350 double *knotsV =
new double[nv+orderv];
351 for(
int i = 0; i < nv+orderv;i++){
352 knotsV[i] = data.at(i+6 +nu+orderu).toDouble();
356 int indice = 6 +nu+orderu +nv+orderv;
357 double *CP =
new double[3*nu*nv];
358 for(
int i = 0; i < nu*nv;i++){
360 list.append(data.at(indice));
361 list.append(data.at(indice+1));
362 list.append(data.at(indice+2));
363 list.append(data.at(indice+3));
364 list.append(data.at(indice+4));
368 CP[3*i] = point->
x();
369 CP[3*i+1] = point->
y();
370 CP[3*i+2] = point->
z();
374 setSurface(nu,nv ,orderu,orderv,dimension,knotsU, knotsV,CP,
false);
375 QString name = data.last().toString();
virtual axlAbstractSurfaceBSpline * copy(void) const
Class axlPoint defines 3D points.
QVariantList convertDataToQVariant(void) const
Convert an axlAbstractData into a QVariantList that specifies all properties of the axlAbstractData...
virtual void resetControlPointConnections(void)
Removes all control point connections.
virtual bool connectionsAreDefined(void)
Return true if control points connections were defined by developers. False if there are default conn...
virtual double getKnot_v(int n) const
virtual QString printCoeffs(bool print) const
virtual void defineControlPointConnection(int i, int j)
Define connection between the ith and the jth coefficient.
void setScalarValue(double u, double v, double value)
axlAbstractSurfaceBSpline(void)
virtual void setSurface(int pointsCount_u, int pointsCount_v, int order_u, int order_v, int dimension, double *knots_u, double *knots_v, double *points, bool rational)
axlAbstractSurfaceBSpline::setSurface
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 double getCoord(int n, int m, int v) const
virtual ~axlAbstractSurfaceBSpline(void)
double scalarValue(double u, double v)
virtual int countControlPoints_u(void) const
virtual int countControlPoints_v(void) const
virtual void removeKnot_v(double k)
virtual double getWeight(int n, int m) const
virtual int knotVectorSize_u(void) const
virtual QVector< axlPoint * > sampling()
virtual QString printKnotsVector(bool print) const
virtual void insertKnot_v(double k)
virtual bool rational(void) const
virtual int order_u(void) const
virtual QString description(void) const
virtual int countControlPoints(void) const
virtual bool setCoef(int n, int m, int v, double c)
virtual void insertKnot_u(double k)
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 axlPoint getCoef(int n, int m) const
int convertQVariantToData(const QVariantList &data)
Modify properties and geometry variables of the axlAbstractData. Return 1 if the modification was suc...
virtual void updateRcoeff()
virtual void gridEvaluator(int num_u, int num_v, std::vector< double > &points, std::vector< double > ¶m_u, std::vector< double > ¶m_v)
virtual int order_v(void) const
virtual int knotVectorSize_v(void) const
virtual double getKnot_u(int n) const
virtual void removeKnot_u(double k)