35 if ( i < 0 || j < 0 || k < 0 )
37 QgsDebugMsg( QStringLiteral(
"Invalid parameters for Bernstein poly calculation!" ) );
60 double zu =
point1.
z() *
calcBernsteinPoly( 2, 2, 0, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp1.
z() *
calcBernsteinPoly( 2, 1, 1, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp2.
z() *
calcBernsteinPoly( 2, 0, 2, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp3.
z() *
calcBernsteinPoly( 2, 1, 0, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp4.
z() *
calcBernsteinPoly( 2, 0, 1, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp7.
z() *
calcBernsteinPoly( 2, 0, 0, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() );
61 double zv =
cp1.
z() *
calcBernsteinPoly( 2, 2, 0, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp2.
z() *
calcBernsteinPoly( 2, 1, 1, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
point2.
z() *
calcBernsteinPoly( 2, 0, 2, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp4.
z() *
calcBernsteinPoly( 2, 1, 0, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp5.
z() *
calcBernsteinPoly( 2, 0, 1, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp8.
z() *
calcBernsteinPoly( 2, 0, 0, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() );
62 double zw =
cp3.
z() *
calcBernsteinPoly( 2, 2, 0, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp4.
z() *
calcBernsteinPoly( 2, 1, 1, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp5.
z() *
calcBernsteinPoly( 2, 0, 2, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp7.
z() *
calcBernsteinPoly( 2, 1, 0, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp8.
z() *
calcBernsteinPoly( 2, 0, 1, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp10.
z() *
calcBernsteinPoly( 2, 0, 0, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() );
64 endpointUXY.
setZ( 3 * ( zu - zv ) );
66 endpointVXY.
setZ( 3 * ( zv - zw ) );
67 Vector3D v1( endpointUXY.
x() - x, endpointUXY.
y() - y, endpointUXY.
z() );
68 Vector3D v2( endpointVXY.
x() - x, endpointVXY.
y() - y, endpointVXY.
z() );
79 double zu =
point2.
z() *
calcBernsteinPoly( 2, 2, 0, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp9.
z() *
calcBernsteinPoly( 2, 1, 1, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp16.
z() *
calcBernsteinPoly( 2, 0, 2, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp5.
z() *
calcBernsteinPoly( 2, 1, 0, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp13.
z() *
calcBernsteinPoly( 2, 0, 1, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp8.
z() *
calcBernsteinPoly( 2, 0, 0, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() );
80 double zv =
cp9.
z() *
calcBernsteinPoly( 2, 2, 0, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp16.
z() *
calcBernsteinPoly( 2, 1, 1, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
point3.
z() *
calcBernsteinPoly( 2, 0, 2, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp13.
z() *
calcBernsteinPoly( 2, 1, 0, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp15.
z() *
calcBernsteinPoly( 2, 0, 1, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp12.
z() *
calcBernsteinPoly( 2, 0, 0, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() );
81 double zw =
cp5.
z() *
calcBernsteinPoly( 2, 2, 0, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp13.
z() *
calcBernsteinPoly( 2, 1, 1, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp15.
z() *
calcBernsteinPoly( 2, 0, 2, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp8.
z() *
calcBernsteinPoly( 2, 1, 0, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp12.
z() *
calcBernsteinPoly( 2, 0, 1, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp10.
z() *
calcBernsteinPoly( 2, 0, 0, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() );
83 endpointUXY.
setZ( 3 * ( zu - zv ) );
85 endpointVXY.
setZ( 3 * ( zv - zw ) );
86 Vector3D v1( endpointUXY.
x() - x, endpointUXY.
y() - y, endpointUXY.
z() );
87 Vector3D v2( endpointVXY.
x() - x, endpointVXY.
y() - y, endpointVXY.
z() );
99 double zu =
point3.
z() *
calcBernsteinPoly( 2, 2, 0, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp14.
z() *
calcBernsteinPoly( 2, 1, 1, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp6.
z() *
calcBernsteinPoly( 2, 0, 2, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp15.
z() *
calcBernsteinPoly( 2, 1, 0, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp11.
z() *
calcBernsteinPoly( 2, 0, 1, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp12.
z() *
calcBernsteinPoly( 2, 0, 0, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() );
100 double zv =
cp14.
z() *
calcBernsteinPoly( 2, 2, 0, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp6.
z() *
calcBernsteinPoly( 2, 1, 1, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
point1.
z() *
calcBernsteinPoly( 2, 0, 2, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp11.
z() *
calcBernsteinPoly( 2, 1, 0, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp3.
z() *
calcBernsteinPoly( 2, 0, 1, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp7.
z() *
calcBernsteinPoly( 2, 0, 0, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() );
101 double zw =
cp15.
z() *
calcBernsteinPoly( 2, 2, 0, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp11.
z() *
calcBernsteinPoly( 2, 1, 1, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp3.
z() *
calcBernsteinPoly( 2, 0, 2, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp12.
z() *
calcBernsteinPoly( 2, 1, 0, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp7.
z() *
calcBernsteinPoly( 2, 0, 1, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp10.
z() *
calcBernsteinPoly( 2, 0, 0, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() );
103 endpointUXY.
setZ( 3 * ( zu - zv ) );
105 endpointVXY.
setZ( 3 * ( zv - zw ) );
106 Vector3D v1( endpointUXY.
x() - x, endpointUXY.
y() - y, endpointUXY.
z() );
107 Vector3D v2( endpointVXY.
x() - x, endpointVXY.
y() - y, endpointVXY.
z() );
149 QgsDebugMsg( QStringLiteral(
"warning, null pointer" ) );
163 double z =
point1.
z() *
calcBernsteinPoly( 3, 3, 0, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp1.
z() *
calcBernsteinPoly( 3, 2, 1, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp2.
z() *
calcBernsteinPoly( 3, 1, 2, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
point2.
z() *
calcBernsteinPoly( 3, 0, 3, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp3.
z() *
calcBernsteinPoly( 3, 2, 0, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp4.
z() *
calcBernsteinPoly( 3, 1, 1, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp5.
z() *
calcBernsteinPoly( 3, 0, 2, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp7.
z() *
calcBernsteinPoly( 3, 1, 0, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp8.
z() *
calcBernsteinPoly( 3, 0, 1, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp10.
z() *
calcBernsteinPoly( 3, 0, 0, 3, barycoord.
x(), barycoord.
y(), barycoord.
z() );
173 double z =
cp10.
z() *
calcBernsteinPoly( 3, 0, 0, 3, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp8.
z() *
calcBernsteinPoly( 3, 1, 0, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp5.
z() *
calcBernsteinPoly( 3, 2, 0, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
point2.
z() *
calcBernsteinPoly( 3, 3, 0, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp12.
z() *
calcBernsteinPoly( 3, 0, 1, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp13.
z() *
calcBernsteinPoly( 3, 1, 1, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp9.
z() *
calcBernsteinPoly( 3, 2, 1, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp15.
z() *
calcBernsteinPoly( 3, 0, 2, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp16.
z() *
calcBernsteinPoly( 3, 1, 2, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
point3.
z() *
calcBernsteinPoly( 3, 0, 3, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() );
183 double z =
point1.
z() *
calcBernsteinPoly( 3, 0, 3, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp3.
z() *
calcBernsteinPoly( 3, 0, 2, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp7.
z() *
calcBernsteinPoly( 3, 0, 1, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp10.
z() *
calcBernsteinPoly( 3, 0, 0, 3, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp6.
z() *
calcBernsteinPoly( 3, 1, 2, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp11.
z() *
calcBernsteinPoly( 3, 1, 1, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp12.
z() *
calcBernsteinPoly( 3, 1, 0, 2, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp14.
z() *
calcBernsteinPoly( 3, 2, 1, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
cp15.
z() *
calcBernsteinPoly( 3, 2, 0, 1, barycoord.
x(), barycoord.
y(), barycoord.
z() ) +
point3.
z() *
calcBernsteinPoly( 3, 3, 0, 0, barycoord.
x(), barycoord.
y(), barycoord.
z() );
225 int ptn1, ptn2, ptn3;
230 mTIN->
getTriangle( x, y,
point1, ptn1, &v1, &state1,
point2, ptn2, &v2, &state2,
point3, ptn3, &v3, &state3 );
462 QgsDebugMsg( QStringLiteral(
"warning, null pointer" ) );
471 int ptn1, ptn2, ptn3;
476 mTIN->
getTriangle( x, y, &
point1, &ptn1, &v1, &state1, &
point2, &ptn2, &v2, &state2, &
point3, &ptn3, &v3, &state3 );
532 tmpx = -tmp.getX() / tmp.getZ();
533 tmpy = -tmp.getY() / tmp.getZ();
545 if ( state2 == NormVecDecorator::Breakline )
549 tmpx = -tmp.getX() / tmp.getZ();
550 tmpy = -tmp.getY() / tmp.getZ();
562 if ( state3 == NormVecDecorator::Breakline )
566 tmpx = -tmp.getX() / tmp.getZ();
567 tmpy = -tmp.getY() / tmp.getZ();
584 if ( state1 == NormVecDecorator::Breakline )
598 if ( state2 == NormVecDecorator::Breakline )
611 if ( state3 == NormVecDecorator::Breakline )
641 MathUtils::derVec( &cp1cp2, &odir3, &midpoint3cp4,
cp4.getX() - midpoint3.getX(),
cp4.getY() - midpoint3.getY() );
642 cp4.
setZ( midpoint3.getZ() + midpoint3cp4.getZ() );
664 cp13.
setZ( midpoint1.getZ() + midpoint1cp13.getZ() );
687 cp11.
setZ( midpoint2.getZ() + midpoint2cp11.getZ() );
731 QgsDebugMsg( QStringLiteral(
"warning, null pointer" ) );