1 // SUIT_ViewModel.cxx: implementation of the SUIT_ViewModel class.
3 //////////////////////////////////////////////////////////////////////
5 #include "SUIT_ViewModel.h"
7 //////////////////////////////////////////////////////////////////////
8 // Construction/Destruction
9 //////////////////////////////////////////////////////////////////////
10 SUIT_ViewModel::StatesMap SUIT_ViewModel::myStateMap;
11 SUIT_ViewModel::ButtonsMap SUIT_ViewModel::myButtonMap;
13 static bool isInitialized = false;
15 SUIT_ViewModel::SUIT_ViewModel()
20 SUIT_ViewModel::myStateMap[ZOOM] = Qt::ControlButton;
21 SUIT_ViewModel::myButtonMap[ZOOM] = Qt::LeftButton;
23 SUIT_ViewModel::myStateMap[PAN] = Qt::ControlButton;
24 SUIT_ViewModel::myButtonMap[PAN] = Qt::MidButton;
26 SUIT_ViewModel::myStateMap[ROTATE] = Qt::ControlButton;
27 SUIT_ViewModel::myButtonMap[ROTATE] = Qt::RightButton;
29 SUIT_ViewModel::myStateMap[FIT_AREA] = Qt::ControlButton;
30 SUIT_ViewModel::myButtonMap[FIT_AREA] = Qt::RightButton;
35 SUIT_ViewModel::~SUIT_ViewModel()
39 //***************************************************************
40 SUIT_ViewWindow* SUIT_ViewModel::createView(SUIT_Desktop* theDesktop)
42 return new SUIT_ViewWindow(theDesktop);
45 //*********************************************************************
46 void SUIT_ViewModel::setHotButton(HotOperation theOper, Qt::ButtonState theState,
47 Qt::ButtonState theButton)
49 myStateMap[theOper] = theState;
50 myButtonMap[theOper] = theButton;
53 //*********************************************************************
54 void SUIT_ViewModel::getHotButton(HotOperation theOper, Qt::ButtonState& theState,
55 Qt::ButtonState& theButton)
57 theState = myStateMap[theOper];
58 theButton = myButtonMap[theOper];