Files
mapmap/Commands.h
T
Tats 7e85ab493c Merge branch 'spike-qgraphicsview-zoom-and-scroll' into spike-qgraphicsview-zoom-and-scroll-merge-develop
Conflicts:
	DestinationGLCanvas.cpp
	DestinationGLCanvas.h
	MainWindow.cpp
	MainWindow.h
	MapperGLCanvas.cpp
	MapperGLCanvas.h
2015-07-06 20:38:51 -06:00

86 lines
2.1 KiB
C++

/*
* Commands.h
*
* (c) 2014 Sofian Audry -- info(@)sofianaudry(.)com
* (c) 2014 Alexandre Quessy -- alexandre(@)quessy(.)net
* (c) 2014 Dame Diongue -- baydamd(@)gmail(.)com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef COMMANDS_H_
#define COMMANDS_H_
#include <QUndoCommand>
#include "MainWindow.h"
#include "MapperGLCanvas.h"
class AddShapesCommand : public QUndoCommand
{
public:
AddShapesCommand(MainWindow *mainWindow, uid mappingId, QUndoCommand *parent = 0);
void undo();
void redo();
private:
MainWindow *m_mainWindow;
Mapping::ptr m_mappingPtr;
uid m_mappingId;
};
class MoveVertexCommand : public QUndoCommand
{
public:
MoveVertexCommand(MapperGLCanvas *mapperGLCanvas, int activeVertex, const QPointF &point, QUndoCommand *parent = 0);
void undo();
void redo();
private:
MapperGLCanvas *m_mapperGLCanvas;
MShape *m_shape;
int m_activeVertex;
QPointF vertexPosition;
};
class MoveShapesCommand : public QUndoCommand
{
public:
MoveShapesCommand(MapperGLCanvas *mapperGLCanvas, QMouseEvent *event, const QPointF &point, QUndoCommand *parent = 0);
void undo();
void redo();
private:
MapperGLCanvas *m_mapperGLCanvas;
MShape *m_shape;
QMouseEvent *m_event;
QPointF newPosition, oldPosition;
};
class DeleteMappingCommand : public QUndoCommand
{
public:
DeleteMappingCommand(MainWindow *mainWindow, uid mappingId, QUndoCommand *parent = 0);
void undo();
void redo();
private:
MainWindow *m_mainWindow;
Mapping::ptr m_mappingPtr;
uid m_mappingId;
};
#endif /* COMMANDS_H_ */