Browse Source

Rename command class names to shorter versions

- Also remove initial undo test code
master
Krisjanis Rijnieks 10 years ago
parent
commit
bbd462f551
  1. 98
      example/example.xcodeproj/project.pbxproj
  2. 16
      src/Commands/BaseCmd.h
  3. 28
      src/Commands/CmdManager.cpp
  4. 8
      src/Commands/CmdManager.h
  5. 28
      src/Commands/CommandManager.cpp
  6. 12
      src/Commands/MvSurfaceCmd.cpp
  7. 8
      src/Commands/MvSurfaceCmd.h
  8. 12
      src/Commands/MvSurfaceVertCmd.cpp
  9. 8
      src/Commands/MvSurfaceVertCmd.h
  10. 12
      src/Commands/RmSurfaceCmd.cpp
  11. 8
      src/Commands/RmSurfaceCmd.h
  12. 10
      src/Commands/SelSurfaceCmd.cpp
  13. 8
      src/Commands/SelSurfaceCmd.h
  14. 17
      src/Commands/TestCommand.cpp
  15. 27
      src/Commands/TestCommand.h
  16. 21
      src/Commands/TestUndoCommand.cpp
  17. 27
      src/Commands/TestUndoCommand.h
  18. 18
      src/Surfaces/SurfaceManagerGui.cpp
  19. 12
      src/Surfaces/SurfaceManagerGui.h
  20. 28
      src/ofxPiMapper.cpp
  21. 17
      src/ofxPiMapper.h

98
example/example.xcodeproj/project.pbxproj

