26#include <QSharedPointer>
35#define RDEFAULT_RBOX RBox()
49 explicit RBox(
const QRectF& rect);
50 RBox(
double x1,
double y1,
double x2,
double y2);
53 RBox(
const RVector& center,
double width,
double height);
65 double getWidth()
const;
66 double getHeight()
const;
68 double getArea()
const;
72 bool isOutside(
const RBox& other)
const;
73 bool isOutsideXY(
const RBox& other)
const;
74 bool contains(
const RBox& other)
const;
78 bool contains(
const RVector& v)
const;
80 return contains(other);
85 bool intersects(
const RBox& other)
const;
86 bool intersectsWith(
const RShape& shape,
bool limited =
true)
const;
88 void growToInclude(
const RBox& other);
89 void growToIncludeBoxes(
const QList<RBox>& others);
96 void growToInclude(
const RVector& v);
102 void setCorner1(
const RVector& v);
104 void setCorner2(
const RVector& v);
106 QList<RVector> getCorners()
const;
107 QList<RVector> getCorners2d()
const;
108 QList<RLine> getLines2d()
const;
110 QList<RTriangle> getTriangles()
const;
112 RBox& grow(
double offset);
113 RBox& growXY(
double offset);
114 RBox& growXY(
double offsetX,
double offsetY);
117 bool scaleByReference(
const RVector& referencePoint,
const RVector& targetPoint,
bool keepAspectRatio =
false,
bool fromCenter =
false);
119 QRectF toQRectF()
const;
121 bool operator ==(
const RBox& other)
const;
122 bool operator !=(
const RBox& other)
const {
123 return !operator==(other);
126 void transform(QTransform& t);
128#if QT_VERSION >= 0x060000
QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RBox &b)
Stream operator for QDebug.
Definition RBox.cpp:640
Q_DECLARE_METATYPE(RMath *)
Represents a box e.g.
Definition RBox.h:46
bool containsBox(const RBox &other) const
Definition RBox.h:79
RVector c1
Getter function for this property: getCorner1 Setter function for this property: setCorner1
Definition RBox.h:143
void growToIncludeBox(const RBox &other)
Definition RBox.h:90
RBox get2D() const
Definition RBox.h:61
void growToIncludePoint(const RVector &v)
Definition RBox.h:97
bool containsPoint(const RVector &v) const
Definition RBox.h:82
RVector c2
Getter function for this property: getCorner2 Setter function for this property: setCorner2
Definition RBox.h:148
Low-level mathematical representation of a line.
Definition RLine.h:41
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition RPolyline.h:50
static const double PointTolerance
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RS.h:920
Interface for geometrical shape classes.
Definition RShape.h:72
Low-level mathematical representation of a triangle.
Definition RTriangle.h:49
Represents a 3d vector (x/y/z).
Definition RVector.h:47
RVector get2D() const
Definition RVector.h:86
#define QCADCORE_EXPORT
Definition core_global.h:10
void move(void e, void offset)
Moves the given entity or shape by the given offset.
Definition simple_modify.js:58