AnimatLab  2
Test
BodyPart.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include "RobotPartInterface.h"
10 
11 namespace AnimatSim
12 {
13  namespace Environment
14  {
25  class ANIMAT_PORT BodyPart : public Node, public MovableItem
26  {
27  protected:
32 
34  CStdArray<RobotPartInterface *> m_aryRobotParts;
35 
40 
43 
46 
49 
50  virtual void UpdateData();
51 
52  public:
53  BodyPart(void);
54  virtual ~BodyPart(void);
55 
56  static BodyPart *CastToDerived(AnimatBase *lpBase) {return static_cast<BodyPart*>(lpBase);}
57 
58 #pragma region AccessorMutators
59 
60  virtual IPhysicsBody *PhysicsBody();
61  virtual void PhysicsBody(IPhysicsBody *lpBody);
62 
63  virtual CStdArray<RobotPartInterface *> *GetRobotPartInterfaces();
64  virtual void AddRobotPartInterface(RobotPartInterface *lpPart);
65  virtual void RemoveRobotPartInterface(RobotPartInterface *lpPart);
66  virtual int FindRobotPartListIndex(std::string strID, bool bThrowError = true);
67 
68  virtual bool SynchWithRobot();
69  virtual void SynchWithRobot(bool bVal);
70 
71  virtual float SynchUpdateInterval();
72  virtual void SynchUpdateInterval(float fltVal);
73 
74  virtual void Resize();
75 
76 #pragma endregion
77 
78 #pragma region DataAccesMethods
79 
80  virtual void SetSystemPointers(Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify);
81  virtual float *GetDataPointer(const std::string &strDataType);
82  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
83  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
84  virtual void UpdateExtraData();
85  virtual bool NeedsRobotSynch();
86 
87 #pragma endregion
88 
89  virtual void Initialize();
90  virtual void ResetSimulation();
91  virtual void TimeStepModified();
92  virtual void Selected(bool bValue, bool bSelectMultiple);
93  virtual void AddBodyClicked(float fltPosX, float fltPosY, float fltPosZ, float fltNormX, float fltNormY, float fltNormZ);
94  virtual void VisualSelectionModeChanged(int iNewMode);
95  virtual void UpdatePhysicsPosFromGraphics();
96  virtual void WakeDynamics();
97 
98  virtual void Load(CStdXml &oXml);
99  };
100 
101  } // Environment
102 } //AnimatSim
IPhysicsBody * m_lpPhysicsBody
Definition: BodyPart.h:31
Simulates the entire environment.
Definition: Simulator.h:31
Root namespace for the base simulation library for AnimatLab.
float m_fltSynchUpdateInterval
This is how often we need to update this particular adapter.
Definition: BodyPart.h:42
int m_iSynchCount
Keeps track of the last time we did a synch for the robot.
Definition: BodyPart.h:48
CStdArray< RobotPartInterface * > m_aryRobotParts
Array of pointers to robot part interfaces connected to this body part.
Definition: BodyPart.h:34
Baes class for all items that can be moved/roated within the environment.
Definition: MovableItem.h:19
int m_iSynchUpdateInterval
The number of ticks between each call to update for this adapter till the next update time...
Definition: BodyPart.h:45
A "static" structure in the simulation.
Definition: Structure.h:84
Base class for all body parts and joints.
Definition: BodyPart.h:25
Animat base class.
Definition: AnimatBase.h:36
Base class for body parts and neural network nodes.
Definition: Node.h:25