2015-09-27 16:18:22 +02:00
|
|
|
#ifndef CSV_RENDER_INSTANCEMODE_H
|
|
|
|
#define CSV_RENDER_INSTANCEMODE_H
|
|
|
|
|
|
|
|
#include "editmode.hpp"
|
|
|
|
|
2016-01-15 12:07:25 +01:00
|
|
|
namespace CSVWidget
|
|
|
|
{
|
|
|
|
class SceneToolMode;
|
|
|
|
}
|
|
|
|
|
2015-09-27 16:18:22 +02:00
|
|
|
namespace CSVRender
|
|
|
|
{
|
2016-01-19 12:17:13 +01:00
|
|
|
class InstanceSelectionMode;
|
|
|
|
|
2015-09-27 16:18:22 +02:00
|
|
|
class InstanceMode : public EditMode
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2016-02-16 16:02:29 +01:00
|
|
|
|
|
|
|
enum DragMode
|
|
|
|
{
|
|
|
|
DragMode_None,
|
2016-03-04 12:02:45 +01:00
|
|
|
DragMode_Move
|
2016-02-16 16:02:29 +01:00
|
|
|
};
|
|
|
|
|
2016-01-15 12:07:25 +01:00
|
|
|
CSVWidget::SceneToolMode *mSubMode;
|
2016-03-05 11:41:42 +01:00
|
|
|
std::string mSubModeId;
|
2016-01-19 12:17:13 +01:00
|
|
|
InstanceSelectionMode *mSelectionMode;
|
2016-02-16 16:02:29 +01:00
|
|
|
DragMode mDragMode;
|
2016-03-04 12:00:05 +01:00
|
|
|
int mDragAxis;
|
2016-03-04 16:24:02 +01:00
|
|
|
bool mLocked;
|
2015-09-27 16:18:22 +02:00
|
|
|
|
2016-03-01 15:48:34 +01:00
|
|
|
int getSubModeFromId (const std::string& id) const;
|
|
|
|
|
2015-09-27 16:18:22 +02:00
|
|
|
public:
|
|
|
|
|
|
|
|
InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent = 0);
|
|
|
|
|
2016-01-15 12:07:25 +01:00
|
|
|
virtual void activate (CSVWidget::SceneToolbar *toolbar);
|
|
|
|
|
|
|
|
virtual void deactivate (CSVWidget::SceneToolbar *toolbar);
|
|
|
|
|
2016-03-04 16:24:02 +01:00
|
|
|
virtual void setEditLock (bool locked);
|
|
|
|
|
2015-09-27 16:18:22 +02:00
|
|
|
virtual void primaryEditPressed (osg::ref_ptr<TagBase> tag);
|
|
|
|
|
|
|
|
virtual void secondaryEditPressed (osg::ref_ptr<TagBase> tag);
|
|
|
|
|
2015-10-29 11:20:06 +01:00
|
|
|
virtual void primarySelectPressed (osg::ref_ptr<TagBase> tag);
|
|
|
|
|
|
|
|
virtual void secondarySelectPressed (osg::ref_ptr<TagBase> tag);
|
2016-01-10 08:56:15 +01:00
|
|
|
|
2016-02-16 16:02:29 +01:00
|
|
|
virtual bool primaryEditStartDrag (osg::ref_ptr<TagBase> tag);
|
|
|
|
|
|
|
|
virtual bool secondaryEditStartDrag (osg::ref_ptr<TagBase> tag);
|
|
|
|
|
|
|
|
virtual void drag (int diffX, int diffY, double speedFactor);
|
|
|
|
|
|
|
|
virtual void dragCompleted();
|
|
|
|
|
2016-03-04 15:19:26 +01:00
|
|
|
/// \note dragAborted will not be called, if the drag is aborted via changing
|
|
|
|
/// editing mode
|
|
|
|
virtual void dragAborted();
|
|
|
|
|
2016-02-16 16:02:29 +01:00
|
|
|
virtual void dragWheel (int diff, double speedFactor);
|
|
|
|
|
2016-01-10 08:56:15 +01:00
|
|
|
virtual void dragEnterEvent (QDragEnterEvent *event);
|
|
|
|
|
|
|
|
virtual void dropEvent (QDropEvent* event);
|
2016-03-01 15:48:34 +01:00
|
|
|
|
|
|
|
virtual int getSubMode() const;
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
void subModeChanged (const std::string& id);
|
2015-09-27 16:18:22 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|