35 for (
int n = 1; n <= int(
mControlPoly->count() - 1 ); n++ )
38 v->
setX( v->
getX() + ( ( *mControlPoly )[n]->x() - ( *mControlPoly )[n - 1]->x() )*bernst );
39 v->
setY( v->
getY() + ( ( *mControlPoly )[n]->y() - ( *mControlPoly )[n - 1]->y() )*bernst );
40 v->
setZ( v->
getZ() + ( ( *mControlPoly )[n]->z() - ( *mControlPoly )[n - 1]->z() )*bernst );
49 QgsDebugMsg( QStringLiteral(
"warning: null pointer" ) );
62 for (
int n = 1; n <= int(
mControlPoly->count() ); n++ )
65 p->
setX( p->
x() + ( *mControlPoly )[n - 1]->x()*bernst );
66 p->
setY( p->
y() + ( *mControlPoly )[n - 1]->y()*bernst );
67 p->
setZ( p->
z() + ( *mControlPoly )[n - 1]->z()*bernst );
73 QgsDebugMsg( QStringLiteral(
"warning: null pointer" ) );
91 for (
int n = 1; n <= int( nodes - 2 ); n++ )
94 v->
setX( v->
getX() + ( ( *mControlPoly )[n + 1]->x() - 2 * ( *mControlPoly )[n]->x() + ( *mControlPoly )[n - 1]->x() )*bernst );
95 v->
setY( v->
getY() + ( ( *mControlPoly )[n + 1]->y() - 2 * ( *mControlPoly )[n]->y() + ( *mControlPoly )[n - 1]->y() )*bernst );
96 v->
setZ( v->
getZ() + ( ( *mControlPoly )[n + 1]->z() - 2 * ( *mControlPoly )[n]->z() + ( *mControlPoly )[n - 1]->z() )*bernst );
105 QgsDebugMsg( QStringLiteral(
"warning: null pointer" ) );
117 pointer[i] = ( *mControlPoly )[i];
129 QgsDebugMsg( QStringLiteral(
"warning: null pointer" ) );
void setX(double x)
Sets the x-component of the vector.
QVector< QgsPoint * > * mControlPoly
MControlPoly stores the points of the control polygon.
void setZ(double z)
Sets the point's z-coordinate.
void changeDirection() override
Changes the order of control points.
void calcPoint(float t, QgsPoint *p) override
Calculates the point on the curve and assigns it to p.
void calcSecDer(float t, Vector3D *v) override
Calculates the second derivative and assigns it to v.
double getZ() const
Returns the z-component of the vector.
Class Vector3D represents a 3D-Vector, capable to store x-,y- and z-coordinates in double values...
void setZ(double z)
Sets the z-component of the vector.
void calcFirstDer(float t, Vector3D *v) override
Calculates the first derivative and assigns it to v.
Point geometry type, with support for z-dimension and m-values.
void setX(double x)
Sets the point's x-coordinate.
void setY(double y)
Sets the point's y-coordinate.
double getY() const
Returns the y-component of the vector.
void setY(double y)
Sets the y-component of the vector.
double ANALYSIS_EXPORT calcBernsteinPoly(int n, int i, double t)
Calculates the value of a Bernstein polynomial.
double getX() const
Returns the x-component of the vector.
int ANALYSIS_EXPORT faculty(int n)
Faculty function.