8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
13 #include "IPhysicsMovableItem.h"
14 #include "IPhysicsBody.h"
16 #include "MovableItem.h"
83 void Sensor::LatitudeSegments(
int iVal)
85 Std_IsAboveMin((
int) 10, iVal,
true,
"Sensor.LatitudeSegments",
true);
92 void Sensor::LongtitudeSegments(
int iVal)
94 Std_IsAboveMin((
int) 10, iVal,
true,
"Sensor.LongtitudeSegments",
true);
107 bool Sensor::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
111 if(RigidBody::SetData(strType, strValue,
false))
114 if(strType ==
"RADIUS")
116 Radius((
float) atof(strValue.c_str()));
120 if(strType ==
"LATITUDESEGMENTS")
122 LatitudeSegments(atoi(strValue.c_str()));
126 if(strType ==
"LONGTITUDESEGMENTS")
128 LongtitudeSegments(atoi(strValue.c_str()));
134 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
139 void Sensor::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
141 RigidBody::QueryProperties(aryProperties);
143 aryProperties.Add(
new TypeProperty(
"Radius", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
144 aryProperties.Add(
new TypeProperty(
"LatitudeSegments", AnimatPropertyType::Integer, AnimatPropertyDirection::Set));
145 aryProperties.Add(
new TypeProperty(
"LongtitudeSegments", AnimatPropertyType::Integer, AnimatPropertyDirection::Set));
158 void Sensor::Load(
CStdXml &oXml)
160 RigidBody::Load(oXml);
Sensor()
Default constructor.
virtual bool AllowRotateDragX()
Gets whether this body part can be rotated along the x-axis by the user with the drag handlers...
Base class file for all Animat simulation objects.
virtual void CreateParts()
Allows the rigid body to create its parts using the chosen physics engine.
Declares the simulation recorder class.
Root namespace for the base simulation library for AnimatLab.
virtual bool AllowRotateDragY()
Gets whether this body part can be rotated along the y-axis by the user with the drag handlers...
virtual bool AllowRotateDragZ()
Gets whether this body part can be rotated along the z-axis by the user with the drag handlers...
Declares the body part class.
virtual float Radius()
Gets the radius.
Simulator * m_lpSim
The pointer to a Simulation.
virtual bool IntoElem()
Goes into the next element where the cursor is located.
int m_iLongtitudeSegments
Number of segments along the longtitude direction that are used to build the sphere.
Class that stores information about types for QueryProperty information.
Declares the key frame class.
virtual void Initialize()
Initializes this object.
Declares the joint class.
Declares the organism class.
virtual int GetChildInt(std::string strElementName)
Gets an integer value from the element with the specified name.
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 Resize()
Called when this object has been resized.
Declares the activated item class.
Declares a light manager object.
float m_fltDensity
Uniform density for the rigid body.
Declares the bounding box class.
A standard xml manipulation class.
virtual void CreateJoints()
Allows the rigid body to create its joints using the chosen physics engine.
int m_iLatitudeSegments
Number of segments along the latitude direction that are used to build the sphere.
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
Declares the sensor class.
Declares the data chart manager class.
Declares the rigid body class.
virtual ~Sensor()
Destructor.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
Joint * m_lpJointToParent
Declares the structure class.
Declares the odor type class.
virtual float InverseDistanceUnits()
Gets the inverse distance units.
Declares the simulator class.
float m_fltRadius
The radius of the sensor part. It is shown as a sphere object.
Declares the activated item manager class.
Declares the external stimuli manager class.
Declares the receptive field class.
virtual float GetChildFloat(std::string strElementName)
Gets a float value from the element with the specified name.