CMS 3D CMS Logo

VisG4MagFieldContent.cc

Go to the documentation of this file.
00001 //<<<<<< INCLUDES                                                       >>>>>>
00002 
00003 #include "VisSimulation/VisSimBase/interface/VisG4MagFieldContent.h"
00004 #include "VisGeant4/VisG4Fields/interface/VisG4MagFieldTwig.h"
00005 #include "Iguana/Studio/interface/IgDocumentData.h"
00006 #include "Iguana/Framework/interface/IgRepSet.h"
00007 #include <classlib/utils/Callback.h>
00008 #include <qapplication.h>
00009 
00010 //<<<<<< PRIVATE DEFINES                                                >>>>>>
00011 //<<<<<< PRIVATE CONSTANTS                                              >>>>>>
00012 //<<<<<< PRIVATE TYPES                                                  >>>>>>
00013 //<<<<<< PRIVATE VARIABLE DEFINITIONS                                   >>>>>>
00014 //<<<<<< PUBLIC VARIABLE DEFINITIONS                                    >>>>>>
00015 //<<<<<< CLASS STRUCTURE INITIALIZATION                                 >>>>>>
00016 
00017 IG_DEFINE_STATE_ELEMENT (VisG4MagFieldContent, "Data/Simulation/MagField");
00018 
00019 //<<<<<< PRIVATE FUNCTION DEFINITIONS                                   >>>>>>
00020 //<<<<<< PUBLIC FUNCTION DEFINITIONS                                    >>>>>>
00021 //<<<<<< MEMBER FUNCTION DEFINITIONS                                    >>>>>>
00022 
00024 VisG4MagFieldContent::VisG4MagFieldContent (IgState *state)
00025     : VisContent (state, s_key, MAIN_THREAD,
00026                   lat::CreateCallback (this, &VisG4MagFieldContent::init))
00027 {}
00028 
00031 void
00032 VisG4MagFieldContent::init (void)
00033 {
00034     // FIXME: need to document model registration + browsing support
00035     qApp->lock ();
00036     IgTwig *root = IgDocumentData::get (state ())->root ();
00037     if (root->lookup ("CMS Event and Detector"))
00038         root = root->lookup ("CMS Event and Detector");
00039     
00040     IgTwig *annotations = 0;
00041 
00042     annotations = root->lookup ("Annotations");
00043     
00044     if (! annotations)
00045         annotations = new IgSimpleTwig (root, "Annotations");
00046 
00047     new VisG4MagFieldTwig (annotations, state ());
00048 
00049     IgRepSet::invalidate (root, IgTwig::SELF_MASK | IgTwig::STRUCTURE_MASK);
00050     qApp->unlock (false);
00051 }

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