8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
13 #include "IPhysicsMovableItem.h"
14 #include "IPhysicsBody.h"
16 #include "MovableItem.h"
72 {
Std_TraceMsg(0,
"Caught Error in desctructor of Odor\r\n",
"", -1,
false,
true);}
212 bool Odor::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
219 if(strType ==
"ENABLED")
225 if(strType ==
"QUANTITY")
231 if(strType ==
"USEFOODQUANTITY")
239 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
248 aryProperties.Add(
new TypeProperty(
"Enabled", AnimatPropertyType::Boolean, AnimatPropertyDirection::Both));
249 aryProperties.Add(
new TypeProperty(
"Quantity", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
250 aryProperties.Add(
new TypeProperty(
"UseFoodQuantity", AnimatPropertyType::Boolean, AnimatPropertyDirection::Set));
Base class file for all Animat simulation objects.
Declares the simulation recorder class.
Root namespace for the base simulation library for AnimatLab.
Declares the body part class.
virtual float FoodQuantity()
Gets the food quantity.
Simulator * m_lpSim
The pointer to a Simulation.
virtual ~Odor()
Destructor.
virtual bool IntoElem()
Goes into the next element where the cursor is located.
RigidBody * m_lpParent
Pointer to the parent RigidBody part that is emitting the odor.
Class that stores information about types for QueryProperty information.
OdorType * m_lpOdorType
Pointer to the type of odor the body part is emitting.
float m_fltQuantity
The quantity used to calculate the odor value.
Declares the key frame class.
Odor(RigidBody *lpParent)
Constructor.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
Declares the joint class.
Declares the organism class.
virtual bool Enabled()
Gets whether the odor is enabled or not.
bool Std_IsAboveMin(int iMinVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
Tests if a number is above a minimum value.
Declares the activated item class.
Declares a light manager object.
Declares the bounding box class.
virtual CStdFPoint GetCurrentPosition()
Gets the current position of this part.
virtual bool UseFoodQuantity()
Tells whether we should use the FoodQuantity of the parent RigidBody when calculating the odor value...
virtual float CalculateOdorValue(OdorType *lpType, CStdFPoint &oSensorPos)
Calculates the odor value for this Odorant for a given odor sensor somewhere in the environment...
A standard xml manipulation class.
Odor type that can be emitted from a RigidBody and sensed by an OdorSensor.
virtual OdorType * FindOdorType(std::string strOdorID, bool bThrowError=true)
Searches for the first odor type with the specified ID.
virtual float DiffusionConstant()
Gets the diffusion constant.
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.
bool Std_ToBool(int iVal)
Converts a value toa bool.
virtual float Quantity()
Gets the quantity that will be used when calculating the odor concentration.
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 AddOdorSource(Odor *lpOdor)
Adds an odor source to the list of odors that are emitting this type of odor.
bool m_bEnabled
Tells if this item is enabled or not. If it is not enabled then it is not run.
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
Declares the data chart manager class.
virtual OdorType * GetOdorType()
Gets a pointer to the odor type.
Declares the rigid body class.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
virtual void SetOdorType(std::string strType)
Sets the odor type to emit for this odorant.
Declares the structure class.
Declares the odor type class.
Declares the simulator class.
Declares the activated item manager class.
Declares the external stimuli manager class.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
The base class for all of the basic rigid body type of objects.
Declares the receptive field class.
double Std_CalculateDistance(CStdIPoint &ptA, CStdIPoint &ptB)
Calculates the distance between two points.
virtual float GetChildFloat(std::string strElementName)
Gets a float value from the element with the specified name.