00001
00002
00003
00004 #ifndef OglGui_Camera3DControl_h
00005 #define OglGui_Camera3DControl_h
00006
00007 #ifndef OglGui_CameraMoveControl_h
00008 #include "OglGui/CameraMoveControl.h"
00009 #endif
00010
00011 #ifndef OglGui_CameraRotateControl_h
00012 #include "OglGui/CameraRotateControl.h"
00013 #endif
00014
00015 namespace OglGui
00016 {
00017
00018 class Camera3DControl : public Window
00019 {
00020 public:
00021
00022 Camera3DControl(int x, int y, int w, int h, Window* wnd3D=0) :
00023 Window(x, y, w, h)
00024 {
00025 Init(w,h,wnd3D);
00026 }
00027
00028 Camera3DControl(Window *parent, int w, int h, Window* wnd3D=0) :
00029 Window(parent, w, h)
00030 {
00031 Init(w,h,wnd3D);
00032 }
00033
00034 Camera3DControl(Window *parent, int x, int y, int w,int h,Window* wnd3D=0) :
00035 Window(parent, x, y, w, h)
00036 {
00037 Init(w,h,wnd3D);
00038 }
00039
00040 void
00041 SetTargetWindow(Window* targetWnd)
00042 {
00043 mCameraMover->SetTargetWindow(targetWnd);
00044 mCameraRotator->SetTargetWindow(targetWnd);
00045 }
00046
00047 void
00048 SetGroupBorderShading(ULONG brdBg, int fillShaded)
00049 {
00050 mCameraMover->SetGroupBorderShading(brdBg, fillShaded);
00051 mCameraRotator->SetGroupBorderShading(brdBg, fillShaded);
00052 }
00053
00054
00055 CameraMoveControl* CameraMover()
00056 {
00057 return mCameraMover;
00058 }
00059
00060 CameraRotateControl* CameraRotator()
00061 {
00062 return mCameraRotator;
00063 }
00064
00065 static void PreferredSize(int& w, int &h)
00066 {
00067 w = 240;
00068 h = 174;
00069 }
00070
00071 private:
00072 CameraMoveControl* mCameraMover;
00073 CameraRotateControl* mCameraRotator;
00074
00075 void Init(int w, int h, Window* wnd3D)
00076 {
00077 int pW, pH;
00078 PreferredSize(pW,pH);
00079 mCameraMover = new CameraMoveControl(this, 0, 0, (pW/2)-2, pH, wnd3D);
00080 mCameraRotator =
00081 new CameraRotateControl(this, (pW/2)+2, 0, (pW/2)-2, pH, wnd3D);
00082 ScaleChildren();
00083 SetAllowChildScaling(false);
00084 SetDimensions(RETAIN, RETAIN, w, h);
00085 }
00086 };
00087
00088 }
00089
00090 #endif