@ -22,10 +22,10 @@
397EFC7C1A08E7680009286E /* ofxPiMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 397EFC7B1A08E7680009286E /* ofxPiMapper.cpp */; }; 397EFC7C1A08E7680009286E /* ofxPiMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 397EFC7B1A08E7680009286E /* ofxPiMapper.cpp */; };
397EFC7F1A08FE720009286E /* FboSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 397EFC7D1A08FE720009286E /* FboSource.cpp */; }; 397EFC7F1A08FE720009286E /* FboSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 397EFC7D1A08FE720009286E /* FboSource.cpp */; };
397EFC821A09047C0009286E /* CustomSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 397EFC801A09047C0009286E /* CustomSource.cpp */; }; 397EFC821A09047C0009286E /* CustomSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 397EFC801A09047C0009286E /* CustomSource.cpp */; };
39A9AAE01B04E78600AA83BC /* RemoveSurfaceCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39A9AADE1B04E78600AA83BC /* RemoveSurfaceCommand.cpp */; }; 39A9AAE01B04E78600AA83BC /* RmSurfaceCmd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39A9AADE1B04E78600AA83BC /* RmSurfaceCmd.cpp */; };
39A9AAE91B0518FC00AA83BC /* MoveSurfaceCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39A9AAE71B0518FC00AA83BC /* MoveSurfaceCommand.cpp */; }; 39A9AAE91B0518FC00AA83BC /* MvSurfaceCmd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39A9AAE71B0518FC00AA83BC /* MvSurfaceCmd.cpp */; };
39A9AAEC1B053B4200AA83BC /* SelectSurfaceCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39A9AAEA1B053B4200AA83BC /* SelectSurfaceCommand.cpp */; }; 39A9AAEC1B053B4200AA83BC /* SelSurfaceCmd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39A9AAEA1B053B4200AA83BC /* SelSurfaceCmd.cpp */; };
39A9AAF21B054FC300AA83BC /* MoveSurfaceVertexCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39A9AAF01B054FC300AA83BC /* MoveSurfaceVertexCommand.cpp */; }; 39A9AAF21B054FC300AA83BC /* MvSurfaceVertCmd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39A9AAF01B054FC300AA83BC /* MvSurfaceVertCmd.cpp */; };
39C1243319EE9589005DF557 /* lz4.c in Sources */ = {isa = PBXBuildFile; fileRef = 39C123EA19EE9589005DF557 /* lz4.c */; }; 39C1243319EE9589005DF557 /* lz4.c in Sources */ = {isa = PBXBuildFile; fileRef = 39C123EA19EE9589005DF557 /* lz4.c */; };
39C1243419EE9589005DF557 /* Base64Encoding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C1241219EE9589005DF557 /* Base64Encoding.cpp */; }; 39C1243419EE9589005DF557 /* Base64Encoding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C1241219EE9589005DF557 /* Base64Encoding.cpp */; };
39C1243519EE9589005DF557 /* ByteBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C1241319EE9589005DF557 /* ByteBuffer.cpp */; }; 39C1243519EE9589005DF557 /* ByteBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C1241319EE9589005DF557 /* ByteBuffer.cpp */; };
@ -67,9 +67,7 @@
39C1248119F187D5005DF557 /* TextureEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C1247A19F187D5005DF557 /* TextureEditor.cpp */; }; 39C1248119F187D5005DF557 /* TextureEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C1247A19F187D5005DF557 /* TextureEditor.cpp */; };
39C1248819F1EB75005DF557 /* SurfaceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C1248319F1EB75005DF557 /* SurfaceManager.cpp */; }; 39C1248819F1EB75005DF557 /* SurfaceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C1248319F1EB75005DF557 /* SurfaceManager.cpp */; };
39C1248919F1EB75005DF557 /* SurfaceManagerGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C1248519F1EB75005DF557 /* SurfaceManagerGui.cpp */; }; 39C1248919F1EB75005DF557 /* SurfaceManagerGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C1248519F1EB75005DF557 /* SurfaceManagerGui.cpp */; };
39C787BD1AC2111B00691393 /* CommandManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C787BC1AC2111B00691393 /* CommandManager.cpp */; }; 39C787BD1AC2111B00691393 /* CmdManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C787BC1AC2111B00691393 /* CmdManager.cpp */; };
39C787C11AC2BBAE00691393 /* TestUndoCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C787BF1AC2BBAE00691393 /* TestUndoCommand.cpp */; };
39FDD9EE1AC00EAE00262205 /* TestCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FDD9EC1AC00EAE00262205 /* TestCommand.cpp */; };
BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; };
E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; }; E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; };
E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9710E8CC7DD009D7055 /* AGL.framework */; }; E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9710E8CC7DD009D7055 /* AGL.framework */; };
@ -151,14 +149,14 @@
397EFC7E1A08FE720009286E /* FboSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FboSource.h; sourceTree = "<group>"; }; 397EFC7E1A08FE720009286E /* FboSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FboSource.h; sourceTree = "<group>"; };
397EFC801A09047C0009286E /* CustomSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomSource.cpp; sourceTree = "<group>"; }; 397EFC801A09047C0009286E /* CustomSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomSource.cpp; sourceTree = "<group>"; };
397EFC811A09047C0009286E /* CustomSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomSource.h; sourceTree = "<group>"; }; 397EFC811A09047C0009286E /* CustomSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomSource.h; sourceTree = "<group>"; };
39A9AADE1B04E78600AA83BC /* RemoveSurfaceCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RemoveSurfaceCommand.cpp; path = Commands/RemoveSurfaceCommand.cpp; sourceTree = "<group>"; }; 39A9AADE1B04E78600AA83BC /* RmSurfaceCmd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RmSurfaceCmd.cpp; path = Commands/RmSurfaceCmd.cpp; sourceTree = "<group>"; };
39A9AADF1B04E78600AA83BC /* RemoveSurfaceCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RemoveSurfaceCommand.h; path = Commands/RemoveSurfaceCommand.h; sourceTree = "<group>"; }; 39A9AADF1B04E78600AA83BC /* RmSurfaceCmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RmSurfaceCmd.h; path = Commands/RmSurfaceCmd.h; sourceTree = "<group>"; };
39A9AAE71B0518FC00AA83BC /* MoveSurfaceCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MoveSurfaceCommand.cpp; path = Commands/MoveSurfaceCommand.cpp; sourceTree = "<group>"; }; 39A9AAE71B0518FC00AA83BC /* MvSurfaceCmd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MvSurfaceCmd.cpp; path = Commands/MvSurfaceCmd.cpp; sourceTree = "<group>"; };
39A9AAE81B0518FC00AA83BC /* MoveSurfaceCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MoveSurfaceCommand.h; path = Commands/MoveSurfaceCommand.h; sourceTree = "<group>"; }; 39A9AAE81B0518FC00AA83BC /* MvSurfaceCmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MvSurfaceCmd.h; path = Commands/MvSurfaceCmd.h; sourceTree = "<group>"; };
39A9AAEA1B053B4200AA83BC /* SelectSurfaceCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SelectSurfaceCommand.cpp; path = Commands/SelectSurfaceCommand.cpp; sourceTree = "<group>"; }; 39A9AAEA1B053B4200AA83BC /* SelSurfaceCmd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SelSurfaceCmd.cpp; path = Commands/SelSurfaceCmd.cpp; sourceTree = "<group>"; };
39A9AAEB1B053B4200AA83BC /* SelectSurfaceCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectSurfaceCommand.h; path = Commands/SelectSurfaceCommand.h; sourceTree = "<group>"; }; 39A9AAEB1B053B4200AA83BC /* SelSurfaceCmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelSurfaceCmd.h; path = Commands/SelSurfaceCmd.h; sourceTree = "<group>"; };
39A9AAF01B054FC300AA83BC /* MoveSurfaceVertexCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MoveSurfaceVertexCommand.cpp; path = Commands/MoveSurfaceVertexCommand.cpp; sourceTree = "<group>"; }; 39A9AAF01B054FC300AA83BC /* MvSurfaceVertCmd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MvSurfaceVertCmd.cpp; path = Commands/MvSurfaceVertCmd.cpp; sourceTree = "<group>"; };
39A9AAF11B054FC300AA83BC /* MoveSurfaceVertexCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MoveSurfaceVertexCommand.h; path = Commands/MoveSurfaceVertexCommand.h; sourceTree = "<group>"; }; 39A9AAF11B054FC300AA83BC /* MvSurfaceVertCmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MvSurfaceVertCmd.h; path = Commands/MvSurfaceVertCmd.h; sourceTree = "<group>"; };
39C123E719EE9589005DF557 /* alphanum.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = alphanum.hpp; sourceTree = "<group>"; }; 39C123E719EE9589005DF557 /* alphanum.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = alphanum.hpp; sourceTree = "<group>"; };
39C123EA19EE9589005DF557 /* lz4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lz4.c; sourceTree = "<group>"; }; 39C123EA19EE9589005DF557 /* lz4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lz4.c; sourceTree = "<group>"; };
39C123EB19EE9589005DF557 /* lz4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lz4.h; sourceTree = "<group>"; }; 39C123EB19EE9589005DF557 /* lz4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lz4.h; sourceTree = "<group>"; };
@ -261,13 +259,9 @@
39C1248519F1EB75005DF557 /* SurfaceManagerGui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SurfaceManagerGui.cpp; sourceTree = "<group>"; }; 39C1248519F1EB75005DF557 /* SurfaceManagerGui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SurfaceManagerGui.cpp; sourceTree = "<group>"; };
39C1248619F1EB75005DF557 /* SurfaceManagerGui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurfaceManagerGui.h; sourceTree = "<group>"; }; 39C1248619F1EB75005DF557 /* SurfaceManagerGui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurfaceManagerGui.h; sourceTree = "<group>"; };
39C1248719F1EB75005DF557 /* SurfaceType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurfaceType.h; sourceTree = "<group>"; }; 39C1248719F1EB75005DF557 /* SurfaceType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurfaceType.h; sourceTree = "<group>"; };
39C787BB1AC20D2400691393 /* CommandManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandManager.h; path = Commands/CommandManager.h; sourceTree = "<group>"; }; 39C787BB1AC20D2400691393 /* CmdManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CmdManager.h; path = Commands/CmdManager.h; sourceTree = "<group>"; };
39C787BC1AC2111B00691393 /* CommandManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandManager.cpp; path = Commands/CommandManager.cpp; sourceTree = "<group>"; }; 39C787BC1AC2111B00691393 /* CmdManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CmdManager.cpp; path = Commands/CmdManager.cpp; sourceTree = "<group>"; };
39C787BF1AC2BBAE00691393 /* TestUndoCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestUndoCommand.cpp; path = Commands/TestUndoCommand.cpp; sourceTree = "<group>"; }; 39FDD9EA1AC007BF00262205 /* BaseCmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaseCmd.h; path = Commands/BaseCmd.h; sourceTree = "<group>"; };
39C787C01AC2BBAE00691393 /* TestUndoCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestUndoCommand.h; path = Commands/TestUndoCommand.h; sourceTree = "<group>"; };
39FDD9EA1AC007BF00262205 /* BaseCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaseCommand.h; path = Commands/BaseCommand.h; sourceTree = "<group>"; };
39FDD9EC1AC00EAE00262205 /* TestCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestCommand.cpp; path = Commands/TestCommand.cpp; sourceTree = "<group>"; };
39FDD9ED1AC00EAE00262205 /* TestCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestCommand.h; path = Commands/TestCommand.h; sourceTree = "<group>"; };
BBAB23BE13894E4700AA2426 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../libs/glut/lib/osx/GLUT.framework; sourceTree = "<group>"; }; BBAB23BE13894E4700AA2426 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../libs/glut/lib/osx/GLUT.framework; sourceTree = "<group>"; };
E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; };
E45BE9710E8CC7DD009D7055 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = "<absolute>"; }; E45BE9710E8CC7DD009D7055 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = "<absolute>"; };
@ -615,17 +609,17 @@
39C1246219F0AB96005DF557 /* Surfaces */ = { 39C1246219F0AB96005DF557 /* Surfaces */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
39C1248319F1EB75005DF557 /* SurfaceManager.cpp */,
39C1248419F1EB75005DF557 /* SurfaceManager.h */, 39C1248419F1EB75005DF557 /* SurfaceManager.h */,
39C1248519F1EB75005DF557 /* SurfaceManagerGui.cpp */, 39C1248319F1EB75005DF557 /* SurfaceManager.cpp */,
39C1248619F1EB75005DF557 /* SurfaceManagerGui.h */, 39C1248619F1EB75005DF557 /* SurfaceManagerGui.h */,
39C1248519F1EB75005DF557 /* SurfaceManagerGui.cpp */,
39C1248719F1EB75005DF557 /* SurfaceType.h */, 39C1248719F1EB75005DF557 /* SurfaceType.h */,
39C1246319F0AB96005DF557 /* BaseSurface.cpp */,
39C1246419F0AB96005DF557 /* BaseSurface.h */, 39C1246419F0AB96005DF557 /* BaseSurface.h */,
39C1246519F0AB96005DF557 /* QuadSurface.cpp */, 39C1246319F0AB96005DF557 /* BaseSurface.cpp */,
39C1246619F0AB96005DF557 /* QuadSurface.h */, 39C1246619F0AB96005DF557 /* QuadSurface.h */,
39C1246719F0AB96005DF557 /* TriangleSurface.cpp */, 39C1246519F0AB96005DF557 /* QuadSurface.cpp */,
39C1246819F0AB96005DF557 /* TriangleSurface.h */, 39C1246819F0AB96005DF557 /* TriangleSurface.h */,
39C1246719F0AB96005DF557 /* TriangleSurface.cpp */,
); );
path = Surfaces; path = Surfaces;
sourceTree = "<group>"; sourceTree = "<group>";
@ -633,20 +627,20 @@
39C1246D19F187D5005DF557 /* UserInterface */ = { 39C1246D19F187D5005DF557 /* UserInterface */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
39C1246E19F187D5005DF557 /* BaseJoint.cpp */,
39C1246F19F187D5005DF557 /* BaseJoint.h */, 39C1246F19F187D5005DF557 /* BaseJoint.h */,
39C1247019F187D5005DF557 /* CircleJoint.cpp */, 39C1246E19F187D5005DF557 /* BaseJoint.cpp */,
39C1247119F187D5005DF557 /* CircleJoint.h */, 39C1247119F187D5005DF557 /* CircleJoint.h */,
39C1247019F187D5005DF557 /* CircleJoint.cpp */,
39C1247219F187D5005DF557 /* EditorType.h */, 39C1247219F187D5005DF557 /* EditorType.h */,
39C1247319F187D5005DF557 /* GuiMode.h */, 39C1247319F187D5005DF557 /* GuiMode.h */,
39C1247419F187D5005DF557 /* ProjectionEditor.cpp */,
39C1247519F187D5005DF557 /* ProjectionEditor.h */, 39C1247519F187D5005DF557 /* ProjectionEditor.h */,
39C1247619F187D5005DF557 /* RadioList.cpp */, 39C1247419F187D5005DF557 /* ProjectionEditor.cpp */,
39C1247719F187D5005DF557 /* RadioList.h */, 39C1247719F187D5005DF557 /* RadioList.h */,
39C1247819F187D5005DF557 /* SourcesEditor.cpp */, 39C1247619F187D5005DF557 /* RadioList.cpp */,
39C1247919F187D5005DF557 /* SourcesEditor.h */, 39C1247919F187D5005DF557 /* SourcesEditor.h */,
39C1247A19F187D5005DF557 /* TextureEditor.cpp */, 39C1247819F187D5005DF557 /* SourcesEditor.cpp */,
39C1247B19F187D5005DF557 /* TextureEditor.h */, 39C1247B19F187D5005DF557 /* TextureEditor.h */,
39C1247A19F187D5005DF557 /* TextureEditor.cpp */,
); );
path = UserInterface; path = UserInterface;
sourceTree = "<group>"; sourceTree = "<group>";
@ -654,21 +648,17 @@
39FDD9E81AC0076200262205 /* Commands */ = { 39FDD9E81AC0076200262205 /* Commands */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
39A9AAF01B054FC300AA83BC /* MoveSurfaceVertexCommand.cpp */, 39FDD9EA1AC007BF00262205 /* BaseCmd.h */,
39A9AAF11B054FC300AA83BC /* MoveSurfaceVertexCommand.h */, 39C787BB1AC20D2400691393 /* CmdManager.h */,
39A9AAEA1B053B4200AA83BC /* SelectSurfaceCommand.cpp */, 39C787BC1AC2111B00691393 /* CmdManager.cpp */,
39A9AAEB1B053B4200AA83BC /* SelectSurfaceCommand.h */, 39A9AAF11B054FC300AA83BC /* MvSurfaceVertCmd.h */,
39A9AAE71B0518FC00AA83BC /* MoveSurfaceCommand.cpp */, 39A9AAF01B054FC300AA83BC /* MvSurfaceVertCmd.cpp */,
39A9AAE81B0518FC00AA83BC /* MoveSurfaceCommand.h */, 39A9AAEB1B053B4200AA83BC /* SelSurfaceCmd.h */,
39A9AADF1B04E78600AA83BC /* RemoveSurfaceCommand.h */, 39A9AAEA1B053B4200AA83BC /* SelSurfaceCmd.cpp */,
39A9AADE1B04E78600AA83BC /* RemoveSurfaceCommand.cpp */, 39A9AAE81B0518FC00AA83BC /* MvSurfaceCmd.h */,
39FDD9EA1AC007BF00262205 /* BaseCommand.h */, 39A9AAE71B0518FC00AA83BC /* MvSurfaceCmd.cpp */,
39C787BB1AC20D2400691393 /* CommandManager.h */, 39A9AADF1B04E78600AA83BC /* RmSurfaceCmd.h */,
39C787BC1AC2111B00691393 /* CommandManager.cpp */, 39A9AADE1B04E78600AA83BC /* RmSurfaceCmd.cpp */,
39FDD9ED1AC00EAE00262205 /* TestCommand.h */,
39FDD9EC1AC00EAE00262205 /* TestCommand.cpp */,
39C787C01AC2BBAE00691393 /* TestUndoCommand.h */,
39C787BF1AC2BBAE00691393 /* TestUndoCommand.cpp */,
); );
name = Commands; name = Commands;
sourceTree = "<group>"; sourceTree = "<group>";
@ -852,7 +842,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
3933D5D819BB87BD000ACA55 /* ofxSlider.cpp in Sources */, 3933D5D819BB87BD000ACA55 /* ofxSlider.cpp in Sources */,
39C787BD1AC2111B00691393 /* CommandManager.cpp in Sources */, 39C787BD1AC2111B00691393 /* CmdManager.cpp in Sources */,
39C1247E19F187D5005DF557 /* ProjectionEditor.cpp in Sources */, 39C1247E19F187D5005DF557 /* ProjectionEditor.cpp in Sources */,
39C1244619EE9589005DF557 /* RecursiveDirectoryIteratorStategies.cpp in Sources */, 39C1244619EE9589005DF557 /* RecursiveDirectoryIteratorStategies.cpp in Sources */,
39C1243A19EE9589005DF557 /* Compression.cpp in Sources */, 39C1243A19EE9589005DF557 /* Compression.cpp in Sources */,
@ -869,20 +859,18 @@
397EFC7F1A08FE720009286E /* FboSource.cpp in Sources */, 397EFC7F1A08FE720009286E /* FboSource.cpp in Sources */,
E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */, E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */,
39C1244719EE9589005DF557 /* RegexPathFilter.cpp in Sources */, 39C1244719EE9589005DF557 /* RegexPathFilter.cpp in Sources */,
39C787C11AC2BBAE00691393 /* TestUndoCommand.cpp in Sources */, 39A9AAE91B0518FC00AA83BC /* MvSurfaceCmd.cpp in Sources */,
39A9AAE91B0518FC00AA83BC /* MoveSurfaceCommand.cpp in Sources */,
39C1247C19F187D5005DF557 /* BaseJoint.cpp in Sources */, 39C1247C19F187D5005DF557 /* BaseJoint.cpp in Sources */,
39FDD9EE1AC00EAE00262205 /* TestCommand.cpp in Sources */,
39C1245219EE95DD005DF557 /* MediaServer.cpp in Sources */, 39C1245219EE95DD005DF557 /* MediaServer.cpp in Sources */,
39C1243D19EE9589005DF557 /* DirectoryUtils.cpp in Sources */, 39C1243D19EE9589005DF557 /* DirectoryUtils.cpp in Sources */,
39264843192224F90008A7F5 /* tinyxmlparser.cpp in Sources */, 39264843192224F90008A7F5 /* tinyxmlparser.cpp in Sources */,
3933D5D419BB87BD000ACA55 /* ofxButton.cpp in Sources */, 3933D5D419BB87BD000ACA55 /* ofxButton.cpp in Sources */,
39A9AAE01B04E78600AA83BC /* RemoveSurfaceCommand.cpp in Sources */, 39A9AAE01B04E78600AA83BC /* RmSurfaceCmd.cpp in Sources */,
39C1244519EE9589005DF557 /* RecursiveDirectoryIterator.cpp in Sources */, 39C1244519EE9589005DF557 /* RecursiveDirectoryIterator.cpp in Sources */,
39C1243919EE9589005DF557 /* COBSEncoding.cpp in Sources */, 39C1243919EE9589005DF557 /* COBSEncoding.cpp in Sources */,
39C1244919EE9589005DF557 /* snappy-sinksource.cc in Sources */, 39C1244919EE9589005DF557 /* snappy-sinksource.cc in Sources */,
39C1248819F1EB75005DF557 /* SurfaceManager.cpp in Sources */, 39C1248819F1EB75005DF557 /* SurfaceManager.cpp in Sources */,
39A9AAF21B054FC300AA83BC /* MoveSurfaceVertexCommand.cpp in Sources */, 39A9AAF21B054FC300AA83BC /* MvSurfaceVertCmd.cpp in Sources */,
39C1244319EE9589005DF557 /* LinkFilter.cpp in Sources */, 39C1244319EE9589005DF557 /* LinkFilter.cpp in Sources */,
39C1245919F086A9005DF557 /* BaseSource.cpp in Sources */, 39C1245919F086A9005DF557 /* BaseSource.cpp in Sources */,
39C1244019EE9589005DF557 /* FileExtensionFilter.cpp in Sources */, 39C1244019EE9589005DF557 /* FileExtensionFilter.cpp in Sources */,
@ -901,7 +889,7 @@
39C1243519EE9589005DF557 /* ByteBuffer.cpp in Sources */, 39C1243519EE9589005DF557 /* ByteBuffer.cpp in Sources */,
39C1246B19F0AB96005DF557 /* TriangleSurface.cpp in Sources */, 39C1246B19F0AB96005DF557 /* TriangleSurface.cpp in Sources */,
39C1244419EE9589005DF557 /* PathFilterCollection.cpp in Sources */, 39C1244419EE9589005DF557 /* PathFilterCollection.cpp in Sources */,
39A9AAEC1B053B4200AA83BC /* SelectSurfaceCommand.cpp in Sources */, 39A9AAEC1B053B4200AA83BC /* SelSurfaceCmd.cpp in Sources */,
39C1243319EE9589005DF557 /* lz4.c in Sources */, 39C1243319EE9589005DF557 /* lz4.c in Sources */,
39C1243B19EE9589005DF557 /* DeviceFilter.cpp in Sources */, 39C1243B19EE9589005DF557 /* DeviceFilter.cpp in Sources */,
39C1243E19EE9589005DF557 /* DirectoryWatcher.cpp in Sources */, 39C1243E19EE9589005DF557 /* DirectoryWatcher.cpp in Sources */,

