Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VInteractorManager Class Referenceabstract

#include <G4VInteractorManager.hh>

+ Inheritance diagram for G4VInteractorManager:

Public Member Functions

 G4VInteractorManager ()
 
virtual ~G4VInteractorManager ()
 
void SetArguments (int, char **)
 
char ** GetArguments (int *)
 
void SetMainInteractor (G4Interactor)
 
G4Interactor GetMainInteractor ()
 
void AddDispatcher (G4DispatchFunction)
 
void RemoveDispatcher (G4DispatchFunction)
 
void AddSecondaryLoopPreAction (G4SecondaryLoopAction)
 
void AddSecondaryLoopPostAction (G4SecondaryLoopAction)
 
void AddShell (G4Interactor)
 
void RemoveShell (G4Interactor)
 
void EnableSecondaryLoop ()
 
void DisableSecondaryLoop ()
 
void SecondaryLoopPreActions ()
 
void SecondaryLoopPostActions ()
 
void RequireExitSecondaryLoop (int)
 
void DispatchEvent (void *)
 
virtual void SecondaryLoop ()
 
int GetExitSecondaryLoopCode ()
 
void PutStringInResourceDatabase (char *)
 
virtual G4bool Inited ()=0
 
virtual void * GetEvent ()=0
 
virtual void FlushAndWaitExecution ()=0
 
void SetParentInteractor (G4Interactor)
 
G4Interactor GetParentInteractor ()
 
void SetCreatedInteractor (G4Interactor)
 
G4Interactor GetCreatedInteractor ()
 
void SetCreationString (char *)
 
char * GetCreationString ()
 

Detailed Description

Definition at line 50 of file G4VInteractorManager.hh.

Constructor & Destructor Documentation

◆ G4VInteractorManager()

G4VInteractorManager::G4VInteractorManager ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 41 of file G4VInteractorManager.cc.

43:argc(0)
44,argv(NULL)
45,mainInteractor(NULL)
46,secondaryLoopEnabled(TRUE)
47,alreadyInSecondaryLoop(FALSE)
48,exitSecondaryLoop(0)
49,parentInteractor(NULL)
50,createdInteractor(NULL)
51,creationString(NULL)
52/***************************************************************************/
53/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
54{
55}
#define TRUE
Definition: globals.hh:41
#define FALSE
Definition: globals.hh:38

◆ ~G4VInteractorManager()

G4VInteractorManager::~G4VInteractorManager ( )
virtual

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 57 of file G4VInteractorManager.cc.

61{
62 if(argv!=NULL) {
63 for(G4int argi=0;argi<argc;++argi) {
64 if(argv[argi]!=NULL) free(argv[argi]);
65 }
66 free (argv);
67 }
68 argv = NULL;
69 argc = 0;
70 dispatchers.clear();
71 preActions.clear();
72 postActions.clear();
73 shells.clear();
74 secondaryLoopEnabled = TRUE;
75 alreadyInSecondaryLoop = FALSE;
76 exitSecondaryLoop = 0;
77}
int G4int
Definition: G4Types.hh:85

Member Function Documentation

◆ AddDispatcher()

void G4VInteractorManager::AddDispatcher ( G4DispatchFunction  a_dispatcher)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 150 of file G4VInteractorManager.cc.

155{
156 if(a_dispatcher==NULL) return;
157 if(std::find(dispatchers.cbegin(),dispatchers.cend(),a_dispatcher)!=dispatchers.cend()) return;
158 dispatchers.push_back(a_dispatcher);
159}

◆ AddSecondaryLoopPostAction()

void G4VInteractorManager::AddSecondaryLoopPostAction ( G4SecondaryLoopAction  a_postAction)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 214 of file G4VInteractorManager.cc.

219{
220 if(a_postAction==NULL) return;
221 if(std::find(postActions.cbegin(),postActions.cend(),a_postAction)!=postActions.cend()) return;
222 postActions.push_back(a_postAction);
223}

◆ AddSecondaryLoopPreAction()

void G4VInteractorManager::AddSecondaryLoopPreAction ( G4SecondaryLoopAction  a_preAction)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 192 of file G4VInteractorManager.cc.

197{
198 if(a_preAction==NULL) return;
199 if(std::find(preActions.cbegin(),preActions.cend(),a_preAction)!=preActions.cend()) return;
200 preActions.push_back(a_preAction);
201}

◆ AddShell()

void G4VInteractorManager::AddShell ( G4Interactor  a_shell)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 287 of file G4VInteractorManager.cc.

292{
293 if(a_shell==NULL) return;
294 if(std::find(shells.cbegin(),shells.cend(),a_shell)!=shells.cend()) return;
295 shells.push_back(a_shell);
296}

