X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondrawpolyline.h;h=b344c577c2f5d090888bc9c1266cb3a906bfeea6;hb=92c8661cef41f1109908bf645c0a171e34680183;hp=5ed5a1ae07ea0348762ab383f35d6c9d006ad8dc;hpb=f62cebc26c7c3af447f0e4e4c43331f8589dce22;p=architektonas diff --git a/src/actions/actiondrawpolyline.h b/src/actions/actiondrawpolyline.h index 5ed5a1a..b344c57 100644 --- a/src/actions/actiondrawpolyline.h +++ b/src/actions/actiondrawpolyline.h @@ -7,27 +7,47 @@ class Polyline; /** - * This action class can handle user events to draw freehand lines. + * This class handles polyline creation. * * @author James Hammons */ class ActionDrawPolyline: public ActionInterface { + public: + /** Action States */ + enum Status + { + SetFirstPoint = 0, /**< Setting the first point. */ + SetNextPoint /**< Setting the next point. */ + }; + public: ActionDrawPolyline(EntityContainer & container, GraphicView & graphicView); ~ActionDrawPolyline(); + virtual RS2::ActionType rtti(); virtual void trigger(); - virtual void mouseMoveEvent(QMouseEvent * e); - virtual void mousePressEvent(QMouseEvent * e); - virtual void mouseReleaseEvent(QMouseEvent * e); + virtual void mouseMoveEvent(QMouseEvent *); + virtual void mousePressEvent(QMouseEvent *); + virtual void mouseReleaseEvent(QMouseEvent *); + virtual void coordinateEvent(Vector *); virtual void updateMouseButtonHints(); virtual void updateMouseCursor(); virtual void updateToolBar(); + virtual void showOptions(); + virtual void hideOptions(); + void close(); + void undo(); protected: Vector vertex; + Vector startPoint; Polyline * polyline; + /** Start point of the series of lines. Used for close function. */ + Vector start; + /** Point history (for undo) */ +//This probably won't work, because of arc segments... + QList history; }; #endif // __ACTIONDRAWPOLYLINE_H__