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/G4VisManager.cc

    r564 r593  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VisManager.cc,v 1.109 2006/11/26 15:43:51 allison Exp $
    27 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     26// $Id: G4VisManager.cc,v 1.113 2007/05/25 10:50:26 allison Exp $
     27// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2828//
    2929//
     
    7272#include "Randomize.hh"
    7373#include "G4RunManager.hh"
     74#include "G4EventManager.hh"
    7475#include "G4Run.hh"
    7576#include "G4Event.hh"
     
    8687  fpSceneHandler   (0),
    8788  fpViewer         (0),
    88   fVerbosity       (confirmations),//(warnings),
     89  fVerbosity       (warnings),
    8990  fpStateDependent (0),
    9091  fEventRefreshing          (false),
     
    9293  fTransientsDrawnThisEvent (false),
    9394  fEventKeepingSuspended    (false),
    94   fKeptLastEvent            (false)
     95  fKeptLastEvent            (false),
     96  fpRequestedEvent (0),
     97  fAbortReviewKeptEvents    (false)
    9598  // All other objects use default constructors.
    9699{
     
    118121  if (fpInstance) {
    119122    G4Exception
    120       ("G4VisManager: attempt to Construct more than one VisManager. ");
     123      ("G4VisManager: attempt to Construct more than one VisManager.");
    121124  }
    122125  else {
     
    584587  if (fpSceneHandler) {
    585588    G4VViewer* p = fpGraphicsSystem -> CreateViewer (*fpSceneHandler, name);
    586     if (p) {
    587       fpViewer = p;                             // Make current.
    588       fpViewer -> Initialise ();
    589       fpSceneHandler -> AddViewerToList (fpViewer);
    590       fpSceneHandler -> SetCurrentViewer (fpViewer);
    591 
    592       const G4ViewParameters& vp = fpViewer->GetViewParameters();
    593       G4bool warn = false;
    594       if (vp.IsCulling () && vp.IsCullingInvisible ()) {
    595         warn = true;
     589    if (!p) {
     590      if (fVerbosity >= errors) {
     591        G4cout << "ERROR in G4VisManager::CreateViewer during "
     592               << fpGraphicsSystem -> GetName ()
     593               << " viewer creation.\n  No action taken."
     594               << G4endl;
     595      }
     596    } else {
     597      p -> Initialise ();
     598      if (p -> GetViewId() < 0) {
     599        if (fVerbosity >= errors) {
     600        G4cout << "ERROR in G4VisManager::CreateViewer during "
     601               << fpGraphicsSystem -> GetName ()
     602               << " viewer initialisation.\n  No action taken."
     603               << G4endl;
     604        }
     605      } else {
     606        fpViewer = p;                             // Make current.
     607        fpSceneHandler -> AddViewerToList (fpViewer);
     608        fpSceneHandler -> SetCurrentViewer (fpViewer);
     609
    596610        if (fVerbosity >= confirmations) {
    597           G4cout << "G4VisManager::CreateViewer: new viewer created:"
     611          G4cout << "G4VisManager::CreateViewer: new viewer created."
    598612                 << G4endl;
    599613        }
     614
     615        const G4ViewParameters& vp = fpViewer->GetViewParameters();
    600616        if (fVerbosity >= parameters) {
    601617          G4cout << " view parameters are:\n  " << vp << G4endl;
    602618        }
    603         if (fVerbosity >= warnings) {
    604           G4cout <<
    605             "WARNING: objects with visibility flag set to \"false\""
    606             " will not be drawn!"
    607             "\n  \"/vis/viewer/set/culling global false\" to Draw such objects."
    608                  << G4endl;
    609         }
    610       }
    611       if (vp.IsCullingCovered ()) {
    612         if (!warn) {
     619
     620        if (vp.IsCulling () && vp.IsCullingInvisible ()) {
     621          static G4bool warned = false;
    613622          if (fVerbosity >= confirmations) {
    614             G4cout << "G4VisManager::CreateViewer: new viewer created:"
    615                    << G4endl;
     623            if (!warned) {
     624              G4cout <<
     625  "NOTE: objects with visibility flag set to \"false\""
     626  " will not be drawn!"
     627  "\n  \"/vis/viewer/set/culling global false\" to Draw such objects."
     628  "\n  Also see other \"/vis/viewer/set\" commands."
     629                     << G4endl;
     630              warned = true;
     631            }
    616632          }
    617633        }
    618         warn = true;
    619         if (fVerbosity >= warnings) {
    620           G4cout <<
    621             "WARNING: covered objects in solid mode will not be rendered!"
    622             "\n  \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
    623                  << G4endl;
     634        if (vp.IsCullingCovered ()) {
     635          static G4bool warned = false;
     636          if (fVerbosity >= warnings) {
     637            if (!warned) {
     638              G4cout <<
     639  "WARNING: covered objects in solid mode will not be rendered!"
     640  "\n  \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
     641  "\n  Also see other \"/vis/viewer/set\" commands."
     642                     << G4endl;
     643              warned = true;
     644            }
     645          }
    624646        }
    625       }
    626       if (warn) {
    627         if (fVerbosity >= warnings) {
    628           G4cout << "  Also see other \"/vis/viewer/set\" commands."
    629                  << G4endl;
    630         }
    631       }
    632     }
    633     else {
    634       if (fVerbosity >= errors) {
    635         G4cout << "ERROR in G4VisManager::CreateViewer during "
    636                << fpGraphicsSystem -> GetName ()
    637                <<       " viewer creation.\n  No action taken."
    638                << G4endl;
    639647      }
    640648    }
     
    893901
    894902  // Top level basic commands...
     903  RegisterMessenger(new G4VisCommandAbortReviewKeptEvents);
    895904  RegisterMessenger(new G4VisCommandEnable);
    896905  RegisterMessenger(new G4VisCommandList);
     
    921930  RegisterMessenger(new G4VisCommandGeometrySetLineWidth);
    922931  RegisterMessenger(new G4VisCommandGeometrySetForceAuxEdgeVisible);
     932  RegisterMessenger(new G4VisCommandGeometrySetForceLineSegmentsPerCircle);
    923933  RegisterMessenger(new G4VisCommandGeometrySetForceSolid);
    924934  RegisterMessenger(new G4VisCommandGeometrySetForceWireframe);
     
    11041114void G4VisManager::BeginOfRun ()
    11051115{
    1106   G4cout << "G4VisManager::BeginOfRun" << G4endl;
     1116  //G4cout << "G4VisManager::BeginOfRun" << G4endl;
    11071117  fKeptLastEvent = false;
    11081118  fEventKeepingSuspended = false;
     
    11131123void G4VisManager::BeginOfEvent ()
    11141124{
    1115   G4cout << "G4VisManager::BeginOfEvent" << G4endl;
     1125  //G4cout << "G4VisManager::BeginOfEvent" << G4endl;
    11161126  fTransientsDrawnThisEvent = false;
    11171127  if (fpSceneHandler) fpSceneHandler->SetTransientsDrawnThisEvent(false);
     
    11201130void G4VisManager::EndOfEvent ()
    11211131{
    1122   G4cout << "G4VisManager::EndOfEvent" << G4endl;
     1132  //G4cout << "G4VisManager::EndOfEvent" << G4endl;
    11231133
    11241134  // Don't call IsValidView unless there is a scene handler.  This
     
    11311141  const G4Run* currentRun = runManager->GetCurrentRun();
    11321142
    1133   const G4Event* currentEvent =
    1134     G4EventManager::GetEventManager()->GetConstCurrentEvent();
     1143  G4EventManager* eventManager = G4EventManager::GetEventManager();
     1144  const G4Event* currentEvent = eventManager->GetConstCurrentEvent();
    11351145  if (!currentEvent) return;
    11361146
    11371147  ClearTransientStoreIfMarked();
    1138   printf("G4VisManager::DrawEvent \n");
    11391148  fpSceneHandler->DrawEvent(currentEvent);
    1140   printf("G4VisManager::DrawEvent END\n");
    11411149
    11421150  G4int nEventsToBeProcessed = 0;
     
    11601168      // Keep, but only if user has not kept any...
    11611169      if (!nKeptEvents) {
    1162         G4EventManager::GetEventManager()->KeepTheCurrentEvent();
     1170        eventManager->KeepTheCurrentEvent();
    11631171        fKeptLastEvent = true;
    11641172      }
     
    11821190      }
    11831191    } else if (maxNumberOfKeptEvents != 0) {
    1184       G4EventManager::GetEventManager()->KeepTheCurrentEvent();
     1192      eventManager->KeepTheCurrentEvent();
    11851193    }
    11861194  }
     
    11891197void G4VisManager::EndOfRun ()
    11901198{
    1191   G4cout << "G4VisManager::EndOfRun" << G4endl;
     1199  //G4cout << "G4VisManager::EndOfRun" << G4endl;
    11921200
    11931201  // Don't call IsValidView unless there is a scene handler.  This
Note: See TracChangeset for help on using the changeset viewer.