8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
13 #include "IPhysicsMovableItem.h"
14 #include "IPhysicsBody.h"
16 #include "MovableItem.h"
62 #pragma region AccessorMutators
66 #pragma region DataAccesMethods
71 void LightManager::SetupLights()
111 bool LightManager::AddItem(
const std::string &strItemType,
const std::string &strXml,
bool bThrowError,
bool bDoNotInit)
115 if(strType ==
"LIGHT")
123 THROW_PARAM_ERROR(Al_Err_lInvalidItemType, Al_Err_strInvalidItemType,
"Item Type", strItemType);
132 if(strType ==
"LIGHT")
140 THROW_PARAM_ERROR(Al_Err_lInvalidItemType, Al_Err_strInvalidItemType,
"Item Type", strItemType);
163 for(
int iIndex=0; iIndex<iCount; iIndex++)
168 THROW_TEXT_ERROR(Al_Err_lBodyOrJointIDNotFound, Al_Err_strBodyOrJointIDNotFound,
"ID");
176 for(
int iLight=0; iLight<iCount; iLight++)
180 void LightManager::Load(
CStdXml &oXml)
188 Light *lpLight = NULL;
190 for(
int iIndex=0; iIndex<iCount; iIndex++)
214 std::string strModuleName, strType;
225 THROW_TEXT_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType,
"Light");
227 lpLight->SetSystemPointers(
m_lpSim, NULL, NULL, NULL,
true);
237 if(lpLight)
delete lpLight;
243 if(lpLight)
delete lpLight;
244 THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
virtual void Deserialize(std::string &strXml)
Deserializes a string into an xml document.
Base class file for all Animat simulation objects.
Declares the simulation recorder class.
virtual bool FindChildElement(std::string strElementName, bool fThrowError=true)
Finds a child element by name.
virtual void AddLight(std::string strXml)
Creates and adds a light.
Root namespace for the base simulation library for AnimatLab.
Declares the body part class.
virtual bool FindElement(std::string strElementName, bool fThrowError=true)
Finds an element with the specified name.
Base class for the light object.
Simulator * m_lpSim
The pointer to a Simulation.
Information about the standard error.
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.
Declares the key frame class.
virtual bool AddItem(const std::string &strItemType, const std::string &strXml, bool bThrowError=true, bool bDoNotInit=false)
Adds a new object to this parent.
Declares the joint class.
Declares the organism class.
Light * LoadLight(CStdXml &oXml)
Loads a Light.
std::string Std_Trim(std::string strVal)
Trims a string.
virtual bool RemoveItem(const std::string &strItemType, const std::string &strID, bool bThrowError=true)
Removes a child item from this parent.
virtual void RemoveLight(std::string strID, bool bThrowError=true)
Removes the light with the specified ID.
Declares the activated item class.
virtual CStdSerialize * CreateObject(std::string strModule, std::string strClassName, std::string strType, bool bThrowError=true)
Creates an object using a class factory.
Declares a light manager object.
virtual ~LightManager(void)
Destructor.
Declares the bounding box class.
A standard xml manipulation class.
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.
CStdPtrArray< Light > m_aryLights
Array of Light objects.
virtual int NumberOfChildren()
Gets the number of children of the current element.
LightManager(void)
Default constructor.
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.
Declares the structure class.
Declares the odor type class.
Declares the simulator class.
virtual bool FindChildByIndex(int iIndex, bool bThrowError=true)
Finds a child element by index.
std::string Std_ToUpper(std::string strVal)
Converts a string to upper case.
Declares the activated item manager class.
virtual int FindChildListPos(std::string strID, bool bThrowError=true)
Finds the array index for the light with the specified ID.
Declares the external stimuli manager class.
virtual void Initialize()
Initializes this object.
virtual void LightNumber(int iVal)
Sets the light number.
Declares the receptive field class.