KD Chart API Documentation  3.1
TernaryPoint.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Chart library.
4 **
5 ** SPDX-FileCopyrightText: 2001 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
11 #ifndef TERNARYPOINT_H
12 #define TERNARYPOINT_H
13 
14 #include <QPointF>
15 #include <QtDebug>
16 
22 {
23 public:
24  TernaryPoint();
25  TernaryPoint(qreal a, qreal b);
26 
27  qreal a() const
28  {
29  return m_a;
30  }
31  qreal b() const
32  {
33  return m_b;
34  }
35  qreal c() const
36  {
37  return 1.0 - m_a - m_b;
38  }
39 
40  void set(qreal a, qreal b);
41 
42  bool isValid() const;
43 
44 private:
45  qreal m_a = -1.0;
46  qreal m_b = -1.0;
47 };
48 
49 QDebug operator<<(QDebug stream, const TernaryPoint &point);
50 
51 QPointF translate(const TernaryPoint &);
52 
53 #endif
QPointF translate(const TernaryPoint &)
QDebug operator<<(QDebug stream, const TernaryPoint &point)
TernaryPoint defines a point within a ternary coordinate plane.
Definition: TernaryPoint.h:22
void set(qreal a, qreal b)
qreal a() const
Definition: TernaryPoint.h:27
qreal b() const
Definition: TernaryPoint.h:31
bool isValid() const
qreal c() const
Definition: TernaryPoint.h:35

© 2001 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-chart/
Generated by doxygen 1.9.1