CMS 3D CMS Logo

Ig3DBaseWindow Class Reference

#include <Iguana/GLBrowsers/interface/Ig3DBaseWindow.h>

Inheritance diagram for Ig3DBaseWindow:

IgView IgBrowser Ig2DWindow Ig3DWindow IgLegoWindow IgRPhiWindow IgRZWindow IgSpareWindow

List of all members.

Public Member Functions

virtual void browse (IgRepresentable *object)
 Begin browsing the object.
Ig3DBaseBrowserbrowser (void)
IgControlCentrecentre (void)
virtual void focusIn (void)
virtual void focusOut (void)
virtual void hide (void)
 Ig3DBaseWindow (IgPage *page)
virtual void initCategories (void)
virtual void initMenu (void)
virtual void initToolBar (void)
Ig3DBaseModelmodel (void)
virtual void show (void)
virtual IgStatestate (void)
void viewingModeCallback (void)
virtual void watchBrowser (Ig3DBaseBrowser *browser)
 ~Ig3DBaseWindow (void)

Static Public Attributes

static const int TOOLBAR_ID_3D2D = 3000
static const int TOOLBAR_ID_3D2D_ALL = 8
static const int TOOLBAR_ID_3D2D_AUTO_PRINT = 20
static const int TOOLBAR_ID_3D2D_CONTROL_CENTRE = 18
static const int TOOLBAR_ID_3D2D_GRID = 10
static const int TOOLBAR_ID_3D2D_HOME = 6
static const int TOOLBAR_ID_3D2D_INVERT = 14
static const int TOOLBAR_ID_3D2D_ORTHO = 15
static const int TOOLBAR_ID_3D2D_PICK = 4
static const int TOOLBAR_ID_3D2D_PRINT = 16
static const int TOOLBAR_ID_3D2D_PRINT_DEFAULT_VIEWS = 19
static const int TOOLBAR_ID_3D2D_SAVE_AS = 17
static const int TOOLBAR_ID_3D2D_SEEK = 9
static const int TOOLBAR_ID_3D2D_SET_HOME = 7
static const int TOOLBAR_ID_3D2D_SHOW_AXIS = 1
static const int TOOLBAR_ID_3D2D_VIEW = 5
static const int TOOLBAR_ID_3D2D_XZ_PLANE = 13
static const int TOOLBAR_ID_3D2D_YX_PLANE = 12
static const int TOOLBAR_ID_3D2D_YZ_PLANE = 11
static const int TOOLBAR_ID_3D2D_ZOOM_IN = 2
static const int TOOLBAR_ID_3D2D_ZOOM_OUT = 3

Private Slots

void pick (void)
void print (const QString &text)
void showToolbar (void)
void showViewProperties (void)
void toolbarVisibilityChanged (bool visibility)
void view (void)

Private Attributes

Ig3DBaseBrowserm_browser
IgControlCentrem_centre
Ig3DBaseModelm_model
IgSitem_site
IgStatem_state
IgCommonViewPropertiesCategorym_viewPropertiesCategory


Detailed Description

Definition at line 35 of file Ig3DBaseWindow.h.


Constructor & Destructor Documentation

Ig3DBaseWindow::Ig3DBaseWindow ( IgPage page  ) 

Definition at line 63 of file Ig3DBaseWindow.cc.

References DBSPlugin::get(), getModelFromManager(), lookup(), m_centre, m_model, m_state, and IgPage::state().

00064     : IgView (page),
00065       m_site (page->workspace ()),
00066       m_browser (0)
00067 { 
00068      m_model = getModelFromManager (page);
00069      m_state = new IgState (IgDocumentDataManager::get(page->state ())->
00070                             lookup (page->state ()));
00071      m_centre = IgStudioCentre::get (m_state)->controlCentre ();
00072      
00073      if (! IgTwigConfigElement::get (m_state))
00074          new IgTwigConfigElement (page->state ());
00075 
00076     // This is the context for this window 
00077     new IgQtAppContextService (m_state,
00078                                IgQtAppWindowService::get (m_state)->mainWindow ());    
00079 }

Ig3DBaseWindow::~Ig3DBaseWindow ( void   ) 

Definition at line 394 of file Ig3DBaseWindow.cc.

00395 {
00396 }


Member Function Documentation

void Ig3DBaseWindow::browse ( IgRepresentable object  )  [virtual]

Begin browsing the object.

The implementation must represent object in all its models. object (its representation, that is) may then be made the current selection of this and all other browsers in the same IgSession as this browser. This last step should be implemented by broadcasting a IgSelectMessage on the session IgSelectionService; the browser itself can simply respond to the message as it is delivered to it.

Note:
The browser has to create a model and a rep of the object; even simple dummy ones will do. These can be discarded once the other browsers have been notified of the selection change.
See also:
See the class documentation for a more complete description.
Parameters:
object The object to visualise. Even though the object is not const, the browser should not assume it can change it. All non-editor browsers should treat the object purely as const. Editors should treat the object as const as long as possible, preferably until the user explicitly requests the object to be changed. Thus, editors should make changes only to the representation until it is clear that the user is committed to making the changes to the object, too.

Implements IgBrowser.

Definition at line 455 of file Ig3DBaseWindow.cc.

References ASSERT, Ig3DBaseBrowser::browse(), and m_browser.

Referenced by watchBrowser().

