8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
13 #include "IPhysicsMovableItem.h"
14 #include "IPhysicsBody.h"
16 #include "MovableItem.h"
69 {
Std_TraceMsg(0,
"Caught Error in desctructor of BodyPart\r\n",
"", -1,
false,
true);}
72 #pragma region AccessorMutators
196 Std_IsAboveMin((
float) 0, fltVal,
true,
"SynchUpdateInterval",
true);
215 MovableItem::Selected(bValue, bSelectMultiple);
242 void BodyPart::WakeDynamics()
248 #pragma region DataAccesMethods
256 float *BodyPart::GetDataPointer(
const std::string &strDataType)
258 return MovableItem::GetDataPointer(strDataType);
261 bool BodyPart::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
266 if(MovableItem::SetData(strDataType, strValue,
false))
271 if(strType ==
"SYNCHWITHROBOT")
277 if(strType ==
"SYNCHUPDATEINTERVAL")
285 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
290 void BodyPart::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
293 MovableItem::QueryProperties(aryProperties);
294 aryProperties.Add(
new TypeProperty(
"SynchWithRobot", AnimatPropertyType::Boolean, AnimatPropertyDirection::Set));
295 aryProperties.Add(
new TypeProperty(
"SynchUpdateInterval", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
347 for(
int iIdx=0; iIdx<iCount; iIdx++)
352 THROW_PARAM_ERROR(Al_Err_lPartInterfaceIDNotFound, Al_Err_strPartInterfaceIDNotFound,
"ID", strID);
375 bool BodyPart::NeedsRobotSynch()
420 void BodyPart::Load(
CStdXml &oXml)
423 MovableItem::Load(oXml);
virtual void SetSystemPointers(Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify)
Sets the system pointers.
IPhysicsBody * m_lpPhysicsBody
Base class file for all Animat simulation objects.
virtual void PhysicsTimeStep(float fltVal)
Sets the integration time step for the physics engine.
virtual void Initialize()
Initializes this object.
Declares the simulation recorder class.
Simulates the entire environment.
virtual void AddBodyClicked(float fltPosX, float fltPosY, float fltPosZ, float fltNormX, float fltNormY, float fltNormZ)=0
Called to signal to the GUI that a part was clicked while AddBody mode was active.
Simulator * m_lpMovableSim
The pointer to a Simulation.
virtual bool InSimulation()
Used to determine if we are running in a simulation, or in a real control mode.
Root namespace for the base simulation library for AnimatLab.
virtual void ResetSimulation()
Resets the simulation back to time 0.
virtual void UpdateData()
Called to collect any body data for this part.
Declares the body part class.
float m_fltSynchUpdateInterval
This is how often we need to update this particular adapter.
Simulator * m_lpSim
The pointer to a Simulation.
virtual std::string ID()
Gets the unique GUID ID of this object.
virtual bool IntoElem()
Goes into the next element where the cursor is located.
int m_iSynchCount
Keeps track of the last time we did a synch for the robot.
CStdArray< RobotPartInterface * > m_aryRobotParts
Array of pointers to robot part interfaces connected to this body part.
virtual void UpdatePhysicsPosFromGraphics()
Updates the physics position from graphics.
Class that stores information about types for QueryProperty information.
IMovableItemCallback * m_lpCallback
virtual void TimeStepModified()
Notification method that the time step modified has been modified. Objects should recalculate any sli...
virtual void Initialize()
Initializes this object.
Declares the key frame class.
virtual float SynchUpdateInterval()
This is how often we need to update this particular adapter.
virtual void AddBodyClicked(float fltPosX, float fltPosY, float fltPosZ, float fltNormX, float fltNormY, float fltNormZ)
Called when the user clicks on this object while the AddBody mode is active.
BodyPart(void)
Default constructor.
Declares the joint class.
Declares the organism class.
bool Std_IsAboveMin(int iMinVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
Tests if a number is above a minimum value.
virtual void SizeChanged()=0
Called to signal to the GUI that the size of the body part changed.
virtual void Resize()
Called when this object has been resized.
Declares the activated item class.
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
Declares a light manager object.
virtual bool RobotAdpaterSynch()
Gets whether we need to synch the physics adapters in a simulation to the robot physics time step...
IPhysicsMovableItem * m_lpPhysicsMovableItem
Declares the bounding box class.
int m_iSynchUpdateInterval
The number of ticks between each call to update for this adapter till the next update time...
A standard xml manipulation class.
virtual ~BodyPart(void)
Destructor.
virtual void UpdateExtraData()
UpdateData is called during this body parts sim update call, and before any of its child updates beca...
virtual bool Selected()
Tells if this items is selected or not.
A "static" structure in the simulation.
virtual bool SynchWithRobot()
Gets whether the m_bRobotAdpaterSynch flag applies to this adapter.
virtual IPhysicsBody * PhysicsBody()
Gets the physics body interface pointer. This is an interface reference to the Vs version of this obj...
bool Std_ToBool(int iVal)
Converts a value toa bool.
virtual void Load(StdUtils::CStdXml &oXml)
Loads the item using an XML data packet.
void Std_TraceMsg(const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
Traces a message to the debugger window.
virtual bool GetChildBool(std::string strElementName)
Gets a bool value from the element with the specified name.
virtual void VisualSelectionModeChanged(int iNewMode)
Called when the visual selection mode changed in GUI.
Base class for body parts and neural network nodes.
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
virtual int FindRobotPartListIndex(std::string strID, bool bThrowError=true)
Finds the index of a robot part attached to this body part with the matching ID.
Declares the data chart manager class.
virtual void ResetSimulation()
Resets the simulation back to time 0.
Declares the rigid body class.
virtual void TimeStepModified()
If the time step is modified then we need to recalculate the length of the delay buffer.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
Declares the structure class.
virtual void VisualSelectionModeChanged(int iNewMode)
Visual selection mode changed.
Declares the odor type class.
virtual void VisualSelectionModeChanged(int iNewMode)
Called when the visual selection mode changed in GUI.
Declares the simulator class.
Declares the activated item manager class.
Declares the external stimuli manager class.
virtual CStdArray< RobotPartInterface * > * GetRobotPartInterfaces()
Gets a pointer to the roboto part interface associated with this body part.
Declares the receptive field class.
virtual float GetChildFloat(std::string strElementName)
Gets a float value from the element with the specified name.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.