2014-11-11 15:58:22 +01:00
|
|
|
#ifndef CSV_RENDER_EDITMODE_H
|
|
|
|
#define CSV_RENDER_EDITMODE_H
|
|
|
|
|
2015-09-27 16:18:22 +02:00
|
|
|
#include <osg/ref_ptr>
|
|
|
|
|
2014-11-11 15:58:22 +01:00
|
|
|
#include "../widget/modebutton.hpp"
|
|
|
|
|
2015-12-18 14:04:53 +01:00
|
|
|
class QDragEnterEvent;
|
|
|
|
class QDropEvent;
|
|
|
|
class QDragMoveEvent;
|
|
|
|
|
2014-11-11 15:58:22 +01:00
|
|
|
namespace CSVRender
|
|
|
|
{
|
|
|
|
class WorldspaceWidget;
|
2015-09-27 16:18:22 +02:00
|
|
|
class TagBase;
|
2014-11-11 15:58:22 +01:00
|
|
|
|
|
|
|
class EditMode : public CSVWidget::ModeButton
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
WorldspaceWidget *mWorldspaceWidget;
|
|
|
|
unsigned int mMask;
|
|
|
|
|
2015-09-29 13:53:47 +02:00
|
|
|
protected:
|
|
|
|
|
|
|
|
WorldspaceWidget& getWorldspaceWidget();
|
|
|
|
|
2014-11-11 15:58:22 +01:00
|
|
|
public:
|
|
|
|
|
|
|
|
EditMode (WorldspaceWidget *worldspaceWidget, const QIcon& icon, unsigned int mask,
|
|
|
|
const QString& tooltip = "", QWidget *parent = 0);
|
|
|
|
|
|
|
|
unsigned int getInteractionMask() const;
|
|
|
|
|
|
|
|
virtual void activate (CSVWidget::SceneToolbar *toolbar);
|
2015-09-24 15:51:16 +02:00
|
|
|
|
2015-09-24 16:07:17 +02:00
|
|
|
/// Default-implementation: Ignored.
|
|
|
|
virtual void setEditLock (bool locked);
|
2015-09-27 16:18:22 +02:00
|
|
|
|
|
|
|
/// Default-implementation: Ignored.
|
|
|
|
virtual void primaryEditPressed (osg::ref_ptr<TagBase> tag);
|
|
|
|
|
|
|
|
/// Default-implementation: Ignored.
|
|
|
|
virtual void secondaryEditPressed (osg::ref_ptr<TagBase> tag);
|
|
|
|
|
|
|
|
/// Default-implementation: Ignored.
|
2015-10-29 11:20:06 +01:00
|
|
|
virtual void primarySelectPressed (osg::ref_ptr<TagBase> tag);
|
|
|
|
|
|
|
|
/// Default-implementation: Ignored.
|
|
|
|
virtual void secondarySelectPressed (osg::ref_ptr<TagBase> tag);
|
2015-10-01 12:46:01 +02:00
|
|
|
|
|
|
|
/// Default-implementation: ignore and return false
|
|
|
|
///
|
|
|
|
/// \return Drag accepted?
|
|
|
|
virtual bool primaryEditStartDrag (osg::ref_ptr<TagBase> tag);
|
|
|
|
|
|
|
|
/// Default-implementation: ignore and return false
|
|
|
|
///
|
|
|
|
/// \return Drag accepted?
|
|
|
|
virtual bool secondaryEditStartDrag (osg::ref_ptr<TagBase> tag);
|
|
|
|
|
|
|
|
/// Default-implementation: ignore and return false
|
|
|
|
///
|
|
|
|
/// \return Drag accepted?
|
2015-10-29 11:20:06 +01:00
|
|
|
virtual bool primarySelectStartDrag (osg::ref_ptr<TagBase> tag);
|
|
|
|
|
|
|
|
/// Default-implementation: ignore and return false
|
|
|
|
///
|
|
|
|
/// \return Drag accepted?
|
|
|
|
virtual bool secondarySelectStartDrag (osg::ref_ptr<TagBase> tag);
|
2015-10-01 12:46:01 +02:00
|
|
|
|
|
|
|
/// Default-implementation: ignored
|
2015-10-01 13:42:21 +02:00
|
|
|
virtual void drag (int diffX, int diffY, double speedFactor);
|
2015-10-01 12:46:01 +02:00
|
|
|
|
|
|
|
/// Default-implementation: ignored
|
|
|
|
virtual void dragCompleted();
|
|
|
|
|
|
|
|
/// Default-implementation: ignored
|
|
|
|
///
|
|
|
|
/// \note dragAborted will not be called, if the drag is aborted via changing
|
|
|
|
/// editing mode
|
|
|
|
virtual void dragAborted();
|
2015-10-01 13:19:48 +02:00
|
|
|
|
|
|
|
/// Default-implementation: ignored
|
2015-10-01 13:42:21 +02:00
|
|
|
virtual void dragWheel (int diff, double speedFactor);
|
2015-12-18 14:04:53 +01:00
|
|
|
|
|
|
|
/// Default-implementation: ignored
|
|
|
|
virtual void dragEnterEvent (QDragEnterEvent *event);
|
|
|
|
|
|
|
|
/// Default-implementation: ignored
|
|
|
|
virtual void dropEvent (QDropEvent* event);
|
|
|
|
|
|
|
|
/// Default-implementation: ignored
|
|
|
|
virtual void dragMoveEvent (QDragMoveEvent *event);
|
2016-03-01 15:48:34 +01:00
|
|
|
|
|
|
|
/// Default: return -1
|
|
|
|
virtual int getSubMode() const;
|
2014-11-11 15:58:22 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|