00456 {
00457     ASSERT (m_browser);
00458     // FIXME: This should be replaced with some sort of automatic
00459     // registration of models into the view/page/document to get all
00460     // this done more automatically.
00461     m_browser->browse (object);
00462 }

Ig3DBaseBrowser * Ig3DBaseWindow::browser ( void   ) 

Definition at line 436 of file Ig3DBaseWindow.cc.

References m_browser.

Referenced by Ig3DWindow::cameraToggled(), IgSpareWindow::initCategories(), initCategories(), IgRZWindow::initCategories(), Ig3DWindow::initCategories(), Ig2DWindow::initCategories(), IgRPhiWindow::initCategories(), IgLegoWindow::initCategories(), IgSpareWindow::initToolBar(), IgRPhiWindow::initToolBar(), IgLegoWindow::initToolBar(), IgRZWindow::initToolBar(), Ig3DWindow::initToolBar(), initToolBar(), Ig3DWindow::printViews(), Ig3DWindow::repClip(), and Ig3DWindow::repSlice().

00437 {
00438     return m_browser;
00439 }

IgControlCentre * Ig3DBaseWindow::centre ( void   ) 

Definition at line 448 of file Ig3DBaseWindow.cc.

References m_centre.

Referenced by Ig2DWindow::show2DViewProperties(), Ig3DWindow::showAnims(), Ig3DWindow::showClips(), Ig3DWindow::showGrids(), IgLegoWindow::showLegoViewProperties(), IgRZWindow::showLights(), IgLegoWindow::showLights(), IgSpareWindow::showLights(), IgRPhiWindow::showLights(), Ig3DWindow::showLights(), Ig3DWindow::showNodeManip(), IgRPhiWindow::showRPhiViewProperties(), IgRZWindow::showRZViewProperties(), Ig3DWindow::showSlicers(), IgSpareWindow::showSpareViewProperties(), and Ig3DWindow::showViewpoints().

00449 { return m_centre; }

void Ig3DBaseWindow::focusIn ( void   )  [virtual]

Reimplemented in Ig3DWindow, IgLegoWindow, IgRPhiWindow, IgRZWindow, and IgSpareWindow.

Definition at line 468 of file Ig3DBaseWindow.cc.

References ASSERT, lat::CreateCallback(), Ig3DBaseBrowser::focusIn(), DBSPlugin::get(), m_browser, m_centre, Ig3DBaseBrowser::repMenu(), state(), and IgControlCentre::updateOnWindowActive().

Referenced by IgLegoWindow::focusIn(), IgRPhiWindow::focusIn(), IgRZWindow::focusIn(), IgSpareWindow::focusIn(), Ig3DWindow::focusIn(), and initMenu().

void Ig3DBaseWindow::focusOut ( void   )  [virtual]

Reimplemented in Ig3DWindow, IgLegoWindow, IgRPhiWindow, IgRZWindow, and IgSpareWindow.

Definition at line 481 of file Ig3DBaseWindow.cc.

References ASSERT, lat::CreateCallback(), Ig3DBaseBrowser::focusOut(), DBSPlugin::get(), m_browser, Ig3DBaseBrowser::repMenu(), and state().

Referenced by IgSpareWindow::focusOut(), Ig3DWindow::focusOut(), IgRPhiWindow::focusOut(), IgLegoWindow::focusOut(), IgRZWindow::focusOut(), and initMenu().

void Ig3DBaseWindow::hide ( void   )  [virtual]

Definition at line 423 of file Ig3DBaseWindow.cc.

References ASSERT, and m_browser.

00424 {
00425     ASSERT (m_browser);
00426     m_browser->getWidget ()->parentWidget ()->hide ();
00427 }

void Ig3DBaseWindow::initCategories ( void   )  [virtual]

Reimplemented in Ig2DWindow, Ig3DWindow, IgLegoWindow, IgRPhiWindow, IgRZWindow, and IgSpareWindow.

Definition at line 100 of file Ig3DBaseWindow.cc.

References browser(), DBSPlugin::get(), m_state, m_viewPropertiesCategory, IgView::page(), IgCommonViewPropertiesCategory::registerBrowser(), and state().

Referenced by IgSpareWindow::initCategories(), IgRZWindow::initCategories(), Ig3DWindow::initCategories(), Ig2DWindow::initCategories(), IgRPhiWindow::initCategories(), and IgLegoWindow::initCategories().

00101 {
00102     // Make sure this is called only once.
00103     // Create a 3D View Properties Category and add it in control
00104     // centre.
00105     
00106     m_viewPropertiesCategory = IgCommonViewPropertiesCategory::get (page ()->state ());
00107     if (!m_viewPropertiesCategory)
00108     {
00109         // Category is added to the global state.
00110         m_viewPropertiesCategory = 
00111             new IgCommonViewPropertiesCategory (page ()->state ());
00112     }
00113     m_viewPropertiesCategory->registerBrowser (m_state, browser ());
00114 }

void Ig3DBaseWindow::initMenu ( void   )  [virtual]

Reimplemented in Ig2DWindow, Ig3DWindow, IgLegoWindow, IgRPhiWindow, IgRZWindow, and IgSpareWindow.

Definition at line 117 of file Ig3DBaseWindow.cc.

