X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Frs_actiondrawlinerelangle.h;h=6908afad7402809b4a8c8319c93a2ca9f447578c;hb=3f46c180da0806c9c263e6d87d0f1404632402da;hp=9bd1ca55b9e3a20e25e9343bacd9ef3fef7f6579;hpb=16ce54abf01ca3032e42a5bb11a4afcf9014dcca;p=architektonas diff --git a/src/actions/rs_actiondrawlinerelangle.h b/src/actions/rs_actiondrawlinerelangle.h index 9bd1ca5..6908afa 100644 --- a/src/actions/rs_actiondrawlinerelangle.h +++ b/src/actions/rs_actiondrawlinerelangle.h @@ -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 @@ -10,86 +13,57 @@ * * @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