00001 #ifndef _NETWORK_VIEWER_H_
00002 #define _NETWORK_VIEWER_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00030 #include "../IPSA.h"
00031 #include "IpsaViewer.h"
00032 #include "instructions/Instruction.h"
00033
00034 #include <Inventor/sensors/SoTimerSensor.h>
00035
00036 class CTCPSocket;
00037 class SbThread;
00038
00039 class IPSA_VIEWER_IMPORT_EXPORT NetworkViewer : public IpsaViewer
00040 {
00041 public:
00042 NetworkViewer(std::string filename = "", SO_WINDOW parent=NULL, const char *name=NULL, SbBool embed=TRUE);
00043 virtual ~NetworkViewer();
00044 static void ReadDatagrams(void *data, SoSensor * );
00045
00046 protected:
00047 void setupNetworkThread();
00048 static void* NetworkSetup(void* data);
00049
00050 SbThread* networkThread;
00051 SoTimerSensor networkReceiveSensor;
00052 const int LISTEN_PORT;
00053
00054 private:
00055 void executeCommands(std::vector< std::vector<std::string> >& Instr);
00056 CTCPSocket* tcp_socket;
00057 std::string commands;
00058 std::map<std::string, Instruction*> instructionMap;
00059 };
00060
00061 #endif