References IgQtAppContextService::addOnFocusIn(), IgQtAppContextService::addOnFocusOut(), ASSERT, HLT_VtxMuL3::connect, lat::CreateCallback(), focusIn(), focusOut(), DBSPlugin::get(), IgQtAppMenuService::index(), IgQtAppMenuService::insertItem(), IgQtAppMenuService::isIdThere(), m_browser, m_state, Ig3DBaseBrowser::MENU_ID_3D, Ig3DBaseBrowser::MENU_ID_3D_TOOLBAR, Ig3DBaseBrowser::MENU_ID_3D_TOOLBAR_SEP, Ig3DBaseBrowser::MENU_ID_3D_VIEW_PROPERTIES, IgQtAppMenuService::MENU_ID_FILE, IgQtAppMenuService::MENU_ID_FILE_PRINT, IgQtAppMenuService::MENU_ID_FILE_SAVE, print(), showToolbar(), showViewProperties(), state(), IgQtAppMenuService::subMenu(), TOOLBAR_ID_3D2D, and toolbarVisibilityChanged().

Referenced by Ig2DWindow::initMenu(), Ig3DWindow::initMenu(), IgRZWindow::initMenu(), IgLegoWindow::initMenu(), IgRPhiWindow::initMenu(), and IgSpareWindow::initMenu().

00118 {
00119     ASSERT (m_state);    
00120     // Initialise menus. FIXME: share a global one with all browsers?
00121     // need to maintain a 3D context service...  This needs to come
00122     // after we've set scene graph so that camera exists.
00123 
00124     // FIXME! get main window from somewhere
00125     // FIXME: deal with absence of main window!
00126 
00127     ASSERT (IgQtAppMenuService::get (m_state));
00128     QMenuBar *bar = IgQtAppMenuService::get (m_state)->menuBar ();    
00129     
00130     IgQtAppMenuService *menuService = IgQtAppMenuService::get (m_state);
00131 
00132     QPopupMenu *menu = menuService->subMenu (Ig3DBaseBrowser::MENU_ID_3D);
00133     
00134     if (!menu)
00135     {
00136         menu = new QPopupMenu (m_browser->getShellWidget ());
00137         menu->setCaption ("View");
00138         menu->insertTearOffHandle ();
00139         bar->insertItem ("&View", menu, Ig3DBaseBrowser::MENU_ID_3D,
00140                          IgQtAppMenuService::index (bar, Ig3DBaseBrowser::MENU_ID_3D));
00141     }
00142     
00143     menu->setCheckable(true);
00144     // FIXME: also drag/drop!
00145     //menu->insertItem ("&Open...", this, SLOT(open()));
00146     
00147     if (IgQtAppMenuService::isIdThere (menu, Ig3DBaseBrowser::MENU_ID_3D_TOOLBAR) == -1)
00148     {
00149         // Miscellaneous controls
00150         menu->insertItem
00151             ("&Tool Bar", 
00152              this, SLOT (showToolbar ()), 0,
00153              Ig3DBaseBrowser::MENU_ID_3D_TOOLBAR, 
00154              IgQtAppMenuService::index (menu, Ig3DBaseBrowser::MENU_ID_3D_TOOLBAR));
00155         menu->setItemChecked (Ig3DBaseBrowser::MENU_ID_3D_TOOLBAR, true);
00156         menu->insertSeparator (IgQtAppMenuService::index (
00157                                 menu, Ig3DBaseBrowser::MENU_ID_3D_TOOLBAR_SEP));
00158         
00159         QToolBar *tb = IgQtAppToolBarService::get (m_state)
00160            ->toolBar (TOOLBAR_ID_3D2D, "General graphics ops");
00161         tb->setCloseMode (QDockWindow::Always);
00162         
00163         connect (tb,   SIGNAL (visibilityChanged (bool)),
00164              this, SLOT (toolbarVisibilityChanged (bool)));
00165     }
00166 
00167     if (IgQtAppMenuService::isIdThere (menu, Ig3DBaseBrowser::MENU_ID_3D_VIEW_PROPERTIES) == -1)
00168     {
00169         // Miscellaneous controls
00170         menu->insertItem
00171             ("&Print/View Settings...", 
00172              this, SLOT (showViewProperties ()), 0,
00173              Ig3DBaseBrowser::MENU_ID_3D_VIEW_PROPERTIES, 
00174              IgQtAppMenuService::index (menu, Ig3DBaseBrowser::MENU_ID_3D_VIEW_PROPERTIES));
00175     }
00176 
00177     menu = menuService->subMenu (IgQtAppMenuService::MENU_ID_FILE);
00178 
00179     ASSERT (m_browser);
00180     
00181     IgQtAppMenuService::insertItem (menu,
00182                                     "&Save As...",
00183                                     m_browser,
00184                                     SLOT(save()),
00185                                     IgQtAppMenuService::MENU_ID_FILE_SAVE,
00186                                     m_state);    
00187 
00188     IgQtAppMenuService::insertItem (menu,
00189                                     "&Print As...", 
00190                                     m_browser,
00191                                     SLOT(print()),
00192                                     IgQtAppMenuService::MENU_ID_FILE_PRINT,
00193                                     m_state);
00194 
00195     // Register the message broadcasting only when the window is
00196     // focused, unregister on focus out.
00197     ASSERT (IgQtAppContextService::get (state ()));
00198     IgQtAppContextService *cs = IgQtAppContextService::get (state ());
00199     cs->addOnFocusIn (lat::CreateCallback (this, &Ig3DBaseWindow::focusIn));
00200     cs->addOnFocusOut (lat::CreateCallback (this, &Ig3DBaseWindow::focusOut));
00201 }

