AnimatLab  2
Test
AnimatBase.h
Go to the documentation of this file.
1 
7 #pragma once
8 
20 namespace AnimatSim
21 {
36  class ANIMAT_PORT AnimatBase : public CStdSerialize
37  {
38  protected:
40  bool m_bEnabled;
41 
44 
47 
50 
53 
55  std::string m_strID;
56 
58  std::string m_strType;
59 
61  std::string m_strName;
62 
65 
66  public:
67  AnimatBase();
68  virtual ~AnimatBase();
69 
70  virtual Simulator *GetSimulator();
71  virtual Structure *GetStructure();
72  virtual NeuralModule *GetNeuralModule();
73  virtual Node *GetNode();
74 
75  virtual void Enabled(bool bVal);
76  virtual bool Enabled();
77 
78  virtual std::string ID() ;
79  virtual void ID(std::string strValue);
80 
81  virtual std::string Name();
82  virtual void Name(std::string strValue);
83 
84  virtual std::string Type();
85  virtual void Type(std::string strValue);
86 
87  virtual bool Selected();
88  virtual void Selected(bool bValue, bool bSelectMultiple);
89 
90  virtual void Copy(CStdSerialize *lpSource);
91 
92 #pragma region DataAccesMethods
93 
116  virtual void SetSystemPointers(Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify);
117  virtual void VerifySystemPointers();
118  virtual float *GetDataPointer(const std::string &strDataType);
119  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
120  virtual bool SetData(const std::string &strDataType, const float fltValue, bool bThrowError = true);
121  virtual bool SetData(const std::string &strDataType, const long lValue, bool bThrowError = true);
122  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
123  virtual bool HasProperty(const std::string &strName);
124  virtual AnimatPropertyType PropertyType(const std::string &strName);
125  virtual bool AddItem(const std::string &strItemType, const std::string &strXml, bool bThrowError = true, bool bDoNotInit = false);
126  virtual bool RemoveItem(const std::string &strItemType, const std::string &strID, bool bThrowError = true);
127 
128  virtual void RigidBodyAdded(std::string strID) {};
129  virtual void RigidBodyRemoved(std::string strID) {};
130 
131 #pragma endregion
132 
133 #pragma region SimulationMethods
134 
135  virtual void Reset();
136  virtual void Initialize();
137  virtual void ResetSimulation();
138  virtual void AfterResetSimulation();
139  virtual void ReInitialize();
140  virtual void Kill(bool bState = true);
141  virtual void StepSimulation();
142 
143  virtual void SimStarting();
144  virtual void SimPausing();
145  virtual void SimStopping();
146 
147  virtual void TimeStepModified();
148 
149 #pragma endregion
150 
151 #pragma region SnapshotMethods
152 
153  virtual long CalculateSnapshotByteSize();
154  virtual void SaveKeyFrameSnapshot(byte *aryBytes, long &lIndex);
155  virtual void LoadKeyFrameSnapshot(byte *aryBytes, long &lIndex);
156 
157 #pragma endregion
158 
159  virtual void VisualSelectionModeChanged(int iNewMode);
160  virtual void Load(StdUtils::CStdXml &oXml);
161  };
162 
163 } //AnimatSim
Simulates the entire environment.
Definition: Simulator.h:31
Root namespace for the base simulation library for AnimatLab.
AnimatSim::Behavior::NeuralModule * m_lpModule
The pointer to this items parentNeuralModule. If this is not relevant for this object then this is NU...
Definition: AnimatBase.h:49
Simulator * m_lpSim
The pointer to a Simulation.
Definition: AnimatBase.h:43
AnimatSim::Environment::Structure * m_lpStructure
The pointer to this items parent Structure. If this is not relevant for this object then this is NULL...
Definition: AnimatBase.h:46
std::string m_strID
The unique Id for this object.
Definition: AnimatBase.h:55
A standard xml manipulation class.
Definition: StdXml.h:19
Node * m_lpNode
The pointer to this items parent Node. If this is not relevant for this object then this is NULL...
Definition: AnimatBase.h:52
A "static" structure in the simulation.
Definition: Structure.h:84
Animat base class.
Definition: AnimatBase.h:36
bool m_bEnabled
Tells if this item is enabled or not. If it is not enabled then it is not run.
Definition: AnimatBase.h:40
Base class for body parts and neural network nodes.
Definition: Node.h:25
bool m_bSelected
Tells whether the object is selected or not.
Definition: AnimatBase.h:64
std::string m_strType
The type for this object. Examples are Box, Plane, Neuron, etc..
Definition: AnimatBase.h:58
std::string m_strName
The name for this object.
Definition: AnimatBase.h:61