8 changed files with 428 additions and 339 deletions
@ -0,0 +1,31 @@ |
|||
#include "MoveSurfaceVertexCommand.h" |
|||
|
|||
namespace ofx{ |
|||
namespace piMapper{ |
|||
|
|||
MoveSurfaceVertexCommand::MoveSurfaceVertexCommand( |
|||
int vertIndex, |
|||
BaseSurface * surface, |
|||
ProjectionEditor * projectionEditor){ |
|||
|
|||
_vertIndex = vertIndex; |
|||
_surface = surface; |
|||
_projectionEditor = projectionEditor; |
|||
} |
|||
|
|||
void MoveSurfaceVertexCommand::exec(){ |
|||
ofLogNotice("MoveJointCommand", "exec"); |
|||
_prevVertPos = _surface->getVertices()[_vertIndex]; |
|||
} |
|||
|
|||
void MoveSurfaceVertexCommand::undo(){ |
|||
ofLogNotice("MoveJointCommand", "undo"); |
|||
_surface->setVertex(_vertIndex, _prevVertPos); |
|||
_projectionEditor->updateJoints(); |
|||
_projectionEditor = 0; |
|||
_surface = 0; |
|||
} |
|||
|
|||
} // namespace piMapper
|
|||
} // namespace ofx
|
|||
|
@ -0,0 +1,34 @@ |
|||
// MoveSurfaceVertexCommand
|
|||
// Provides with option to undo move surface vertex operation.
|
|||
// Created by Krisjanis Rijnieks 2015-05-15
|
|||
|
|||
#pragma once |
|||
|
|||
#include "BaseCommand.h" |
|||
#include "BaseSurface.h" |
|||
#include "ProjectionEditor.h" |
|||
#include "BaseJoint.h" |
|||
|
|||
namespace ofx{ |
|||
namespace piMapper{ |
|||
|
|||
class MoveSurfaceVertexCommand : public BaseUndoableCommand{ |
|||
|
|||
public: |
|||
MoveSurfaceVertexCommand( |
|||
int vertIndex, |
|||
BaseSurface * surface, |
|||
ProjectionEditor * projectionEditor); |
|||
void exec(); |
|||
void undo(); |
|||
|
|||
private: |
|||
int _vertIndex; |
|||
ofVec2f _prevVertPos; |
|||
BaseSurface * _surface; |
|||
ProjectionEditor * _projectionEditor; |
|||
}; |
|||
|
|||
} // namespace piMapper
|
|||
} // namespace ofx
|
|||
|
Loading…
Reference in new issue