#include <VisExamples/VisG4ExN02/src/VisG4ExampleSetup.h>
Public Member Functions | |
virtual bool | setup (IgStudioDriver *into) |
VisG4ExampleSetup (IgState *state) | |
~VisG4ExampleSetup (void) | |
Private Member Functions | |
IG_DECLARE_STATE_ELEMENT (VisG4ExampleSetup) | |
Private Attributes | |
IgDocument * | m_document |
IgState * | m_state |
IgStudioDriver * | m_studio |
Definition at line 21 of file VisG4ExampleSetup.h.
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.
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 }
IgDocument* VisG4ExampleSetup::m_document [private] |
IgState* VisG4ExampleSetup::m_state [private] |
Definition at line 33 of file VisG4ExampleSetup.h.
Referenced by setup(), VisG4ExampleSetup(), and ~VisG4ExampleSetup().
IgStudioDriver* VisG4ExampleSetup::m_studio [private] |