-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeometry.h
More file actions
35 lines (23 loc) · 1.05 KB
/
Copy pathGeometry.h
File metadata and controls
35 lines (23 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef GEOMETRY_H
#define GEOMETRY_H
#include "Shape.h"
#include <QVector>
#include <QPointF>
#include <QRectF>
namespace Geometry {
QRectF boundsFromPoints(const QVector<QPointF> &points);
QVector<QPointF> toLocalPoints(const QVector<QPointF> &scenePoints, const QPointF &origin);
QVector<QPointF> toScenePoints(const QVector<QPointF> &localPoints, const Transform &t);
/// True when stored vertices look like legacy absolute scene coordinates.
bool looksLikeAbsoluteCoords(const QVector<QPointF> &points, const Transform &t);
QRectF localBounds(const Transform &t);
QRectF rotatedBoundingRect(const Transform &t);
QVector<QPointF> scaleLocalPoints(const QVector<QPointF> &points,
const QRectF &oldBounds,
const QRectF &newBounds);
QPointF snapToGrid(const QPointF &p, double gridSize = 20.0);
/// Axis-aligned scene bounds for export / hit testing.
QRectF sceneBounds(const Shape &shape);
bool intersectsRect(const QRectF &a, const QRectF &b);
} // namespace Geometry
#endif // GEOMETRY_H