📄 shareddata.h
字号:
/*********************************************************************************** In the name of Almighty ** ** SharedData.h : Robocup 3D Soccer Simulation Team Zigorat ** ** Date: 07/08/2007 ** Author: Mahdi Hamdarsi <hamdarsi@gmail.com> ** Comments: This file contains class declerations for serveral inter-thread ** communication tasks ** ***********************************************************************************//*! \file SharedData.h<pre><b>File:</b> SharedData.h<b>Project:</b> Robocup Soccer Simulation Team: Zigorat<b>Authors:</b> Mahdi Hamdarsi<b>Created:</b> 07/08/2007<b>Last Revision:</b> $ID$<b>Contents:</b> This file contains class declerations for serveral inter-thread communication tasks.<hr size=2><h2><b>Changes</b></h2><b>Date</b> <b>Author</b> <b>Comment</b>07/08/2007 Mahdi Initial version created</pre>*/#ifndef _SHARED_DATA_#define _SHARED_DATA_#include <iostream>#include <pthread.h>#include "Geometry.h"using namespace std;/********************************************************************************//********************************* Class TMutex *******************************//********************************************************************************//*! This class is wrapper of a mutex to guide inter-thread data access */class TMutex{ protected: pthread_mutex_t m_Mutex; /*!< Mutex identifier */ public: TMutex ( ); void lock ( ); void unlock ( );};/*! CommandT enumeration represents all kinds of commands that the two engines can send to each other */enum CommandT{ CMD_ILLEGAL, CMD_NODE_CREATE, CMD_NODE_RESIZE, CMD_NODE_POSITION, CMD_NODE_RENAME, CMD_NODE_RESHAPE, CMD_NODE_MASS, CMD_NODE_REPARRENT, CMD_NODE_REMATERIAL, CMD_NODE_DELETE, CMD_NODE_MAX, CMD_JOINT_CREATE, CMD_JOINT_DELETE, CMD_JOINT_RETYPE, CMD_JOINT_REPARRENT, CMD_JOINT_RECHILD, CMD_JOINT_OBJECT, CMD_JOINT_ANCHOR, CMD_JOINT_MOTOR, CMD_JOINT_PERCEPTOR, CMD_JOINT_EFFECTOR, CMD_JOINT_AXIS};/*! TMaterial is an enumeration of all different meterial types */enum TMaterial{ MAT_ILLEGAL, /*!< Unknown material */ MAT_RED, /*!< Red material */ MAT_GREEN, /*!< Green material */ MAT_GREY, /*!< Grey material */ MAT_BLUE, /*!< Blue material */ MAT_DARKGREY, /*!< Dark grey material */ MAT_WHITE, /*!< White material */ MAT_YELLOW /*!< Yellow material */};/*! TShape is an enumeration of all kinds of shapes that a node can have */enum TShape{ SHAPE_ILLEGAL, /*!< Unknown shape*/ SHAPE_SPHERE, /*!< Shape is a sphere */ SHAPE_BOX, /*!< Shape is a box */ SHAPE_CYLINDER, /*!< Shape is a cylinder */ SHAPE_CAPSULE, /*!< Shape is a capsule */};/*! TJoint is an enumeration to represent types of joints */enum TJoint{ JOINT_ILLEGAL, /*!< Unknown joint type */ JOINT_FIXED, /*!< A Fixed joint*/ JOINT_HINGE, /*!< A Hinge joint */ JOINT_HINGE2, /*!< A Hinge 2 joint */ JOINT_UNIVERSAL /*!< A universal joint */};/*! TDataType is an enumeration of all possible types of storages that can be used in this framework. Currently numbers and strings are supported */enum TDataType{ DT_NUMBER, /*!< Represents a number as data */ DT_STRING, /*!< Represents a text as data */ DT_ILLEGAL /*!< Represents an illegal data */};/********************************************************************************//********************************* Class TMutex *******************************//********************************************************************************//*! This class represents a message beween the engines */class TMessage{ public: string m_Name; /*!< Name of the node or joint to change */ int m_ParrentIndex; /*!< Index of parrent of node */ CommandT m_Command; /*!< Command to apply */ VecPosition m_Size; /*!< Size of the components (for nodes) */ VecPosition m_Position; /*!< Position of the component */ int m_Shape; /*!< Shape of the component */ unsigned m_Index; /*!< Index of node or joint to edit */ double m_Mass; /*!< Mass of node */ TMaterial m_Material; /*!< Material of node */ double m_Force; /*!< Motor force of node */ int m_Number; /*!< Number of motor or axis to edit */ // Constructor TMessage ( ); void clear ( );};#endif // _SHARED_DATA_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -