fshake3d  0.0.1
FreeformDensity3DSurfaceEditor
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
command.hpp
Go to the documentation of this file.
00001 class Command
00002 {
00003 public:
00004   virtual void doAction() = 0;
00005   virtual void undoAction() = 0;
00006 };
00007 
00008 class CommandNewHotSpot;
00009 class CommandSelectHotSpot;
00010 class CommandSetSliderValue;
00011 class CommandUnselect;
00012 
00013 class CommandStack
00014 {
00015 public:
00016   void undoCommand()
00017   {
00018     if (mCommandStack.
00019   }
00020   void redoCommand();
00021   void doCommand(Command* pCommand)
00022   {
00023     if 
00024     mCommandStack.push_back(pCommand);
00025     pCommand->doAction();
00026     mUndo = mCommandStack.end();
00027   }
00028 private:
00029   std::vector<Command*> mCommandStack;
00030   std::vector<Command*>::iterator mIterator;
00031 };
00032 
00033 class CommandNewHotSpot : public Command
00034 {
00035 public:
00036   CommandSelectHotSpot(FunctionMixer* pFunctionMixer, HotSpot* pHotSpot)
00037     : mpFunctionMixer(pFunctionMixer)
00038     , mpHotSpot(pHotSpot)
00039   {
00040   }
00041   void doAction()
00042   {
00043     mpFunctionMixer->add(mpHotSpot);
00044   }
00045   void undoAction()
00046   {
00047     mpFunctionMixer->unselect(mpHotSpot);
00048   }
00049 
00050 private:
00051   FunctionMixer* mpFunctionMixer;
00052   HotSpot* mpHotSpot;
00053 };
00054 
00055 class CommandSelectHotSpot : public Command
00056 {
00057 public:
00058   CommandSelectHotSpot(FunctionMixer* pFunctionMixer, HotSpot* pHotSpot)
00059     : mpFunctionMixer(pFunctionMixer)
00060     , mpHotSpot(pHotSpot)
00061   {
00062   }
00063   void doAction()
00064   {
00065     mpFunctionMixer->select(mpHotSpot);
00066   }
00067   void undoAction()
00068   {
00069     mpFunctionMixer->unselect(mpHotSpot);
00070   }
00071 private:
00072   FunctionMixer* mpFunctionMixer;
00073   HotSpot* mpHotSpot;
00074 };
00075 
00076 class CommandSetSliderValue : public Command
00077 {
00078 public:
00079   CommandSetSliderValue(Slider* pSlider, double value)
00080   {
00081 
00082   }
00083 };