diff options
author | Stijn Buys <ingar@osirion.org> | 2012-02-25 16:56:25 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-02-25 16:56:25 +0000 |
commit | e10c0a7602c612993e6b99348bab507b7def0881 (patch) | |
tree | 2d863e946024fc3560221bedcddb149b253b4918 /src/manipulator.h | |
parent | 01f671303b75f3e4c683e3ff47b7ee120f0cda12 (diff) |
Add entity manipulator widget, added support for editing entity angles.
Diffstat (limited to 'src/manipulator.h')
-rw-r--r-- | src/manipulator.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/manipulator.h b/src/manipulator.h new file mode 100644 index 0000000..9ac28be --- /dev/null +++ b/src/manipulator.h @@ -0,0 +1,68 @@ +/* + manipulator.h + This file is part of the Project::OSiRiON world editor + and is distributed under the terms and conditions of + the GNU General Public License version 2 +*/ + +#ifndef __INCLUDED_EDITOR_MANIPULATOR__ +#define __INCLUDED_EDITOR_MANIPULATOR__ + +#include "entityproperties.h" + +#include <QWidget> + +namespace editor +{ + + +/** + * @brief a Widget displaying the manipulator state of an entity + * */ +class Manipulator : public QWidget +{ + Q_OBJECT + +public: + enum Mode {None = 0, Select = 1, Move = 2, Rotate = 3 }; + + Manipulator(QWidget *parent = 0); + + /* ---- inspectors ---- */ + + /** + * @brief returns the current manipulator Mode + * */ + inline const Mode mode() const { + return manipulator_mode; + } + + /* ---- mutatorss ---- */ + + /** + * @brief set the manipulator mode + * */ + inline void setMode(Mode mode) { + manipulator_mode = mode; + } + + void setSize(const QWidget *widget); + +public slots: + void setProperties(const EntityProperties *properties); + +protected: + /** + * @brief handle draw events + * */ + virtual void paintEvent(QPaintEvent *event); + +private: + + Mode manipulator_mode; + float manipulator_yaw; +}; + +} + +#endif // __INCLUDED_EDITOR_MANIPULATOR__ |