void Ig3DBaseWindow::initToolBar ( void   )  [virtual]

Reimplemented in Ig2DWindow, Ig3DWindow, IgLegoWindow, IgRPhiWindow, IgRZWindow, and IgSpareWindow.

Definition at line 220 of file Ig3DBaseWindow.cc.

References reco::fitHelper::add(), IgQtAppContextService::addOnFocusIn(), ASSERT, browser(), lat::CreateCallback(), DBSPlugin::get(), IgImageIDs::IMAGE_ID_AUTO_PRINT, IgImageIDs::IMAGE_ID_CONTROL_CENTRE, IgImageIDs::IMAGE_ID_HOME, IgImageIDs::IMAGE_ID_PICK, IgImageIDs::IMAGE_ID_PRINT, IgImageIDs::IMAGE_ID_SAVE_AS, IgImageIDs::IMAGE_ID_SEEK, IgImageIDs::IMAGE_ID_SET_HOME, IgImageIDs::IMAGE_ID_VIEW, IgImageIDs::IMAGE_ID_VIEW_ALL, IgImageIDs::IMAGE_ID_XZ_SMALL, IgImageIDs::IMAGE_ID_YX_SMALL, IgImageIDs::IMAGE_ID_YZ_SMALL, IgImageIDs::IMAGE_ID_ZOOM_MINUS, IgImageIDs::IMAGE_ID_ZOOM_PLUS, m_browser, m_centre, m_state, pick(), IgQtAppImageService::pixmapById(), print(), show(), state(), TOOLBAR_ID_3D2D, TOOLBAR_ID_3D2D_ALL, TOOLBAR_ID_3D2D_AUTO_PRINT, TOOLBAR_ID_3D2D_CONTROL_CENTRE, TOOLBAR_ID_3D2D_HOME, TOOLBAR_ID_3D2D_PICK, TOOLBAR_ID_3D2D_PRINT, TOOLBAR_ID_3D2D_SAVE_AS, TOOLBAR_ID_3D2D_SEEK, TOOLBAR_ID_3D2D_SET_HOME, TOOLBAR_ID_3D2D_VIEW, TOOLBAR_ID_3D2D_XZ_PLANE, TOOLBAR_ID_3D2D_YX_PLANE, TOOLBAR_ID_3D2D_YZ_PLANE, TOOLBAR_ID_3D2D_ZOOM_IN, TOOLBAR_ID_3D2D_ZOOM_OUT, IgQtAppToolBarService::toolBarButton(), view(), and viewingModeCallback().

Referenced by IgSpareWindow::initToolBar(), IgLegoWindow::initToolBar(), IgRPhiWindow::initToolBar(), Ig3DWindow::initToolBar(), IgRZWindow::initToolBar(), and Ig2DWindow::initToolBar().

