00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef CYBMSGPSGC_H
00027 #define CYBMSGPSGC_H
00028
00029 #include "oaw/misc/msgpsgc.h"
00030 #include "oaw/misc/arrayc.h"
00031 #include "oaw/misc/stringc.h"
00032 #include "oaw/misc/dllc.h"
00033 #include "oaw/ctk/cybwrlfields.h"
00034 #include "oaw/ctk/cybsai.h"
00035 #include "../oawconfig.h"
00036
00037 OAW_BEGIN_NAMESPACE
00038
00039
00040 typedef void EventInSFFloat (const SFFloat&, void*,const SFTime&);
00041 typedef void EventInSFInt32 (const SFInt32&, void*,const SFTime&);
00042 typedef void EventInSFBool (const SFBool&, void*,const SFTime&);
00043 typedef void EventInSFString (const SFString&, void*,const SFTime&);
00044 typedef void EventInSFVec2f (const SFVec2f&, void*,const SFTime&);
00045 typedef void EventInSFVec3f (const SFVec3f&, void*,const SFTime&);
00046 typedef void EventInSFRotation (const SFRotation&, void*,const SFTime&);
00047 typedef void EventInSFColor (const SFColor&,const SFTime&);
00048 typedef void EventInSFTime (const SFTime&, void*,const SFTime&);
00049 typedef void EventInSFNode (const SFNode&, void*,const SFTime&);
00050
00051
00052 typedef void EventInMFFloat (const MFFloat&, void*,const SFTime&);
00053 typedef void EventInMFInt32 (const MFInt32&, void*,const SFTime&);
00054 typedef void EventInMFString (const MFString&, void*,const SFTime&);
00055 typedef void EventInMFVec2f (const MFVec2f&, void*,const SFTime&);
00056 typedef void EventInMFVec3f (const MFVec3f&, void*,const SFTime&);
00057 typedef void EventInMFRotation (const MFRotation&, void*,const SFTime&);
00058 typedef void EventInMFColor (const MFColor&,const SFTime&);
00059 typedef void EventInMFTime (const MFTime&, void*,const SFTime&);
00060 typedef void EventInMFNode (const MFNode&, void*,const SFTime&);
00061
00062 typedef void InitFunc (void*,const SFTime&);
00063 typedef void ShutdownFunc (void*,const SFTime&);
00064 typedef void EventsProcessedFunc(void*,const SFTime&);
00065 typedef void EventCascadeFunc(void*,const SFTime&);
00066 typedef long GetNodeEventsDataMaxLengthFunc();
00067
00068
00069
00070 class CybScriptC;
00071 class CybScriptC_Impl;
00072
00073
00074 class OAW_DLLMAPPING CybMsgPsgC : public MsgPsgC
00075 {
00076 public:
00077 CybMsgPsgC();
00078 virtual ~CybMsgPsgC();
00079 CybMsgPsgC(const CybMsgPsgC&);
00080 CybMsgPsgC& operator = (const CybMsgPsgC&);
00081 virtual void* GetImpl(){return this;}
00082 public:
00083
00084
00085 virtual long ReplaceEventInFunc(const char*, void*);
00086 virtual long AddEventIn(const char*, long, void*);
00087 virtual long AddEventOut(const char*, long);
00088 virtual long AddField(const char*, long, void*);
00089 virtual void TerminateInit();
00090 virtual void SetActive(short a){m_activeMsgPsg=a;}
00091
00092 virtual long GetIDEventIn(const char*,long);
00093 virtual long GetIDEventOut(const char*,long);
00094
00095
00096 virtual short GetEventOut(long, void*&,short*&);
00097 virtual short SetEventIn(void*,long,short);
00098 virtual short SetField(void*,long);
00099 virtual void Initialize(CybScriptC_Impl*);
00100
00101 virtual short ProcessEvents(short);
00102 virtual void EventCascadeBegin(short);
00103 virtual void EventCascadeEnd(short);
00104
00105
00106 virtual long GetNodeEventsDataMaxLength();
00107
00108 void SetScript(CybScriptC* pS);
00109 void SetWorld(CybWorldC* pW);
00110
00111 long GetEventBufMaxDataSize();
00112 long GetEventBufMinDataSize();
00113 void SetEventBufData(AnyC& any);
00114 void CopyEventBufData(AnyC& any,long maxLen);
00115
00116 private:
00117 struct _EventC{
00118 void* m_data;
00119 long m_srct;
00120 short m_dataCopied;
00121 };
00122 struct Params{
00123 const SFNode* thisProto;
00124 void* script;
00125 void* browser;
00126 void* pFields;
00127 void* pEventOutFlags;
00128 void* pEventOuts;
00129 void* pProcData;
00130 };
00131
00132 protected:
00133 virtual void callInitialize(const TimeC&){};
00134 virtual void callEventsProcessed(const TimeC&){};
00135 virtual void callShutdown(const TimeC&){};
00136 virtual void callEventCascadeBegin(const TimeC&){};
00137 virtual void callEventCascadeEnd(const TimeC&){};
00138 void CallFunction(long ix, void* data, TimeC& t);
00139 void SendEventOutToUser();
00140 virtual void Init(const CybMsgPsgC& n);
00141
00142 void PrintMessageQue();
00143 protected:
00144 ArrayC<StringC> m_eventInName;
00145 ArrayC<long> m_eventInType;
00146
00147 ArrayC<StringC> m_eventOutName;
00148 ArrayC<long> m_eventOutType;
00149 ArrayC<void*> m_eventOutpValue;
00150 ArrayC<short*> m_eventOutpFlag;
00151
00152 ArrayC<StringC> m_fieldName;
00153 ArrayC<long> m_fieldType;
00154 ArrayC<void*> m_fieldpValue;
00155
00156 ArrayC<_EventC> m_eventQue;
00157
00158 ArrayC<void*> m_eventInFunc;
00159
00160 short m_activeMsgPsg;
00161
00162 char* m_pEventOuts;
00163 char* m_pFields;
00164 short* m_pEventOutFlags;
00165
00166 long m_eventOutsLength;
00167 long m_fieldsLength;
00168
00169 CybWorldC* m_pWorld;
00170 CybSAI::BrowserC* m_pBrowser;
00171
00172 CybScriptC* m_pScript;
00173 long m_i;
00174
00175 InitFunc* m_pFuncInit;
00176 ShutdownFunc* m_pFuncShutdown;
00177 EventsProcessedFunc* m_pFuncEventsProcessed;
00178 EventCascadeFunc* m_pFuncEventCascadeBegin;
00179 EventCascadeFunc* m_pFuncEventCascadeEnd;
00180
00181 Params m_params;
00182
00183 };
00184
00185
00186
00187 OAW_END_NAMESPACE
00188
00189
00190 #endif
00191
00192
00193
00194
00195
00196
00197