CMS 3D CMS Logo

VisG4ExampleSetup Class Reference

#include <VisExamples/VisG4ExN02/src/VisG4ExampleSetup.h>

Inheritance diagram for VisG4ExampleSetup:

IgStudioSetupExtension IgExtension IgStateElement

List of all members.

Public Member Functions

virtual bool setup (IgStudioDriver *into)
 VisG4ExampleSetup (IgState *state)
 ~VisG4ExampleSetup (void)

Private Member Functions

 IG_DECLARE_STATE_ELEMENT (VisG4ExampleSetup)

Private Attributes

IgDocumentm_document
IgStatem_state
IgStudioDriverm_studio


Detailed Description

Definition at line 21 of file VisG4ExampleSetup.h.


Constructor & Destructor Documentation

VisG4ExampleSetup::VisG4ExampleSetup ( IgState state  ) 

Definition at line 45 of file VisG4ExampleSetup.cc.

References ASSERT, m_state, and IgState::put().

00046     : m_state (state),
00047       m_studio (0),
00048       m_document (0)
00049 { ASSERT (m_state); m_state->put (s_key, this); }

VisG4ExampleSetup::~VisG4ExampleSetup ( void   ) 

Definition at line 51 of file VisG4ExampleSetup.cc.

References ASSERT, IgState::detach(), and m_state.

00052 { ASSERT (m_state); m_state->detach (s_key); /* delete m_document; */ }


Member Function Documentation

VisG4ExampleSetup::IG_DECLARE_STATE_ELEMENT ( VisG4ExampleSetup   )  [private]

bool VisG4ExampleSetup::setup ( IgStudioDriver into  )  [virtual]

Reimplemented from IgStudioSetupExtension.

Definition at line 55 of file VisG4ExampleSetup.cc.

References ASSERT, lat::CreateCallback(), IgDocument::data(), DBSPlugin::get(), m_document, m_state, m_studio, VisG4TwigOps::menuAction(), IgTwigOps::menuAction(), IgDocumentData::root(), IgDocument::setName(), VisG4UIManager::start(), IgTwig::STRUCTURE_MASK, t, and IgRepSet::update().

00056 {
00057     ASSERT (into);
00058     ASSERT (! m_studio);
00059     m_studio = into;
00060 
00061     // Setup G4.
00062     QApplication::setOverrideCursor (Qt::waitCursor);
00063 
00064     // Create document.
00065     ASSERT (! m_document);
00066     m_document = new IgDocument (m_studio);
00067     m_document->setName ("Geant4 N02 Visualisation Demo");
00068     IgPage *page = new IgPage (m_document);
00069     new IgMDIView (page);
00070 
00071     // Add data.
00072     G4RunManager *rm = new G4RunManager;
00073     VisG4UIManager *uim = new VisG4UIManager (m_state);
00074     VisG4VisManager *vm = new VisG4VisManager (m_state);
00075 
00076     ASSERT (IgQtObjectMenuService::get (m_state));
00077     IgQtObjectMenuService::get (m_state)
00078         ->add (lat::CreateCallback (new IgTwigOps, &IgTwigOps::menuAction));
00079     IgQtObjectMenuService::get (m_state)
00080         ->add (lat::CreateCallback (new VisG4TwigOps, &VisG4TwigOps::menuAction));
00081 
00082     // Build and browse the twigs
00083     IgCompoundTwig *t;
00084     t = new VisG4GeometryTwig (vm, m_document->data ()->root ());
00085     t = new VisG4TransientsTwig (m_document->data ()->root ());
00086     new VisG4TrajectoriesTwig (t);
00087     t = new VisG4AnnotationsTwig (m_document->data ()->root ());
00088     new VisG4MagFieldTwig (t, m_state);
00089 
00090     IgRepSet::update (m_document->data ()->root (), IgTwig::STRUCTURE_MASK);
00091 
00092     // Initialise G4 run configuration.
00093     VisG4ExampleDetector *det = new VisG4ExampleDetector;
00094     rm->SetUserInitialization (det);
00095     rm->SetUserInitialization (new VisG4ExamplePhysics);
00096     rm->SetUserAction (new VisG4ExampleGenerator (det));
00097     rm->SetUserAction (new VisG4ExampleRunAction);
00098     rm->SetUserAction (new VisG4ExampleEventAction);
00099     rm->Initialize ();
00100 
00101     // Start the G4 command line loop (Qt event loop is in studio).
00102     uim->start ();
00103 
00104     QApplication::restoreOverrideCursor ();
00105     return true;
00106 }


Member Data Documentation

IgDocument* VisG4ExampleSetup::m_document [private]

Definition at line 35 of file VisG4ExampleSetup.h.

Referenced by setup().

IgState* VisG4ExampleSetup::m_state [private]

Definition at line 33 of file VisG4ExampleSetup.h.

Referenced by setup(), VisG4ExampleSetup(), and ~VisG4ExampleSetup().

IgStudioDriver* VisG4ExampleSetup::m_studio [private]

Definition at line 34 of file VisG4ExampleSetup.h.

Referenced by setup().


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