4 changed files with 47 additions and 60 deletions
@ -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
|
|||
|
@ -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 <ofVec3f> _previousVertices; |
|||
|
|||
}; |
|||
|
|||
} // namespace piMapper
|
|||
} // namespace ofx
|
|||
|
@ -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
|
|||
|
@ -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 <ofVec3f> _previousVertices; |
|||
|
|||
}; |
|||
|
|||
} // namespace piMapper
|
|||
} // namespace ofx
|
|||
|
Loading…
Reference in new issue