8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
13 #include "IPhysicsMovableItem.h"
14 #include "IPhysicsBody.h"
16 #include "MovableItem.h"
89 Std_IsAboveMin((
int) 10, iVal,
true,
"Sphere.LatitudeSegments",
true);
114 Std_IsAboveMin((
int) 10, iVal,
true,
"Sphere.LongtitudeSegments",
true);
129 bool Sphere::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
133 if(RigidBody::SetData(strType, strValue,
false))
136 if(strType ==
"RADIUS")
138 Radius((
float) atof(strValue.c_str()));
142 if(strType ==
"LATITUDESEGMENTS")
148 if(strType ==
"LONGTITUDESEGMENTS")
156 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
161 void Sphere::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
163 RigidBody::QueryProperties(aryProperties);
165 aryProperties.Add(
new TypeProperty(
"Radius", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
166 aryProperties.Add(
new TypeProperty(
"LatitudeSegments", AnimatPropertyType::Integer, AnimatPropertyDirection::Set));
167 aryProperties.Add(
new TypeProperty(
"LongtitudeSegments", AnimatPropertyType::Integer, AnimatPropertyDirection::Set));
170 void Sphere::Load(
CStdXml &oXml)
172 RigidBody::Load(oXml);
virtual ~Sphere()
Destructor.
Base class file for all Animat simulation objects.
Declares the simulation recorder class.
Declares the sphere class.
int m_iLongtitudeSegments
Number of segments along the longtitude direction that are used to build the sphere.
Root namespace for the base simulation library for AnimatLab.
Declares the body part class.
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.
Declares the key frame 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.
int m_iLatitudeSegments
Number of segments along the latitude direction that are used to build the sphere.
Declares a light manager object.
Sphere()
Default constructor.
Declares the bounding box class.
A standard xml manipulation class.
float m_fltRadius
The radius of the sphere.
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
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 int LongtitudeSegments()
Gets the longtitude segments.
Declares the structure class.
Declares the odor type class.
virtual float Radius()
Gets the radius.
virtual float InverseDistanceUnits()
Gets the inverse distance units.
Declares the simulator class.
Declares the activated item manager class.
Declares the external stimuli manager class.
virtual int LatitudeSegments()
Gets the latitude segments.
Declares the receptive field class.
virtual float GetChildFloat(std::string strElementName)
Gets a float value from the element with the specified name.