Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-02-25 16:56:25 +0000
committerStijn Buys <ingar@osirion.org>2012-02-25 16:56:25 +0000
commite10c0a7602c612993e6b99348bab507b7def0881 (patch)
tree2d863e946024fc3560221bedcddb149b253b4918 /src/manipulator.h
parent01f671303b75f3e4c683e3ff47b7ee120f0cda12 (diff)
Add entity manipulator widget, added support for editing entity angles.
Diffstat (limited to 'src/manipulator.h')
-rw-r--r--src/manipulator.h68
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__