2016-05-12 23:35:49 +00:00
|
|
|
#ifndef CSV_RENDER_PATHGRIDMODE_H
|
|
|
|
#define CSV_RENDER_PATHGRIDMODE_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "editmode.hpp"
|
|
|
|
|
2022-10-19 17:02:00 +00:00
|
|
|
namespace CSVWidget
|
|
|
|
{
|
|
|
|
class SceneToolbar;
|
|
|
|
}
|
|
|
|
|
2016-05-12 23:35:49 +00:00
|
|
|
namespace CSVRender
|
|
|
|
{
|
2016-05-18 14:46:25 +00:00
|
|
|
class PathgridSelectionMode;
|
2022-10-19 17:02:00 +00:00
|
|
|
class WorldspaceWidget;
|
|
|
|
struct WorldspaceHitResult;
|
2016-05-18 14:46:25 +00:00
|
|
|
|
2016-05-12 23:35:49 +00:00
|
|
|
class PathgridMode : public EditMode
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-11-13 07:39:47 +00:00
|
|
|
PathgridMode(WorldspaceWidget* worldspace, QWidget* parent = nullptr);
|
2016-05-12 23:35:49 +00:00
|
|
|
|
2020-11-13 07:39:47 +00:00
|
|
|
void activate(CSVWidget::SceneToolbar* toolbar) override;
|
2016-05-12 23:35:49 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void deactivate(CSVWidget::SceneToolbar* toolbar) override;
|
2016-05-16 21:06:40 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void primaryOpenPressed(const WorldspaceHitResult& hit) override;
|
2016-07-26 00:49:28 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void primaryEditPressed(const WorldspaceHitResult& hit) override;
|
2019-07-01 23:26:05 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void secondaryEditPressed(const WorldspaceHitResult& hit) override;
|
2016-05-12 23:35:49 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void primarySelectPressed(const WorldspaceHitResult& hit) override;
|
2016-05-12 23:35:49 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void secondarySelectPressed(const WorldspaceHitResult& hit) override;
|
2016-05-12 23:35:49 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
bool primaryEditStartDrag(const QPoint& pos) override;
|
2016-05-12 23:35:49 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
bool secondaryEditStartDrag(const QPoint& pos) override;
|
2016-05-12 23:35:49 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void drag(const QPoint& pos, int diffX, int diffY, double speedFactor) override;
|
2016-05-12 23:35:49 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void dragCompleted(const QPoint& pos) override;
|
2016-05-12 23:35:49 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
/// \note dragAborted will not be called, if the drag is aborted via changing
|
2016-05-12 23:35:49 +00:00
|
|
|
/// editing mode
|
2020-10-16 18:18:54 +00:00
|
|
|
void dragAborted() override;
|
2016-05-12 23:35:49 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
enum DragMode
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
2016-05-12 23:35:49 +00:00
|
|
|
DragMode_None,
|
2020-10-16 18:18:54 +00:00
|
|
|
DragMode_Move,
|
|
|
|
DragMode_Edge
|
|
|
|
};
|
2016-05-12 23:35:49 +00:00
|
|
|
|
|
|
|
DragMode mDragMode;
|
|
|
|
std::string mLastId, mEdgeId;
|
|
|
|
unsigned short mFromNode;
|
|
|
|
|
|
|
|
PathgridSelectionMode* mSelectionMode;
|
|
|
|
|
2016-05-16 20:50:02 +00:00
|
|
|
QString getTooltip();
|
2016-05-12 23:35:49 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|