123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- #ifndef MODEL_H
- #define MODEL_H
- #include <QList>
- #include <QWidget>
- #include "sequenz.h"
- #include "usermode.h"
- class Model
- {
- private:
- QList< QWidget* > views;
- public:
- Model();
-
- void addView( QWidget *v );
-
- void notifyViews();
- };
- class MainWindow;
- class ArbeitsModel : public Model
- {
- private:
- Frame *f;
- QPixmap m;
- QImage image;
- bool showIds;
- bool showMask;
- bool showColors;
- MainWindow *window;
-
- QRect *deleteField;
-
- QPolygon *newPolygon;
-
- ObjectPolygon copyedObject;
- float rotation;
- QPoint pSCenter;
-
- ObjectPolygon cutObject;
- int cutPolygon;
- int cutIndex;
-
- ObjectPolygon moveObject;
- int movePolygon;
- QPoint newVertex;
- int insertIndex;
- int moveIndex;
-
- QPoint viewPos;
- QSize viewSize;
- float xScaleFactor;
- float yScaleFactor;
- int xOffset;
- int yOffset;
-
- bool mousePressed;
- Qt::MouseButton mouseButton;
- UserMode mode;
- QPoint mouseStart;
- QPoint mousePos;
- public:
- ArbeitsModel(MainWindow *w);
- ~ArbeitsModel();
-
- QPoint translate(QPoint p);
-
- QPolygon translatePolygon(QPolygon p);
-
- QPoint inverseTranslate(QPoint p);
-
- void setFrame(Frame *f);
-
- void setMode(UserMode mode);
-
- UserMode getMode() const;
-
- void setShowId(bool sid);
-
- bool areIdsShown() const;
-
- void setShowMask(bool sm);
-
- bool isMaskShown() const;
-
- void setShowColors(bool sc);
-
- bool areColoresShown() const;
-
- void setMask(QPixmap m);
-
- QPixmap getMask() const;
-
- Frame* getFrame() const;
-
- MainWindow* getWindow() const;
-
- QImage getImage() const;
-
- void setMousePressed(bool pressed);
-
- void setMouseButtonPressed(Qt::MouseButton btn,
- QPoint pos);
-
- void setMousePoint(QPoint mp);
-
- bool isMousePressed() const;
-
- bool isMouseButtonPressed(Qt::MouseButton btn) const;
-
- QPoint getMousePressPoint() const;
-
- QPoint getMousePoint() const;
-
- void setOffset(int xo,
- int yo);
-
- void setScaleFactor(float xs,
- float ys);
-
- void setView(QPoint pos,
- QSize size);
-
- QSize getViewSize() const;
-
- int getXOffset() const;
-
- int getYOffset() const;
-
- float getXScaleFactor() const;
-
- float getYScaleFactor() const;
-
- QPoint getViewPos() const;
-
- void resetZoom();
-
- void setMoveObject(ObjectPolygon mo,
- int pIndex);
-
- void setMoveIndex(int index);
-
- void setInsertIndex(int index);
-
- void setNewVertex(QPoint vertex);
-
- ObjectPolygon getMoveObject() const;
-
- int getMoveIndex() const;
-
- int getInsertIndex() const;
-
- QPoint getNewVertex() const;
-
- int getMovePolygon() const;
-
- ObjectPolygon getCutObject() const;
-
- int getCutIndex() const;
-
- int getCutPolygon() const;
-
- void setCutObject(ObjectPolygon o,
- int pIndex);
-
- void setCutIndex(int index);
-
- ObjectPolygon getCopyedObject() const;
-
- float getCopyedRotation() const;
-
- QPoint getCopyedCenter() const;
-
- void setCopyedObject(ObjectPolygon o,
- QPoint c);
-
- void setCopyedRotation(float r);
-
- QPolygon* getNewPolygon() const;
-
- void setNewPolygon(QPolygon *p);
-
- QRect* getDeleteField() const;
-
- void setDeleteField(QRect *f);
- };
- #endif
|