1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* @file KeyFrameMotionFactory.h
*
* @author <a href="mailto:mellmann@informatik.hu-berlin.de">Heinrich Mellmann</a>
* Declaration of class KeyFrameMotionFactory
*/

#ifndef _KeyFrameMotionFactory_h_
#define _KeyFrameMotionFactory_h_

#include "Tools/KeyFrameMotion.h"

#include "Representations/Motion/Request/MotionRequest.h"
#include "Motion/Engine/MotionFactory.h"

#include <string>

/**
* representation holding the loaded motion nets
*/
class MotionNets
{
private:
  typedef std::map<std::string, MotionNet> MotionNetsRegistry;
  MotionNetsRegistry registry;

public:
  MotionNet& operator[] (std::string name){ return registry[name]; }
  bool exist(std::string name) const { return registry.find(name) != registry.end(); }
  
  const MotionNet* get(std::string name) const 
  { 
    MotionNetsRegistry::const_iterator iter = registry.find(name); 
    if(iter != registry.end())
      return &(iter->second);
    else
      return NULL;
  }
};


#include <ModuleFramework/Module.h>

BEGIN_DECLARE_MODULE(KeyFrameMotionFactory)
  PROVIDE(MotionNets)
END_DECLARE_MODULE(KeyFrameMotionFactory)


class KeyFrameMotionFactory: public MotionFactory, private KeyFrameMotionFactoryBase //TODO: , public DebugCommandExecutor
{
public:

  KeyFrameMotionFactory();
  ~KeyFrameMotionFactory();

  Module* createMotion(const MotionRequest& motionRequest);

  void execute(){} // dummy

  /*virtual void executeDebugCommand(
    const std::string& command, const std::map<std::string,std::string>& arguments,
    std::stringstream &outstream);*/

private:
  ModuleCreator<KeyFrameMotion>* keyFrameMotionCreator;

  // loading motion-nets
  void loadMotionNetFromFile(const std::string& fileName, MotionNet& motionNet) const;
  bool loadMotionNet(const std::string& fileName, const std::string& motionNetName);
  void loadAvailableMotionNets(std::string directoryName);<--- Function 'loadAvailableMotionNets' argument 1 names different: declaration 'directoryName' definition 'dirlocation'.
};

#endif //_KeyFrameMotionFactory_h_