Ignore:
Timestamp:
Nov 9, 2007, 3:32:25 PM (17 years ago)
Author:
garnier
Message:

r627@mac-90108: laurentgarnier | 2007-11-09 07:57:42 +0100
modif dans les includes directives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/management/src/G4VisCommands.cc

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VisCommands.cc,v 1.20 2006/11/26 15:49:10 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VisCommands.cc,v 1.22 2007/03/27 15:47:32 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/ top level commands - John Allison  5th February 2001
     
    4040#include "G4Run.hh"
    4141#include "G4UIsession.hh"
     42
     43////////////// /vis/abortReviewKeptEvents /////////////////////////////
     44
     45G4VisCommandAbortReviewKeptEvents::G4VisCommandAbortReviewKeptEvents () {
     46  G4bool omitable;
     47
     48  fpCommand = new G4UIcmdWithABool("/vis/abortReviewKeptEvents", this);
     49  fpCommand -> SetGuidance("Abort review of kept events.");
     50  fpCommand -> SetParameterName("abort", omitable=true);
     51  fpCommand -> SetDefaultValue(true);
     52}
     53
     54G4VisCommandAbortReviewKeptEvents::~G4VisCommandAbortReviewKeptEvents () {
     55  delete fpCommand;
     56}
     57
     58G4String G4VisCommandAbortReviewKeptEvents::GetCurrentValue (G4UIcommand*) {
     59  return G4String();
     60}
     61
     62void G4VisCommandAbortReviewKeptEvents::SetNewValue (G4UIcommand*,
     63                                                     G4String newValue) {
     64  fpVisManager->SetAbortReviewKeptEvents(G4UIcommand::ConvertToBool(newValue));
     65  G4cout << "Type \"continue\" to complete the abort." << G4endl;
     66}
    4267
    4368////////////// /vis/enable ///////////////////////////////////////
     
    128153  fpCommand -> SetGuidance
    129154    ("If a macro file is specified, it is executed for each event.");
    130   fpCommand -> SetGuidance
    131     ("If a macro file is not specified, each event is drawn to the current"
    132      "\nviewer.  After each event, the session is paused.  The user may issue"
    133      "\nany allowed command.  Then enter \"continue\" to continue to the next"
    134      "\nevent.");
     155  fpCommand -> SetGuidance(
     156  "If a macro file is not specified, each event is drawn to the current"
     157  "\nviewer.  After each event, the session is paused.  The user may issue"
     158  "\nany allowed command.  Then enter \"cont[inue]\" to continue to the next"
     159  "\nevent."
     160  "\nUseful commands might be:"
     161  "\n  \"/vis/viewer/...\" to change the view (zoom, set/viewpoint,...)."
     162  "\n  \"/vis/oglx/printEPS\" to get hard copy."
     163  "\n  \"/vis/open\" to get alternative viewer."
     164  "\n  \"/vis/abortReviewKeptEvents\", then \"cont[inue]\", to abort.");
    135165  fpCommand -> SetParameterName("macro-file-name", omitable=true);
    136166  fpCommand -> SetDefaultValue("");
     
    185215  }
    186216
    187   G4VSceneHandler* sceneHandler = fpVisManager->GetCurrentSceneHandler();
    188 
    189217  G4UImanager* UImanager = G4UImanager::GetUIpointer();
    190218  G4int keepVerbose = UImanager->GetVerboseLevel();
     
    200228
    201229    // Draw to viewer and pause session...
     230    G4UIsession* session = UImanager->GetSession();
    202231    for (size_t i = 0; i < nKeptEvents; ++i) {
    203232      const G4Event* event = (*events)[i];
    204233      if (verbosity >= G4VisManager::warnings) {
    205234        G4cout << "Drawing event : " << event->GetEventID() <<
    206           ".  At EndOfEvent, enter any command, then \"continue\"..."
     235          ".  At EndOfEvent, enter any command, then \"cont[inue]\"..."
    207236               << G4endl;
     237        static G4bool first = true;
     238        if (first) {
     239          first = false;
     240          G4cout <<
     241  "  Useful commands might be:"
     242  "\n    \"/vis/viewer/...\" to change the view (zoom, set/viewpoint,...)."
     243  "\n    \"/vis/oglx/printEPS\" to get hard copy."
     244  "\n    \"/vis/open\" to get alternative viewer."
     245  "\n    \"/vis/abortReviewKeptEvents\", then \"cont[inue]\", to abort."
     246                 << G4endl;
     247        }
    208248      }
    209       sceneHandler->SetEvent(event);
     249      fpVisManager->SetRequestedEvent(event);
    210250      UImanager->ApplyCommand("/vis/viewer/rebuild");
    211251      /* The above command forces a rebuild of the scene, including
     
    224264         features or a complete re-think.
    225265      */
    226       if (!viewer->GetViewParameters().IsAutoRefresh())
    227         UImanager->ApplyCommand("/vis/viewer/flush");
    228       G4UIsession* session = UImanager->GetSession();
     266      UImanager->ApplyCommand("/vis/viewer/flush");
    229267      session->PauseSessionStart("EndOfEvent");
    230       sceneHandler->SetEvent(0);
    231     }
     268      fpVisManager->SetRequestedEvent(0);
     269      if (fpVisManager->GetAbortReviewKeptEvents()) break;
     270    }
     271    fpVisManager->SetAbortReviewKeptEvents(false);
    232272
    233273  } else {
     
    240280               << " with macro file \"" << macroFileName << G4endl;
    241281      }
    242       sceneHandler->SetEvent(event);
     282      fpVisManager->SetRequestedEvent(event);
    243283      UImanager->ApplyCommand("/control/execute " + macroFileName);
    244       sceneHandler->SetEvent(0);
     284      fpVisManager->SetRequestedEvent(0);
    245285    }
    246286  }
Note: See TracChangeset for help on using the changeset viewer.