You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.7 KiB
C++
66 lines
1.7 KiB
C++
#ifndef CSV_RENDER_PATHGRIDMODE_H
|
|
#define CSV_RENDER_PATHGRIDMODE_H
|
|
|
|
#include <string>
|
|
|
|
#include "editmode.hpp"
|
|
|
|
namespace CSVRender
|
|
{
|
|
class PathgridSelectionMode;
|
|
|
|
class PathgridMode : public EditMode
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PathgridMode(WorldspaceWidget* worldspace, QWidget* parent=nullptr);
|
|
|
|
void activate(CSVWidget::SceneToolbar* toolbar) override;
|
|
|
|
void deactivate(CSVWidget::SceneToolbar* toolbar) override;
|
|
|
|
void primaryOpenPressed(const WorldspaceHitResult& hit) override;
|
|
|
|
void primaryEditPressed(const WorldspaceHitResult& hit) override;
|
|
|
|
void secondaryEditPressed(const WorldspaceHitResult& hit) override;
|
|
|
|
void primarySelectPressed(const WorldspaceHitResult& hit) override;
|
|
|
|
void secondarySelectPressed(const WorldspaceHitResult& hit) override;
|
|
|
|
bool primaryEditStartDrag (const QPoint& pos) override;
|
|
|
|
bool secondaryEditStartDrag (const QPoint& pos) override;
|
|
|
|
void drag (const QPoint& pos, int diffX, int diffY, double speedFactor) override;
|
|
|
|
void dragCompleted(const QPoint& pos) override;
|
|
|
|
/// \note dragAborted will not be called, if the drag is aborted via changing
|
|
/// editing mode
|
|
void dragAborted() override;
|
|
|
|
private:
|
|
|
|
enum DragMode
|
|
{
|
|
DragMode_None,
|
|
DragMode_Move,
|
|
DragMode_Edge
|
|
};
|
|
|
|
DragMode mDragMode;
|
|
std::string mLastId, mEdgeId;
|
|
unsigned short mFromNode;
|
|
|
|
PathgridSelectionMode* mSelectionMode;
|
|
|
|
QString getTooltip();
|
|
};
|
|
}
|
|
|
|
#endif
|