File indexing completed on 2025-03-09 04:39:02
0001 // SPDX-License-Identifier: GPL-2.0-or-later 0002 // SPDX-FileCopyrightText: 2018 Kevin Ottens <ervin@kde.org> 0003 0004 #ifndef SKETCHMODEL_H 0005 #define SKETCHMODEL_H 0006 0007 #include <QHash> 0008 #include <QObject> 0009 0010 #include "stroke.h" 0011 0012 class SketchModel : public QObject 0013 { 0014 Q_OBJECT 0015 public: 0016 using QObject::QObject; 0017 0018 void addStroke(const Stroke &stroke); 0019 QVector<Stroke> strokes(Stroke::Type type) const; 0020 QVector<Stroke> strokes() const; 0021 0022 void eraseArea(Stroke::Type type, const QVector2D ¢er, float radius); 0023 0024 private: 0025 const QVector<Stroke> &strokesRef(Stroke::Type type) const; 0026 QVector<Stroke> &strokesRef(Stroke::Type type); 0027 0028 QVector<Stroke> m_fillStrokes; 0029 QVector<Stroke> m_outlineStrokes; 0030 }; 0031 0032 #endif // SKETCHMODEL_H