00001
00002
00003
00004 #ifdef WIN32
00005
00006 #include "WinScene.h"
00007 #include "WinDraw.h"
00008 #include "gui/Projector.h"
00009 using namespace gui;
00010
00011 WinScene::WinScene(HWND win, float size, int initial_view )
00012 : SceneControl(m_proj = new gui::Projector(m_wd= new WinDraw(win)),size, initial_view )
00013 {
00014 }
00015
00016 WinScene::~WinScene()
00017 {
00018 delete m_wd;
00019 delete m_proj;
00020 }
00021
00022 void WinScene::redisplay()
00023
00024 {
00025 m_wd->invalidate();
00026 }
00027
00028 void WinScene::redisplay(HDC hdc)
00029
00030 {
00031 m_wd->setHDC(hdc);
00032 SceneControl::redisplay();
00033 }
00034
00035
00036 void WinScene::print_commands(std::ostream& out)
00037 {
00038 out <<
00039 "\n"
00040 "Mouse commands\n"
00041 "==============================\n"
00042 "left botton click: \t center at mouse position\n"
00043 "left botton drag: \t select viewport\n"
00044 "right botton click: \t display menu\n"
00045 "\n"
00046 "Special Keys\n"
00047 "============\n"
00048 "arrows: move reference point in selected view\n"
00049 "PgUp/PgDn: increase/decrease magnification\n"
00050 "Home: reset selected view\n"
00051 ;
00052 SceneControl::print_commands(out);
00053 }
00054
00055
00056 void WinScene::mouseDown(int ix, int iy)
00057 {
00058 m_x = m_wd->xnorm(ix);
00059 m_y = m_wd->ynorm(iy);
00060 }
00061 void WinScene::mouseUp(int ix, int iy)
00062 {
00063 SceneControl::setViewPort(m_x,m_y, m_wd->xnorm(ix), m_wd->ynorm(iy));
00064 redisplay();
00065 }
00066
00067 #endif