#include <Ruler.h>
Definition at line 12 of file Ruler.h.
◆ Ruler()
Definition at line 9 of file Ruler.cc.
9 :
p1(QPointF(10, 10)),
p2(QPointF(100, 190))
10{
11}
◆ ~Ruler()
◆ point1()
| const QPointF & Ruler::point1 |
( |
| ) |
const |
◆ point2()
| const QPointF & Ruler::point2 |
( |
| ) |
const |
◆ project()
| QPointF Ruler::project |
( |
const QPointF & | pt | ) |
|
Definition at line 17 of file Ruler.cc.
18{
23 double a1 = (y2 - y1) / (x2 - x1);
24 double b1 = y1 - x1 * a1;
25 double a2 = (x2 - x1) / (y1 - y2);
26 double b2 = pt.y() - a2 * pt.x();
27 double xm = (b2 - b1) / (a1 - a2);
28 return QPointF(xm, xm * a1 + b1);
29}
References p1, and p2.
◆ setPoint1()
| void Ruler::setPoint1 |
( |
const QPointF & | p | ) |
|
|
inline |
Definition at line 19 of file Ruler.h.
References p, and p1.
◆ setPoint2()
| void Ruler::setPoint2 |
( |
const QPointF & | p | ) |
|
|
inline |
Definition at line 23 of file Ruler.h.
References p, and p2.
◆ p1
◆ p2
The documentation for this class was generated from the following files:
- plugins/assistants/Assistants/Ruler.h
- plugins/assistants/Assistants/Ruler.cc