AnimatLab  2
Test
ForceStimulus.h
1 
2 #pragma once
3 
4 namespace AnimatSim
5 {
6 
12  namespace ExternalStimuli
13  {
14 
16  {
17  protected:
18  Structure *m_lpStructure;
19  std::string m_strStructureID;
20 
21  std::string m_strBodyID;
22  RigidBody *m_lpBody;
23 
24  CStdFPoint m_oRelativePosition;
25 
26  std::string m_strForceXEquation;
27  std::string m_strForceYEquation;
28  std::string m_strForceZEquation;
29 
30  CStdPostFixEval *m_lpForceXEval;
31  CStdPostFixEval *m_lpForceYEval;
32  CStdPostFixEval *m_lpForceZEval;
33 
34  float m_fltForceX;
35  float m_fltForceY;
36  float m_fltForceZ;
37 
38  float m_fltForceReportX;
39  float m_fltForceReportY;
40  float m_fltForceReportZ;
41 
42  std::string m_strTorqueXEquation;
43  std::string m_strTorqueYEquation;
44  std::string m_strTorqueZEquation;
45 
46  CStdPostFixEval *m_lpTorqueXEval;
47  CStdPostFixEval *m_lpTorqueYEval;
48  CStdPostFixEval *m_lpTorqueZEval;
49 
50  float m_fltTorqueX;
51  float m_fltTorqueY;
52  float m_fltTorqueZ;
53 
54  float m_fltTorqueReportX;
55  float m_fltTorqueReportY;
56  float m_fltTorqueReportZ;
57 
58  CStdPostFixEval *SetupEquation(std::string strEquation);
59 
60  public:
61  ForceStimulus();
62  virtual ~ForceStimulus();
63 
64  static ForceStimulus *CastToDerived(AnimatBase *lpBase) {return static_cast<ForceStimulus*>(lpBase);}
65 
66  float RelativePositionX() {return m_oRelativePosition.x;};
67  float RelativePositionY() {return m_oRelativePosition.y;};
68  float RelativePositionZ() {return m_oRelativePosition.z;};
69 
70  void RelativePositionX(float fltVal);
71  void RelativePositionY(float fltVal);
72  void RelativePositionZ(float fltVal);
73 
74  std::string ForceXEquation() {return m_strForceXEquation;};
75  std::string ForceYEquation() {return m_strForceYEquation;};
76  std::string ForceZEquation() {return m_strForceZEquation;};
77 
78  void ForceXEquation(std::string strVal);
79  void ForceYEquation(std::string strVal);
80  void ForceZEquation(std::string strVal);
81 
82  std::string TorqueXEquation() {return m_strTorqueXEquation;};
83  std::string TorqueYEquation() {return m_strTorqueYEquation;};
84  std::string TorqueZEquation() {return m_strTorqueZEquation;};
85 
86  void TorqueXEquation(std::string strVal);
87  void TorqueYEquation(std::string strVal);
88  void TorqueZEquation(std::string strVal);
89 
90  virtual void Load(CStdXml &oXml);
91 
92  //ActiveItem overrides
93  virtual std::string Type() {return "ForceInput";};
94  virtual void Initialize();
95  virtual void ResetSimulation();
96  virtual void StepSimulation();
97  virtual void Deactivate();
98 
99  virtual float *GetDataPointer(const std::string &strDataType);
100  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
101  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
102  };
103 
104  } //ExternalStimuli
105 } //AnimatSim
Root namespace for the base simulation library for AnimatLab.
Animat base class.
Definition: AnimatBase.h:36
virtual std::string Type()
returns the string type name of this object.
Definition: ForceStimulus.h:93