X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdrawingview.h;h=441b7a8eb61cecfd2b080bc636b11b00000faee8;hb=a3e939d9028531324be8ba2ec54eddca31342c19;hp=29a47a7083e7c2f801d5deda81e6c1f3d543fd03;hpb=4708212b56a0c5645226e728f9a26ee1fd2d027d;p=architektonas diff --git a/src/drawingview.h b/src/drawingview.h index 29a47a7..441b7a8 100644 --- a/src/drawingview.h +++ b/src/drawingview.h @@ -18,14 +18,17 @@ class DrawingView: public QWidget DrawingView(QWidget * parent = NULL); public: + void DrawBackground(Painter *); void SetGridSize(uint32_t); + void SetGridSize(double); void UpdateGridBackground(void); + void UpdateGridBackgroundF(void); Point SnapPointToGrid(Point); Point SnapPointToAngle(Point); - void RenderObjects(Painter *, std::vector &, int, bool ignoreLayer = false); + void RenderObjects(Painter *, VPVector &, int, bool ignoreLayer = false); void AddHoveredToSelection(void); - void GetSelection(std::vector &); - void GetHovered(std::vector &); + VPVector GetSelection(void); + VPVector GetHovered(void); void ToolHandler(int, Point); void ToolDraw(Painter *); void LineHandler(int, Point); @@ -33,12 +36,17 @@ class DrawingView: public QWidget void ArcHandler(int, Point); void RotateHandler(int, Point); void MirrorHandler(int, Point); + void DimensionHandler(int, Point); + void TriangulateHandler(int, Point); + void TrimHandler(int, Point); + void ParallelHandler(int, Point); Rect GetObjectExtents(Object *); void CheckObjectBounds(void); bool HitTestObjects(Point); bool HitTest(Object *, Point); bool HandleObjectClicked(void); void HandleObjectMovement(Point); + void AddDimensionTo(void * obj); public slots: void DeleteCurrentLayer(int); @@ -47,12 +55,15 @@ class DrawingView: public QWidget void HandlePenWidth(float); void HandlePenStyle(int); void HandlePenColor(uint32_t); + void HandlePenStamp(void); signals: void ObjectHovered(Object *); void ObjectSelected(Object *); + void NeedZoomUpdate(void); protected: + void focusOutEvent(QFocusEvent * event); void paintEvent(QPaintEvent * event); void resizeEvent(QResizeEvent * event); void mousePressEvent(QMouseEvent * event); @@ -63,15 +74,16 @@ 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); public: bool useAntialiasing; -// uint32_t numSelected; uint32_t numHovered; bool shiftDown; bool ctrlDown; + bool altDown; private: QPixmap gridBackground; @@ -80,18 +92,22 @@ class DrawingView: public QWidget public: Container document; uint32_t gridPixels; // Grid size in pixels - private: + double gridPixelsF; // Grid size in pixels (float) +// private: + public: bool collided; bool scrollDrag; Vector oldPoint; + Vector oldScrollPoint; QString informativeText; public: - std::vector select; - std::vector hover; - std::vector toolObjects; + VPVector select; + VPVector toolObjects; std::vector toolScratch; + VPVector toolScratch2; Point toolPoint[32]; + Object * toolObj[32]; Point intersectionPoint; Point hoverPoint; bool hoverPointValid; @@ -99,6 +115,8 @@ class DrawingView: public QWidget Object * dragged; bool draggingObject; bool angleSnap; + bool dirty; + bool scrollWheelSeen; }; #endif // __DRAWINGVIEW_H__