00001 //<<<<<< INCLUDES >>>>>> 00002 00003 #include "VisSimulation/VisSimBase/interface/VisSimQtActions.h" 00004 #include "Iguana/Studio/interface/IgQtObjectMenuService.h" 00005 #include "Iguana/Studio/interface/IgQtObjectMenuMessage.h" 00006 #include "Iguana/Studio/interface/IgQtAppLoopService.h" 00007 #include "Iguana/Studio/interface/IgTwigOps.h" 00008 #include "VisGeant4/VisG4Core/interface/VisG4VisManager.h" 00009 #include "VisGeant4/VisG4Core/interface/VisG4UIManager.h" 00010 #include "VisGeant4/VisG4Volumes/interface/VisG4TwigOps.h" 00011 #include <classlib/utils/Callback.h> 00012 #include <classlib/utils/DebugAids.h> 00013 #include <qapplication.h> 00014 00015 //<<<<<< PRIVATE DEFINES >>>>>> 00016 //<<<<<< PRIVATE CONSTANTS >>>>>> 00017 //<<<<<< PRIVATE TYPES >>>>>> 00018 //<<<<<< PRIVATE VARIABLE DEFINITIONS >>>>>> 00019 //<<<<<< PUBLIC VARIABLE DEFINITIONS >>>>>> 00020 //<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>> 00021 00022 IG_DEFINE_STATE_ELEMENT (VisSimQtActions, "Services/Simulation/GUI/Menu Actions"); 00023 00024 //<<<<<< PRIVATE FUNCTION DEFINITIONS >>>>>> 00025 //<<<<<< PUBLIC FUNCTION DEFINITIONS >>>>>> 00026 //<<<<<< MEMBER FUNCTION DEFINITIONS >>>>>> 00027 00028 VisSimQtActions::VisSimQtActions (IgState *state) 00029 : m_state (state) 00030 { 00031 m_state->put (s_key, this); 00032 00033 IgQtAppLoopService *loopService = IgQtAppLoopService::get (m_state); 00034 00035 ASSERT (loopService); 00036 loopService->schedule (lat::CreateCallback (this, 00037 &VisSimQtActions::init)); 00038 } 00039 00040 VisSimQtActions::~VisSimQtActions (void) 00041 { 00042 ASSERT (m_state); 00043 m_state->detach (s_key); 00044 } 00045 00046 void 00047 VisSimQtActions::init (void) 00048 { 00049 // Setup G4 00050 qApp->lock (); 00051 00052 // Register object action menus 00053 ASSERT (IgQtObjectMenuService::get (m_state)); 00054 IgQtObjectMenuService::get (m_state) 00055 ->add (lat::CreateCallback (new IgTwigOps, &IgTwigOps::menuAction)); 00056 IgQtObjectMenuService::get (m_state) 00057 ->add (lat::CreateCallback (new VisG4TwigOps, &VisG4TwigOps::menuAction)); 00058 00059 qApp->unlock (false); 00060 }