00221 {
00222     // This creates a toolbar with the general widgets.
00223     IgQtAppToolBarService *toolBarService = IgQtAppToolBarService::get (m_state);
00224     IgQtAppImageService *is = IgQtAppImageService::get (m_state);
00225     IgQtAppContextService *cs = IgQtAppContextService::get (state ());
00226     ASSERT (is);
00227     ASSERT (cs);
00228     
00229     QToolButton *button = 0;
00230     button = toolBarService->toolBarButton (m_state,
00231                                             TOOLBAR_ID_3D2D,
00232                                             TOOLBAR_ID_3D2D_SAVE_AS, 
00233                                             *is->pixmapById (IgImageIDs::IMAGE_ID_SAVE_AS), 
00234                                             "Save As",
00235                                             m_browser,
00236                                             SLOT (save ()));
00237     QWhatsThis::add (button, "Save scene graph.");
00238     
00239     button = toolBarService->toolBarButton (m_state,
00240                                             TOOLBAR_ID_3D2D,
00241                                             TOOLBAR_ID_3D2D_PRINT, 
00242                                             *is->pixmapById (IgImageIDs::IMAGE_ID_PRINT), 
00243                                             "Print scene graph",
00244                                             m_browser,
00245                                             SLOT (print ()));
00246     QWhatsThis::add (button, "Print scene graph.");
00247 
00248     button = toolBarService->toolBarButton (m_state,
00249                                             TOOLBAR_ID_3D2D,
00250                                             TOOLBAR_ID_3D2D_CONTROL_CENTRE, 
00251                                             *is->pixmapById (IgImageIDs::IMAGE_ID_CONTROL_CENTRE), 
00252                                             "Show Control Centre",
00253                                             m_centre,
00254                                             SLOT (show ()));
00255     QWhatsThis::add (button, "Show Control Centre. You can manipulate Clip "
00256                             "planes, slicers, lights, camera, view/print "
00257                             "setting via control centre.");
00258 
00259     button = toolBarService->toolBarButton (m_state,
00260                                             TOOLBAR_ID_3D2D,
00261                                             TOOLBAR_ID_3D2D_ZOOM_IN, 
00262                                             *is->pixmapById (IgImageIDs::IMAGE_ID_ZOOM_PLUS), 
00263                                             "Zoom in",
00264                                             m_browser,
00265                                             SLOT (zoomIn ()));
00266     QWhatsThis::add (button, "Zoom in to the scene graph");
00267     
00268     button = toolBarService->toolBarButton (m_state,
00269                                             TOOLBAR_ID_3D2D,
00270                                             TOOLBAR_ID_3D2D_ZOOM_OUT, 
00271                                             *is->pixmapById (IgImageIDs::IMAGE_ID_ZOOM_MINUS),
00272                                             "Zoom out",
00273                                             m_browser,
00274                                             SLOT (zoomOut ()));
00275     QWhatsThis::add (button, "Zoom out of the scene graph");
00276     
00277     button = toolBarService->toolBarButton (m_state,
00278                                             TOOLBAR_ID_3D2D,
00279                                             TOOLBAR_ID_3D2D_PICK,                                
00280                                             *is->pixmapById (IgImageIDs::IMAGE_ID_PICK),
00281                                             "Pick/Select mode",
00282                                             this,
00283                                             SLOT (pick ()));
00284     button->setToggleButton (true);
00285     button->setOn (false);
00286     QWhatsThis::add (button, "Switch to the object pick/select mode. "
00287                      "In this mode you can pick/select 3D objects in the "
00288                      "scene graph");
00289     
00290     button = toolBarService->toolBarButton (m_state,
00291                                             TOOLBAR_ID_3D2D,
00292                                             TOOLBAR_ID_3D2D_VIEW, 
00293                                             *is->pixmapById (IgImageIDs::IMAGE_ID_VIEW),
00294                                             "View mode",
00295                                             this,
00296                                             SLOT (view ()));
00297     button->setToggleButton (true);
00298     button->setOn (true);
00299     QWhatsThis::add (button, "Switch to the camera or viewer mode. "
00300                      "In this mode you can move/re-orient "
00301                      "the camera in 3D space.");
00302     
00303     button = toolBarService->toolBarButton (m_state,
00304                                             TOOLBAR_ID_3D2D,
00305                                             TOOLBAR_ID_3D2D_SEEK, 
00306                                             *is->pixmapById (IgImageIDs::IMAGE_ID_SEEK),
00307                                             "Seek mode",
00308                                             m_browser,
00309                                             SLOT (seek ()));
00310     QWhatsThis::add (button, "Seek towards an object. Click on the object and "
00311                      "camera will either jump (if Seet Time is 0) or "
00312                      "animate (otherwise) to this new position. Seek "
00313                      "time can be change via the View Setting control "
00314                      "category.");
00315 
00316     button = toolBarService->toolBarButton (m_state,
00317                                             TOOLBAR_ID_3D2D,
00318                                             TOOLBAR_ID_3D2D_HOME, 
00319                                             *is->pixmapById (IgImageIDs::IMAGE_ID_HOME),
00320                                             "Go to Home",
00321                                             m_browser,
00322                                             SLOT (resetToHomePosition ()));
00323     QWhatsThis::add (button, "Return camera to its home position or "
00324                      "initial one if no home position was set.");
00325     
00326     button = toolBarService->toolBarButton (m_state,
00327                                             TOOLBAR_ID_3D2D,
00328                                             TOOLBAR_ID_3D2D_SET_HOME,
00329                                             *is->pixmapById (IgImageIDs::IMAGE_ID_SET_HOME),
00330                                             "Set this as home",
00331                                             m_browser,
00332                                             SLOT (saveHomePosition ()));
00333     QWhatsThis::add (button, "Mark current camera position as Home. "
00334                      "You can click on Home button to come back "
00335                      "to this position.");
00336     
00337     button = toolBarService->toolBarButton (m_state,
00338                                             TOOLBAR_ID_3D2D,
00339                                             TOOLBAR_ID_3D2D_ALL, 
00340                                             *is->pixmapById (IgImageIDs::IMAGE_ID_VIEW_ALL),
00341                                             "View All scene",
00342                                             m_browser,
00343                                             SLOT (viewAll ()));
00344     QWhatsThis::add (button, "Adjust the view to include the entire secne graph.");
00345         
00346     button = toolBarService->toolBarButton (state (),
00347                                             Ig3DBaseWindow::TOOLBAR_ID_3D2D,
00348                                             Ig3DBaseWindow::TOOLBAR_ID_3D2D_YX_PLANE, 
00349                                             *is->pixmapById (IgImageIDs::IMAGE_ID_YX_SMALL),
00350                                             "YX plane",
00351                                             browser (),
00352                                             SLOT (viewPlaneZ ()));
00353     QWhatsThis::add (button, "Align camera along -ve Z-axis.");  
00354 
00355     button = toolBarService->toolBarButton (state (),
00356                                             Ig3DBaseWindow::TOOLBAR_ID_3D2D,
00357                                             Ig3DBaseWindow::TOOLBAR_ID_3D2D_XZ_PLANE, 
00358                                             *is->pixmapById (IgImageIDs::IMAGE_ID_XZ_SMALL),
00359                                             "XZ plane",
00360                                             browser (),
00361                                             SLOT (viewPlaneY ()));
00362     QWhatsThis::add (button, "Align camera along -ve Y-axis.");
00363     button = toolBarService->toolBarButton (state (),
00364                                             Ig3DBaseWindow::TOOLBAR_ID_3D2D,
00365                                             Ig3DBaseWindow::TOOLBAR_ID_3D2D_YZ_PLANE, 
00366                                             *is->pixmapById (IgImageIDs::IMAGE_ID_YZ_SMALL),
00367                                             "YZ plane",
00368                                             browser (),
00369                                             SLOT (viewPlaneX ()));
00370     QWhatsThis::add (button, "Align camera along +ve X-axis.");
00371 
00372     button = toolBarService->toolBarButton (m_state,
00373                                             TOOLBAR_ID_3D2D,
00374                                             TOOLBAR_ID_3D2D_AUTO_PRINT, 
00375                                             *is->pixmapById (IgImageIDs::IMAGE_ID_AUTO_PRINT), 
00376                                             "Auto Print",
00377                                             m_browser,
00378                                             SLOT (autoPrint ()));
00379     QWhatsThis::add (button, "Print JPEG.");
00380 
00381     cs->addOnFocusIn (lat::CreateCallback (this,
00382                                            &Ig3DBaseWindow::viewingModeCallback));
00383 }

