X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdrawingview.h;h=0d483926f049e62787b45bce2c7fa6a8a1a164c0;hb=41644f6a841b45cb6f1f7a96c93fd550f67a7974;hp=d252ffcf3515e5273c74c48e6cdb33554daf2a26;hpb=e34f829de8f46c03e74f75e46438433153f6b96d;p=architektonas diff --git a/src/drawingview.h b/src/drawingview.h index d252ffc..0d48392 100644 --- a/src/drawingview.h +++ b/src/drawingview.h @@ -18,14 +18,14 @@ class DrawingView: public QWidget DrawingView(QWidget * parent = NULL); public: - void SetGridSize(uint32_t); - void UpdateGridBackground(void); + void DrawBackground(Painter *); Point SnapPointToGrid(Point); Point SnapPointToAngle(Point); void RenderObjects(Painter *, VPVector &, int, bool ignoreLayer = false); - void AddHoveredToSelection(void); + void HandleSelectionClick(VPVector &); VPVector GetSelection(void); - VPVector GetHovered(void); + VPVector GetHovered(bool exclude = false); + void MoveSelectedToLayer(int); void ToolHandler(int, Point); void ToolDraw(Painter *); void LineHandler(int, Point); @@ -34,6 +34,7 @@ class DrawingView: public QWidget void RotateHandler(int, Point); void MirrorHandler(int, Point); void DimensionHandler(int, Point); + void DeleteHandler(int, Point); void TriangulateHandler(int, Point); void TrimHandler(int, Point); void ParallelHandler(int, Point); @@ -49,17 +50,18 @@ class DrawingView: public QWidget void DeleteCurrentLayer(int); void HandleLayerToggle(void); void HandleLayerSwap(int, int); - void HandlePenWidth(float); - void HandlePenStyle(int); - void HandlePenColor(uint32_t); - void HandlePenStamp(void); + void HandleLayerSwap(int, int, VPVector &); + void HandlePenStamp(QAction *); + void HandlePenDropper(QAction *); signals: void ObjectHovered(Object *); void ObjectSelected(Object *); + void NeedZoomUpdate(void); protected: void focusOutEvent(QFocusEvent * event); + void focusInEvent(QFocusEvent * event); void paintEvent(QPaintEvent * event); void resizeEvent(QResizeEvent * event); void mousePressEvent(QMouseEvent * event); @@ -70,6 +72,7 @@ class DrawingView: public QWidget void keyReleaseEvent(QKeyEvent * event); private: + void DrawSubGrid(Painter *, uint32_t, double, Vector, Vector); QPoint GetAdjustedMousePosition(QMouseEvent * event); QPoint GetAdjustedClientPosition(int x, int y); @@ -82,12 +85,16 @@ class DrawingView: public QWidget private: QPixmap gridBackground; - double scale; // Window scaling factor - int32_t offsetX, offsetY; // Window offsets + double scale; // Window scaling factor + int32_t offsetX, offsetY; // Window offsets + bool supressSelected; + QCursor curMarker; + QCursor curDropper; + uint32_t currentSelect; public: Container document; - uint32_t gridPixels; // Grid size in pixels - private: + uint32_t gridPixels; // Grid size in pixels + double gridPixelsF; // Grid size in pixels (float) bool collided; bool scrollDrag; Vector oldPoint; @@ -99,8 +106,10 @@ class DrawingView: public QWidget VPVector toolObjects; std::vector toolScratch; VPVector toolScratch2; + VPVector oldHover; Point toolPoint[32]; Object * toolObj[32]; + double toolParam[32]; Point intersectionPoint; Point hoverPoint; bool hoverPointValid; @@ -113,4 +122,3 @@ class DrawingView: public QWidget }; #endif // __DRAWINGVIEW_H__ -