]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/rs_actiondrawlinerelangle.h
Major refactoring of actions: Moved implementation from header files
[architektonas] / src / actions / rs_actiondrawlinerelangle.h
index 9bd1ca55b9e3a20e25e9343bacd9ef3fef7f6579..6908afad7402809b4a8c8319c93a2ca9f447578c 100644 (file)
@@ -1,8 +1,11 @@
 #ifndef RS_ACTIONDRAWLINERELANGLE_H
 #define RS_ACTIONDRAWLINERELANGLE_H
 
+#include "rs_line.h"
 #include "rs_previewactioninterface.h"
+#include "vector.h"
 
+class RS_Entity;
 
 /**
  * This action class can handle user events to draw lines with a given angle
  *
  * @author Andrew Mustun
  */
-class RS_ActionDrawLineRelAngle : public RS_PreviewActionInterface {
-       //Q_OBJECT
-private:
-    enum Status {
-        SetEntity,     /**< Choose entity. */
-        SetPos,        /**< Choose position. */
-               SetAngle,      /**< Set angle in console. */
-               SetLength      /**< Set length in console. */
-    };
-
-public:
-    RS_ActionDrawLineRelAngle(RS_EntityContainer& container,
-                              RS_GraphicView& graphicView,
-                              double angle=0.0,
-                              bool fixedAngle=false);
-    ~RS_ActionDrawLineRelAngle() {}
-
-       static QAction* createGUIAction(RS2::ActionType /*type*/, QObject* /*parent*/);
-
-       virtual RS2::ActionType rtti() {
-               return RS2::ActionDrawLineRelAngle;
-       }
-
-    virtual void trigger();
-
-    virtual void mouseMoveEvent(QMouseEvent* e);
-    virtual void mouseReleaseEvent(QMouseEvent* e);
-
-       virtual void coordinateEvent(RS_CoordinateEvent* e);
-    virtual void commandEvent(RS_CommandEvent* e);
-       virtual QStringList getAvailableCommands();
-
-    virtual void hideOptions();
-    virtual void showOptions();
-
-    virtual void updateMouseButtonHints();
-    virtual void updateMouseCursor();
-    virtual void updateToolBar();
-
-       void setAngle(double a) {
-               angle = a;
-       }
-
-       double getAngle() {
-               return angle;
-       }
-
-       void setLength(double l) {
-               length = l;
-       }
-
-       double getLength() {
-               return length;
-       }
-
-       bool hasFixedAngle() {
-               return fixedAngle;
-       }
-
-private:
-    /** new line */
-    //RS_Line* line;
-    /** Chosen entity */
-    RS_Entity* entity;
-    /** Chosen position */
-    Vector pos;
-    /** Data of new line */
-    RS_LineData data;
-    /**
-     * Line angle.
-     */
-    double angle;
-    /**
-     * Line length.
-     */
-    double length;
-    /**
-     * Is the angle fixed?
-     */
-    bool fixedAngle;
+class RS_ActionDrawLineRelAngle: public RS_PreviewActionInterface
+{
+       private:
+               enum Status {
+                       SetEntity,     /**< Choose entity. */
+                       SetPos,        /**< Choose position. */
+                       SetAngle,      /**< Set angle in console. */
+                       SetLength      /**< Set length in console. */
+               };
+
+       public:
+               RS_ActionDrawLineRelAngle(RS_EntityContainer & container, RS_GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false);
+               ~RS_ActionDrawLineRelAngle();
+
+               virtual RS2::ActionType rtti();
+               virtual void trigger();
+               virtual void mouseMoveEvent(QMouseEvent * e);
+               virtual void mouseReleaseEvent(QMouseEvent * e);
+               virtual void coordinateEvent(Vector * e);
+               virtual void commandEvent(RS_CommandEvent * e);
+               virtual QStringList getAvailableCommands();
+               virtual void hideOptions();
+               virtual void showOptions();
+               virtual void updateMouseButtonHints();
+               virtual void updateMouseCursor();
+               virtual void updateToolBar();
+               void setAngle(double a);
+               double getAngle();
+               void setLength(double l);
+               double getLength();
+               bool hasFixedAngle();
+
+       private:
+               /** Chosen entity */
+               RS_Entity * entity;
+               /** Chosen position */
+               Vector pos;
+               /** Data of new line */
+               RS_LineData data;
+               /**
+                * Line angle.
+                */
+               double angle;
+               /**
+                * Line length.
+                */
+               double length;
+               /**
+                * Is the angle fixed?
+                */
+               bool fixedAngle;
 };
 
 #endif