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

cybprotoc.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 CYBPROTOC_H
00027 #define CYBPROTOC_H
00028 
00029 #include <math.h>
00030 #include <stdio.h>
00031 #include <fstream>
00032 
00033 #include "oaw/misc/stringc.h"
00034 #include "oaw/misc/arrayc.h"
00035 #include "oaw/ctk/cybnodec.h"
00036 #include "oaw/misc/vectorc.h"
00037 #include "cybgroupc.h"
00038 #include "cybscriptc.h"
00039 #include "cybworldc.h"
00040 #include "oaw/misc/idmapc.h"
00041 #include "../oawconfig.h"
00042 
00043 OAW_BEGIN_NAMESPACE
00044 
00045 
00046 class CybGLViewC;
00047 class CybViewC;
00048 class CybExternProtoC;
00049 
00050 //#define TRUE 1
00051 //#define FALSE 0
00052 
00056 
00057 class OAW_DLLMAPPING CybProtoC : public CybScriptC
00058 {
00059 protected:
00060   StringC m_file;  // for externprotos
00061   CybGroupC*    m_pGroup;
00062   bool          m_bActive;
00063   StringC        m_name;
00064 private:
00065   KetteC<DefUseC> m_DEFList;
00066   IDMapC<CybNodeC*> m_idNodeMap;
00067   
00068   ArrayC<ArrayXpEventPipeX> m_pFieldPipes;
00069   ArrayC<ArrayXpEventPipeX> m_pEventInPipes;
00070     
00071 public:
00072   virtual void FinishInit();
00073   virtual int AddSrc(CybNodeC*,const StringC&,const StringC&);
00074   virtual int AddDes(EventDesI*,const StringC&,long);
00075   virtual void SetEvent(long,const void*, BaseI*);
00076   const StringC& GetFile(){ return m_file;}
00077 
00078 public:
00079   CybProtoC(CybWorldC*);
00080   virtual ~CybProtoC();
00081   bool IsActive() const {return m_bActive;}
00082   virtual void ToChannel(CybChannelC*,long flag);
00083   virtual int SetNode(CybNodeC*);
00084   virtual void LoadVRML(char*&, const char*,long&);
00085   virtual void LoadFromVRMLExtern(char*&, const char*,long&);
00086 
00087   const StringC& GetName(){return m_name;}
00088 
00089   CybNodeC* GetDefineNode(const StringC&);
00090   void DefineNode(CybNodeC*, const StringC&);
00091 
00092   long GetFreeNodeIDProto(CybNodeC* pN);//{return m_idNodeMap.add(pN);}
00093   void SetNodeToProtoID(long id, CybNodeC* pN);//{m_idNodeMap.set(id,pN);}
00094   void FreeNodeIDProto(long id,CybNodeC*);//{m_idNodeMap.remove(id);}
00095   CybNodeC* GetNodeToIDProto(long id){return m_idNodeMap.get(id);}
00096   void PrintNodeTable();
00097 
00098   virtual const CybBInfoC& GetBInfo();
00099   virtual void GetMessageAsObjectI(void*,long,SharedObjectC*);
00100  
00101   virtual void Load_eventIn(char*&, const char*,long&);
00102   //  virtual void Load_eventOut(char*&, const char*,long&);
00103   virtual void Load_myfield(char*&, const char*,long&);
00104   virtual void Load_exposedField(char*&, const char*,long&);
00105   
00106   virtual CybNodeC* CreateNew();
00107 protected:
00108   virtual void LoadVRMLInst(char*&, const char*,long&);
00109 protected:
00110   virtual void InitChilds();
00111   // Serialization
00112 private:
00113   static char VRMLKeyStrList[][30];
00114   short m_bInitReady;
00115 };
00116 
00117 OAW_END_NAMESPACE
00118 
00119 
00120 #endif
00121 
00122 
00123 
00124 
00125 
00126 
00127 
00128 
00129 
00130 
00131 
00132 

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