[571] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
| 2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
---|
| 3 | <title>G4VInteractorManager.cc Source File</title> |
---|
| 4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
| 5 | </head><body> |
---|
| 6 | <!-- Generated by Doxygen 1.3.4 --> |
---|
| 7 | <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div> |
---|
| 8 | <h1>G4VInteractorManager.cc</h1><a href="G4VInteractorManager_8cc.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">//</span> |
---|
| 9 | 00002 <span class="comment">// ********************************************************************</span> |
---|
| 10 | 00003 <span class="comment">// * License and Disclaimer *</span> |
---|
| 11 | 00004 <span class="comment">// * *</span> |
---|
| 12 | 00005 <span class="comment">// * The Geant4 software is copyright of the Copyright Holders of *</span> |
---|
| 13 | 00006 <span class="comment">// * the Geant4 Collaboration. It is provided under the terms and *</span> |
---|
| 14 | 00007 <span class="comment">// * conditions of the Geant4 Software License, included in the file *</span> |
---|
| 15 | 00008 <span class="comment">// * LICENSE and available at http://cern.ch/geant4/license . These *</span> |
---|
| 16 | 00009 <span class="comment">// * include a list of copyright holders. *</span> |
---|
| 17 | 00010 <span class="comment">// * *</span> |
---|
| 18 | 00011 <span class="comment">// * Neither the authors of this software system, nor their employing *</span> |
---|
| 19 | 00012 <span class="comment">// * institutes,nor the agencies providing financial support for this *</span> |
---|
| 20 | 00013 <span class="comment">// * work make any representation or warranty, express or implied, *</span> |
---|
| 21 | 00014 <span class="comment">// * regarding this software system or assume any liability for its *</span> |
---|
| 22 | 00015 <span class="comment">// * use. Please see the license in the file LICENSE and URL above *</span> |
---|
| 23 | 00016 <span class="comment">// * for the full disclaimer and the limitation of liability. *</span> |
---|
| 24 | 00017 <span class="comment">// * *</span> |
---|
| 25 | 00018 <span class="comment">// * This code implementation is the result of the scientific and *</span> |
---|
| 26 | 00019 <span class="comment">// * technical work of the GEANT4 collaboration. *</span> |
---|
| 27 | 00020 <span class="comment">// * By using, copying, modifying or distributing the software (or *</span> |
---|
| 28 | 00021 <span class="comment">// * any work based on the software) you agree to acknowledge its *</span> |
---|
| 29 | 00022 <span class="comment">// * use in resulting scientific publications, and indicate your *</span> |
---|
| 30 | 00023 <span class="comment">// * acceptance of all terms of the Geant4 Software license. *</span> |
---|
| 31 | 00024 <span class="comment">// ********************************************************************</span> |
---|
| 32 | 00025 <span class="comment">//</span> |
---|
| 33 | 00026 <span class="comment">//</span> |
---|
| 34 | 00027 <span class="comment">// $Id: G4VInteractorManager.cc,v 1.13 2006/06/29 19:10:24 gunter Exp $</span> |
---|
| 35 | 00028 <span class="comment">// GEANT4 tag $Name: geant4-08-01-patch-01 $</span> |
---|
| 36 | 00029 <span class="comment">//</span> |
---|
| 37 | 00030 <span class="comment">// G.Barrand</span> |
---|
| 38 | 00031 |
---|
| 39 | 00032 <span class="preprocessor">#include <stdlib.h></span> |
---|
| 40 | 00033 <span class="preprocessor">#include <string.h></span> |
---|
| 41 | 00034 |
---|
| 42 | 00035 <span class="preprocessor">#include <algorithm></span> |
---|
| 43 | 00036 |
---|
| 44 | 00037 <span class="preprocessor">#include "<a class="code" href="G4VInteractorManager_8hh.html">G4VInteractorManager.hh</a>"</span> |
---|
| 45 | 00038 |
---|
| 46 | 00039 <span class="preprocessor">#define NewString(str) \</span> |
---|
| 47 | 00040 <span class="preprocessor"> ((str) != NULL ? (strcpy((char*)malloc((unsigned)strlen(str) + 1), str)) : NULL)</span> |
---|
| 48 | 00041 <span class="preprocessor"></span> |
---|
| 49 | 00042 <span class="comment">/***************************************************************************/</span> |
---|
| 50 | <a name="l00043"></a><a class="code" href="classG4VInteractorManager.html#a0">00043</a> <a class="code" href="classG4VInteractorManager.html#a0">G4VInteractorManager::G4VInteractorManager</a> ( |
---|
| 51 | 00044 ) |
---|
| 52 | 00045 :argc(0) |
---|
| 53 | 00046 ,argv(NULL) |
---|
| 54 | 00047 ,mainInteractor(NULL) |
---|
| 55 | 00048 ,secondaryLoopEnabled(TRUE) |
---|
| 56 | 00049 ,alreadyInSecondaryLoop(FALSE) |
---|
| 57 | 00050 ,exitSecondaryLoop(0) |
---|
| 58 | 00051 ,parentInteractor(NULL) |
---|
| 59 | 00052 ,createdInteractor(NULL) |
---|
| 60 | 00053 ,creationString(NULL) |
---|
| 61 | 00054 <span class="comment">/***************************************************************************/</span> |
---|
| 62 | 00056 { |
---|
| 63 | 00057 } |
---|
| 64 | 00058 <span class="comment">/***************************************************************************/</span> |
---|
| 65 | <a name="l00059"></a><a class="code" href="classG4VInteractorManager.html#a1">00059</a> <a class="code" href="classG4VInteractorManager.html#a1">G4VInteractorManager::~G4VInteractorManager</a> ( |
---|
| 66 | 00060 ) |
---|
| 67 | 00061 <span class="comment">/***************************************************************************/</span> |
---|
| 68 | 00063 { |
---|
| 69 | 00064 <span class="keywordflow">if</span>(<a class="code" href="classG4VInteractorManager.html#r1">argv</a>!=NULL) { |
---|
| 70 | 00065 <span class="keywordflow">for</span>(G4int argi=0;argi<<a class="code" href="classG4VInteractorManager.html#r0">argc</a>;argi++) { |
---|
| 71 | 00066 <span class="keywordflow">if</span>(<a class="code" href="classG4VInteractorManager.html#r1">argv</a>[argi]!=NULL) free(<a class="code" href="classG4VInteractorManager.html#r1">argv</a>[argi]); |
---|
| 72 | 00067 } |
---|
| 73 | 00068 free (<a class="code" href="classG4VInteractorManager.html#r1">argv</a>); |
---|
| 74 | 00069 } |
---|
| 75 | 00070 <a class="code" href="classG4VInteractorManager.html#r1">argv</a> = NULL; |
---|
| 76 | 00071 <a class="code" href="classG4VInteractorManager.html#r0">argc</a> = 0; |
---|
| 77 | 00072 <a class="code" href="classG4VInteractorManager.html#r3">dispatchers</a>.clear(); |
---|
| 78 | 00073 <a class="code" href="classG4VInteractorManager.html#r4">preActions</a>.clear(); |
---|
| 79 | 00074 <a class="code" href="classG4VInteractorManager.html#r5">postActions</a>.clear(); |
---|
| 80 | 00075 <a class="code" href="classG4VInteractorManager.html#r6">shells</a>.clear(); |
---|
| 81 | 00076 <a class="code" href="classG4VInteractorManager.html#r7">secondaryLoopEnabled</a> = TRUE; |
---|
| 82 | 00077 <a class="code" href="classG4VInteractorManager.html#r8">alreadyInSecondaryLoop</a> = FALSE; |
---|
| 83 | 00078 <a class="code" href="classG4VInteractorManager.html#r9">exitSecondaryLoop</a> = 0; |
---|
| 84 | 00079 } |
---|
| 85 | 00080 <span class="comment">/***************************************************************************/</span> |
---|
| 86 | 00081 <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a2">G4VInteractorManager::SetArguments</a> ( |
---|
| 87 | 00082 G4int a_argc |
---|
| 88 | 00083 ,<span class="keywordtype">char</span>** a_argv |
---|
| 89 | 00084 ) |
---|
| 90 | 00085 <span class="comment">/***************************************************************************/</span> |
---|
| 91 | 00087 { |
---|
| 92 | 00088 <span class="comment">// Free previous values.</span> |
---|
| 93 | 00089 <span class="keywordflow">if</span>(<a class="code" href="classG4VInteractorManager.html#r1">argv</a>!=NULL) { |
---|
| 94 | 00090 <span class="keywordflow">for</span>(G4int argi=0;argi<<a class="code" href="classG4VInteractorManager.html#r0">argc</a>;argi++) { |
---|
| 95 | 00091 <span class="keywordflow">if</span>(<a class="code" href="classG4VInteractorManager.html#r1">argv</a>[argi]!=NULL) free(argv[argi]); |
---|
| 96 | 00092 } |
---|
| 97 | 00093 free(argv); |
---|
| 98 | 00094 } |
---|
| 99 | 00095 <a class="code" href="classG4VInteractorManager.html#r1">argv</a> = NULL; |
---|
| 100 | 00096 <a class="code" href="classG4VInteractorManager.html#r0">argc</a> = 0; |
---|
| 101 | 00097 <span class="comment">// Set new values.</span> |
---|
| 102 | 00098 <span class="keywordflow">if</span>(a_argc!=0) { |
---|
| 103 | 00099 <a class="code" href="classG4VInteractorManager.html#r1">argv</a> = (<span class="keywordtype">char</span>**)malloc(a_argc * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>*)); |
---|
| 104 | 00100 <span class="keywordflow">if</span>(<a class="code" href="classG4VInteractorManager.html#r1">argv</a>!=NULL) { |
---|
| 105 | 00101 <a class="code" href="classG4VInteractorManager.html#r0">argc</a> = a_argc; |
---|
| 106 | 00102 <span class="keywordflow">for</span>(G4int argi=0;argi<a_argc;argi++) { |
---|
| 107 | 00103 <a class="code" href="classG4VInteractorManager.html#r1">argv</a>[argi] = (<span class="keywordtype">char</span>*)NewString (a_argv[argi]); |
---|
| 108 | 00104 } |
---|
| 109 | 00105 } |
---|
| 110 | 00106 } |
---|
| 111 | 00107 } |
---|
| 112 | 00108 <span class="comment">/***************************************************************************/</span> |
---|
| 113 | 00109 <span class="keywordtype">char</span>** <a class="code" href="classG4VInteractorManager.html#a3">G4VInteractorManager::GetArguments</a> ( |
---|
| 114 | 00110 G4int* a_argc |
---|
| 115 | 00111 ) |
---|
| 116 | 00112 <span class="comment">/***************************************************************************/</span> |
---|
| 117 | 00114 { |
---|
| 118 | 00115 <span class="keywordflow">if</span>(a_argc!=NULL) *a_argc = <a class="code" href="classG4VInteractorManager.html#r0">argc</a>; |
---|
| 119 | 00116 <span class="keywordflow">return</span> <a class="code" href="classG4VInteractorManager.html#r1">argv</a>; |
---|
| 120 | 00117 } |
---|
| 121 | 00118 <span class="comment">/***************************************************************************/</span> |
---|
| 122 | <a name="l00119"></a><a class="code" href="classG4VInteractorManager.html#a4">00119</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a4">G4VInteractorManager::SetMainInteractor</a> ( |
---|
| 123 | 00120 <a class="code" href="G4VInteractorManager_8hh.html#a0">G4Interactor</a> a_main |
---|
| 124 | 00121 ) |
---|
| 125 | 00122 <span class="comment">/***************************************************************************/</span> |
---|
| 126 | 00124 { |
---|
| 127 | 00125 <a class="code" href="classG4VInteractorManager.html#r2">mainInteractor</a> = a_main; |
---|
| 128 | 00126 } |
---|
| 129 | 00127 <span class="comment">/***************************************************************************/</span> |
---|
| 130 | <a name="l00128"></a><a class="code" href="classG4VInteractorManager.html#a5">00128</a> <a class="code" href="G4VInteractorManager_8hh.html#a0">G4Interactor</a> <a class="code" href="classG4VInteractorManager.html#a5">G4VInteractorManager::GetMainInteractor</a> ( |
---|
| 131 | 00129 ) |
---|
| 132 | 00130 <span class="comment">/***************************************************************************/</span> |
---|
| 133 | 00132 { |
---|
| 134 | 00133 <span class="keywordflow">return</span> <a class="code" href="classG4VInteractorManager.html#r2">mainInteractor</a>; |
---|
| 135 | 00134 } |
---|
| 136 | 00135 <span class="comment">/***************************************************************************/</span> |
---|
| 137 | <a name="l00136"></a><a class="code" href="classG4VInteractorManager.html#a12">00136</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a12">G4VInteractorManager::EnableSecondaryLoop</a> ( |
---|
| 138 | 00137 ) |
---|
| 139 | 00138 <span class="comment">/***************************************************************************/</span> |
---|
| 140 | 00140 { |
---|
| 141 | 00141 <a class="code" href="classG4VInteractorManager.html#r7">secondaryLoopEnabled</a> = TRUE; |
---|
| 142 | 00142 } |
---|
| 143 | 00143 <span class="comment">/***************************************************************************/</span> |
---|
| 144 | <a name="l00144"></a><a class="code" href="classG4VInteractorManager.html#a13">00144</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a13">G4VInteractorManager::DisableSecondaryLoop</a> ( |
---|
| 145 | 00145 ) |
---|
| 146 | 00146 <span class="comment">/***************************************************************************/</span> |
---|
| 147 | 00148 { |
---|
| 148 | 00149 <a class="code" href="classG4VInteractorManager.html#r7">secondaryLoopEnabled</a> = FALSE; |
---|
| 149 | 00150 } |
---|
| 150 | 00151 <span class="comment">/***************************************************************************/</span> |
---|
| 151 | <a name="l00152"></a><a class="code" href="classG4VInteractorManager.html#a6">00152</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a6">G4VInteractorManager::AddDispatcher</a> ( |
---|
| 152 | 00153 <a class="code" href="G4VInteractorManager_8hh.html#a1">G4DispatchFunction</a> a_dispatcher |
---|
| 153 | 00154 ) |
---|
| 154 | 00155 <span class="comment">/***************************************************************************/</span> |
---|
| 155 | 00157 { |
---|
| 156 | 00158 <span class="keywordflow">if</span>(a_dispatcher==NULL) <span class="keywordflow">return</span>; |
---|
| 157 | 00159 <span class="keywordflow">if</span>(std::find(<a class="code" href="classG4VInteractorManager.html#r3">dispatchers</a>.begin(),<a class="code" href="classG4VInteractorManager.html#r3">dispatchers</a>.end(),a_dispatcher)!=<a class="code" href="classG4VInteractorManager.html#r3">dispatchers</a>.end()) <span class="keywordflow">return</span>; |
---|
| 158 | 00160 <a class="code" href="classG4VInteractorManager.html#r3">dispatchers</a>.push_back(a_dispatcher); |
---|
| 159 | 00161 } |
---|
| 160 | 00162 <span class="comment">/***************************************************************************/</span> |
---|
| 161 | <a name="l00163"></a><a class="code" href="classG4VInteractorManager.html#a7">00163</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a7">G4VInteractorManager::RemoveDispatcher</a> ( |
---|
| 162 | 00164 <a class="code" href="G4VInteractorManager_8hh.html#a1">G4DispatchFunction</a> a_dispatcher |
---|
| 163 | 00165 ) |
---|
| 164 | 00166 <span class="comment">/***************************************************************************/</span> |
---|
| 165 | 00168 { |
---|
| 166 | 00169 std::vector<G4DispatchFunction>::iterator it; |
---|
| 167 | 00170 <span class="keywordflow">for</span> (it = <a class="code" href="classG4VInteractorManager.html#r3">dispatchers</a>.begin(); it != <a class="code" href="classG4VInteractorManager.html#r3">dispatchers</a>.end(); it++) { |
---|
| 168 | 00171 <span class="keywordflow">if</span> (*it == a_dispatcher) { |
---|
| 169 | 00172 <a class="code" href="classG4VInteractorManager.html#r3">dispatchers</a>.erase(it); |
---|
| 170 | 00173 <span class="keywordflow">break</span>; |
---|
| 171 | 00174 } |
---|
| 172 | 00175 } |
---|
| 173 | 00176 } |
---|
| 174 | 00177 <span class="comment">/***************************************************************************/</span> |
---|
| 175 | <a name="l00178"></a><a class="code" href="classG4VInteractorManager.html#a17">00178</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a17">G4VInteractorManager::DispatchEvent</a> ( |
---|
| 176 | 00179 <span class="keywordtype">void</span>* a_event |
---|
| 177 | 00180 ) |
---|
| 178 | 00181 <span class="comment">/***************************************************************************/</span> |
---|
| 179 | 00183 { |
---|
| 180 | 00184 G4int dispatchern = <a class="code" href="classG4VInteractorManager.html#r3">dispatchers</a>.size(); |
---|
| 181 | 00185 <a class="code" href="G4VInteractorManager_8hh.html#a1">G4DispatchFunction</a> func; |
---|
| 182 | 00186 <span class="keywordflow">for</span>(G4int count=0;count<dispatchern;count++) { |
---|
| 183 | 00187 func = <a class="code" href="classG4VInteractorManager.html#r3">dispatchers</a>[count]; |
---|
| 184 | 00188 <span class="keywordflow">if</span>(func!=NULL) { |
---|
| 185 | 00189 <span class="keywordflow">if</span>(func(a_event)==<span class="keyword">true</span>) <span class="keywordflow">return</span>; |
---|
| 186 | 00190 } |
---|
| 187 | 00191 } |
---|
| 188 | 00192 } |
---|
| 189 | 00193 <span class="comment">/***************************************************************************/</span> |
---|
| 190 | <a name="l00194"></a><a class="code" href="classG4VInteractorManager.html#a8">00194</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a8">G4VInteractorManager::AddSecondaryLoopPreAction</a> ( |
---|
| 191 | 00195 <a class="code" href="G4VInteractorManager_8hh.html#a2">G4SecondaryLoopAction</a> a_preAction |
---|
| 192 | 00196 ) |
---|
| 193 | 00197 <span class="comment">/***************************************************************************/</span> |
---|
| 194 | 00199 { |
---|
| 195 | 00200 <span class="keywordflow">if</span>(a_preAction==NULL) <span class="keywordflow">return</span>; |
---|
| 196 | 00201 <span class="keywordflow">if</span>(std::find(<a class="code" href="classG4VInteractorManager.html#r4">preActions</a>.begin(),<a class="code" href="classG4VInteractorManager.html#r4">preActions</a>.end(),a_preAction)!=<a class="code" href="classG4VInteractorManager.html#r4">preActions</a>.end()) <span class="keywordflow">return</span>; |
---|
| 197 | 00202 <a class="code" href="classG4VInteractorManager.html#r4">preActions</a>.push_back(a_preAction); |
---|
| 198 | 00203 } |
---|
| 199 | 00204 <span class="comment">/***************************************************************************/</span> |
---|
| 200 | <a name="l00205"></a><a class="code" href="classG4VInteractorManager.html#a14">00205</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a14">G4VInteractorManager::SecondaryLoopPreActions</a> ( |
---|
| 201 | 00206 ) |
---|
| 202 | 00207 <span class="comment">/***************************************************************************/</span> |
---|
| 203 | 00209 { |
---|
| 204 | 00210 G4int preActionn = <a class="code" href="classG4VInteractorManager.html#r4">preActions</a>.size(); |
---|
| 205 | 00211 <span class="keywordflow">for</span>(G4int count=0;count<preActionn;count++) { |
---|
| 206 | 00212 <span class="keywordflow">if</span>(<a class="code" href="classG4VInteractorManager.html#r4">preActions</a>[count]!=NULL) <a class="code" href="classG4VInteractorManager.html#r4">preActions</a>[count](); |
---|
| 207 | 00213 } |
---|
| 208 | 00214 } |
---|
| 209 | 00215 <span class="comment">/***************************************************************************/</span> |
---|
| 210 | <a name="l00216"></a><a class="code" href="classG4VInteractorManager.html#a9">00216</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a9">G4VInteractorManager::AddSecondaryLoopPostAction</a> ( |
---|
| 211 | 00217 <a class="code" href="G4VInteractorManager_8hh.html#a2">G4SecondaryLoopAction</a> a_postAction |
---|
| 212 | 00218 ) |
---|
| 213 | 00219 <span class="comment">/***************************************************************************/</span> |
---|
| 214 | 00221 { |
---|
| 215 | 00222 <span class="keywordflow">if</span>(a_postAction==NULL) <span class="keywordflow">return</span>; |
---|
| 216 | 00223 <span class="keywordflow">if</span>(std::find(<a class="code" href="classG4VInteractorManager.html#r5">postActions</a>.begin(),<a class="code" href="classG4VInteractorManager.html#r5">postActions</a>.end(),a_postAction)!=<a class="code" href="classG4VInteractorManager.html#r5">postActions</a>.end()) <span class="keywordflow">return</span>; |
---|
| 217 | 00224 <a class="code" href="classG4VInteractorManager.html#r5">postActions</a>.push_back(a_postAction); |
---|
| 218 | 00225 } |
---|
| 219 | 00226 <span class="comment">/***************************************************************************/</span> |
---|
| 220 | <a name="l00227"></a><a class="code" href="classG4VInteractorManager.html#a15">00227</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a15">G4VInteractorManager::SecondaryLoopPostActions</a> ( |
---|
| 221 | 00228 ) |
---|
| 222 | 00229 <span class="comment">/***************************************************************************/</span> |
---|
| 223 | 00231 { |
---|
| 224 | 00232 G4int postActionn = <a class="code" href="classG4VInteractorManager.html#r5">postActions</a>.size(); |
---|
| 225 | 00233 <span class="keywordflow">for</span>(G4int count=0;count<postActionn;count++) { |
---|
| 226 | 00234 <span class="keywordflow">if</span>(<a class="code" href="classG4VInteractorManager.html#r5">postActions</a>[count]!=NULL) <a class="code" href="classG4VInteractorManager.html#r5">postActions</a>[count](); |
---|
| 227 | 00235 } |
---|
| 228 | 00236 } |
---|
| 229 | 00237 <span class="comment">/***************************************************************************/</span> |
---|
| 230 | <a name="l00238"></a><a class="code" href="classG4VInteractorManager.html#a18">00238</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a18">G4VInteractorManager::SecondaryLoop</a> ( |
---|
| 231 | 00239 ) |
---|
| 232 | 00240 <span class="comment">/***************************************************************************/</span> |
---|
| 233 | 00242 { |
---|
| 234 | 00243 <span class="keywordflow">if</span>(<a class="code" href="classG4VInteractorManager.html#a21">Inited</a>()==FALSE) <span class="keywordflow">return</span>; |
---|
| 235 | 00244 |
---|
| 236 | 00245 <span class="keywordflow">if</span>(<a class="code" href="classG4VInteractorManager.html#r7">secondaryLoopEnabled</a>==FALSE) <span class="keywordflow">return</span>; |
---|
| 237 | 00246 |
---|
| 238 | 00247 <span class="keywordflow">if</span> (<a class="code" href="classG4VInteractorManager.html#r8">alreadyInSecondaryLoop</a>==FALSE) { |
---|
| 239 | 00248 G4cout << <span class="stringliteral">"------------------------------------------"</span> << G4endl; |
---|
| 240 | 00249 G4cout << <span class="stringliteral">"You have entered a viewer secondary X event loop."</span> << G4endl; |
---|
| 241 | 00250 G4cout << <span class="stringliteral">"Quit it with an 'Escape' viewer button"</span> << G4endl; |
---|
| 242 | 00251 <a class="code" href="classG4VInteractorManager.html#r8">alreadyInSecondaryLoop</a> = TRUE; |
---|
| 243 | 00252 <a class="code" href="classG4VInteractorManager.html#r9">exitSecondaryLoop</a> = 0; |
---|
| 244 | 00253 <a class="code" href="classG4VInteractorManager.html#a14">SecondaryLoopPreActions</a> (); |
---|
| 245 | 00254 <span class="comment">//for(G4int count=0;count<shelln;count++) XWidgetUniconify(shells[count]);</span> |
---|
| 246 | 00255 <span class="keywordtype">void</span>* event; |
---|
| 247 | 00256 <span class="keywordflow">while</span>(1) { |
---|
| 248 | 00257 event = <a class="code" href="classG4VInteractorManager.html#a22">GetEvent</a>(); |
---|
| 249 | 00258 <span class="keywordflow">if</span>(event==NULL) <span class="keywordflow">break</span>; |
---|
| 250 | 00259 <a class="code" href="classG4VInteractorManager.html#a17">DispatchEvent</a> (event); |
---|
| 251 | 00260 <span class="keywordflow">if</span>(<a class="code" href="classG4VInteractorManager.html#r9">exitSecondaryLoop</a>!=0) <span class="keywordflow">break</span>; |
---|
| 252 | 00261 } |
---|
| 253 | 00262 G4cout << <span class="stringliteral">"Secondary X event loop exited."</span> << G4endl; |
---|
| 254 | 00263 <a class="code" href="classG4VInteractorManager.html#a15">SecondaryLoopPostActions</a> (); |
---|
| 255 | 00264 } |
---|
| 256 | 00265 } |
---|
| 257 | 00266 <span class="comment">/***************************************************************************/</span> |
---|
| 258 | 00267 <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a16">G4VInteractorManager::RequireExitSecondaryLoop</a> ( |
---|
| 259 | 00268 G4int a_code |
---|
| 260 | 00269 ) |
---|
| 261 | 00270 <span class="comment">/***************************************************************************/</span> |
---|
| 262 | 00272 { |
---|
| 263 | 00273 <span class="keywordflow">if</span>(<a class="code" href="classG4VInteractorManager.html#r7">secondaryLoopEnabled</a>==FALSE) <span class="keywordflow">return</span>; |
---|
| 264 | 00274 <span class="keywordflow">if</span>(a_code==0) a_code = 1; |
---|
| 265 | 00275 <a class="code" href="classG4VInteractorManager.html#r9">exitSecondaryLoop</a> = a_code; |
---|
| 266 | 00276 <a class="code" href="classG4VInteractorManager.html#r8">alreadyInSecondaryLoop</a> = FALSE; |
---|
| 267 | 00277 <span class="comment">// for(G4int count=0;count<shelln;count++) XWidgetIconify(shells[count]);</span> |
---|
| 268 | 00278 <span class="comment">// if(shelln!=0) XSync(XtDisplay(topWidget),False);</span> |
---|
| 269 | 00279 } |
---|
| 270 | 00280 <span class="comment">/***************************************************************************/</span> |
---|
| 271 | <a name="l00281"></a><a class="code" href="classG4VInteractorManager.html#a19">00281</a> G4int <a class="code" href="classG4VInteractorManager.html#a19">G4VInteractorManager::GetExitSecondaryLoopCode</a> ( |
---|
| 272 | 00282 ) |
---|
| 273 | 00283 <span class="comment">/***************************************************************************/</span> |
---|
| 274 | 00285 { |
---|
| 275 | 00286 <span class="keywordflow">return</span> <a class="code" href="classG4VInteractorManager.html#r9">exitSecondaryLoop</a>; |
---|
| 276 | 00287 } |
---|
| 277 | 00288 <span class="comment">/***************************************************************************/</span> |
---|
| 278 | <a name="l00289"></a><a class="code" href="classG4VInteractorManager.html#a10">00289</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a10">G4VInteractorManager::AddShell</a> ( |
---|
| 279 | 00290 <a class="code" href="G4VInteractorManager_8hh.html#a0">G4Interactor</a> a_shell |
---|
| 280 | 00291 ) |
---|
| 281 | 00292 <span class="comment">/***************************************************************************/</span> |
---|
| 282 | 00294 { |
---|
| 283 | 00295 <span class="keywordflow">if</span>(a_shell==NULL) <span class="keywordflow">return</span>; |
---|
| 284 | 00296 <span class="keywordflow">if</span>(std::find(<a class="code" href="classG4VInteractorManager.html#r6">shells</a>.begin(),<a class="code" href="classG4VInteractorManager.html#r6">shells</a>.end(),a_shell)!=<a class="code" href="classG4VInteractorManager.html#r6">shells</a>.end()) <span class="keywordflow">return</span>; |
---|
| 285 | 00297 <a class="code" href="classG4VInteractorManager.html#r6">shells</a>.push_back(a_shell); |
---|
| 286 | 00298 } |
---|
| 287 | 00299 <span class="comment">/***************************************************************************/</span> |
---|
| 288 | <a name="l00300"></a><a class="code" href="classG4VInteractorManager.html#a11">00300</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a11">G4VInteractorManager::RemoveShell</a> ( |
---|
| 289 | 00301 <a class="code" href="G4VInteractorManager_8hh.html#a0">G4Interactor</a> a_shell |
---|
| 290 | 00302 ) |
---|
| 291 | 00303 <span class="comment">/***************************************************************************/</span> |
---|
| 292 | 00305 { |
---|
| 293 | 00306 std::vector<G4Interactor>::iterator it; |
---|
| 294 | 00307 <span class="keywordflow">for</span> (it = <a class="code" href="classG4VInteractorManager.html#r6">shells</a>.begin(); it != <a class="code" href="classG4VInteractorManager.html#r6">shells</a>.end(); it++) { |
---|
| 295 | 00308 <span class="keywordflow">if</span> (*it == a_shell) { |
---|
| 296 | 00309 <a class="code" href="classG4VInteractorManager.html#r6">shells</a>.erase(it); |
---|
| 297 | 00310 <span class="keywordflow">break</span>; |
---|
| 298 | 00311 } |
---|
| 299 | 00312 } |
---|
| 300 | 00313 } |
---|
| 301 | 00314 <span class="comment">/***************************************************************************/</span> |
---|
| 302 | <a name="l00315"></a><a class="code" href="classG4VInteractorManager.html#a24">00315</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a24">G4VInteractorManager::SetParentInteractor</a> ( |
---|
| 303 | 00316 <a class="code" href="G4VInteractorManager_8hh.html#a0">G4Interactor</a> a_interactor |
---|
| 304 | 00317 ) |
---|
| 305 | 00318 <span class="comment">/***************************************************************************/</span> |
---|
| 306 | 00320 { |
---|
| 307 | 00321 <a class="code" href="classG4VInteractorManager.html#r10">parentInteractor</a> = a_interactor; |
---|
| 308 | 00322 } |
---|
| 309 | 00323 <span class="comment">/***************************************************************************/</span> |
---|
| 310 | <a name="l00324"></a><a class="code" href="classG4VInteractorManager.html#a25">00324</a> <a class="code" href="G4VInteractorManager_8hh.html#a0">G4Interactor</a> <a class="code" href="classG4VInteractorManager.html#a25">G4VInteractorManager::GetParentInteractor</a> ( |
---|
| 311 | 00325 ) |
---|
| 312 | 00326 <span class="comment">/***************************************************************************/</span> |
---|
| 313 | 00328 { |
---|
| 314 | 00329 <span class="keywordflow">return</span> <a class="code" href="classG4VInteractorManager.html#r10">parentInteractor</a>; |
---|
| 315 | 00330 } |
---|
| 316 | 00331 <span class="comment">/***************************************************************************/</span> |
---|
| 317 | <a name="l00332"></a><a class="code" href="classG4VInteractorManager.html#a26">00332</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a26">G4VInteractorManager::SetCreatedInteractor</a> ( |
---|
| 318 | 00333 <a class="code" href="G4VInteractorManager_8hh.html#a0">G4Interactor</a> a_interactor |
---|
| 319 | 00334 ) |
---|
| 320 | 00335 <span class="comment">/***************************************************************************/</span> |
---|
| 321 | 00337 { |
---|
| 322 | 00338 <a class="code" href="classG4VInteractorManager.html#r11">createdInteractor</a> = a_interactor; |
---|
| 323 | 00339 } |
---|
| 324 | 00340 <span class="comment">/***************************************************************************/</span> |
---|
| 325 | <a name="l00341"></a><a class="code" href="classG4VInteractorManager.html#a27">00341</a> <a class="code" href="G4VInteractorManager_8hh.html#a0">G4Interactor</a> <a class="code" href="classG4VInteractorManager.html#a27">G4VInteractorManager::GetCreatedInteractor</a> ( |
---|
| 326 | 00342 ) |
---|
| 327 | 00343 <span class="comment">/***************************************************************************/</span> |
---|
| 328 | 00345 { |
---|
| 329 | 00346 <span class="keywordflow">return</span> <a class="code" href="classG4VInteractorManager.html#r11">createdInteractor</a>; |
---|
| 330 | 00347 } |
---|
| 331 | 00348 <span class="comment">/***************************************************************************/</span> |
---|
| 332 | <a name="l00349"></a><a class="code" href="classG4VInteractorManager.html#a28">00349</a> <span class="keywordtype">void</span> <a class="code" href="classG4VInteractorManager.html#a28">G4VInteractorManager::SetCreationString</a> ( |
---|
| 333 | 00350 <span class="keywordtype">char</span>* a_string |
---|
| 334 | 00351 ) |
---|
| 335 | 00352 <span class="comment">/***************************************************************************/</span> |
---|
| 336 | 00354 { |
---|
| 337 | 00355 <a class="code" href="classG4VInteractorManager.html#r12">creationString</a> = a_string; |
---|
| 338 | 00356 } |
---|
| 339 | 00357 <span class="comment">/***************************************************************************/</span> |
---|
| 340 | <a name="l00358"></a><a class="code" href="classG4VInteractorManager.html#a29">00358</a> <span class="keywordtype">char</span>* <a class="code" href="classG4VInteractorManager.html#a29">G4VInteractorManager::GetCreationString</a> ( |
---|
| 341 | 00359 ) |
---|
| 342 | 00360 <span class="comment">/***************************************************************************/</span> |
---|
| 343 | 00362 { |
---|
| 344 | 00363 <span class="keywordflow">return</span> <a class="code" href="classG4VInteractorManager.html#r12">creationString</a>; |
---|
| 345 | 00364 } |
---|
| 346 | 00365 |
---|
| 347 | </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Jun 22 11:07:02 2007 by |
---|
| 348 | <a href="http://www.doxygen.org/index.html"> |
---|
| 349 | <img src="doxygen.png" alt="doxygen" align="middle" border=0 > |
---|
| 350 | </a>1.3.4 </small></address> |
---|
| 351 | </body> |
---|
| 352 | </html> |
---|