CMS 3D CMS Logo

VisSimMain.cc

Go to the documentation of this file.
00001 //<<<<<< INCLUDES                                                       >>>>>>
00002 
00003 #include "VisSimulation/VisSimApp/src/VisSimMain.h"
00004 #include "VisFramework/VisConfigService/interface/VisConfigurationService.h"
00005 #include "Iguana/GLBrowsers/interface/Ig3DShapeManager.h"
00006 #include "Iguana/Framework/interface/IgTwig.h"
00007 #include "Iguana/Studio/interface/IgDocument.h"
00008 #include "Iguana/Studio/interface/IgDocumentData.h"
00009 #include "Iguana/Studio/interface/IgMDIView.h"
00010 #include "Iguana/Studio/interface/IgPage.h"
00011 #include "Iguana/Studio/interface/IgStudioDriver.h"
00012 #include "Iguana/Studio/interface/IgQtAppStatusBarService.h"
00013 #include "Iguana/Framework/interface/IgExtensionDB.h"
00014 #include "Iguana/Framework/interface/IgState.h"
00015 #include "Iguana/Framework/interface/IgRepSet.h"
00016 
00017 //<<<<<< PRIVATE DEFINES                                                >>>>>>
00018 //<<<<<< PRIVATE CONSTANTS                                              >>>>>>
00019 //<<<<<< PRIVATE TYPES                                                  >>>>>>
00020 //<<<<<< PRIVATE VARIABLE DEFINITIONS                                   >>>>>>
00021 //<<<<<< PUBLIC VARIABLE DEFINITIONS                                    >>>>>>
00022 //<<<<<< CLASS STRUCTURE INITIALIZATION                                 >>>>>>
00023 
00024 IG_DEFINE_STATE_ELEMENT (VisSimMain, "Services/Studio/Session Types/CMSSW Simulation");
00025 
00026 //<<<<<< PRIVATE FUNCTION DEFINITIONS                                   >>>>>>
00027 //<<<<<< PUBLIC FUNCTION DEFINITIONS                                    >>>>>>
00028 //<<<<<< MEMBER FUNCTION DEFINITIONS                                    >>>>>>
00029 
00030 VisSimMain::VisSimMain (IgState *state)
00031     : m_state (state),
00032       m_studio (0),
00033       m_document (0)
00034 { ASSERT (m_state); m_state->put (s_key, this);}
00035 
00036 
00037 bool
00038 VisSimMain::setup (IgStudioDriver *into)
00039 {
00040     ASSERT (m_state);
00041     ASSERT (! m_studio);
00042 
00043     ASSERT (into);
00044     m_studio = into;
00045 
00046     // Create document
00047     ASSERT (! m_document);
00048     m_document = new IgDocument (m_studio);
00049     
00050     // Change window caption.
00051     m_document->setName ("CMSSW Simulation Visualisation");
00052     m_document->addContentProxy ("Framework/Core");
00053 
00054     const edm::ParameterSet *pset = VisConfigurationService::pSet ();
00055     if (! pset)
00056     {
00057         edm::ParameterSet p;
00058         VisConfigurationService *visServise = new VisConfigurationService (p);
00059         pset = visServise->pSet ();
00060         delete visServise;
00061     }
00062     std::vector<std::string> proxies;
00063     proxies = pset->getUntrackedParameter<std::vector<std::string> >
00064               ("ContentProxies", proxies);
00065 
00066     // Fill document
00067     IgPage *page = new IgPage (m_document);
00068     new IgMDIView (page, "3D Window");
00069 
00070     // Load all data proxies
00071     if (proxies.empty ())
00072     {
00073         proxies.push_back ("Simulation/Core");
00074         proxies.push_back ("Simulation/Data");
00075         proxies.push_back ("Simulation/Geometry");
00076         proxies.push_back ("Simulation/Hits"); 
00077     }
00078     
00079     for (unsigned int i = 0; i < proxies.size (); i++)
00080     {
00081         m_document->addContentProxy (proxies [i]);
00082     }
00083     m_document->load ("Services/Framework/GUI/", true);
00084 
00085     IgRepSet::invalidate (m_document->data ()->root (), IgTwig::STRUCTURE_MASK);
00086     return true;
00087 }

Generated on Tue Jun 9 17:50:29 2009 for CMSSW by  doxygen 1.5.4