Referenced by G4OpenGLXmViewer::GetXmConnection(), G4OpenInventorWinViewer::Initialise(), G4OpenInventorXtExtendedViewer::Initialise(), and G4OpenInventorXtViewer::Initialise().

◆ DisableSecondaryLoop()

void G4VInteractorManager::DisableSecondaryLoop ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 142 of file G4VInteractorManager.cc.

146{
147 secondaryLoopEnabled = FALSE;
148}

Referenced by G4UIQt::SessionStart(), G4UIXm::SessionStart(), and G4UIWin32::SessionStart().

◆ DispatchEvent()

void G4VInteractorManager::DispatchEvent ( void *  a_event)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 176 of file G4VInteractorManager.cc.

181{
182 std::size_t dispatchern = dispatchers.size();
184 for(std::size_t count=0;count<dispatchern;++count) {
185 func = dispatchers[count];
186 if(func!=NULL) {
187 if(func(a_event)==true) return;
188 }
189 }
190}
G4bool(* G4DispatchFunction)(void *)

Referenced by SecondaryLoop(), G4UIXm::SessionStart(), and G4UIWin32::SessionStart().

◆ EnableSecondaryLoop()

void G4VInteractorManager::EnableSecondaryLoop ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 134 of file G4VInteractorManager.cc.

138{
139 secondaryLoopEnabled = TRUE;
140}

Referenced by G4UIQt::SessionStart(), G4UIXm::SessionStart(), and G4UIWin32::SessionStart().

◆ FlushAndWaitExecution()

virtual void G4VInteractorManager::FlushAndWaitExecution ( )
pure virtual

◆ GetArguments()

char ** G4VInteractorManager::GetArguments ( int *  a_argc)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 107 of file G4VInteractorManager.cc.

112{
113 if(a_argc!=NULL) *a_argc = argc;
114 return argv;
115}

◆ GetCreatedInteractor()

G4Interactor G4VInteractorManager::GetCreatedInteractor ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 339 of file G4VInteractorManager.cc.

343{
344 return createdInteractor;
345}

◆ GetCreationString()

char * G4VInteractorManager::GetCreationString ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 356 of file G4VInteractorManager.cc.

360{
361 return creationString;
362}

Referenced by G4OpenInventorWinViewer::Initialise(), G4OpenInventorXtExtendedViewer::Initialise(), and G4OpenInventorXtViewer::Initialise().

◆ GetEvent()

virtual void * G4VInteractorManager::GetEvent ( )
pure virtual

Implemented in G4Qt, G4Win32, G4Xt, and G4SoQt.

Referenced by SecondaryLoop(), and G4UIWin32::SessionStart().

◆ GetExitSecondaryLoopCode()

G4int G4VInteractorManager::GetExitSecondaryLoopCode ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 279 of file G4VInteractorManager.cc.

283{
284 return exitSecondaryLoop;
285}

◆ GetMainInteractor()

G4Interactor G4VInteractorManager::GetMainInteractor ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 126 of file G4VInteractorManager.cc.

130{
131 return mainInteractor;
132}

Referenced by G4UIQt::G4UIQt(), G4UIXm::G4UIXm(), G4OpenGLXmViewer::GetXmConnection(), session::session(), G4UIQt::SessionStart(), and G4UIQt::SessionTerminate().

◆ GetParentInteractor()

G4Interactor G4VInteractorManager::GetParentInteractor ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 322 of file G4VInteractorManager.cc.

326{
327 return parentInteractor;
328}

Referenced by G4OpenInventorWinViewer::Initialise(), G4OpenInventorXtExtendedViewer::Initialise(), and G4OpenInventorXtViewer::Initialise().

◆ Inited()

virtual G4bool G4VInteractorManager::Inited ( )
pure virtual

Implemented in G4Qt, G4Win32, G4Xt, and G4SoQt.

Referenced by SecondaryLoop().

◆ PutStringInResourceDatabase()

void G4VInteractorManager::PutStringInResourceDatabase ( char *  )

◆ RemoveDispatcher()

void G4VInteractorManager::RemoveDispatcher ( G4DispatchFunction  a_dispatcher)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 161 of file G4VInteractorManager.cc.

166{
167 std::vector<G4DispatchFunction>::iterator it;
168 for (it = dispatchers.begin(); it != dispatchers.end(); ++it) {
169 if (*it == a_dispatcher) {
170 dispatchers.erase(it);
171 break;
172 }
173 }
174}

◆ RemoveShell()

void G4VInteractorManager::RemoveShell ( G4Interactor  a_shell)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 298 of file G4VInteractorManager.cc.

303{
304 std::vector<G4Interactor>::iterator it;
305 for (it = shells.begin(); it != shells.end(); ++it) {
306 if (*it == a_shell) {
307 shells.erase(it);
308 break;
309 }
310 }
311}

