00001 // $Id: void.h,v 1.10 2001/10/17 16:49:39 kevin Exp $ 00002 // $Copyright: (c)2001 National Biocomputation Center, Stanford University $ 00003 00004 #ifndef _VOID_H_ 00005 #define _VOID_H_ 00006 00007 #include <stdio.h> 00008 00009 #ifdef _WIN32 00010 #else 00011 #include <netinet/in.h> 00012 #endif 00013 00014 #include "point3d.h" 00015 #include "space.h" 00016 #include "socket.h" 00017 00018 class space_v : public space { 00019 public: 00020 00021 char buf[3]; 00022 00023 space_v() 00024 { 00025 us_t l; 00026 buf[0] = TYPE_VOID; 00027 l.s = htons(0); 00028 for(int i=0; i<2; i++) 00029 buf[i+1] = l.c[i]; 00030 } 00031 virtual ~space_v() 00032 { 00033 } 00034 00035 virtual void send_datas(Socket *s) 00036 { 00037 s->Send(buf, 3); 00038 } 00039 00040 virtual void use_new_datas(char *buf, int size) 00041 { 00042 } 00043 00044 virtual void erase_all() 00045 { 00046 } 00047 00048 virtual Point3D *get_force(Point3D *pos, Point3D *res) 00049 { 00050 if(res == NULL) 00051 res = new Point3D(); 00052 *res = Point3D(0,0,0); 00053 return res; 00054 } 00055 00056 virtual int istouching() 00057 { 00058 return 0; 00059 } 00060 00061 virtual void print_datas() 00062 { 00063 fprintf(stderr, "Space of void.\n"); 00064 } 00065 00066 virtual long gethash() 00067 { 00068 return 0; 00069 } 00070 }; 00071 00072 #endif
1.5.3