]> Shamusworld >> Repos - architektonas/blobdiff - src/drawingview.h
Fixed click selection and pen functionality.
[architektonas] / src / drawingview.h
index d252ffcf3515e5273c74c48e6cdb33554daf2a26..5906766d35b6bd459e0c2ccf9cdca55405a2f60a 100644 (file)
@@ -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);
 
@@ -84,10 +87,14 @@ class DrawingView: public QWidget
                QPixmap gridBackground;
                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:
+               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<Object> 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__
-