Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

WinScene.cxx

Go to the documentation of this file.
00001 //  $Header: /nfs/slac/g/glast/ground/cvs/gui/src/WinScene.cxx,v 1.1.1.1 2001/01/04 01:01:12 burnett Exp $
00002 //  Author: T. Burnett
00003 //
00004 #ifdef WIN32
00005 // Implement the WinScene widget
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 // force redraw of this window--schedules a WM_PAINT message
00024 {
00025     m_wd->invalidate();
00026 }
00027 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00028 void  WinScene::redisplay(HDC hdc)
00029 // respond to WM_PAINT message to main window
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

Generated at Mon Nov 26 18:18:12 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000