11 #include "IMovableItemCallback.h"
12 #include "ISimGUICallback.h"
15 #include <sys/types.h>
20 #include "IPhysicsMovableItem.h"
21 #include "IPhysicsBody.h"
23 #include "MovableItem.h"
90 {
Std_TraceMsg(0,
"Caught Error in desctructor of AnimatBase\r\n",
"", -1,
false,
true);}
182 THROW_ERROR(Al_Err_lIDBlank, Al_Err_strIDBlank);
271 CStdSerialize::Copy(lpSource);
286 #pragma region DataAccesMethods
318 THROW_ERROR(Al_Err_lSimulationNotDefined, Al_Err_strSimulationNotDefined);
343 THROW_TEXT_ERROR(Al_Err_lDataPointNotFound, Al_Err_strDataPointNotFound, (
"ID: " +
m_strID +
" Name: " +
m_strName));
373 if(strDataType ==
"NAME")
379 if(strDataType ==
"CALL_INIT")
387 THROW_TEXT_ERROR(Al_Err_lDataPointNotFound, Al_Err_strDataPointNotFound, (
"ID: " +
m_strID +
" Name: " +
m_strName));
449 aryProperties.Add(
new TypeProperty(
"Name", AnimatPropertyType::String, AnimatPropertyDirection::Set));
466 CStdPtrArray<TypeProperty> aryProperties;
470 int iCount = aryProperties.GetSize();
471 for(
int iIdx=0; iIdx<iCount; iIdx++)
479 AnimatPropertyType AnimatBase::PropertyType(
const std::string &strName)
481 CStdPtrArray<TypeProperty> aryProperties;
485 int iCount = aryProperties.GetSize();
486 for(
int iIdx=0; iIdx<iCount; iIdx++)
488 return aryProperties[iIdx]->m_eType;
490 return AnimatPropertyType::Invalid;
513 bool AnimatBase::AddItem(
const std::string &strItemType,
const std::string &strXml,
bool bThrowError,
bool bDoNotInit)
517 THROW_TEXT_ERROR(Al_Err_lItemTypeInvalid, Al_Err_strItemTypeInvalid, (
"ID: " +
m_strID +
" ItemType: " + strItemType));
542 THROW_TEXT_ERROR(Al_Err_lItemNotFound, Al_Err_strItemNotFound, (
"ID: " +
m_strID));
549 #pragma region SimulationMethods
689 #pragma region SnapshotMethods
783 THROW_ERROR(Al_Err_lIDBlank, Al_Err_strIDBlank);
virtual void ResetSimulation()
Resets the simulation back to time 0.
virtual void ReInitialize()
Re-initialize this object.
Base class file for all Animat simulation objects.
Declares the nervous system class.
Declares the simulation recorder class.
virtual void RemoveFromObjectList(AnimatBase *lpItem)
Removes an object from the list of all simulation objects.
virtual void SetSystemPointers(Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify)
Sets the system pointers.
Simulates the entire environment.
std::string Std_CreateAppID()
Gets the standard create application identifier.
virtual void LoadKeyFrameSnapshot(byte *aryBytes, long &lIndex)
Loads a key frame snapshot.
AnimatBase()
Constructs an AnimatBase object.
Root namespace for the base simulation library for AnimatLab.
virtual void SimPausing()
Called just before the simulation pauses.
AnimatSim::Behavior::NeuralModule * m_lpModule
The pointer to this items parentNeuralModule. If this is not relevant for this object then this is NU...
Declares the body part class.
virtual void Kill(bool bState=true)
Kills.
virtual std::string Type()
returns the string type name of this object.
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.
virtual bool HasProperty(const std::string &strName)
Queries this object if it has a property with the given name.
virtual Node * GetNode()
Gets the node.
virtual float * GetDataPointer(const std::string &strDataType)
Returns a float pointer to a data item of interest in this object.
Class that stores information about types for QueryProperty information.
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 link base class.
virtual void SimStarting()
Called just before the simulation starts.
virtual void AfterResetSimulation()
Called after a simulation reset for some objects.
Declares the key frame class.
virtual Simulator * GetSimulator()
Gets the simulator pointer.
Declares the joint class.
Declares the organism class.
AnimatSim::Environment::Structure * m_lpStructure
The pointer to this items parent Structure. If this is not relevant for this object then this is NULL...
std::string m_strID
The unique Id for this object.
Declares the activated item class.
Declares a light manager object.
virtual void Reset()
Resets this object.
Declares the bounding box class.
virtual std::string Name()
Gets the name of this object.
Declares the gain base class.
virtual bool Enabled()
Tells whether this item is enabled or not. This is not actually used for all objects, only specific ones. I am putting it in the base class though to prevent numerous duplications.
A standard xml manipulation class.
Node * m_lpNode
The pointer to this items parent Node. If this is not relevant for this object then this is NULL...
virtual bool Selected()
Tells if this items is selected or not.
A "static" structure in the simulation.
virtual void StepSimulation()
Step the simulation for this object.
virtual bool AddItem(const std::string &strItemType, const std::string &strXml, bool bThrowError=true, bool bDoNotInit=false)
Adds a new object to this parent.
virtual void SaveKeyFrameSnapshot(byte *aryBytes, long &lIndex)
Saves a key frame snapshot.
virtual NeuralModule * GetNeuralModule()
Gets the neural module.
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
virtual std::string GetChildString(std::string strElementName)
Gets a string value from the element with the specified name.
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.
bool m_bEnabled
Tells if this item is enabled or not. If it is not enabled then it is not run.
virtual ~AnimatBase()
Destroys the AnimatBase object..
Base class for body parts and neural network nodes.
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
std::string Std_ToStr(std::string strVal)
Converts a value to a string.
virtual Structure * GetStructure()
Gets the structure for this node.
bool Std_IsBlank(std::string strVal)
Trims a string and tests if a string is blank.
Declares the data chart manager class.
Declares the rigid body class.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
virtual void SimStopping()
Called just before the simulation stops.
virtual bool RemoveItem(const std::string &strItemType, const std::string &strID, bool bThrowError=true)
Removes a child item from this parent.
Declares the structure class.
virtual void VisualSelectionModeChanged(int iNewMode)
Visual selection mode changed.
Declares the odor type class.
virtual long CalculateSnapshotByteSize()
Calculates the snapshot byte size.
Standard serialize class.
virtual void VerifySystemPointers()
Verify that system pointers have been set correctly.
Declares the simulator class.
Declares the neural module class.
bool m_bSelected
Tells whether the object is selected or not.
Declares the activated item manager class.
Declares the external stimuli manager class.
std::string m_strType
The type for this object. Examples are Box, Plane, Neuron, etc..
virtual void AddToObjectList(AnimatBase *lpItem)
Adds an object to the list of all simulation objects.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
Declares the receptive field class.
std::string m_strName
The name for this object.