diff options
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__ |