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