Ig3DBaseModel * Ig3DBaseWindow::model ( void   ) 

Definition at line 442 of file Ig3DBaseWindow.cc.

References m_model.

Referenced by Ig2DWindow::Ig2DWindow(), Ig3DWindow::Ig3DWindow(), IgSpareWindow::repMenu(), IgLegoWindow::repMenu(), IgRPhiWindow::repMenu(), Ig3DWindow::repMenu(), and IgRZWindow::repMenu().

00443 {
00444     return m_model;
00445 }

void Ig3DBaseWindow::pick ( void   )  [private, slot]

Definition at line 492 of file Ig3DBaseWindow.cc.

References m_browser, Ig3DBaseBrowser::pick(), and viewingModeCallback().

Referenced by initToolBar().

00493 {
00494     m_browser->pick ();
00495     viewingModeCallback ();
00496 }

void Ig3DBaseWindow::print ( const QString &  text  )  [private, slot]

Definition at line 537 of file Ig3DBaseWindow.cc.

References Ig3DBaseBrowser::autoPrint(), m_browser, t, and IgView::title().

Referenced by initMenu(), initToolBar(), and watchBrowser().

00538 {
00539     QString t = title ();
00540     t.append (QString ("\n"));    
00541     t.append (text);
00542     
00543     m_browser->autoPrint (t);
00544 }

void Ig3DBaseWindow::show ( void   )  [virtual]

Definition at line 399 of file Ig3DBaseWindow.cc.

References ASSERT, IgQtSite::hostFrom(), m_browser, and m_site.

Referenced by Ig2DWindow::Ig2DWindow(), Ig3DWindow::Ig3DWindow(), IgLegoWindow::IgLegoWindow(), IgRPhiWindow::IgRPhiWindow(), IgRZWindow::IgRZWindow(), IgSpareWindow::IgSpareWindow(), and initToolBar().

00400 {
00401     ASSERT (m_browser);
00402     m_browser->getWidget ()->parentWidget ()->show ();
00403     IgQtWorkspace *ws = dynamic_cast <IgQtWorkspace*>(IgQtSite::hostFrom (m_site));
00404     QWidget *pw = ws->activeWindow ()->parentWidget();
00405     if (!pw)
00406         pw = ws->activeWindow ();
00407       
00408     if (ws->windowList (QWorkspace::CreationOrder).count () == 1)
00409     {
00410         pw->resize (600, 600);
00411         pw->showMaximized ();
00412     }
00413     else if (ws)      
00414     {
00415         if (! pw->isMaximized ())
00416             pw->setGeometry (0, 0, ws->width (), ws->height ());
00417     }
00418     else
00419         pw->showMaximized ();
00420 }

void Ig3DBaseWindow::showToolbar ( void   )  [private, slot]

Definition at line 506 of file Ig3DBaseWindow.cc.

References ASSERT, HLT_VtxMuL3::connect, DBSPlugin::get(), m_state, Ig3DBaseBrowser::MENU_ID_3D, TOOLBAR_ID_3D2D, and toolbarVisibilityChanged().

Referenced by initMenu().

00507 {
00508     QToolBar *tb = IgQtAppToolBarService::get (m_state)
00509                    ->toolBar (TOOLBAR_ID_3D2D, "");
00510     QPopupMenu *menu = IgQtAppMenuService::get (m_state)
00511                        ->subMenu (Ig3DBaseBrowser::MENU_ID_3D);
00512     ASSERT (menu);
00513 
00514     disconnect (tb,   SIGNAL (visibilityChanged (bool)),
00515                 this, SLOT (toolbarVisibilityChanged (bool)));
00516 
00517     if (tb->isShown ())
00518         tb->hide ();
00519     else
00520         tb->show ();
00521 
00522     connect (tb,   SIGNAL (visibilityChanged (bool)),
00523              this, SLOT (toolbarVisibilityChanged (bool)));
00524     toolbarVisibilityChanged (tb->isShown ());
00525 }

void Ig3DBaseWindow::showViewProperties ( void   )  [private, slot]

Definition at line 386 of file Ig3DBaseWindow.cc.

References label, m_centre, m_viewPropertiesCategory, IgControlCentre::selectCategory(), and IgControlCentre::show().

Referenced by initMenu().

00387 {
00388     QString label (m_viewPropertiesCategory->catalogLabel ());
00389     m_centre->selectCategory (
00390         label.right (label.length ()- label.findRev ("/") - 1));
00391     m_centre->show ();
00392 }

