00001 #ifndef OglGui_WindowView3D_h
00002 #define OglGui_WindowView3D_h
00003
00004 #ifndef OglGui_Window_h
00005 #include "OglGui/Window.h"
00006 #endif
00007
00008 namespace OglGui
00009 {
00010
00011 class WindowView3D : public Window
00012 {
00013 public:
00014
00015 WindowView3D(Window* parent, int x, int y, int w, int h, OGLIMAGE *oglIm=0):
00016 Window(parent, x, y, w, h, false)
00017 {
00018 Init(oglIm);
00019 }
00020
00021 WindowView3D(Window* parent, int w, int h, OGLIMAGE *oglIm=0) :
00022 Window(parent, w, h, false)
00023 {
00024 Init(oglIm);
00025 }
00026
00027 virtual void InitFunc()
00028 {
00029 Window::InitFunc();
00030 view3DSys.SetShowInfo(mOglWnd, 0, 0, 0);
00031 }
00032
00033 OGLVIEW3D* GetOglView() const
00034 {
00035 return mView;
00036 }
00037
00038 protected:
00039
00040 OGLVIEW3D *mView;
00041
00042 private:
00043
00044 void
00045 Init(OGLIMAGE *oglIm)
00046 {
00047 int w = 256, h = 256;
00048
00049 if (oglIm){
00050 w = oglIm->w;
00051 h = oglIm->h;
00052 }
00053
00054 mOglWnd->clipRounded = 1;
00055 mView = view3DSys.View3D(mOglWnd, oglIm, 0.0f, 0.0f, -3.0f,
00056 w/100.0f, h/100.0f, w/100.0f);
00057 view3DSys.SetZoom(mView, w/100.0f, h/100.0f);
00058 view3DSys.SetTags(mView, selectedTag | FlexViewTags);
00059 SetBorderType(BEV_ETCHED);
00060 oglSys.SetAllowCameraMove(mOglWnd, TRUE);
00061 oglSys.AllowPicking(mOglWnd, TRUE, TRUE);
00062 }
00063 };
00064
00065 }
00066 #endif