File indexing completed on 2024-04-28 15:52:31

0001 // This file is part of Washi Pad
0002 // SPDX-FileCopyrightText: 2018 Kevin Ottens <ervin@kde.org>
0003 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 
0005 #ifndef SKETCHMODEL_H
0006 #define SKETCHMODEL_H
0007 
0008 #include <QObject>
0009 #include <QHash>
0010 
0011 #include "stroke.h"
0012 
0013 class SketchModel : public QObject
0014 {
0015     Q_OBJECT
0016 public:
0017     using QObject::QObject;
0018 
0019     void addStroke(const Stroke &stroke);
0020     QVector<Stroke> strokes(Stroke::Type type) const;
0021     QVector<Stroke> strokes() const;
0022 
0023     void eraseArea(Stroke::Type type, const QVector2D &center, float radius);
0024 
0025 private:
0026     const QVector<Stroke> &strokesRef(Stroke::Type type) const;
0027     QVector<Stroke> &strokesRef(Stroke::Type type);
0028 
0029     QVector<Stroke> m_fillStrokes;
0030     QVector<Stroke> m_outlineStrokes;
0031 };
0032 
0033 #endif // SKETCHMODEL_H