]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actiondrawpolyline.h
In the middle of removing Snapper class/fixing snapper rendering...
[architektonas] / src / actions / actiondrawpolyline.h
index 5ed5a1ae07ea0348762ab383f35d6c9d006ad8dc..b344c577c2f5d090888bc9c1266cb3a906bfeea6 100644 (file)
@@ -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<Vector *> history;
 };
 
 #endif // __ACTIONDRAWPOLYLINE_H__