IgState * Ig3DBaseWindow::state ( void   )  [virtual]

Reimplemented from IgView.

Definition at line 430 of file Ig3DBaseWindow.cc.

References m_state.

Referenced by Ig3DWindow::cameraToggled(), IgLegoWindow::focusIn(), IgRPhiWindow::focusIn(), focusIn(), IgRZWindow::focusIn(), IgSpareWindow::focusIn(), Ig3DWindow::focusIn(), IgSpareWindow::focusOut(), Ig3DWindow::focusOut(), IgRPhiWindow::focusOut(), focusOut(), IgLegoWindow::focusOut(), IgRZWindow::focusOut(), Ig2DWindow::Ig2DWindow(), Ig3DWindow::Ig3DWindow(), IgLegoWindow::IgLegoWindow(), IgRPhiWindow::IgRPhiWindow(), IgRZWindow::IgRZWindow(), IgSpareWindow::IgSpareWindow(), IgSpareWindow::initCategories(), initCategories(), Ig3DWindow::initCategories(), IgRZWindow::initCategories(), Ig2DWindow::initCategories(), IgLegoWindow::initCategories(), IgRPhiWindow::initCategories(), Ig2DWindow::initMenu(), Ig3DWindow::initMenu(), IgRZWindow::initMenu(), IgLegoWindow::initMenu(), IgRPhiWindow::initMenu(), initMenu(), IgSpareWindow::initMenu(), IgSpareWindow::initToolBar(), IgLegoWindow::initToolBar(), IgRPhiWindow::initToolBar(), Ig3DWindow::initToolBar(), IgRZWindow::initToolBar(), initToolBar(), and viewingModeCallback().

00431 {
00432     return m_state;
00433 }

void Ig3DBaseWindow::toolbarVisibilityChanged ( bool  visibility  )  [private, slot]

Definition at line 528 of file Ig3DBaseWindow.cc.

References ASSERT, DBSPlugin::get(), m_state, Ig3DBaseBrowser::MENU_ID_3D, and Ig3DBaseBrowser::MENU_ID_3D_TOOLBAR.

Referenced by initMenu(), and showToolbar().

00529 {
00530     QPopupMenu *menu = IgQtAppMenuService::get (m_state)
00531                        ->subMenu (Ig3DBaseBrowser::MENU_ID_3D);
00532     ASSERT (menu);
00533     menu->setItemChecked (Ig3DBaseBrowser::MENU_ID_3D_TOOLBAR, visibility);
00534 }

void Ig3DBaseWindow::view ( void   )  [private, slot]

Definition at line 499 of file Ig3DBaseWindow.cc.

References m_browser, Ig3DBaseBrowser::view(), and viewingModeCallback().

Referenced by initToolBar(), and viewingModeCallback().

00500 {
00501     m_browser->view ();
00502     viewingModeCallback ();
00503 }

void Ig3DBaseWindow::viewingModeCallback ( void   ) 

Definition at line 204 of file Ig3DBaseWindow.cc.

References ASSERT, DBSPlugin::get(), IgQtAppToolBarService::getToolBarButton(), m_browser, state(), TOOLBAR_ID_3D2D, TOOLBAR_ID_3D2D_PICK, TOOLBAR_ID_3D2D_SEEK, TOOLBAR_ID_3D2D_VIEW, and view().

Referenced by initToolBar(), pick(), and view().

00205 {
00206     IgQtAppToolBarService *ts = IgQtAppToolBarService::get (state ());
00207     ASSERT (ts);
00208     
00209     QToolButton *vb = ts->getToolBarButton (TOOLBAR_ID_3D2D, TOOLBAR_ID_3D2D_VIEW);
00210     QToolButton *pb = ts->getToolBarButton (TOOLBAR_ID_3D2D, TOOLBAR_ID_3D2D_PICK);
00211     QToolButton *sb = ts->getToolBarButton (TOOLBAR_ID_3D2D, TOOLBAR_ID_3D2D_SEEK);
00212     
00213     bool view = m_browser->isViewing();
00214     vb->setOn(view);
00215     sb->setEnabled (view);
00216     pb->setOn(!view);
00217 }

void Ig3DBaseWindow::watchBrowser ( Ig3DBaseBrowser browser  )  [virtual]

Definition at line 82 of file Ig3DBaseWindow.cc.

References browse(), HLT_VtxMuL3::connect, DBSPlugin::get(), IgDocumentDataRoot::getCurrentRoot(), m_browser, m_state, IgView::page(), print(), IgPage::registerView(), pydbsAccessor::root, IgView::setTitle(), t, and IgView::title().

Referenced by Ig2DWindow::Ig2DWindow(), Ig3DWindow::Ig3DWindow(), IgLegoWindow::IgLegoWindow(), IgRPhiWindow::IgRPhiWindow(), IgRZWindow::IgRZWindow(), and IgSpareWindow::IgSpareWindow().

00083 {
00084     m_browser = browser;
00085     // Show myself and show all the document data (FIXME: select?).
00086     QString t (IgDocumentDataRoot::getCurrentRoot());
00087     t += QString(" ( ") + title ().c_str () + " )";
00088                     
00089     m_browser->getWidget ()->parentWidget ()->setCaption (t);
00090     setTitle (t.latin1 ());
00091     
00092     browse (IgDocumentData::get (m_state)->root ());
00093     // register the MDI window used by this view.
00094     page ()->registerView (dynamic_cast <IgView *> (this), 
00095                            m_browser->getWidget ()->parentWidget ());
00096     connect (page (), SIGNAL (autoPrint (const QString &)), this, SLOT (print (const QString &)));    
00097 }


