8 changed files with 83 additions and 3 deletions
@ -0,0 +1,26 @@ |
|||
#include "MvTexCoordCmd.h" |
|||
|
|||
namespace ofx{ |
|||
namespace piMapper{ |
|||
|
|||
MvTexCoordCmd::MvTexCoordCmd(int jointIndex, TextureEditor * texEditor){ |
|||
_jointIndex = jointIndex; |
|||
_texEditor = texEditor; |
|||
} |
|||
|
|||
void MvTexCoordCmd::exec(){ |
|||
ofLogNotice("MvTexCoordCmd", "exec"); |
|||
_jointPosition = _texEditor->getJoints()[_jointIndex]->position; |
|||
} |
|||
|
|||
void MvTexCoordCmd::undo(){ |
|||
ofLogNotice("MvTexCoordCmd", "undo"); |
|||
_texEditor->unselectAllJoints(); |
|||
_texEditor->getJoints()[_jointIndex]->select(); |
|||
_texEditor->getJoints()[_jointIndex]->position = _jointPosition; |
|||
_texEditor = 0; |
|||
} |
|||
|
|||
} // namespace piMapper
|
|||
} // namespace ofx
|
|||
|
@ -0,0 +1,29 @@ |
|||
// MvTexCoordCmd
|
|||
// Move texture coordinate of a selected surface and be able to undo it
|
|||
// Created by Krisjanis Rijnieks 2015-05-19
|
|||
|
|||
#pragma once |
|||
|
|||
#include "BaseCmd.h" |
|||
#include "CircleJoint.h" |
|||
#include "TextureEditor.h" |
|||
|
|||
namespace ofx{ |
|||
namespace piMapper{ |
|||
|
|||
class MvTexCoordCmd : public BaseUndoCmd{ |
|||
|
|||
public: |
|||
MvTexCoordCmd(int jointIndex, TextureEditor * texEditor); |
|||
void exec(); |
|||
void undo(); |
|||
|
|||
private: |
|||
ofVec2f _jointPosition; |
|||
int _jointIndex; |
|||
TextureEditor * _texEditor; |
|||
}; |
|||
|
|||
} // namespace piMapper
|
|||
} // namespace ofx
|
|||
|
Loading…
Reference in new issue