Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
1.4 KB
Raw Blame
/*
 *  kis_tool_polygon.h - part of Krita
 *
 *  SPDX-FileCopyrightText: 2004 Michael Thaler <michael [email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef KIS_TOOL_POLYGON_H_
#define KIS_TOOL_POLYGON_H_

#include "kis_tool_shape.h"
#include "flake/kis_node_shape.h"
#include <kis_tool_polyline_base.h>
#include <kis_icon.h>

class KoCanvasBase;

class KisToolPolygon : public KisToolPolylineBase
{
    Q_OBJECT

public:
    KisToolPolygon(KoCanvasBase *canvas);
    ~KisToolPolygon() override;

    bool supportsPaintingAssistants() const override;

protected:
    void finishPolyline(const QVector<QPointF>& points) override;
protected Q_SLOTS:
    void resetCursorStyle() override;
};


#include "KoToolFactoryBase.h"

class KisToolPolygonFactory : public KisToolPolyLineFactoryBase
{

public:
    KisToolPolygonFactory()
            : KisToolPolyLineFactoryBase("KisToolPolygon") {
        setToolTip(i18n("Polygon Tool: Shift-mouseclick ends the polygon."));
        setToolName(i18n("Polygon Tool"));
        setSection(ToolBoxSection::Shape);
        setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
        setIconName(koIconNameCStr("krita_tool_polygon"));
        setPriority(4);
    }

    ~KisToolPolygonFactory() override {}

    KoToolBase * createTool(KoCanvasBase *canvas) override {
        return new KisToolPolygon(canvas);
    }
};


#endif //__KIS_TOOL_POLYGON_H__