#include <Iguana/GLBrowsers/interface/Ig2DWindow.h>
Public Member Functions | |
Ig2DWindow (IgPage *page) | |
~Ig2DWindow (void) | |
Protected Member Functions | |
virtual void | initCategories (void) |
virtual void | initMenu (void) |
virtual void | initToolBar (void) |
Protected Attributes | |
Ig2DViewPropertiesCategory * | m_2DViewPropertiesCategory |
Private Slots | |
virtual void | show2DViewProperties (void) |
Private Attributes | |
Ig2DModel * | m_2dmodel |
Definition at line 21 of file Ig2DWindow.h.
Ig2DWindow::Ig2DWindow | ( | IgPage * | page | ) |
Definition at line 32 of file Ig2DWindow.cc.
References IgModelManager::add(), DBSPlugin::get(), IgQtSiteStack::hostWithName(), initCategories(), initMenu(), initToolBar(), IgDocumentDataManager::lookup(), IgModelManager::lookup(), m_2dmodel, Ig3DBaseWindow::model(), IgView::setTitle(), Ig3DBaseWindow::show(), IgPage::state(), Ig3DBaseWindow::state(), t, Ig3DBaseWindow::watchBrowser(), and IgPage::workspace().
00033 : Ig3DBaseWindow (page), 00034 m_2dmodel (0) 00035 { 00036 static int lastWindowNumber = 0; 00037 IgModelManager *manager = IgModelManager::get (page->state ()); 00038 if (!manager) 00039 manager = new IgModelManager (page->state ()); 00040 manager->lookup (&m_2dmodel); 00041 if (!m_2dmodel) 00042 { 00043 IgDocumentDataManager* dm = IgDocumentDataManager::get(page->state ()); 00044 m_2dmodel = new Ig2DModel (dm->lookup(0), model ()); 00045 manager->add (dm->lookup(0), m_2dmodel); 00046 } 00047 00048 QString t = "2D Window #" + QString::number (lastWindowNumber++); 00049 IgView::setTitle (t.ascii ()); 00050 00051 watchBrowser (new Ig2DBrowser (state (), 00052 page->workspace ()->hostWithName (t), 00053 m_2dmodel)); 00054 00055 initCategories (); 00056 initMenu (); 00057 initToolBar (); 00058 00059 show (); 00060 }
Ig2DWindow::~Ig2DWindow | ( | void | ) |
Reimplemented from Ig3DBaseWindow.
Definition at line 67 of file Ig2DWindow.cc.
References Ig3DBaseWindow::browser(), DBSPlugin::get(), Ig3DBaseWindow::initCategories(), m_2DViewPropertiesCategory, IgView::page(), Ig2DViewPropertiesCategory::registerBrowser(), and Ig3DBaseWindow::state().
Referenced by Ig2DWindow().
00068 { 00069 Ig3DBaseWindow::initCategories (); 00070 00071 // Create a 2D Window Properties Category and add it in control 00072 // centre 00073 m_2DViewPropertiesCategory = Ig2DViewPropertiesCategory::get (page ()->state ()); 00074 00075 if (!m_2DViewPropertiesCategory) 00076 { 00077 m_2DViewPropertiesCategory = new Ig2DViewPropertiesCategory ( 00078 page ()->state (), 00079 dynamic_cast <Ig2DBrowser *> (browser ())); 00080 } 00081 00082 m_2DViewPropertiesCategory->registerBrowser (state (), browser ()); 00083 }
Reimplemented from Ig3DBaseWindow.
Definition at line 86 of file Ig2DWindow.cc.
References ASSERT, DBSPlugin::get(), IgQtAppMenuService::index(), Ig3DBaseWindow::initMenu(), IgQtAppMenuService::isIdThere(), Ig3DBaseBrowser::MENU_ID_3D, Ig3DBaseBrowser::MENU_ID_3D_2D_VIEW_PROPERTIES, show2DViewProperties(), and Ig3DBaseWindow::state().
Referenced by Ig2DWindow().
00087 { 00088 Ig3DBaseWindow::initMenu (); 00089 00090 ASSERT (IgQtAppMenuService::get (state ())); 00091 00092 // Get the menu as it has already been initialised in the 00093 // baseClass. 00094 QPopupMenu *menu = IgQtAppMenuService::get (state ())->subMenu 00095 (Ig3DBaseBrowser::MENU_ID_3D); 00096 00097 // Submenus 00098 if (IgQtAppMenuService::isIdThere (menu, Ig3DBaseBrowser::MENU_ID_3D_2D_VIEW_PROPERTIES) == -1) 00099 { 00100 menu->insertItem 00101 ("2&D View properties...", this, SLOT (show2DViewProperties ()), 0, 00102 Ig3DBaseBrowser::MENU_ID_3D_2D_VIEW_PROPERTIES, IgQtAppMenuService::index 00103 (menu, Ig3DBaseBrowser::MENU_ID_3D_2D_VIEW_PROPERTIES)); 00104 } 00105 }
Reimplemented from Ig3DBaseWindow.
Definition at line 108 of file Ig2DWindow.cc.
References Ig3DBaseWindow::initToolBar().
Referenced by Ig2DWindow().
00109 { 00110 Ig3DBaseWindow::initToolBar (); 00111 }
Definition at line 115 of file Ig2DWindow.cc.
References Ig3DBaseWindow::centre(), m_2DViewPropertiesCategory, IgControlCentre::selectCategory(), and IgControlCentre::show().
Referenced by initMenu().
00116 { 00117 centre ()->selectCategory (m_2DViewPropertiesCategory); 00118 centre ()->show (); 00119 }
Ig2DModel* Ig2DWindow::m_2dmodel [private] |
Definition at line 34 of file Ig2DWindow.h.
Referenced by initCategories(), and show2DViewProperties().