From 164d95c21ea2c271512c4f10f8073b91723ea6bf Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Fri, 16 Sep 2016 11:24:41 +0300 Subject: [PATCH] Add initial SetTexMapDrawModeCmd --- src/Commands/SetTexMapDrawModeCmd.cpp | 24 ++++++++++++++++++++++ src/Commands/SetTexMapDrawModeCmd.h | 29 +++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/Commands/SetTexMapDrawModeCmd.cpp create mode 100644 src/Commands/SetTexMapDrawModeCmd.h diff --git a/src/Commands/SetTexMapDrawModeCmd.cpp b/src/Commands/SetTexMapDrawModeCmd.cpp new file mode 100644 index 0000000..2f1d279 --- /dev/null +++ b/src/Commands/SetTexMapDrawModeCmd.cpp @@ -0,0 +1,24 @@ +#include "SetTexMapDrawModeCmd.h" + +namespace ofx { +namespace piMapper { + +SetTexMapDrawModeCmd::SetTexMapDrawModeCmd(TextureMappingState * s, int m){ + _state = s; + _newMode = m; +} + +void SetTexMapDrawModeCmd::exec(){ + ofLogNotice("SetTexMapDrawModeCmd", "undo"); + _oldMode = 0; // _state->getDrawMode(); + // _state->setDrawMode(_newMode); +} + +void SetTexMapDrawModeCmd::undo(){ + ofLogNotice("SetTexMapDrawModeCmd", "undo"); + // _state->setDrawMode(_oldMode); +} + +} // namespace piMapper +} // namespace ofx + diff --git a/src/Commands/SetTexMapDrawModeCmd.h b/src/Commands/SetTexMapDrawModeCmd.h new file mode 100644 index 0000000..5265962 --- /dev/null +++ b/src/Commands/SetTexMapDrawModeCmd.h @@ -0,0 +1,29 @@ +// SetTexMapDrawMode +// Sets draw mode of the texture mapping state +// Created by Krisjanis Rijnieks 2016-09-16 + +#pragma once + +#include "BaseCmd.h" +#include "TextureMappingState.h" + +namespace ofx { +namespace piMapper { + +class SetTexMapDrawModeCmd : public BaseUndoCmd { + + public: + SetTexMapDrawModeCmd(TextureMappingState * s, int m); + void exec(); + void undo(); + + private: + TextureMappingState * _state; + int _oldMode; + int _newMode; + +}; + +} // namespace piMapper +} // namespace ofx +