#include <TernaryPoint.h>
Definition at line 40 of file TernaryPoint.h.
Public Member Functions | |
double | a () const |
double | b () const |
double | c () const |
bool | isValid () const |
void | set (double a, double b) |
TernaryPoint (double a, double b) | |
TernaryPoint () |
TernaryPoint::TernaryPoint | ( | ) |
Definition at line 38 of file TernaryPoint.cpp.
References isValid().
00039 : m_a( -1.0 ) 00040 , m_b( -1.0 ) 00041 { 00042 Q_ASSERT( !isValid() ); 00043 }
TernaryPoint::TernaryPoint | ( | double | a, | |
double | b | |||
) |
double TernaryPoint::a | ( | ) | const |
double TernaryPoint::b | ( | ) | const |
double TernaryPoint::c | ( | ) | const |
bool TernaryPoint::isValid | ( | ) | const |
Definition at line 67 of file TernaryPoint.cpp.
Referenced by operator<<(), set(), TernaryPoint(), and translate().
00068 { 00069 return 00070 m_a >= 0.0 && m_a <= 1.0 00071 && m_b >= 0.0 && m_b <= 1.0 00072 && 1.0 - m_a + m_b >= - std::numeric_limits<double>::epsilon(); 00073 }
void TernaryPoint::set | ( | double | a, | |
double | b | |||
) |
Definition at line 52 of file TernaryPoint.cpp.
References isValid().
00053 { 00054 if ( a >= 0.0 && a <= 1.0 00055 && b >= 0.0 && b <= 1.0 00056 && 1.0 - a - b >= -2.0 * std::numeric_limits<double>::epsilon() ) { 00057 m_a = a; 00058 m_b = b; 00059 Q_ASSERT( isValid() ); // more a test for isValid 00060 } else { 00061 m_a = -1.0; 00062 m_b = -1.0; 00063 Q_ASSERT( ! isValid() ); 00064 } 00065 }