17 #include <QTextStream>
31 if (
a >= 0.0 &&
a <= 1.0
32 &&
b >= 0.0 &&
b <= 1.0
33 && 1.0 -
a -
b >= -2.0 * std::numeric_limits<qreal>::epsilon()) {
46 return m_a >= 0.0 && m_a <= 1.0
47 && m_b >= 0.0 && m_b <= 1.0
48 && 1.0 - m_a + m_b >= -std::numeric_limits<qreal>::epsilon();
54 QTextStream text(&
string);
55 text <<
"[TernaryPoint: ";
57 text.setFieldWidth(2);
58 text.setPadChar(QLatin1Char(
'0'));
59 text << ( int )(point.
a() * 100.0) <<
"%|"
60 << (
int )(point.
b() * 100.0) <<
"%|"
61 << (
int )(point.
c() * 100.0) <<
"%]";
63 text <<
"a=" << point.
a() <<
" - b=" << point.
b() <<
" - INVALID]";
78 QPointF bPosition(1.0 - point.
b(), 0.0);
80 QPointF result(bPosition + aPosition);
83 qWarning() <<
"TernaryPoint::translate(TernaryPoint): cannot translate invalid ternary points:"
const QPointF AxisVector_C_A
QDebug operator<<(QDebug stream, const TernaryPoint &point)
QPointF translate(const TernaryPoint &point)
TernaryPoint defines a point within a ternary coordinate plane.
void set(qreal a, qreal b)