Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

LoadWalkControl.h

Go to the documentation of this file.
00001 #ifndef INCLUDED_LoadWalkControl_h
00002 #define INCLUDED_LoadWalkControl_h
00003 
00004 #include "FileBrowserControl.h"
00005 #include "Motion/WalkMC.h"
00006 #include "Shared/Config.h"
00007 #include <string>
00008 
00009 //! When activated, loads a set of walk parameters from a file specified by user
00010 class LoadWalkControl : public FileBrowserControl {
00011 public:
00012   //! constructor, pass the MC_ID of the WalkMC which you want to save
00013   LoadWalkControl(const std::string& n, MotionManager::MC_ID w)
00014     : FileBrowserControl(n,"Loads a set of walk parameters from a file specified by user",config->motion.root), walk_id(w)
00015   {
00016     setFilter("*.prm");
00017   }
00018   //! destructor
00019   virtual ~LoadWalkControl() {}
00020 
00021 protected:
00022   //!does the actual loading of the MotionSequence
00023   virtual ControlBase* selectedFile(const std::string& f) {
00024     WalkMC* walk = (WalkMC*)motman->checkoutMotion(walk_id);
00025     walk->load(f.c_str());
00026     motman->checkinMotion(walk_id);
00027     return NULL;
00028   }
00029 
00030   MotionManager::MC_ID walk_id; //!< the MC_ID of the walk to load into
00031 };
00032 
00033 /*! @file
00034  * @brief Defines LoadWalkControl, which when activated, loads a set of walk parameters from a file read from cin.
00035  * @author ejt (Creator)
00036  *
00037  * $Author: ejt $
00038  * $Name: tekkotsu-1_4_1 $
00039  * $Revision: 1.4 $
00040  * $State: Exp $
00041  * $Date: 2003/06/10 00:53:48 $
00042  */
00043 
00044 #endif

Tekkotsu v1.4
Generated Sat Jul 19 00:06:31 2003 by Doxygen 1.3.2