8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
175 #pragma region DataAccesMethods
185 THROW_TEXT_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Simulator DataType: " + strDataType);
197 if(strType ==
"LOOKATSTRUCTUREID")
203 if(strType ==
"LOOKATBODYID")
209 if(strType ==
"TRACKCAMERA")
217 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
226 aryProperties.Add(
new TypeProperty(
"LookAtStructureID", AnimatPropertyType::String, AnimatPropertyDirection::Set));
227 aryProperties.Add(
new TypeProperty(
"LookAtBodyID", AnimatPropertyType::String, AnimatPropertyDirection::Set));
228 aryProperties.Add(
new TypeProperty(
"TrackCamera", AnimatPropertyType::Boolean, AnimatPropertyDirection::Set));
290 void SimulationWindow::UpdateBackgroundColor() {}
298 void SimulationWindow::Load(std::string strXml)
305 oXml.Deserialize(strXml);
307 oXml.FindElement(
"WindowMgr");
308 oXml.FindChildElement(
"Window");
313 void SimulationWindow::Load(CStdXml &oXml)
319 if(oXml.FindChildElement(
"Position",
false))
321 if(oXml.FindChildElement(
"Size",
false))
333 THROW_TEXT_ERROR(Al_Err_lSimWinPosInvalid, Al_Err_strSimWinPosInvalid,
"POS: (" + STR(
m_ptPosition.x) +
", " + STR(
m_ptPosition.y) +
")");
335 THROW_TEXT_ERROR(Al_Err_lSimWinSizeInvalid, Al_Err_strSimWinSizeInvalid,
"Size: (" + STR(
m_ptSize.x) +
", " + STR(
m_ptSize.y) +
")");
virtual void SetupTrackCamera(bool bResetEyePos)=0
Sets up the camera tracking.
std::string m_strLookAtStructureID
Base class file for all Animat simulation objects.
virtual void SetCameraPostion(CStdFPoint vCameraPos)
Manually sets a camera position.
Root namespace for the base simulation library for AnimatLab.
virtual float * GetDataPointer(const std::string &strDataType)
Returns a float pointer to a data item of interest in this object.
~SimulationWindow(void)
Destructor.
virtual std::string LookAtStructureID()
Gets the look at structure GUID ID.
Class that stores information about types for QueryProperty information.
virtual bool StandAlone()
Gets whether this window stands alone from all others.
virtual std::string LookAtBodyID()
Gets the GUID ID of the RigidBody to look at.
bool m_bStandAlone
true if the window is seperate from all other windows.
CStdFPoint m_ptSize
Size of the window.
virtual void OnLoseFocus()
Called by the GUI when this window loses the focus.
HWND m_HWND
Handle of the hwnd.
Declares the simulation Windows Form.
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 bool UsingTrackCamera()
Gets wheter camera tracking is being used.
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
std::string m_strLookAtBodyID
virtual void SetCameraLookAt(CStdFPoint oTarget, bool bResetEyePos)
Manually sets a camera look at position.
CStdFPoint m_ptPosition
The position of the window.
bool Std_ToBool(int iVal)
Converts a value toa bool.
virtual void Load(StdUtils::CStdXml &oXml)
Loads the item using an XML data packet.
virtual void OnGetFocus()
Called by the GUI when this window gets the focus.
bool Std_IsBlank(std::string strVal)
Trims a string and tests if a string is blank.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
bool Std_LoadPoint(CStdXml &oXml, std::string strName, CStdIPoint &oPoint, bool bThrowError)
Standard load point.
virtual void SetCameraPositionAndLookAt(CStdFPoint oCameraPos, CStdFPoint oTarget)
Manually sets a camera position and look at position.
SimulationWindow(void)
Default constructor.
virtual HWND WindowID()
Gets the HWND window identifier.
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.