summaryrefslogtreecommitdiffstats
path: root/kivio/kiviopart/kiviosdk/kivio_shape_painter.h
blob: 5de938a9c90fda465c17c660f7e865b670392dfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef KIVIO_SHAPE_PAINTER_H
#define KIVIO_SHAPE_PAINTER_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "kivio_fill_style.h"

class KivioPainter;
class KivioShape;

class KivioShapePainter
{
protected:
    KivioFillStyle m_fillStyle;
    KivioPainter *m_pPainter;
    KivioShape *m_pShape;
    QColor m_fgColor;
    float m_lineWidth;

    float m_x, m_y, m_w, m_h;

    void drawArc();
    void drawBezier();
    void drawOpenPath();
    void drawClosedPath();
    void drawPie();
    void drawEllipse();
    void drawLineArray();
    void drawRectangle();
    void drawRoundRectangle();
    void drawPolygon();
    void drawPolyline();
    void drawTextBox();

public:
    KivioShapePainter( KivioPainter * );
    virtual ~KivioShapePainter();


    void setFGColor( const QColor &c ) { m_fgColor = c; }
    void setBGColor( const QColor &c ) { m_fillStyle.setColor(c); }
    void setLineWidth( const float &f ) { m_lineWidth = f; }

    void drawShape( KivioShape *, float, float, float, float );
    void drawShapeOutline( KivioShape *, float, float, float, float );

};

#endif