00001 #ifndef _JOT_GEOM_DISTRIB_H
00002 #define _JOT_GEOM_DISTRIB_H
00003
00004 #include "net/net.H"
00005 #include "net/io_manager.H"
00006 #include "disp/jot_vars.H"
00007 #include "disp/cam.H"
00008 #include "geom/geom.H"
00009 #include "geom/world.H"
00010 #include "geom/winsys.H"
00011
00012
00013 extern "C" void distrib();
00014 extern "C" void distrib_startnet(int);
00015 extern "C" void distrib_client(FD_MANAGER *, char *, int);
00016 extern "C" void distrib_cam(STDdstream *, CCAMdataptr &);
00017 extern "C" void distrib_win(STDdstream *, WINSYS *);
00018 extern "C" void distrib_view(STDdstream *, CVIEWptr &);
00019 extern "C" void distrib_done(STDdstream *);
00020 extern "C" void distrib_send_geom(CGEOMptr &);
00021 extern "C" void distrib_render_mode();
00022 extern "C" void distrib_clip_info();
00023 extern "C" void distrib_display_geom( CGELptr &, int);
00024
00025
00026
00027
00028
00029 class DISTRIB : public Network,
00030 public XFORMobs, public GRABobs, public DISPobs,
00031 public COLORobs, public EXISTobs,
00032 public GEOMobs, public TRANSPobs,
00033 public SAVEobs, public LOADobs, public CAMobs,
00034 public HASHobs, public TEXTUREobs,
00035 public JOTvar_obs
00036 {
00037 protected:
00038
00039 static DISTRIB* _d;
00040
00041 protected:
00042
00043 bool _cam_loaded;
00044 bool _processing_gate;
00045
00046 public:
00047
00048 static bool cam_loaded () { return _d && _d->_cam_loaded;}
00049 static void set_distrib (DISTRIB *d) { _d = d; }
00050 static DISTRIB* get_distrib () { return _d; }
00051
00052 public:
00053
00054 DISTRIB(FD_MANAGER *manager);
00055
00056 public:
00057
00058 void set_cam_loaded () { _cam_loaded = true; }
00059 void set_processing_gate(bool pg) { _processing_gate = pg; }
00060
00061 protected:
00062
00063 bool should_save(CGEOMptr &g);
00064
00065 bool load(NetStream &);
00066 bool save(NetStream &, bool to_file, bool full_scene);
00067
00068 LOADobs::load_status_t load_stream(NetStream &, bool from_file, bool full_scene);
00069 SAVEobs::save_status_t save_stream(NetStream &, bool to_file, bool full_scene);
00070
00071 public:
00072
00073 virtual int interpret(NETenum, NetStream *);
00074 virtual void add_client(NetStream *);
00075 virtual void remove_stream(NetStream *);
00076 int processing() const { return _processing_gate && Network::processing(); }
00077
00078
00079 public:
00080 virtual void notify_jot_var (DATA_ITEM *);
00081 virtual void notify_xform (CGEOMptr &, STATE state);
00082 virtual void notify_grab (CGELptr &, int flag);
00083 virtual void notify (CGELptr &, int flag);
00084 virtual void notify_exist (CGELptr &, int flag);
00085 virtual void notify_color (CGEOMptr &, APPEAR *);
00086 virtual void notify_transp (CGEOMptr &);
00087 virtual void notify_geom (CGEOMptr &);
00088 virtual void notify (CCAMdataptr &data);
00089 virtual void notify_hash (CGELptr &, hashdist *);
00090 virtual void notify_texture (CGEOMptr &);
00091 virtual void notify_load (NetStream &s, LOADobs::load_status_t &status, bool from_file, bool full_scene);
00092 virtual void notify_save (NetStream &s, SAVEobs::save_status_t &status, bool to_file, bool full_scene);
00093
00094 };
00095
00096 #endif