Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

cybscriptc.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 1999  Carsten Winkelholz
00003 
00004 Address:  FGAN Forschungsgesellschaft fr Angewandte Naturwissenschaften e. V.
00005       Neuenahrer Str. 20
00006       D - 53343 Wachtberg
00007       
00008 Email:    winkelholz@fgan.de
00009 
00010 This program is free software; you can redistribute it and/or
00011 modify it under the terms of the GNU General Public License
00012 as published by the Free Software Foundation; either version 2
00013 of the License, or (at your option) any later version.
00014 
00015 This program is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 GNU General Public License for more details.
00019 
00020 You should have received a copy of the GNU General Public License
00021 along with this program; if not, write to the Free Software
00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023 */
00024 
00025 
00026 #ifndef CYBSCRIPTC_H
00027 #define CYBSCRIPTC_H
00028 
00029 #include "oaw/ctk/cybnodec.h"
00030 #include "oaw/misc/stringc.h"
00031 #include "oaw/misc/arrayc.h"
00032 #include "oaw/misc/msgpsgc.h"
00033 #include "oaw/misc/eventpipec.h"
00034 #include "oaw/ctk/cybinterfacec.h"
00035 #include "oaw/misc/arrayc.h"
00036 #include "../oawconfig.h"
00037 
00038 OAW_BEGIN_NAMESPACE
00039 
00040 
00041 typedef ArrayC<EventPipeC> ArrayXpEventPipeX ;
00042 typedef ArrayC<StringC> StringArrayC;
00043 
00044 class CybProxyC;
00045 class CybScriptC;
00046 class CybBatchProxyC;
00047 class CybProxyManagerC;
00048 typedef CybProxyC SFNode;
00049 
00050 #define NODE_BUFEVENT_MINLEN 50*sizeof(double)
00051 
00052 class OAW_DLLMAPPING CybScriptC_Impl : public ObjectI{
00053 public:
00054   virtual void init_impl(CybScriptC*,void*)=0;
00055   virtual StringC GetWrlInterfaceDef() = 0;
00056 };
00057 
00058 class OAW_DLLMAPPING CybScriptC : public CybInterfaceC
00059 {
00060 //  friend CybProxyC;
00061 public:
00062   CybScriptC(CybWorldC*);
00063   virtual ~CybScriptC();
00064   CybScriptC(const CybScriptC&);
00065   CybScriptC& operator = (const CybScriptC&);  
00066   virtual CybNodeC* CreateNew();
00067   
00068   virtual int AddSrc(CybNodeC*,const StringC&,const StringC&);
00069   virtual int AddDes(EventDesI*,const StringC&,long);
00070   virtual void SetEvent(long,const void*, BaseI*);
00071   virtual long BufEvent(long,const void*, BaseI*);
00072   virtual long GetEventBufMaxDataSize();
00073   virtual long GetEventBufMinDataSize();
00074   virtual short CopyEventBuf(AnyC&,long);
00075   virtual short SetEventBuf(AnyC&, BaseI*);
00076   virtual long GetFieldEventID(const char*); 
00077   virtual long GetFieldDataType(long);
00078   virtual short GetFieldData(long ix,void* data);
00079   virtual short SendingEventsToActPasIntfcs();
00080 
00081   ArrayC<StringArrayC> GetInterfaceDescription(); 
00082 
00083   short ReplaceEventInFunc(const StringC&, void*);
00084   void AddEventIn(long,StringC, void* pFunc = 0);
00085   void AddEventOut(long,StringC);
00086   void AddField(long,StringC,void*);
00087   void SetImpl(CybScriptC_Impl* p);
00088   
00089   virtual void Load_eventIn(char*&, const char*,long&);
00090   virtual void Load_eventOut(char*&, const char*,long&);
00091   virtual void Load_myfield(char*&, const char*,long&);
00092   virtual void Load_exposedField(char*&, const char*,long&);
00093   virtual void Load_url(char*&, const char*,long&);
00094   virtual void Load_End(char*&, const char*,long&);
00095   virtual void LoadVRML(char*&, const char*,long&);
00096   virtual void FinishInit();
00097   
00098   virtual void InitByVRML(char*&, const char*,long&);
00099   
00100   virtual void EventCascadeBegin();
00101   virtual void EventCascadeEnd();
00102 
00103   virtual void SetInterfaceData(AnyC&); 
00104   virtual void CopyInterfaceData (AnyC&,long maxLen);
00105   
00106   virtual long GetInterfaceDataMinLength();
00107   virtual long GetInterfaceDataMaxLength();
00108   virtual void SetType(int i);
00109   
00110   virtual void GetMessageAsObjectI(void*,long,SharedObjectC*);
00111 
00112   void AllocFieldsFromDLL();
00113   void DeallocFieldsFromDLL();
00114 
00115   virtual ArrayC<CybNodeC*> GetRouteList();
00116 
00117   void SetEventOutData(long,const void*);
00118   long GetEventOutIx(const StringC&);
00119 
00120   MsgPsgC* GetMsgPsgObj(){ return m_pMP;}
00121 
00122   const CybProxyC* GetProtoProxy(){return m_pProtoProxy;}
00123   CybBatchProxyC* GetBatchProxy(){return m_pBatchProxy;}
00124 //  CybProxyC* CreateProxyNode(CybNodeC*);
00125   CybProxyManagerC* GetProxyManager(){return m_pProxyMgr;}
00126 
00127   void UpdateEventOutpValue();
00128   
00129 protected:
00130   void Init_impl();
00131   void CreateNewScriptCopy(CybScriptC* pN);
00132   void SetMsgPsgObject(MsgPsgC*);
00133   void InitMsgPsgObject();
00134   virtual void RouteData();
00135   virtual void Process();
00136   //long GetEventOutDataLength();
00137 
00138 private:
00139   void CopyFieldData(const CybScriptC& n);
00140   void RouteEventOut();
00141   const CybProxyC* GetProxyNode(const SFNode*);
00142 
00143 protected:
00144   
00145   //ArrayC<CybProxyC*>        m_proxyNode;
00146 
00147   ArrayC<StringC>            m_eventInName;
00148   ArrayC<long>              m_eventInType;
00149   ArrayC<long>              m_eventInIx;
00150   ArrayC<void*>              m_eventInFunc;
00151   
00152   ArrayC<StringC>            m_eventOutName;
00153   ArrayC<long>              m_eventOutType;
00154   ArrayC<long>              m_eventOutIx;
00155   ArrayC<void*>              m_eventOutpValue;
00156   ArrayC<short*>            m_eventOutpFlag;
00157   
00158   ArrayC<StringC>            m_fieldName;
00159   ArrayC<long>              m_fieldType;
00160   ArrayC<long>              m_fieldIx;
00161   ArrayC<void*>              m_fieldData;
00162   StringC                    m_urlString;
00163   
00164   ArrayC<ArrayXpEventPipeX> m_pEventOutPipes;
00165   
00166   MsgPsgC*              m_pMP;
00167   CybBatchProxyC*        m_pBatchProxy;
00168   CybProxyC*            m_pProtoProxy;
00169   CybScriptC_Impl*      m_pScript_Impl;
00170 
00171   short m_bInitialized;
00172 
00173   short m_bHaveNodeFields;
00174 
00175   CybProxyManagerC* m_pProxyMgr;
00176   
00177 private:
00178   static char VRMLKeyStrList[][30];
00179   static char ValueKeyStrList[][30];
00180 };
00181 
00182 OAW_END_NAMESPACE
00183 
00184 
00185 #endif
00186 
00187 
00188 
00189 
00190 
00191 
00192 
00193 
00194 
00195 
00196 
00197 
00198 
00199 
00200 

Generated on Tue Jul 29 14:24:12 2003 for Open ActiveWrl by doxygen1.3-rc2