29 #include <QTextStream> 47 if ( a >= 0.0 && a <= 1.0
48 && b >= 0.0 && b <= 1.0
49 && 1.0 - a - b >= -2.0 * std::numeric_limits<qreal>::epsilon() ) {
63 m_a >= 0.0 && m_a <= 1.0
64 && m_b >= 0.0 && m_b <= 1.0
65 && 1.0 - m_a + m_b >= - std::numeric_limits<qreal>::epsilon();
71 QTextStream text( &
string );
72 text <<
"[TernaryPoint: ";
74 text.setFieldWidth( 2 );
75 text.setPadChar( QLatin1Char(
'0' ) );
76 text << ( int ) ( point.
a() * 100.0 ) <<
"%|" 77 << (
int ) ( point.
b() * 100.0 ) <<
"%|" 78 << (
int ) ( point.
c() * 100.0 ) <<
"%]";
80 text <<
"a=" << point.
a() <<
" - b=" << point.
b() <<
" - INVALID]";
95 QPointF bPosition( 1.0 - point.
b(), 0.0 );
97 QPointF result( bPosition + aPosition );
100 qWarning() <<
"TernaryPoint::translate(TernaryPoint): cannot translate invalid ternary points:" QDebug operator<<(QDebug stream, const TernaryPoint &point)
TernaryPoint defines a point within a ternary coordinate plane.
const QPointF AxisVector_C_A
QPointF translate(const TernaryPoint &point)
void set(qreal a, qreal b)