openmw-tes3coop/apps/opencs/view/render/pathgridmode.hpp
Aesylwinn aea2380c2b Add raytrace to dragCompleted. Implement node drag connection,
node and edge removal, and some fixes.
2016-05-16 17:25:02 -04:00

73 lines
1.9 KiB
C++

#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);
virtual void activate(CSVWidget::SceneToolbar* toolbar);
virtual bool createContextMenu(QMenu* menu);
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);
virtual void dragCompleted(const WorldspaceHitResult& hit);
/// \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;
std::string mLastId, mEdgeId;
unsigned short mFromNode;
QAction* mSelectAll;
QAction* mInvertSelection;
QAction* mClearSelection;
QAction* mRemoveSelected;
QAction* mRemoveSelectedEdges;
QString getTooltip();
private slots:
void selectAll();
void invertSelection();
void clearSelection();
void removeSelected();
void removeSelectedEdges();
};
}
#endif