00001 #ifndef OglGui_ClusterApp_h
00002 #define OglGui_ClusterApp_h
00003
00004 #include "OglGui/Cluster.h"
00005 #include "OglGui/WindowView2D.h"
00006
00007 namespace OglGui
00008 {
00009
00010 class ClusterApp : public Window
00011 {
00012 public:
00013 ClusterApp(int x, int y, int w, int h) :
00014 Window(x, y, w, h)
00015 {
00016 Init(w,h);
00017 }
00018 ClusterApp(Window* wnd, int w, int h) :
00019 Window(wnd, w, h)
00020 {
00021 Init(w,h);
00022 }
00023 ClusterApp(Window* wnd, int x, int y, int w, int h) :
00024 Window(wnd, x, y, w, h)
00025 {
00026 Init(w,h);
00027 }
00028
00029 Cluster* ClusterWnd() { return mCluster; }
00030 WindowView2D* WndView2D() { return mWndView2D; }
00031
00032 void InitViewers()
00033 {
00034 mCluster->InitClusterViewers();
00035 }
00036
00037 virtual void DisplayFunc()
00038 {
00039 int w, h;
00040 GetDimensions(w,h);
00041 mCluster->SetDimensions(w/3, 0, 2*w/3, h);
00042 mControl->SetDimensions(0, 0, w/3, h);
00043 mWndView2D->SetDimensions(0, h/2, w/3, h/2);
00044 oglSys.SetDimensions(mNavOGLWND, 0, 0, w/3, h/2);
00045 }
00046
00047 private:
00048
00049 Cluster* mCluster;
00050 Window* mControl;
00051 WindowView2D* mWndView2D;
00052 OGLWND* mNavOGLWND;
00053
00054 void Init(int w, int h)
00055 {
00056 mCluster = new Cluster(this, w/3, 0, 2*w/3, h);
00057 mControl = new Window(this, 0, 0, w/3, h);
00058 mWndView2D = new WindowView2D(mControl, 0, h/2, w/3, h/2);
00059
00060 mCluster->DetailImageInterface(mWndView2D);
00061
00062 mNavOGLWND = Navigate2DChild(mControl->GetOGLWND(),
00063 mCluster->GetOGLWND(), 0, 0, w/3, h/2);
00064 oglSys.SetUserData(mNavOGLWND, 2, (void *) 1);
00065
00066 SetBorderType(BEV_ETCHED);
00067 mCluster->SetBorderType(BEV_ETCHED);
00068 mControl->SetBorderType(BEV_ETCHED);
00069 }
00070 };
00071
00072
00073 };
00074
00075 #endif OglGui_ClusterApp_h