00001 00009 #ifndef __UIUC_CHARM_LV3D_SERVER_1_H 00010 #define __UIUC_CHARM_LV3D_SERVER_1_H 00011 00012 #include "lv3d0_server.h" 00013 00014 #define LV3D_USE_FLAT 1 /* include link to liveViz 2D image assembly */ 00015 #if LV3D_USE_FLAT 00016 #include "liveViz.h" 00017 #else 00018 class liveVizRequestMsg; 00019 #endif 00020 00021 #include "lv3d1.decl.h" /* for message superclasses */ 00022 00024 class LV3D1_ServerMgr : public LV3D_ServerMgr { 00025 CProxy_LV3D_Array a; 00026 public: 00027 00028 LV3D1_ServerMgr(const CProxy_LV3D_Array &a_) :a(a_) {} 00029 virtual void newClient(int clientID) { 00030 a.LV3D_NewClient(clientID); 00031 } 00032 virtual void newViewpoint(LV3D_ViewpointMsg *m) { 00033 a.LV3D_Viewpoint(m); 00034 } 00035 virtual void doBalance(void); 00036 }; 00037 00043 void LV3D1_Attach(CkArrayOptions &opts); 00044 00045 00052 void LV3D1_Init(CkArrayID LV3D_ArrayID,LV3D_Universe *theUniverse=0); 00053 00054 00063 class LV3D_RenderMsg : public CMessage_LV3D_RenderMsg { 00064 public: 00065 int clientID; //Unique identifier for this client 00066 int frameID; //0 is first frame, then incrementing 00067 int viewableID; //Viewable to render 00068 00072 static LV3D_RenderMsg *new_(int client,int frame,int viewable,double prioAdj); 00073 static void delete_(LV3D_RenderMsg *m); 00074 }; 00075 00076 00077 class impl_LV3D_Array; 00078 00091 class LV3D_Array : public CBase_LV3D_Array { 00092 impl_LV3D_Array *impl; 00093 void init(); 00094 public: 00095 LV3D_Array(void) {init();} 00096 LV3D_Array(CkMigrateMessage *m) :CBase_LV3D_Array(m) {init();} 00097 00113 void addViewable(CkViewable *v); 00114 void removeViewable(CkViewable *v); 00115 00116 virtual void pup(PUP::er &p); 00117 ~LV3D_Array(); 00118 00119 // Network-called methods: 00123 virtual void LV3D_NewClient(int clientID); 00124 00128 virtual void LV3D_Prepare(void); 00129 00133 virtual void LV3D_DoBalance(void); 00134 00140 virtual void LV3D_Viewpoint(LV3D_ViewpointMsg *m); 00141 00145 virtual void LV3D_Render(LV3D_RenderMsg *m); 00146 00151 virtual void LV3D_FlatRender(liveVizRequestMsg *m); 00152 }; 00153 00154 #endif