diff --git a/src/Commands/MvSurfaceCmd.cpp b/src/Commands/MvSurfaceCmd.cpp deleted file mode 100644 index 91456fc..0000000 --- a/src/Commands/MvSurfaceCmd.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "MvSurfaceCmd.h" - -namespace ofx { -namespace piMapper { - -MvSurfaceCmd::MvSurfaceCmd(BaseSurface * surface, - ProjectionEditor * projectionEditor){ - - _surface = surface; - _projectionEditor = projectionEditor; -} - -void MvSurfaceCmd::exec(){ - ofLogNotice("MvSurfaceCmd", "exec"); - _previousVertices = _surface->getVertices(); - _surface->setMoved(false); -} - -void MvSurfaceCmd::undo(){ - ofLogNotice("MvSurfaceCmd", "undo"); - _surface->moveBy(_previousVertices[0] - _surface->getVertices()[0]); - _projectionEditor->updateJoints(); - _previousVertices.clear(); - _surface = 0; -} - -} // namespace piMapper -} // namespace ofx - diff --git a/src/Commands/MvSurfaceCmd.h b/src/Commands/MvSurfaceCmd.h deleted file mode 100644 index c5bb388..0000000 --- a/src/Commands/MvSurfaceCmd.h +++ /dev/null @@ -1,31 +0,0 @@ -// MvSurfaceCmd -// Provides with option to undo move surface operation. -// Created by Krisjanis Rijnieks 2015-05-14 - -#pragma once - -#include "BaseCmd.h" -#include "BaseSurface.h" -#include "ProjectionEditor.h" - -namespace ofx { -namespace piMapper { - -class MvSurfaceCmd : public BaseUndoCmd { - - public: - MvSurfaceCmd(BaseSurface * surface, - ProjectionEditor * projectionEditor); - void exec(); - void undo(); - - private: - BaseSurface * _surface; - ProjectionEditor * _projectionEditor; - vector _previousVertices; - -}; - -} // namespace piMapper -} // namespace ofx - diff --git a/src/Commands/StartDragSurfaceCmd.cpp b/src/Commands/StartDragSurfaceCmd.cpp new file mode 100644 index 0000000..8adb2ed --- /dev/null +++ b/src/Commands/StartDragSurfaceCmd.cpp @@ -0,0 +1,23 @@ +#include "StartDragSurfaceCmd.h" + +namespace ofx { +namespace piMapper { + +StartDragSurfaceCmd::StartDragSurfaceCmd(BaseSurface * surface){ + _surface = surface; +} + +void StartDragSurfaceCmd::exec(){ + ofLogNotice("StartDragSurfaceCmd", "exec"); + _previousVertices = _surface->getVertices(); + _surface->setMoved(false); +} + +void StartDragSurfaceCmd::undo(){ + ofLogNotice("StartDragSurfaceCmd", "undo"); + _surface->moveBy(_previousVertices[0] - _surface->getVertices()[0]); +} + +} // namespace piMapper +} // namespace ofx + diff --git a/src/Commands/StartDragSurfaceCmd.h b/src/Commands/StartDragSurfaceCmd.h new file mode 100644 index 0000000..7bee80d --- /dev/null +++ b/src/Commands/StartDragSurfaceCmd.h @@ -0,0 +1,24 @@ +#pragma once + +#include "BaseCmd.h" +#include "BaseSurface.h" + +namespace ofx { +namespace piMapper { + +class StartDragSurfaceCmd : public BaseUndoCmd { + + public: + StartDragSurfaceCmd(BaseSurface * surface); + void exec(); + void undo(); + + private: + BaseSurface * _surface; + vector _previousVertices; + +}; + +} // namespace piMapper +} // namespace ofx +