CMS 3D CMS Logo

IgDocument.cc

Go to the documentation of this file.
00001 //<<<<<< INCLUDES                                                       >>>>>>
00002 
00003 #include "Iguana/Studio/interface/IgDocument.h"
00004 #include "Iguana/Studio/interface/IgDocumentData.h"
00005 #include "Iguana/Studio/interface/IgStudioDriver.h"
00006 #include "Iguana/Studio/interface/IgPage.h"
00007 #include "Iguana/Studio/interface/IgQHSplitterSite.h"
00008 #include "Iguana/Studio/interface/IgQtAppStatusBarService.h"
00009 #include "Iguana/Framework/interface/IgState.h"
00010 #include "Iguana/Framework/interface/IgPluginLoader.h"
00011 #include <qwidget.h>
00012 #undef emit // zap qt macro
00013 #include <classlib/utils/DebugAids.h>
00014 
00015 //<<<<<< PRIVATE DEFINES                                                >>>>>>
00016 //<<<<<< PRIVATE CONSTANTS                                              >>>>>>
00017 //<<<<<< PRIVATE TYPES                                                  >>>>>>
00018 //<<<<<< PRIVATE VARIABLE DEFINITIONS                                   >>>>>>
00019 //<<<<<< PUBLIC VARIABLE DEFINITIONS                                    >>>>>>
00020 //<<<<<< CLASS STRUCTURE INITIALIZATION                                 >>>>>>
00021 //<<<<<< PRIVATE FUNCTION DEFINITIONS                                   >>>>>>
00022 //<<<<<< PUBLIC FUNCTION DEFINITIONS                                    >>>>>>
00023 //<<<<<< MEMBER FUNCTION DEFINITIONS                                    >>>>>>
00024 
00025 IgDocument::IgDocument (IgStudioDriver *parent)
00026     : m_owner (parent),
00027       m_state (new IgState (parent->state ())),
00028       // FIXME: We don't really need or want a splitter here, but
00029       //  I haven't yet figured out how to otherwise make the window
00030       //  expand to maximum possible space...  Setting size policy
00031       //  [Expanding,Expanding] doesn't seem to be helping.
00032       m_window (new IgQHSplitterSite (m_state, parent->mainSite ())),
00033       m_data (new IgDocumentData (m_state, this)),
00034       m_currentPage (0)
00035 {
00036     // FIXME: record IgDocumentElement in state to point to myself?
00037     // FIXME: construct window layout: tree browser, page area,
00038     //   docking areas, controller control panels, ...
00039     // FIXME: maximise, show window?
00040     setName ("IGUANA Visualization");
00041     IgQtSite::selfFrom (m_window)->show ();
00042 }
00043 
00044 IgDocument::~IgDocument (void)
00045 {
00046     // FIXME: detach from m_owner
00047     delete m_window;
00048     delete m_state;
00049 }
00050 
00054 IgStudioDriver *
00055 IgDocument::owner (void) const
00056 { return m_owner; }
00057 
00058 IgState *
00059 IgDocument::state (void) const
00060 { return m_state; }
00061 
00062 IgDocumentData *
00063 IgDocument::data (void) const
00064 { return m_data; }
00065 
00069 IgQtSite *
00070 IgDocument::window (void) const
00071 { return m_window; }
00072 
00076 void
00077 IgDocument::setName (const std::string &name)
00078 {
00079     // FIXME: Set (document) window title
00080     // FIXME: Main window, document window title merging?
00081     // IgQtSite::selfFrom (m_window)->setName (name.c_str ());
00082     m_owner->mainWindow ()->setName (name.c_str ());
00083     m_owner->mainWindow ()->setCaption (name.c_str ());
00084     // FIXME: file name?
00085 }
00086 
00087 void
00088 IgDocument::addContentProxy (const std::string &name)
00089 {
00090     // FIXME: load certain data prefix
00091     // FIXME: remember in construction -> write out -> reload on read
00092     IgQtAppStatusBarService::get (m_state)
00093         ->setMessage ("Loading " + name + "...");
00094     IgPluginLoader::get (m_state)->load (m_state, "Data/" + name);
00095 }
00096 
00097 void
00098 IgDocument::load (const std::string &name, bool prefix /* = false */)
00099 {
00100     // FIXME: IgPluginLoader::load()
00101     // FIXME: remember in construction -> write out -> reload on read
00102     IgQtAppStatusBarService::get (m_state)
00103         ->setMessage ("Loading " + name + (prefix ? "*..." : "..."));
00104     IgPluginLoader::get (m_state)->load (m_state, name, prefix);
00105 }
00106 
00107 void
00108 IgDocument::addPage (IgPage *page)
00109 {
00110     ASSERT (page);    
00111     m_pageMap.push_back (page);
00112     m_currentPage = page;    
00113 }
00114 
00115 IgPage *
00116 IgDocument::currentPage (void)
00117 {
00118     return m_currentPage;    
00119 }

Generated on Tue Jun 9 17:38:49 2009 for CMSSW by  doxygen 1.5.4