8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
13 #include "IPhysicsMovableItem.h"
14 #include "IPhysicsBody.h"
16 #include "MovableItem.h"
107 THROW_PARAM_ERROR(Al_Err_lPartTypeNotOdorType, Al_Err_strPartTypeNotOdorType,
"ID", strID);
117 bool OdorSensor::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
121 if(Sensor::SetData(strType, strValue,
false))
124 if(strType ==
"ODORTYPEID")
132 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
137 void OdorSensor::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
139 Sensor::QueryProperties(aryProperties);
141 aryProperties.Add(
new TypeProperty(
"OdorValue", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
143 aryProperties.Add(
new TypeProperty(
"OdorTypeID", AnimatPropertyType::String, AnimatPropertyDirection::Set));
146 float *OdorSensor::GetDataPointer(
const std::string &strDataType)
150 if(strType ==
"ODORVALUE")
153 return RigidBody::GetDataPointer(strDataType);
164 void OdorSensor::Load(
CStdXml &oXml)
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.
Declares the odor sensor class.
virtual void ResetSimulation()
Resets the simulation back to time 0.
Simulator * m_lpSim
The pointer to a Simulation.
virtual bool IntoElem()
Goes into the next element where the cursor is located.
Class that stores information about types for QueryProperty information.
OdorSensor()
Default constructor.
Declares the key frame class.
virtual std::string OdorTypeID()
Gets the odor type identifier.
Declares the joint class.
Declares the organism class.
Declares the activated item class.
Declares a light manager object.
Declares the bounding box class.
OdorType * m_lpOdorType
Pointer to the type odor to detect.
A standard xml manipulation class.
Odor type that can be emitted from a RigidBody and sensed by an OdorSensor.
CStdFPoint m_oAbsPosition
virtual std::string GetChildString(std::string strElementName)
Gets a string value from the element with the specified name.
std::string m_strOdorTypeID
Identifier for the odor type.
virtual AnimatBase * FindByID(std::string strID, bool bThrowError=true)
Searches for the object with the specified ID.
virtual void StepSimulation()
Step the simulation for this object.
virtual void SetOdorTypePointer(std::string strID)
Sets the odor type pointer.
virtual ~OdorSensor()
Destructor.
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
virtual float CalculateOdorValue(CStdFPoint &oSensorPos)
Calculates the odor value for this OdorType for a given sensor location.
Declares the sensor class.
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.
virtual void StepSimulation()
Step the simulation for this object.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
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.
Declares the receptive field class.
virtual void ResetSimulation()
Resets the simulation back to time 0.
float m_fltOdorValue
The odor concentration value.