AnimatLab  2
Test
MotorStimulus.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 namespace AnimatSim
10 {
11  namespace ExternalStimuli
12  {
13 
15  {
16  protected:
17  std::string m_strStructureID;
18  std::string m_strJointID;
19  MotorizedJoint *m_lpJoint;
20  int m_iTargetID;
21 
22  float *m_lpPosition;
23  float *m_lpVelocity;
24 
25  std::string m_strEquation;
26  CStdPostFixEval *m_lpEval;
27 
28  bool m_bDisableMotorWhenDone;
29 
30  float m_fltValue;
31  float m_fltValueReport;
32 
33  public:
34  MotorStimulus();
35  virtual ~MotorStimulus();
36 
37  static MotorStimulus *CastToDerived(AnimatBase *lpBase) {return static_cast<MotorStimulus*>(lpBase);}
38 
39  std::string StructureID() {return m_strStructureID;};
40  void StructureID(std::string strVal) {m_strStructureID = strVal;};
41 
42  std::string JointID() {return m_strJointID;};
43  void JointID(std::string strVal) {m_strJointID = strVal;};
44 
45  std::string Equation() {return m_strEquation;};
46  void Equation(std::string strVal);
47 
48  int TargetID() {return m_iTargetID;}
49  void TargetID(int iID);
50  void TargetID(std::string strID);
51 
52  bool DisableMotorWhenDone() {return m_bDisableMotorWhenDone;};
53  void DisableMotorWhenDone(bool bVal) {m_bDisableMotorWhenDone = bVal;};
54 
55  virtual void Load(CStdXml &oXml);
56 
57  //ActiveItem overrides
58  virtual std::string Type() {return "MotorVelocity";};
59  virtual void Initialize();
60  virtual void Activate();
61  virtual void ResetSimulation();
62  virtual void StepSimulation();
63  virtual void Deactivate();
64 
65  virtual float *GetDataPointer(const std::string &strDataType);
66  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
67  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
68  };
69 
70  } //ExternalStimuli
71 } //AnimatSim
Root namespace for the base simulation library for AnimatLab.
virtual std::string Type()
returns the string type name of this object.
Definition: MotorStimulus.h:58
Animat base class.
Definition: AnimatBase.h:36