Member Data Documentation

Ig3DBaseBrowser* Ig3DBaseWindow::m_browser [private]

Definition at line 96 of file Ig3DBaseWindow.h.

Referenced by browse(), browser(), focusIn(), focusOut(), hide(), initMenu(), initToolBar(), pick(), print(), show(), view(), viewingModeCallback(), and watchBrowser().

IgControlCentre* Ig3DBaseWindow::m_centre [private]

Definition at line 97 of file Ig3DBaseWindow.h.

Referenced by centre(), focusIn(), Ig3DBaseWindow(), initToolBar(), and showViewProperties().

Ig3DBaseModel* Ig3DBaseWindow::m_model [private]

Definition at line 95 of file Ig3DBaseWindow.h.

Referenced by Ig3DBaseWindow(), and model().

IgSite* Ig3DBaseWindow::m_site [private]

Definition at line 94 of file Ig3DBaseWindow.h.

Referenced by show().

IgState* Ig3DBaseWindow::m_state [private]

Definition at line 93 of file Ig3DBaseWindow.h.

Referenced by Ig3DBaseWindow(), initCategories(), initMenu(), initToolBar(), showToolbar(), state(), toolbarVisibilityChanged(), and watchBrowser().

IgCommonViewPropertiesCategory* Ig3DBaseWindow::m_viewPropertiesCategory [private]

Definition at line 98 of file Ig3DBaseWindow.h.

Referenced by initCategories(), and showViewProperties().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D = 3000 [static]

Definition at line 41 of file Ig3DBaseWindow.h.

Referenced by Ig3DWindow::cameraToggled(), initMenu(), IgSpareWindow::initToolBar(), IgRPhiWindow::initToolBar(), IgLegoWindow::initToolBar(), IgRZWindow::initToolBar(), Ig3DWindow::initToolBar(), initToolBar(), showToolbar(), and viewingModeCallback().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_ALL = 8 [static]

Definition at line 49 of file Ig3DBaseWindow.h.

Referenced by initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_AUTO_PRINT = 20 [static]

Definition at line 61 of file Ig3DBaseWindow.h.

Referenced by initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_CONTROL_CENTRE = 18 [static]

Definition at line 59 of file Ig3DBaseWindow.h.

Referenced by initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_GRID = 10 [static]

Definition at line 51 of file Ig3DBaseWindow.h.

Referenced by IgSpareWindow::initToolBar(), IgRPhiWindow::initToolBar(), and Ig3DWindow::initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_HOME = 6 [static]

Definition at line 47 of file Ig3DBaseWindow.h.

Referenced by initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_INVERT = 14 [static]

Definition at line 55 of file Ig3DBaseWindow.h.

Referenced by IgLegoWindow::initToolBar(), IgRZWindow::initToolBar(), and Ig3DWindow::initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_ORTHO = 15 [static]

Definition at line 56 of file Ig3DBaseWindow.h.

Referenced by Ig3DWindow::cameraToggled(), IgLegoWindow::initToolBar(), IgRZWindow::initToolBar(), and Ig3DWindow::initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_PICK = 4 [static]

Definition at line 45 of file Ig3DBaseWindow.h.

Referenced by initToolBar(), and viewingModeCallback().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_PRINT = 16 [static]

Definition at line 57 of file Ig3DBaseWindow.h.

Referenced by initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_PRINT_DEFAULT_VIEWS = 19 [static]

Definition at line 60 of file Ig3DBaseWindow.h.

Referenced by Ig3DWindow::initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_SAVE_AS = 17 [static]

Definition at line 58 of file Ig3DBaseWindow.h.

Referenced by initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_SEEK = 9 [static]

Definition at line 50 of file Ig3DBaseWindow.h.

Referenced by initToolBar(), and viewingModeCallback().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_SET_HOME = 7 [static]

Definition at line 48 of file Ig3DBaseWindow.h.

Referenced by initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_SHOW_AXIS = 1 [static]

Definition at line 42 of file Ig3DBaseWindow.h.

Referenced by IgSpareWindow::initToolBar(), IgRPhiWindow::initToolBar(), IgLegoWindow::initToolBar(), IgRZWindow::initToolBar(), and Ig3DWindow::initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_VIEW = 5 [static]

Definition at line 46 of file Ig3DBaseWindow.h.

Referenced by initToolBar(), and viewingModeCallback().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_XZ_PLANE = 13 [static]

Definition at line 54 of file Ig3DBaseWindow.h.

Referenced by initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_YX_PLANE = 12 [static]

Definition at line 53 of file Ig3DBaseWindow.h.

Referenced by initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_YZ_PLANE = 11 [static]

Definition at line 52 of file Ig3DBaseWindow.h.

Referenced by initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_ZOOM_IN = 2 [static]

Definition at line 43 of file Ig3DBaseWindow.h.

Referenced by initToolBar().

const int Ig3DBaseWindow::TOOLBAR_ID_3D2D_ZOOM_OUT = 3 [static]

Definition at line 44 of file Ig3DBaseWindow.h.

Referenced by initToolBar().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:24:57 2009 for CMSSW by  doxygen 1.5.4