aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/modelinglib/qmt/stereotype/shapepaintvisitor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/modelinglib/qmt/stereotype/shapepaintvisitor.h')
-rw-r--r--src/libs/modelinglib/qmt/stereotype/shapepaintvisitor.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/libs/modelinglib/qmt/stereotype/shapepaintvisitor.h b/src/libs/modelinglib/qmt/stereotype/shapepaintvisitor.h
index 92e340e3e9..8ad4074764 100644
--- a/src/libs/modelinglib/qmt/stereotype/shapepaintvisitor.h
+++ b/src/libs/modelinglib/qmt/stereotype/shapepaintvisitor.h
@@ -31,6 +31,8 @@
#include <QPainter>
#include <QPointF>
#include <QSizeF>
+#include <QPolygonF>
+#include <QPainterPath>
namespace qmt {
@@ -84,4 +86,31 @@ private:
QRectF m_boundingRect;
};
+class QMT_EXPORT ShapePolygonVisitor : public ShapeConstVisitor
+{
+public:
+ ShapePolygonVisitor(const QPointF &scaledOrigin, const QSizeF &originalSize,
+ const QSizeF &baseSize, const QSizeF &size);
+
+ QPainterPath path() const { return m_path; }
+ QList<QPolygonF> toPolygons() const;
+
+ void visitLine(const LineShape *shapeLine) override;
+ void visitRect(const RectShape *shapeRect) override;
+ void visitRoundedRect(const RoundedRectShape *shapeRoundedRect) override;
+ void visitCircle(const CircleShape *shapeCircle) override;
+ void visitEllipse(const EllipseShape *shapeEllipse) override;
+ void visitDiamond(const DiamondShape *shapeDiamond) override;
+ void visitTriangle(const TriangleShape *shapeTriangle) override;
+ void visitArc(const ArcShape *shapeArc) override;
+ void visitPath(const PathShape *shapePath) override;
+
+private:
+ QPointF m_scaledOrigin;
+ QSizeF m_originalSize;
+ QSizeF m_baseSize;
+ QSizeF m_size;
+ QPainterPath m_path;
+};
+
} // namespace qmt