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

cybsai.h

Go to the documentation of this file.
00001 #ifndef CYBSAI_H
00002 #define CYBSAI_H
00003 
00004 #include "cybwrlfields.h"
00005 #include "oaw/ctk/cybworldc.h"
00006 #include "oaw/ctk/cybproxyc.h"
00007 #include "../oawconfig.h"
00008 
00009 OAW_BEGIN_NAMESPACE
00010 
00011 
00012 class CybViewpointSensorC;
00013 class CybScriptC;
00014 class CybBatchProxyC;
00015 class CybProxyManagerC;
00016 
00017 namespace CybSAI{
00018   struct IsectResultS{
00019     SFVec3f hitPoint;
00020     SFVec3f hitNormal;
00021     SFVec2f hitTexCoord;
00022     SFFloat hitMinZ;
00023     const SFNode* pNode;
00024     SFInt32 nodeType;
00025     MFNode pDragSensors;
00026   };
00027   class OAW_DLLMAPPING ScriptC{
00028   public:
00029     ScriptC(CybScriptC* p){m_pScript=p;}
00030     virtual void SendEventOut(long id,const void* data);
00031     virtual void SendEventOutByName(const char*,const void* data);
00032   protected:
00033     CybScriptC* m_pScript;
00034   };
00035   class OAW_DLLMAPPING BrowserC{
00036   public:
00037     BrowserC(CybWorldC*,CybScriptC*);
00038     ~BrowserC();
00039     virtual MFNode* CreateVrmlFromString(const char*);
00040     virtual void Dealloc(MFNode*);
00041     virtual const SFNode* GetNode(const char*);
00042     virtual const SFNode* GetNode(const SFNode*);
00043     virtual void DecNodeRefCount(const SFNode*);
00044     virtual void IncNodeRefCount(const SFNode*);
00045     virtual const SFNode* GetNilNode(); 
00046     virtual void SetHeadtrackerOn(SFBool);
00047     virtual void SetEyedist(SFFloat);
00048     virtual SFVec3f GetUserHeadCenter();
00049     virtual SFVec3f GetViewpointPos();
00050     virtual SFVec3f GetViewpointNorm();
00051     virtual void SetViewpointPos(SFVec3f);
00052     virtual void SetViewpointNorm(SFVec3f);
00053     virtual void SetActiveViewpoint(long n);
00054     virtual short IsectSceneWithNode(SFNode*, IsectResultS&);
00055     virtual short IsectSceneWithLine(SFVec3f, SFVec3f, SFNode*, IsectResultS&);
00056     virtual const char* GetWrlHomePath();
00057     virtual const char* GetWrlMainUrl();
00058     virtual const MFString& GetArgv();
00059     virtual Matrix4C GetGlobalTransformMatrix(SFNode*);
00060     virtual void EnableNavigation(short b);
00061 
00062     virtual void Print(char *pFormat ...);
00063     virtual void PrintError(char *pFormat ...);
00064 
00065     long GetEventBufMaxDataSize();
00066     long GetEventBufMinDataSize();
00067     void SetEventBufData(AnyC& any);
00068     void CopyEventBufData(AnyC& any,long maxLen);
00069 
00070     void GarbageCollection();
00071 
00072   protected:
00073     MFNode _CreateVrmlFromString(const char*);
00074     const SFNode* GetProxyNode(CybNodeC* pN);
00075 
00076   protected:
00077     CybProxyManagerC* m_pProxyMgr;
00078     CybWorldC* m_pWorld;
00079     CybScriptC* m_pScript;
00080     CybBatchProxyC*        m_pBatchProxy;
00081     ArrayC<StringC> m_createVrmlFromStringBatch;
00082 
00083     SFVec3f vposBuf;
00084     SFVec3f vdirBuf;
00085     long avpBuf;
00086     short vposBufFlag;
00087     short vdirBufFlag;
00088     short avpBufFlag;
00089   }; 
00090   extern BrowserC Browser;
00091 };
00092 
00093 #define  FIELD(x)         (*pParams->pFields->x)
00094 #define  DATA(x)          pParams->pScriptData->x
00095 #define  EVENTOUT(x)      (*pParams->pOut->x)
00096 #define  EVENTOUTFLAG(x)  pParams->pOutFlag->x
00097 #define  SENDEVENTOUT(x,val)   pParams->script->SetEventOutByName("x",&val)
00098 #define  SETEVENTOUT(x)   pParams->pOutFlag->x=1;(*pParams->pOut->x)
00099 
00100 
00101 
00102 OAW_END_NAMESPACE
00103 
00104 
00105 #endif
00106 
00107 
00108 
00109 
00110 
00111 

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