16
src/Commands/BaseCommand.h → src/Commands/BaseCmd.h

@ -13,9 +13,9 @@ namespace ofx{
namespace piMapper{ namespace piMapper{
// Base class for all commands // Base class for all commands
class BaseCommand{ class BaseCmd{
public: public:
virtual ~BaseCommand(){}; virtual ~BaseCmd(){};
virtual void exec() = 0; virtual void exec() = 0;
// By default a command is not undo // By default a command is not undo
@ -24,24 +24,18 @@ namespace ofx{
protected: protected:
// In order to avoid using this class directly, // In order to avoid using this class directly,
// we make the constructor protected. // we make the constructor protected.
BaseCommand(){}; BaseCmd(){};
}; };
// Base class for all undoable commands // Base class for all undoable commands
class BaseUndoableCommand : public BaseCommand{ class BaseUndoCmd : public BaseCmd{
public: public:
virtual void undo() = 0; virtual void undo() = 0;
virtual bool isUndoable(){return true;} virtual bool isUndoable(){return true;}
protected: protected:
BaseUndoableCommand(){}; BaseUndoCmd(){};
}; };
} // namespace piMapper } // namespace piMapper
} // namespace ofx } // namespace ofx
// Ideas for command classes
// SelectSurfaceCommand
// MoveSurfaceCommand
// SelectSourceMapCommand
// MoveSourceMapCommand

28
src/Commands/CmdManager.cpp

@ -0,0 +1,28 @@
#include "CmdManager.h"
namespace ofx{
namespace piMapper{
void CmdManager::exec(BaseCmd * cmd){
cmd->exec();
if (cmd->isUndoable()){
cmdStack.push_back(static_cast<BaseUndoCmd *>(cmd));
}
}
void CmdManager::undo(){
ofLogNotice("CmdManager", "undo");
if (cmdStack.size() > 0){
BaseUndoCmd * cmd = cmdStack.back();
cmd->undo();
// Delete last command now, change this when implementing redo.
delete cmdStack.back();
cmdStack.pop_back();
} else {
ofLogNotice("CmdManager", "Nothing to undo");
}
}
} // namespace piMapper
} // namespace ofx

8
src/Commands/CommandManager.h → src/Commands/CmdManager.h

@ -1,19 +1,19 @@
#pragma once #pragma once
#import <vector> #import <vector>
#import "BaseCommand.h" #import "BaseCmd.h"
#import "ofLog.h" #import "ofLog.h"
namespace ofx{ namespace ofx{
namespace piMapper{ namespace piMapper{
class CommandManager{ class CmdManager{
public: public:
void exec(BaseCommand * cmd); void exec(BaseCmd * cmd);
void undo(); void undo();
private: private:
std::vector<BaseUndoableCommand *> commandStack; std::vector<BaseUndoCmd *> cmdStack;
}; };
} // namespace piMapper } // namespace piMapper

28
src/Commands/CommandManager.cpp

@ -1,28 +0,0 @@
#include "CommandManager.h"
namespace ofx{
namespace piMapper{
void CommandManager::exec(BaseCommand * cmd){
cmd->exec();
if (cmd->isUndoable()){
commandStack.push_back(static_cast<BaseUndoableCommand *>(cmd));
}
}
void CommandManager::undo(){
ofLogNotice("CommandManager", "undo");
if (commandStack.size() > 0){
BaseUndoableCommand * cmd = commandStack.back();
cmd->undo();
// Delete last command now, change this when implementing redo.
delete commandStack.back();
commandStack.pop_back();
} else {
ofLogNotice("CommandManager", "Nothing to undo");
}
}
} // namespace piMapper
} // namespace ofx

12
src/Commands/MoveSurfaceCommand.cpp → src/Commands/MvSurfaceCmd.cpp

@ -1,9 +1,9 @@
#include "MoveSurfaceCommand.h" #include "MvSurfaceCmd.h"
namespace ofx{ namespace ofx{
namespace piMapper{ namespace piMapper{
MoveSurfaceCommand::MoveSurfaceCommand( MvSurfaceCmd::MvSurfaceCmd(
BaseSurface * surface, BaseSurface * surface,
ProjectionEditor * projectionEditor){ ProjectionEditor * projectionEditor){
@ -11,14 +11,14 @@ namespace ofx{
_projectionEditor = projectionEditor; _projectionEditor = projectionEditor;
} }
void MoveSurfaceCommand::exec(){ void MvSurfaceCmd::exec(){
ofLogNotice("MoveSurfaceCommand", "exec"); ofLogNotice("MvSurfaceCmd", "exec");
_previousVertices = _surface->getVertices(); _previousVertices = _surface->getVertices();
_surface->setMoved(false); _surface->setMoved(false);
} }
void MoveSurfaceCommand::undo(){ void MvSurfaceCmd::undo(){
ofLogNotice("MoveSurfaceCommand", "undo"); ofLogNotice("MvSurfaceCmd", "undo");
_surface->moveBy(_previousVertices[0] - _surface->getVertices()[0]); _surface->moveBy(_previousVertices[0] - _surface->getVertices()[0]);
_projectionEditor->updateJoints(); _projectionEditor->updateJoints();
_previousVertices.clear(); _previousVertices.clear();

8
src/Commands/MoveSurfaceCommand.h → src/Commands/MvSurfaceCmd.h

@ -1,20 +1,20 @@
// MoveSurfaceCommand // MvSurfaceCmd
// Provides with option to undo move surface operation. // Provides with option to undo move surface operation.
// Created by Krisjanis Rijnieks 2015-05-14 // Created by Krisjanis Rijnieks 2015-05-14
#pragma once #pragma once
#include "BaseCommand.h" #include "BaseCmd.h"
#include "BaseSurface.h" #include "BaseSurface.h"
#include "ProjectionEditor.h" #include "ProjectionEditor.h"
namespace ofx{ namespace ofx{
namespace piMapper{ namespace piMapper{
class MoveSurfaceCommand : public BaseUndoableCommand{ class MvSurfaceCmd : public BaseUndoCmd{
public: public:
MoveSurfaceCommand( MvSurfaceCmd(
BaseSurface * surface, BaseSurface * surface,
ProjectionEditor * projectionEditor); ProjectionEditor * projectionEditor);
void exec(); void exec();

12
src/Commands/MoveSurfaceVertexCommand.cpp → src/Commands/MvSurfaceVertCmd.cpp

@ -1,9 +1,9 @@
#include "MoveSurfaceVertexCommand.h" #include "MvSurfaceVertCmd.h"
namespace ofx{ namespace ofx{
namespace piMapper{ namespace piMapper{
MoveSurfaceVertexCommand::MoveSurfaceVertexCommand( MvSurfaceVertCmd::MvSurfaceVertCmd(
int vertIndex, int vertIndex,
BaseSurface * surface, BaseSurface * surface,
ProjectionEditor * projectionEditor){ ProjectionEditor * projectionEditor){
@ -13,13 +13,13 @@ namespace ofx{
_projectionEditor = projectionEditor; _projectionEditor = projectionEditor;
} }
void MoveSurfaceVertexCommand::exec(){ void MvSurfaceVertCmd::exec(){
ofLogNotice("MoveJointCommand", "exec"); ofLogNotice("MvSurfaceVertCommand", "exec");
_prevVertPos = _surface->getVertices()[_vertIndex]; _prevVertPos = _surface->getVertices()[_vertIndex];
} }
void MoveSurfaceVertexCommand::undo(){ void MvSurfaceVertCmd::undo(){
ofLogNotice("MoveJointCommand", "undo"); ofLogNotice("MvSurfaceVertCommand", "undo");
_surface->setVertex(_vertIndex, _prevVertPos); _surface->setVertex(_vertIndex, _prevVertPos);
_projectionEditor->updateJoints(); _projectionEditor->updateJoints();
_projectionEditor = 0; _projectionEditor = 0;

8
src/Commands/MoveSurfaceVertexCommand.h → src/Commands/MvSurfaceVertCmd.h

@ -1,10 +1,10 @@
// MoveSurfaceVertexCommand // MvSurfaceVertCmd
// Provides with option to undo move surface vertex operation. // Provides with option to undo move surface vertex operation.
// Created by Krisjanis Rijnieks 2015-05-15 // Created by Krisjanis Rijnieks 2015-05-15
#pragma once #pragma once
#include "BaseCommand.h" #include "BaseCmd.h"
#include "BaseSurface.h" #include "BaseSurface.h"
#include "ProjectionEditor.h" #include "ProjectionEditor.h"
#include "BaseJoint.h" #include "BaseJoint.h"
@ -12,10 +12,10 @@
namespace ofx{ namespace ofx{
namespace piMapper{ namespace piMapper{
class MoveSurfaceVertexCommand : public BaseUndoableCommand{ class MvSurfaceVertCmd : public BaseUndoCmd{
public: public:
MoveSurfaceVertexCommand( MvSurfaceVertCmd(
int vertIndex, int vertIndex,
BaseSurface * surface, BaseSurface * surface,
ProjectionEditor * projectionEditor); ProjectionEditor * projectionEditor);

12
src/Commands/RemoveSurfaceCommand.cpp → src/Commands/RmSurfaceCmd.cpp

@ -1,24 +1,24 @@
#include "RemoveSurfaceCommand.h" #include "RmSurfaceCmd.h"
namespace ofx{ namespace ofx{
namespace piMapper{ namespace piMapper{
RemoveSurfaceCommand::RemoveSurfaceCommand(ofxPiMapper * app){ RmSurfaceCmd::RmSurfaceCmd(ofxPiMapper * app){
_app = app; _app = app;
_surface = 0; _surface = 0;
} }
void RemoveSurfaceCommand::exec(){ void RmSurfaceCmd::exec(){
// Store the surface, this implies that the surfaceManager's // Store the surface, this implies that the surfaceManager's
// removeSelectedSurface does not destroy the surface. // removeSelectedSurface does not destroy the surface.
_surface = _app->surfaceManager.getSelectedSurface(); _surface = _app->surfaceManager.getSelectedSurface();
_app->surfaceManager.removeSelectedSurface(); _app->surfaceManager.removeSelectedSurface();
} }
void RemoveSurfaceCommand::undo(){ void RmSurfaceCmd::undo(){
ofLogNotice("RemoveSurfaceCommand", "undo"); ofLogNotice("RmSurfaceCmd", "undo");
if (_surface == 0) { if (_surface == 0) {
ofLogError("RemoveSurfaceCommand", "No surface stored"); ofLogError("RmSurfaceCmd", "No surface stored");
} }
_app->surfaceManager.addSurface(_surface); _app->surfaceManager.addSurface(_surface);
_app->surfaceManager.selectSurface(_surface); _app->surfaceManager.selectSurface(_surface);

8
src/Commands/RemoveSurfaceCommand.h → src/Commands/RmSurfaceCmd.h

@ -1,11 +1,11 @@
// RemoveSurfaceCommand // RmSurfaceCmd
// Provides with option to undo remove surface operation. // Provides with option to undo remove surface operation.
// Created by Krisjanis Rijnieks 2015-05-14 // Created by Krisjanis Rijnieks 2015-05-14
#pragma once #pragma once
#include "ofxPiMapper.h" #include "ofxPiMapper.h"
#include "BaseCommand.h" #include "BaseCmd.h"
#include "BaseSurface.h" #include "BaseSurface.h"
class ofxPiMapper; class ofxPiMapper;
@ -13,10 +13,10 @@ class ofxPiMapper;
namespace ofx{ namespace ofx{
namespace piMapper{ namespace piMapper{
class RemoveSurfaceCommand : public BaseUndoableCommand{ class RmSurfaceCmd : public BaseUndoCmd{
public: public:
RemoveSurfaceCommand(ofxPiMapper * app); RmSurfaceCmd(ofxPiMapper * app);
void exec(); void exec();
void undo(); void undo();

10
src/Commands/SelectSurfaceCommand.cpp → src/Commands/SelSurfaceCmd.cpp

@ -1,9 +1,9 @@
#include "SelectSurfaceCommand.h" #include "SelSurfaceCmd.h"
namespace ofx{ namespace ofx{
namespace piMapper{ namespace piMapper{
SelectSurfaceCommand::SelectSurfaceCommand( SelSurfaceCmd::SelSurfaceCmd(
SurfaceManager * surfaceManager, SurfaceManager * surfaceManager,
BaseSurface * surfaceToSelect, BaseSurface * surfaceToSelect,
ProjectionEditor * projectionEditor){ ProjectionEditor * projectionEditor){
@ -13,15 +13,15 @@ namespace ofx{
_projectionEditor = projectionEditor; _projectionEditor = projectionEditor;
} }
void SelectSurfaceCommand::exec(){ void SelSurfaceCmd::exec(){
_prevSelectedSurface = _surfaceManager->getSelectedSurface(); _prevSelectedSurface = _surfaceManager->getSelectedSurface();
_projectionEditor->clearJoints(); _projectionEditor->clearJoints();
_surfaceManager->selectSurface(_surfaceToSelect); _surfaceManager->selectSurface(_surfaceToSelect);
_projectionEditor->createJoints(); _projectionEditor->createJoints();
} }
void SelectSurfaceCommand::undo(){ void SelSurfaceCmd::undo(){
ofLogNotice("SelectSurfaceCommand", "undo"); ofLogNotice("SelSurfaceCmd", "undo");
_projectionEditor->clearJoints(); _projectionEditor->clearJoints();
_surfaceManager->selectSurface(_prevSelectedSurface); _surfaceManager->selectSurface(_prevSelectedSurface);
_projectionEditor->createJoints(); _projectionEditor->createJoints();

8
src/Commands/SelectSurfaceCommand.h → src/Commands/SelSurfaceCmd.h

@ -1,10 +1,10 @@
// SelectSurfaceCommand // SelSurfaceCmd
// Provides with option to undo select surface operation. // Provides with option to undo select surface operation.
// Created by Krisjanis Rijnieks 2015-05-14 // Created by Krisjanis Rijnieks 2015-05-14
#pragma once #pragma once
#include "BaseCommand.h" #include "BaseCmd.h"
#include "BaseSurface.h" #include "BaseSurface.h"
#include "SurfaceManager.h" #include "SurfaceManager.h"
#include "ProjectionEditor.h" #include "ProjectionEditor.h"
@ -12,10 +12,10 @@
namespace ofx{ namespace ofx{
namespace piMapper{ namespace piMapper{
class SelectSurfaceCommand : public BaseUndoableCommand{ class SelSurfaceCmd : public BaseUndoCmd{
public: public:
SelectSurfaceCommand( SelSurfaceCmd(
SurfaceManager * surfaceManager, SurfaceManager * surfaceManager,
BaseSurface * surfaceToSelect, BaseSurface * surfaceToSelect,
ProjectionEditor * projectionEditor); ProjectionEditor * projectionEditor);

17
src/Commands/TestCommand.cpp

@ -1,17 +0,0 @@
# include "TestCommand.h"
namespace ofx{
namespace piMapper{
TestCommand::TestCommand(ofxPiMapper * a){
_application = a;
}
void TestCommand::exec(){
string name = "Hugo";
_application->testCommand(name);
}
} // namespace piMapper
} // namespace ofx

27
src/Commands/TestCommand.h

@ -1,27 +0,0 @@
// TestCommand class, extends Command base class. Used for Command design pattern implementation
// pre-tests. Will be removed as soon as possible.
// Created by Krisjanis Rijnieks 2015-03-23
#pragma once
#include "ofxPiMapper.h"
#include "BaseCommand.h"
class ofxPiMapper;
namespace ofx{
namespace piMapper{
class TestCommand : public BaseCommand{
public:
TestCommand(ofxPiMapper * a);
void exec();
private:
ofxPiMapper * _application;
};
} // namespace piMapper
} // namespace ofx

21
src/Commands/TestUndoCommand.cpp

@ -1,21 +0,0 @@
#include "TestUndoCommand.h"
namespace ofx{
namespace piMapper{
TestUndoCommand::TestUndoCommand(ofxPiMapper * a){
_application = a;
}
void TestUndoCommand::exec(){
increase = 2;
_application->testUndoableCommand(increase);
}
void TestUndoCommand::undo(){
_application->testUndoableCommand(-increase);
}
} // namespace piMapper
} // namespace ofx

27
src/Commands/TestUndoCommand.h

@ -1,27 +0,0 @@
// Created by Krisjanis Rijnieks 2015-03-25
#pragma once
#include "ofxPiMapper.h"
#include "BaseCommand.h"
class ofxPiMapper;
namespace ofx{
namespace piMapper{
class TestUndoCommand : public BaseUndoableCommand{
public:
TestUndoCommand(ofxPiMapper * a);
void exec();
void undo();
private:
ofxPiMapper * _application;
int increase;
};
} // namespace piMapper
} // namespace ofx

18
src/Surfaces/SurfaceManagerGui.cpp

@ -8,13 +8,13 @@ namespace ofx {
bDrag = false; bDrag = false;
registerMouseEvents(); registerMouseEvents();
ofHideCursor(); ofHideCursor();
_commandManager = 0; _cmdManager = 0;
} }
SurfaceManagerGui::~SurfaceManagerGui() { SurfaceManagerGui::~SurfaceManagerGui() {
unregisterMouseEvents(); unregisterMouseEvents();
surfaceManager = NULL; surfaceManager = NULL;
_commandManager = 0; _cmdManager = 0;
} }
void SurfaceManagerGui::registerMouseEvents() { void SurfaceManagerGui::registerMouseEvents() {
@ -123,7 +123,7 @@ namespace ofx {
break; break;
} }
} }
_commandManager->exec(new MoveSurfaceVertexCommand( _cmdManager->exec(new MvSurfaceVertCmd(
jointVertIndex, jointVertIndex,
surfaceManager->getSelectedSurface(), surfaceManager->getSelectedSurface(),
&projectionEditor)); &projectionEditor));
@ -138,7 +138,7 @@ namespace ofx {
// Do not repeat this command if attempting to select an // Do not repeat this command if attempting to select an
// already selected surface. // already selected surface.
if (surfaceManager->getSelectedSurface() != surfaceManager->getSurface(i)){ if (surfaceManager->getSelectedSurface() != surfaceManager->getSurface(i)){
_commandManager->exec(new SelectSurfaceCommand( _cmdManager->exec(new SelSurfaceCmd(
surfaceManager, surfaceManager,
surfaceManager->getSurface(i), surfaceManager->getSurface(i),
&projectionEditor)); &projectionEditor));
@ -157,8 +157,8 @@ namespace ofx {
clickPosition = ofVec2f(args.x, args.y); clickPosition = ofVec2f(args.x, args.y);
startDrag(); startDrag();
_commandManager->exec( _cmdManager->exec(
new MoveSurfaceCommand( new MvSurfaceCmd(
surfaceManager->getSelectedSurface(), surfaceManager->getSelectedSurface(),
&projectionEditor)); &projectionEditor));
} }
@ -179,7 +179,7 @@ namespace ofx {
// Check if surface has moved // Check if surface has moved
if (!surfaceManager->getSelectedSurface()->getMoved()) { if (!surfaceManager->getSelectedSurface()->getMoved()) {
_commandManager->undo(); _cmdManager->undo();
} }
} }
@ -212,8 +212,8 @@ namespace ofx {
sourcesEditor.setMediaServer(mediaServer); sourcesEditor.setMediaServer(mediaServer);
} }
void SurfaceManagerGui::setCommandManager(CommandManager * commandManager){ void SurfaceManagerGui::setCmdManager(CmdManager * cmdManager){
_commandManager = commandManager; _cmdManager = cmdManager;
} }
void SurfaceManagerGui::setMode(int newGuiMode) { void SurfaceManagerGui::setMode(int newGuiMode) {

12
src/Surfaces/SurfaceManagerGui.h

@ -11,10 +11,10 @@
#include "ProjectionEditor.h" #include "ProjectionEditor.h"
#include "SourcesEditor.h" #include "SourcesEditor.h"
#include "GuiMode.h" #include "GuiMode.h"
#include "CommandManager.h" #include "CmdManager.h"
#include "MoveSurfaceCommand.h" #include "MvSurfaceCmd.h"
#include "SelectSurfaceCommand.h" #include "SelSurfaceCmd.h"
#include "MoveSurfaceVertexCommand.h" #include "MvSurfaceVertCmd.h"
namespace ofx { namespace ofx {
namespace piMapper { namespace piMapper {
@ -33,7 +33,7 @@ namespace ofx {
void setSurfaceManager(SurfaceManager* newSurfaceManager); void setSurfaceManager(SurfaceManager* newSurfaceManager);
void setMediaServer(MediaServer* newMediaServer); void setMediaServer(MediaServer* newMediaServer);
void setCommandManager(CommandManager * commandManager); void setCmdManager(CmdManager * cmdManager);
void setMode(int newGuiMode); void setMode(int newGuiMode);
void drawSelectedSurfaceHighlight(); void drawSelectedSurfaceHighlight();
@ -50,7 +50,7 @@ namespace ofx {
int guiMode; int guiMode;
bool bDrag; bool bDrag;
ofVec2f clickPosition; ofVec2f clickPosition;
CommandManager * _commandManager; CmdManager * _cmdManager;
}; };
} }
} }

28
src/ofxPiMapper.cpp

@ -14,7 +14,7 @@ void ofxPiMapper::setup(){
// Assign media server to other pi mapper components // Assign media server to other pi mapper components
surfaceManager.setMediaServer(&mediaServer); surfaceManager.setMediaServer(&mediaServer);
gui.setMediaServer(&mediaServer); gui.setMediaServer(&mediaServer);
gui.setCommandManager(&commandManager); gui.setCmdManager(&cmdManager);
// Check if we have user surfaces defined, if not - load default // Check if we have user surfaces defined, if not - load default
if (ofFile::doesFileExist(PIMAPPER_USER_SURFACES_XML_FILE)){ if (ofFile::doesFileExist(PIMAPPER_USER_SURFACES_XML_FILE)){
@ -31,9 +31,6 @@ void ofxPiMapper::setup(){
isSetUp = true; isSetUp = true;
ofLogNotice("ofxPiMapper") << "Done setting up"; ofLogNotice("ofxPiMapper") << "Done setting up";
// Initialize undo test vars
undoTestValue = 0;
} }
void ofxPiMapper::draw(){ void ofxPiMapper::draw(){
@ -102,19 +99,11 @@ void ofxPiMapper::keyPressed(ofKeyEventArgs &args){
surfaceManager.saveXmlSettings(PIMAPPER_USER_SURFACES_XML_FILE); surfaceManager.saveXmlSettings(PIMAPPER_USER_SURFACES_XML_FILE);
break; break;
case OF_KEY_BACKSPACE: case OF_KEY_BACKSPACE:
//surfaceManager.removeSelectedSurface(); cmdManager.exec(new ofx::piMapper::RmSurfaceCmd((ofxPiMapper *)this));
commandManager.exec(new ofx::piMapper::RemoveSurfaceCommand((ofxPiMapper *)this));
break;
// TODO: Remove the following case when Command test done.
case '9':
commandManager.exec(new ofx::piMapper::TestUndoCommand((ofxPiMapper *)this));
break;
case '0':
commandManager.exec(new ofx::piMapper::TestCommand((ofxPiMapper *)this));
break; break;
case 'z': case 'z':
// undo // Undo any undo command operation
commandManager.undo(); cmdManager.undo();
break; break;
default: default:
break; break;
@ -175,13 +164,4 @@ ofx::piMapper::MediaServer& ofxPiMapper::getMediaServer(){
ofx::piMapper::SurfaceManager& ofxPiMapper::getSurfaceManager(){ ofx::piMapper::SurfaceManager& ofxPiMapper::getSurfaceManager(){
return surfaceManager; return surfaceManager;
}
// TODO: remove this when done testing and everything works
void ofxPiMapper::testCommand(string name){
ofLogNotice("ofxPiMapper", name);
}
void ofxPiMapper::testUndoableCommand(int increase){
undoTestValue += increase;
} }

17
src/ofxPiMapper.h

@ -12,11 +12,10 @@
#include "MediaServer.h" #include "MediaServer.h"
#include "FboSource.h" #include "FboSource.h"
#include "BaseCommand.h" // Command design pattern includes
#include "TestCommand.h" // TODO: Remove this line when done testing #include "BaseCmd.h"
#include "TestUndoCommand.h" #include "CmdManager.h"
#include "CommandManager.h" #include "RmSurfaceCmd.h"
#include "RemoveSurfaceCommand.h"
#define PIMAPPER_DEF_SURFACES_XML_FILE "defaultSurfaces.xml" #define PIMAPPER_DEF_SURFACES_XML_FILE "defaultSurfaces.xml"
#define PIMAPPER_USER_SURFACES_XML_FILE "surfaces.xml" #define PIMAPPER_USER_SURFACES_XML_FILE "surfaces.xml"
@ -49,12 +48,8 @@ class ofxPiMapper{
// from anywhere within ofxPiMapper. // from anywhere within ofxPiMapper.
ofx::piMapper::MediaServer& getMediaServer(); ofx::piMapper::MediaServer& getMediaServer();
ofx::piMapper::SurfaceManager& getSurfaceManager(); ofx::piMapper::SurfaceManager& getSurfaceManager();
// Test first steps of the Command design pattern implementation. ofx::piMapper::CmdManager cmdManager;
void testCommand(string name);
void testUndoableCommand(int increase);
int undoTestValue;
ofx::piMapper::CommandManager commandManager;
ofx::piMapper::SurfaceManager surfaceManager; ofx::piMapper::SurfaceManager surfaceManager;
private: private:

Loading…
Cancel
Save