32 ShapeElement(
const QRectF& f,
const char* t = 0) : QRectF(f), text(t) {}
42 class Shape :
public std::vector<ShapeElement> {
53 Shape(
const QRectF& r,
const char* s = 0) { add(r, s); }
55 Shape(
const QRectF& r) { add(r); }
57 void add(
const Shape& s) { insert(end(), s.begin(), s.end()); }
59 void add(
const QRectF& r,
const char* t = 0);
61 void add(
const QRectF& r) { push_back(r); }
63 void remove(
const QRectF&);
64 void remove(
const Shape&);
68 void translate(
const QPointF&);
69 void translateX(qreal);
70 void translateY(qreal);
71 Shape translated(
const QPointF&)
const;
73 qreal minHorizontalDistance(
const Shape&)
const;
75 qreal topDistance(
const QPointF&)
const;
76 qreal bottomDistance(
const QPointF&)
const;
82 size_t size()
const {
return std::vector<ShapeElement>::size(); }
83 bool empty()
const {
return std::vector<ShapeElement>::empty(); }
84 void clear() { std::vector<ShapeElement>::clear(); }
86 bool contains(
const QPointF&)
const;
87 bool intersects(
const QRectF& rr)
const;
88 bool intersects(
const Shape&)
const;
89 void paint(QPainter&)
const;
92 void dump(
const char*)
const;
100 inline static bool intersects(qreal a, qreal b, qreal c, qreal d)
105 if (a == b || c == d)
107 return (b > c) && (a < d);
111 extern void testShapes();
bool empty() const
Definition: shape.h:83
void clear()
Definition: shape.h:84
void add(const Shape &s)
Definition: shape.h:57
Shape()
Definition: shape.h:51
void dump() const
Definition: shape.cpp:301
Definition: aeolus.cpp:26
ShapeElement(const QRectF &f, const char *t=0)
Definition: shape.h:32
Shape(const QRectF &r, const char *s=0)
Definition: shape.h:53
const char * text
Definition: shape.h:30
size_t size() const
Definition: shape.h:82
HorizontalSpacingType
Definition: shape.h:45