2016-05-12 23:35:49 +00:00
|
|
|
#ifndef CSV_RENDER_PATHGRIDMODE_H
|
|
|
|
#define CSV_RENDER_PATHGRIDMODE_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "editmode.hpp"
|
|
|
|
|
|
|
|
namespace CSVRender
|
|
|
|
{
|
|
|
|
class PathgridMode : public EditMode
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
PathgridMode(WorldspaceWidget* worldspace, QWidget* parent=0);
|
|
|
|
|
2016-05-16 21:06:40 +00:00
|
|
|
virtual void activate(CSVWidget::SceneToolbar* toolbar);
|
|
|
|
|
|
|
|
virtual bool createContextMenu(QMenu* menu);
|
|
|
|
|
2016-05-12 23:35:49 +00:00
|
|
|
virtual void primaryEditPressed(const WorldspaceHitResult& hit);
|
|
|
|
|
|
|
|
virtual void secondaryEditPressed(const WorldspaceHitResult& hit);
|
|
|
|
|
|
|
|
virtual void primarySelectPressed(const WorldspaceHitResult& hit);
|
|
|
|
|
|
|
|
virtual void secondarySelectPressed(const WorldspaceHitResult& hit);
|
|
|
|
|
|
|
|
virtual bool primaryEditStartDrag (const WorldspaceHitResult& hit);
|
|
|
|
|
|
|
|
virtual bool secondaryEditStartDrag (const WorldspaceHitResult& hit);
|
|
|
|
|
|
|
|
virtual void drag (int diffX, int diffY, double speedFactor);
|
|
|
|
|
2016-05-16 21:25:02 +00:00
|
|
|
virtual void dragCompleted(const WorldspaceHitResult& hit);
|
2016-05-12 23:35:49 +00:00
|
|
|
|
|
|
|
/// \note dragAborted will not be called, if the drag is aborted via changing
|
|
|
|
/// editing mode
|
|
|
|
virtual void dragAborted();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
enum DragMode
|
|
|
|
{
|
|
|
|
DragMode_None,
|
|
|
|
DragMode_Move,
|
|
|
|
DragMode_Edge
|
|
|
|
};
|
|
|
|
|
|
|
|
DragMode mDragMode;
|
2016-05-16 21:25:02 +00:00
|
|
|
std::string mLastId, mEdgeId;
|
2016-05-12 23:35:49 +00:00
|
|
|
unsigned short mFromNode;
|
2016-05-16 21:06:40 +00:00
|
|
|
|
|
|
|
QAction* mSelectAll;
|
|
|
|
QAction* mInvertSelection;
|
|
|
|
QAction* mClearSelection;
|
|
|
|
QAction* mRemoveSelected;
|
|
|
|
QAction* mRemoveSelectedEdges;
|
|
|
|
|
2016-05-16 20:50:02 +00:00
|
|
|
QString getTooltip();
|
|
|
|
|
2016-05-16 21:06:40 +00:00
|
|
|
private slots:
|
|
|
|
|
|
|
|
void selectAll();
|
|
|
|
void invertSelection();
|
|
|
|
void clearSelection();
|
|
|
|
void removeSelected();
|
|
|
|
void removeSelectedEdges();
|
2016-05-12 23:35:49 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|