QTfrontend/drawmapscene.h
changeset 13209 f5d36be88c61
parent 11046 47a8c19ecb60
equal deleted inserted replaced
13207:d948d39e5da8 13209:f5d36be88c61
    20 #define DRAWMAPSCENE_H
    20 #define DRAWMAPSCENE_H
    21 
    21 
    22 #include <QGraphicsScene>
    22 #include <QGraphicsScene>
    23 #include <QPainterPath>
    23 #include <QPainterPath>
    24 #include <QGraphicsEllipseItem>
    24 #include <QGraphicsEllipseItem>
       
    25 
       
    26 #define DRAWN_MAP_BRUSH_SIZE_STEP (10)
       
    27 #define DRAWN_MAP_BRUSH_SIZE_MAX (516)
       
    28 #define DRAWN_MAP_BRUSH_SIZE_MIN (16)
       
    29 #define DRAWN_MAP_BRUSH_SIZE_START (76)
    25 
    30 
    26 class QGraphicsPathItem;
    31 class QGraphicsPathItem;
    27 
    32 
    28 struct PathParams
    33 struct PathParams
    29 {
    34 {
    48         explicit DrawMapScene(QObject *parent = 0);
    53         explicit DrawMapScene(QObject *parent = 0);
    49 
    54 
    50         QByteArray encode();
    55         QByteArray encode();
    51         void decode(QByteArray data);
    56         void decode(QByteArray data);
    52         int pointsCount();
    57         int pointsCount();
       
    58         int brushSize();
    53 
    59 
    54     signals:
    60     signals:
    55         void pathChanged();
    61         void pathChanged();
       
    62         void brushSizeChanged(int brushSize);
    56 
    63 
    57     public slots:
    64     public slots:
    58         void undo();
    65         void undo();
    59         void clearMap();
    66         void clearMap();
    60         void simplifyLast();
    67         void simplifyLast();
    61         void optimize();
    68         void optimize();
    62         void setErasing(bool erasing);
    69         void setErasing(bool erasing);
    63         void showCursor();
    70         void showCursor();
    64         void hideCursor();
    71         void hideCursor();
    65         void setPathType(PathType pathType);
    72         void setPathType(PathType pathType);
       
    73         void setBrushSize(int brushSize);
    66 
    74 
    67     private:
    75     private:
    68         QPen m_pen;
    76         QPen m_pen;
    69         QBrush m_eraser;
    77         QBrush m_eraser;
    70         QBrush m_brush;
    78         QBrush m_brush;