AnimatLab  2
Test
VsForceStimulus.h
1 
2 #pragma once
3 
4 namespace VortexAnimatSim
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  VsRigidBody *m_lpVsBody;
24 
25  CStdFPoint m_oRelativePosition;
26 
27  std::string m_strForceXEquation;
28  std::string m_strForceYEquation;
29  std::string m_strForceZEquation;
30 
31  CStdPostFixEval *m_lpForceXEval;
32  CStdPostFixEval *m_lpForceYEval;
33  CStdPostFixEval *m_lpForceZEval;
34 
35  float m_fltForceX;
36  float m_fltForceY;
37  float m_fltForceZ;
38 
39  float m_fltForceReportX;
40  float m_fltForceReportY;
41  float m_fltForceReportZ;
42 
43  std::string m_strTorqueXEquation;
44  std::string m_strTorqueYEquation;
45  std::string m_strTorqueZEquation;
46 
47  CStdPostFixEval *m_lpTorqueXEval;
48  CStdPostFixEval *m_lpTorqueYEval;
49  CStdPostFixEval *m_lpTorqueZEval;
50 
51  float m_fltTorqueX;
52  float m_fltTorqueY;
53  float m_fltTorqueZ;
54 
55  float m_fltTorqueReportX;
56  float m_fltTorqueReportY;
57  float m_fltTorqueReportZ;
58 
59  CStdPostFixEval *SetupEquation(std::string strEquation);
60 
61  public:
63  virtual ~VsForceStimulus();
64 
65  float RelativePositionX() {return m_oRelativePosition.x;};
66  float RelativePositionY() {return m_oRelativePosition.y;};
67  float RelativePositionZ() {return m_oRelativePosition.z;};
68 
69  void RelativePositionX(float fltVal);
70  void RelativePositionY(float fltVal);
71  void RelativePositionZ(float fltVal);
72 
73  std::string ForceXEquation() {return m_strForceXEquation;};
74  std::string ForceYEquation() {return m_strForceYEquation;};
75  std::string ForceZEquation() {return m_strForceZEquation;};
76 
77  void ForceXEquation(std::string strVal);
78  void ForceYEquation(std::string strVal);
79  void ForceZEquation(std::string strVal);
80 
81  std::string TorqueXEquation() {return m_strTorqueXEquation;};
82  std::string TorqueYEquation() {return m_strTorqueYEquation;};
83  std::string TorqueZEquation() {return m_strTorqueZEquation;};
84 
85  void TorqueXEquation(std::string strVal);
86  void TorqueYEquation(std::string strVal);
87  void TorqueZEquation(std::string strVal);
88 
89  virtual void Load(CStdXml &oXml);
90 
91  //ActiveItem overrides
92  virtual std::string Type() {return "ForceInput";};
93  virtual void Initialize();
94  virtual void ResetSimulation();
95  virtual void StepSimulation();
96  virtual void Deactivate();
97 
98  virtual float *GetDataPointer(const std::string &strDataType);
99  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
100  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
101  };
102 
103  } //ExternalStimuli
104 } //VortexAnimatSim
virtual std::string Type()
returns the string type name of this object.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.