Referenced by G4OpenGLXmViewer::~G4OpenGLXmViewer(), G4OpenInventorWinViewer::~G4OpenInventorWinViewer(), G4OpenInventorXtExtendedViewer::~G4OpenInventorXtExtendedViewer(), and G4OpenInventorXtViewer::~G4OpenInventorXtViewer().

◆ RequireExitSecondaryLoop()

void G4VInteractorManager::RequireExitSecondaryLoop ( int  a_code)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 265 of file G4VInteractorManager.cc.

270{
271 if(secondaryLoopEnabled==FALSE) return;
272 if(a_code==0) a_code = 1;
273 exitSecondaryLoop = a_code;
274 alreadyInSecondaryLoop = FALSE;
275 // for(G4int count=0;count<shelln;count++) XWidgetIconify(shells[count]);
276 // if(shelln!=0) XSync(XtDisplay(topWidget),False);
277}

Referenced by G4OpenInventorViewer::Escape().

◆ SecondaryLoop()

void G4VInteractorManager::SecondaryLoop ( )
virtual

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Reimplemented in G4SoQt.

Definition at line 236 of file G4VInteractorManager.cc.

240{
241 if(Inited()==FALSE) return;
242
243 if(secondaryLoopEnabled==FALSE) return;
244
245 if (alreadyInSecondaryLoop==FALSE) {
246 G4cout << "------------------------------------------" << G4endl;
247 G4cout << "You have entered a viewer secondary X event loop." << G4endl;
248 G4cout << "Quit it with an 'Escape' viewer button" << G4endl;
249 alreadyInSecondaryLoop = TRUE;
250 exitSecondaryLoop = 0;
252 //for(G4int count=0;count<shelln;count++) XWidgetUniconify(shells[count]);
253 void* event;
254 while(1) {
255 event = GetEvent();
256 if(event==NULL) break;
257 DispatchEvent (event);
258 if(exitSecondaryLoop!=0) break;
259 }
260 G4cout << "Secondary X event loop exited." << G4endl;
262 }
263}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
virtual void * GetEvent()=0
virtual G4bool Inited()=0

◆ SecondaryLoopPostActions()

void G4VInteractorManager::SecondaryLoopPostActions ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 225 of file G4VInteractorManager.cc.

229{
230 std::size_t postActionn = postActions.size();
231 for(std::size_t count=0;count<postActionn;++count) {
232 if(postActions[count]!=NULL) postActions[count]();
233 }
234}

Referenced by SecondaryLoop().

◆ SecondaryLoopPreActions()

void G4VInteractorManager::SecondaryLoopPreActions ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 203 of file G4VInteractorManager.cc.

207{
208 std::size_t preActionn = preActions.size();
209 for(std::size_t count=0;count<preActionn;++count) {
210 if(preActions[count]!=NULL) preActions[count]();
211 }
212}

Referenced by SecondaryLoop().

◆ SetArguments()

void G4VInteractorManager::SetArguments ( int  a_argc,
char **  a_argv 
)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 79 of file G4VInteractorManager.cc.

85{
86 // Free previous values.
87 if(argv!=NULL) {
88 for(G4int argi=0;argi<argc;++argi) {
89 if(argv[argi]!=NULL) free(argv[argi]);
90 }
91 free(argv);
92 }
93 argv = NULL;
94 argc = 0;
95 // Set new values.
96 if(a_argc!=0) {
97 argv = (char**)malloc(a_argc * sizeof(char*));
98 if(argv!=NULL) {
99 argc = a_argc;
100 for(G4int argi=0;argi<a_argc;++argi) {
101 argv[argi] = (char*)NewString (a_argv[argi]);
102 }
103 }
104 }
105}
#define NewString(str)

◆ SetCreatedInteractor()

void G4VInteractorManager::SetCreatedInteractor ( G4Interactor  a_interactor)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 330 of file G4VInteractorManager.cc.

335{
336 createdInteractor = a_interactor;
337}

Referenced by G4OpenInventorQtViewer::Initialise(), G4OpenInventorWinViewer::Initialise(), G4OpenInventorXtExtendedViewer::Initialise(), and G4OpenInventorXtViewer::Initialise().

◆ SetCreationString()

void G4VInteractorManager::SetCreationString ( char *  a_string)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 347 of file G4VInteractorManager.cc.

352{
353 creationString = a_string;
354}

◆ SetMainInteractor()

void G4VInteractorManager::SetMainInteractor ( G4Interactor  a_main)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 117 of file G4VInteractorManager.cc.

122{
123 mainInteractor = a_main;
124}

◆ SetParentInteractor()

void G4VInteractorManager::SetParentInteractor ( G4Interactor  a_interactor)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 313 of file G4VInteractorManager.cc.

318{
319 parentInteractor = a_interactor;
320}

The documentation for this class was generated from the following files: