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

Location:
trunk/geant4/visualization/management
Files:
66 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/management/History

    r531 r593  
    1 $Id: History,v 1.90 2006/12/12 11:51:13 gcosmo Exp $
     1$Id: History,v 1.101 2007/07/10 17:52:25 allison Exp $
    22
    33-------------------------------------------------------------------
     
    2626History file for visualization management sub-category
    2727------------------------------------------------------
     28
     2910th July 2007  John Allison  (visman-V09-00-00)
     30- Remove redundant method declarations in G4VisManager.hh.
     31- Reinstate refesh after "/vis/viewer/set/autoRefresh true".
     32
     33-25th May 2007  John Allison  (visman-V08-03-01)
     34 Improved error trapping in viewer initialisation.
     35- Bug fix in /vis/scene/notifyHandlers for case of no current viewer.
     36
     3716th May 2007  John Allison  (visman-V08-03-00)
     38- G4VSceneHandler.cc: Added #include "G4AttDef.hh" to help buggy
     39  Windows compiler(!).
     40
     414th April 2007  John Allison  (visman-V08-02-04)
     42- G4VSceneHandler.cc: Bug fix for zero vis atts in LoadAtts.
     43
     443rd April 2007  John Allison  (visman-V08-02-03)
     45- Added /vis/viewer/set/picking.  Picking is false by default, except
     46  for OpenInventor.
     47
     4825th March 2007  John Allison  (visman-V08-02-02)
     49- G4VisExecutive.icc: Removed G4GAGTree.
     50- G4VisCommandsCompound.cc: Removed /vis/scene/add/eventID, once
     51  again, from /vis/drawVolume.
     52- G4VisCommands.cc: Improved messages for /vis/abortReviewKeptEvents.
     53- G4VisManager.cc, G4VSceneHandler.cc: Cosmetic.
     54
     5511th January 2007  John Allison  (visman-V08-02-01)
     56- Added /vis/abortReviewKeptEvents.
     57- /vis/reviewKeptEvents: Improved guidance.
     58- Bug fix: /vis/open in /vis/reviewKeptEvents loop.
     59  o Moved fpRequestedEvent from G4VSceneHandler to G4VisManager.
     60- Reduced WARNING noise.
     61
     625th January 2007  John Allison  (visman-V08-02-00)
     63- G4VSceneHandler:
     64  o Introduced LoadAtts (from G4OpenInventorSceneHandler, but now
     65    available to all scene handlers).  Loads G4AttValues and G4AttDefs
     66    onto any object that inherits G4AttHolder.
     67  o Change signature of GetLineWidth from G4Visible& to
     68    G4VisAttributes* for consistency with similar utility functions.
     69    (Only used by OpenGL at present; requires opengl-V08-02-00.)
     70  o GetLineSegmentsPerCircle: protected against null vis atts pointer.
     71- G4VisCommandsGeometrySet and G4VisManager.cc:
     72  o Introduced /vis/geometry/set/forceLineSegmentsPerCircle
     73    (inadvertently omitted in previous release).
     74  o Improved guidance.
     75- G4VisCommandsGeometry.cc: Invoke /vis/viewer/rebuild only if viewer current.
     76- G4VViewer.cc: Improved comment.
     77- G4VisCommandsCompound.cc:
     78  o Re-introduced /vis/scene/add/eventID into /vis/drawVolume.
     79- G4VisCommandsViewer.cc: Improve guidance for /vis/viewer/addCutawayPlane.
    2880
    298112th December 2006  Gabriele Cosmo  (visman-V08-01-16)
  • trunk/geant4/visualization/management/include/G4GraphicsSystemList.hh

    r531 r593  
    2626//
    2727// $Id: G4GraphicsSystemList.hh,v 1.9 2006/06/29 21:27:54 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4Scene.hh

    r531 r593  
    2626//
    2727// $Id: G4Scene.hh,v 1.18 2006/11/14 14:59:54 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4Scene.icc

    r531 r593  
    2626//
    2727// $Id: G4Scene.icc,v 1.14 2006/11/14 14:59:54 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4SceneHandlerList.hh

    r531 r593  
    2626//
    2727// $Id: G4SceneHandlerList.hh,v 1.8 2006/06/29 21:28:00 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4SceneList.hh

    r531 r593  
    2626//
    2727// $Id: G4SceneList.hh,v 1.10 2006/06/29 21:28:02 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4VGraphicsSystem.hh

    r531 r593  
    2626//
    2727// $Id: G4VGraphicsSystem.hh,v 1.11 2006/06/29 21:28:04 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4VGraphicsSystem.icc

    r531 r593  
    2626//
    2727// $Id: G4VGraphicsSystem.icc,v 1.7 2006/06/29 21:28:06 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4VSceneHandler.hh

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VSceneHandler.hh,v 1.37 2006/11/15 19:25:31 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VSceneHandler.hh,v 1.39 2007/01/11 16:38:14 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
     
    5959class G4Material;
    6060class G4Event;
     61class G4AttHolder;
    6162
    6263class G4VSceneHandler: public G4VGraphicsScene {
     
    217218  void          SetTransientsDrawnThisRun        (G4bool);
    218219  // Maintained by vis manager.
    219   void          SetEvent         (const G4Event*);
    220   // If non-zero, this event is used in ProcessScene.  Otherwise, the
    221   // current event, or last event(s) are used.  The user must
    222   // SetEvent(0) when finished.
    223220
    224221  //////////////////////////////////////////////////////////////
     
    233230  // Returns colour of G4Text object, or default text colour.
    234231
    235   G4double GetLineWidth(const G4Visible& visible);
    236   // Returns line width of G4Visible object, or default line width.
    237   // Multiplies by GlobalLineWidthScale.
     232  G4double GetLineWidth(const G4VisAttributes*);
     233  // Returns line width of G4VisAttributes multiplied by GlobalLineWidthScale.
    238234
    239235  G4ViewParameters::DrawingStyle GetDrawingStyle (const G4VisAttributes*);
     
    247243  // over-riding the current view parameter.
    248244
    249   G4int GetNoOfSides(const G4VisAttributes* pVisAttribs);
     245  G4int GetNoOfSides(const G4VisAttributes*);
    250246  // Returns no. of sides (lines segments per circle) from current
    251247  // view parameters, unless the user has forced through the vis
     
    314310  // implemented in this class.  Subclasses that implement their own
    315311  // clipping should provide an override that returns zero.
     312  void LoadAtts(const G4Visible&, G4AttHolder*);
     313  // Load G4AttValues and G4AttDefs associated with the G4Visible
     314  // object onto the G4AttHolder object.  It checks fpModel, and also
     315  // loads the G4AttValues and G4AttDefs from G4PhysicalVolumeModel,
     316  // G4VTrajectory, G4VTrajectoryPoint, or G4VHits, as appropriate.
     317  // The G4AttHolder object is an object of a class that publicly
     318  // inherits G4AttHolder - see, e.g., SoG4Polyhedron in the Open
     319  // Inventor driver.  G4AttHolder deletes G4AttValues in its
     320  // destructor to ensure proper clean-up of G4AttValues.
    316321
    317322  //////////////////////////////////////////////////////////////
     
    338343  G4int              fNestingDepth; // For Begin/EndPrimitives.
    339344  const G4VisAttributes* fpVisAttribs;  // Working vis attributes.
    340   const G4Event* fRequestedEvent;   // If non-zero, use this event.
    341345  const G4Transform3D fIdentityTransformation;
    342346
  • trunk/geant4/visualization/management/include/G4VSceneHandler.icc

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VSceneHandler.icc,v 1.18 2006/11/15 19:25:31 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VSceneHandler.icc,v 1.20 2007/01/11 16:38:14 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
     
    124124}
    125125
    126 inline void G4VSceneHandler::SetEvent (const G4Event* event) {
    127   fRequestedEvent = event;
    128 }
    129126inline const G4Colour& G4VSceneHandler::GetColor (const G4Visible& visible) {
    130127  return GetColour (visible);
  • trunk/geant4/visualization/management/include/G4VUserVisAction.hh

    r531 r593  
    2626//
    2727// $Id: G4VUserVisAction.hh,v 1.8 2006/06/29 21:28:12 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4VViewer.hh

    r531 r593  
    2626//
    2727// $Id: G4VViewer.hh,v 1.18 2006/06/29 21:28:14 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4VViewer.icc

    r531 r593  
    2626//
    2727// $Id: G4VViewer.icc,v 1.11 2006/06/29 21:28:16 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4VVisCommand.hh

    r531 r593  
    2626//
    2727// $Id: G4VVisCommand.hh,v 1.18 2006/06/29 21:28:18 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// Base class for visualization commands - John Allison  9th August 1998
  • trunk/geant4/visualization/management/include/G4VVisCommand.icc

    r531 r593  
    2626//
    2727// $Id: G4VVisCommand.icc,v 1.5 2006/06/29 21:28:20 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// Base class for visualization commands - John Allison  9th August 1998
  • trunk/geant4/visualization/management/include/G4ViewParameters.hh

    r531 r593  
    2525//
    2626//
    27 // $Id: G4ViewParameters.hh,v 1.25 2006/09/19 16:02:31 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4ViewParameters.hh,v 1.26 2007/04/03 13:33:16 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
     
    161161        G4bool           IsAutoRefresh           () const;
    162162  const G4Colour&        GetBackgroundColour     () const;
     163        G4bool           IsPicking               () const;
    163164
    164165  // Here Follow functions to evaluate the above algorithms as a
     
    221222  void SetAutoRefresh          (G4bool);
    222223  void SetBackgroundColour     (const G4Colour&);
     224  void SetPicking              (G4bool);
    223225
    224226  void PrintDifferences (const G4ViewParameters& v) const;
     
    268270  G4bool       fAutoRefresh;     // ...after change of view parameters.
    269271  G4Colour     fBackgroundColour;
     272  G4bool       fPicking;         // Request picking.
    270273};
    271274
  • trunk/geant4/visualization/management/include/G4ViewParameters.icc

    r531 r593  
    2525//
    2626//
    27 // $Id: G4ViewParameters.icc,v 1.15 2006/09/19 16:02:31 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4ViewParameters.icc,v 1.16 2007/04/03 13:33:16 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
     
    182182}
    183183
     184inline G4bool G4ViewParameters::IsPicking () const {
     185  return fPicking;
     186}
     187
    184188inline void
    185189G4ViewParameters::SetDrawingStyle (G4ViewParameters::DrawingStyle style) {
     
    335339  fBackgroundColour = colour;
    336340}
     341
     342inline void G4ViewParameters::SetPicking (G4bool picking) {
     343  fPicking = picking;
     344}
  • trunk/geant4/visualization/management/include/G4ViewerList.hh

    r531 r593  
    2626//
    2727// $Id: G4ViewerList.hh,v 1.8 2006/06/29 21:28:26 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4VisCommandModelCreate.hh

    r531 r593  
    2525//
    2626// $Id: G4VisCommandModelCreate.hh,v 1.3 2006/06/29 21:28:28 gunter Exp $
    27 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     27// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2828//
    2929// Jane Tinslay, John Allison, Joseph Perl October 2005
  • trunk/geant4/visualization/management/include/G4VisCommands.hh

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VisCommands.hh,v 1.6 2006/11/14 14:59:54 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VisCommands.hh,v 1.7 2007/01/11 16:39:33 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/ top level commands - John Allison  5th February 2001
     
    3838class G4UIcmdWithAString;
    3939class G4UIcmdWithoutParameter;
     40
     41class G4VisCommandAbortReviewKeptEvents: public G4VVisCommand {
     42public:
     43  G4VisCommandAbortReviewKeptEvents ();
     44  virtual ~G4VisCommandAbortReviewKeptEvents ();
     45  G4String GetCurrentValue (G4UIcommand* command);
     46  void SetNewValue (G4UIcommand* command, G4String newValue);
     47private:
     48  G4VisCommandAbortReviewKeptEvents (const G4VisCommandAbortReviewKeptEvents&);
     49  G4VisCommandAbortReviewKeptEvents& operator = (const G4VisCommandAbortReviewKeptEvents&);
     50  G4UIcmdWithABool* fpCommand;
     51};
    4052
    4153class G4VisCommandEnable: public G4VVisCommand {
  • trunk/geant4/visualization/management/include/G4VisCommandsCompound.hh

    r531 r593  
    2626//
    2727// $Id: G4VisCommandsCompound.hh,v 1.9 2006/06/29 21:28:32 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// Compound /vis/ commands - John Allison  15th May 2000
  • trunk/geant4/visualization/management/include/G4VisCommandsGeometry.hh

    r531 r593  
    2626//
    2727// $Id: G4VisCommandsGeometry.hh,v 1.3 2006/06/29 21:28:34 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/geometry commands - John Allison  31st January 2006
  • trunk/geant4/visualization/management/include/G4VisCommandsGeometrySet.hh

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VisCommandsGeometrySet.hh,v 1.2 2006/06/29 21:28:36 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     27// $Id: G4VisCommandsGeometrySet.hh,v 1.3 2007/01/05 16:24:19 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/geometry commands - John Allison  31st January 2006
     
    8080private:
    8181  G4bool fForceAuxEdgeVisible;
     82};
     83
     84class G4VisCommandGeometrySetForceLineSegmentsPerCircleFunction:
     85  public G4VVisCommandGeometrySetFunction {
     86public:
     87  G4VisCommandGeometrySetForceLineSegmentsPerCircleFunction
     88  (G4int lineSegmentsPerCircle):
     89    fLineSegmentsPerCircle(lineSegmentsPerCircle) {}
     90  void operator()
     91    (G4VisAttributes* visAtts) const
     92  {visAtts->SetForceLineSegmentsPerCircle(fLineSegmentsPerCircle);}
     93private:
     94  G4int fLineSegmentsPerCircle;
    8295};
    8396
     
    212225};
    213226
     227class G4VisCommandGeometrySetForceLineSegmentsPerCircle:
     228  public G4VVisCommandGeometrySet {
     229public:
     230  G4VisCommandGeometrySetForceLineSegmentsPerCircle ();
     231  virtual ~G4VisCommandGeometrySetForceLineSegmentsPerCircle ();
     232  G4String GetCurrentValue (G4UIcommand* command);
     233  void SetNewValue (G4UIcommand* command, G4String newValue);
     234private:
     235  G4VisCommandGeometrySetForceLineSegmentsPerCircle
     236  (const G4VisCommandGeometrySetForceLineSegmentsPerCircle&);
     237  G4VisCommandGeometrySetForceLineSegmentsPerCircle& operator=
     238  (const G4VisCommandGeometrySetForceLineSegmentsPerCircle&);
     239  G4UIcommand* fpCommand;
     240};
     241
    214242class G4VisCommandGeometrySetForceWireframe:
    215243  public G4VVisCommandGeometrySet {
  • trunk/geant4/visualization/management/include/G4VisCommandsListManager.hh

    r531 r593  
    2525//
    2626// $Id: G4VisCommandsListManager.hh,v 1.3 2006/06/29 21:28:38 gunter Exp $
    27 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     27// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2828//
    2929// Jane Tinslay, John Allison, Joseph Perl October 2005
  • trunk/geant4/visualization/management/include/G4VisCommandsScene.hh

    r531 r593  
    2626//
    2727// $Id: G4VisCommandsScene.hh,v 1.19 2006/11/14 14:59:54 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/scene commands - John Allison  9th August 1998
  • trunk/geant4/visualization/management/include/G4VisCommandsSceneAdd.hh

    r531 r593  
    2626//
    2727// $Id: G4VisCommandsSceneAdd.hh,v 1.17 2006/11/01 10:50:28 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/scene commands - John Allison  9th August 1998
  • trunk/geant4/visualization/management/include/G4VisCommandsSceneHandler.hh

    r531 r593  
    2626//
    2727// $Id: G4VisCommandsSceneHandler.hh,v 1.8 2006/06/29 21:28:44 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/sceneHandler commands - John Allison  10th October 1998
  • trunk/geant4/visualization/management/include/G4VisCommandsViewer.hh

    r531 r593  
    2626//
    2727// $Id: G4VisCommandsViewer.hh,v 1.23 2006/09/13 13:17:29 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/viewer commands - John Allison  25th October 1998
  • trunk/geant4/visualization/management/include/G4VisCommandsViewerSet.hh

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VisCommandsViewerSet.hh,v 1.21 2006/09/19 16:03:14 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VisCommandsViewerSet.hh,v 1.22 2007/04/03 13:33:16 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/viewer/set commands - John Allison  16th May 2000
     
    6969  G4UIcommand*          fpCommandLightsVector;
    7070  G4ThreeVector         fLightsVector;
     71  G4UIcmdWithABool*     fpCommandPicking;
    7172  G4UIcommand*          fpCommandProjection;
    7273  G4UIcommand*          fpCommandSectionPlane;
  • trunk/geant4/visualization/management/include/G4VisExecutive.hh

    r531 r593  
    2626//
    2727// $Id: G4VisExecutive.hh,v 1.6 2006/06/29 21:28:50 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4VisExecutive.icc

    r564 r593  
    2525//
    2626//
    27 // $Id: G4VisExecutive.icc,v 1.14 2006/09/12 18:55:45 tinslay Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VisExecutive.icc,v 1.16 2007/10/03 14:20:23 lgarnier Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4VisFeaturesOfDAWNFILE.hh

    r531 r593  
    2626//
    2727// $Id: G4VisFeaturesOfDAWNFILE.hh,v 1.5 2006/06/29 21:28:54 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030#ifndef G4VISFEATURESOFDAWNFILE_HH
  • trunk/geant4/visualization/management/include/G4VisFeaturesOfFukuiRenderer.hh

    r531 r593  
    2626//
    2727// $Id: G4VisFeaturesOfFukuiRenderer.hh,v 1.5 2006/06/29 21:28:56 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4VisFeaturesOfOpenGL.hh

    r535 r593  
    2525//
    2626//
    27 // $Id: G4VisFeaturesOfOpenGL.hh,v 1.5 2006/06/29 21:28:58 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     27// $Id: G4VisFeaturesOfOpenGL.hh,v 1.6 2007/10/03 14:20:23 lgarnier Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4VisFeaturesOfOpenInventor.hh

    r531 r593  
    2626//
    2727// $Id: G4VisFeaturesOfOpenInventor.hh,v 1.5 2006/06/29 21:29:00 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/include/G4VisFilterManager.hh

    r531 r593  
    2525//
    2626// $Id: G4VisFilterManager.hh,v 1.4 2006/06/29 21:29:02 gunter Exp $
    27 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     27// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2828//
    2929// Filter manager. Manages filter models, factories, messengers,
  • trunk/geant4/visualization/management/include/G4VisListManager.hh

    r531 r593  
    2525//
    2626// $Id: G4VisListManager.hh,v 1.8 2006/06/29 21:29:04 gunter Exp $
    27 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     27// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2828//
    2929// Jane Tinslay, John Allison, Joseph Perl October 2005
  • trunk/geant4/visualization/management/include/G4VisManager.hh

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VisManager.hh,v 1.65 2006/11/21 14:23:20 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VisManager.hh,v 1.67 2007/07/10 17:49:27 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
     
    344344  // GetXGeometryString and GetWindowSizeHint is guaranteed to be
    345345  // identical.)
    346   const G4String&              GetBeginOfLastRunRandomStatus   () const;
    347   const G4String&              GetBeginOfLastEventRandomStatus () const;
    348   G4int                        GetLastRunID                    () const;
    349346  G4bool                       GetTransientsDrawnThisRun       () const;
    350347  G4bool                       GetTransientsDrawnThisEvent     () const;
     348  const G4Event*               GetRequestedEvent               () const;
     349  G4bool                       GetAbortReviewKeptEvents        () const;
    351350
    352351  void SetUserAction (G4VUserVisAction* pVisAction,
     
    366365  void              SetEventRefreshing          (G4bool);
    367366  void              ResetTransientsDrawnFlags   ();
     367  // If non-zero, requested event is used in G4VSceneHandler::ProcessScene.
     368  void              SetRequestedEvent           (const G4Event*);
     369  void              SetAbortReviewKeptEvents    (G4bool);
    368370
    369371  /////////////////////////////////////////////////////////////////////
     
    436438  G4VisStateDependent*  fpStateDependent;   // Friend state dependent class.
    437439  G4int fWindowSizeHintX, fWindowSizeHintY; // For viewer...
    438   G4String fXGeometryString;                // ...construction.
    439   G4TrajectoriesModel dummyTrajectoriesModel;  // For passing drawing mode.
    440   G4bool fEventRefreshing;
    441   G4bool fTransientsDrawnThisRun;
    442   G4bool fTransientsDrawnThisEvent;
    443   G4bool fEventKeepingSuspended;
    444   G4bool fKeptLastEvent;
     440  G4String              fXGeometryString;   // ...construction.
     441  G4TrajectoriesModel   dummyTrajectoriesModel;  // For passing drawing mode.
     442  G4bool                fEventRefreshing;
     443  G4bool                fTransientsDrawnThisRun;
     444  G4bool                fTransientsDrawnThisEvent;
     445  G4bool                fEventKeepingSuspended;
     446  G4bool                fKeptLastEvent;
     447  const G4Event*        fpRequestedEvent; // If non-zero, scene handler uses.
     448  G4bool                fAbortReviewKeptEvents;
    445449
    446450  // Trajectory draw model manager
  • trunk/geant4/visualization/management/include/G4VisManager.icc

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VisManager.icc,v 1.19 2006/11/14 14:59:55 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VisManager.icc,v 1.20 2007/01/11 16:40:58 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
     
    9090}
    9191
     92inline const G4Event* G4VisManager::GetRequestedEvent() const {
     93  return fpRequestedEvent;
     94}
     95
     96inline G4bool G4VisManager::GetAbortReviewKeptEvents() const {
     97  return fAbortReviewKeptEvents;
     98}
     99
    92100inline void G4VisManager::SetUserActionExtent (const G4VisExtent& extent) {
    93101  fUserVisActionExtent = extent;
     
    122130  fMessengerList.push_back(msgr);
    123131}
     132
     133inline void G4VisManager::SetRequestedEvent (const G4Event* event) {
     134  fpRequestedEvent = event;
     135}
     136
     137inline void G4VisManager::SetAbortReviewKeptEvents (G4bool abort) {
     138  fAbortReviewKeptEvents = abort;
     139}
  • trunk/geant4/visualization/management/include/G4VisModelManager.hh

    r531 r593  
    2525//
    2626// $Id: G4VisModelManager.hh,v 1.4 2006/06/29 21:29:10 gunter Exp $
    27 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     27// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2828//
    2929// Generic model manager. Manages models, associated
  • trunk/geant4/visualization/management/include/G4VisStateDependent.hh

    r531 r593  
    2626//
    2727// $Id: G4VisStateDependent.hh,v 1.5 2006/06/29 21:29:12 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030// A "state dependent" service class for G4VisManager.
  • trunk/geant4/visualization/management/src/G4GraphicsSystemList.cc

    r531 r593  
    2626//
    2727// $Id: G4GraphicsSystemList.cc,v 1.4 2006/06/29 21:29:14 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030#include "G4GraphicsSystemList.hh"
  • trunk/geant4/visualization/management/src/G4Scene.cc

    r531 r593  
    2626//
    2727// $Id: G4Scene.cc,v 1.23 2006/11/26 15:51:12 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/src/G4SceneHandlerList.cc

    r531 r593  
    2626//
    2727// $Id: G4SceneHandlerList.cc,v 1.4 2006/06/29 21:29:18 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030#include "G4SceneHandlerList.hh"
  • trunk/geant4/visualization/management/src/G4SceneList.cc

    r531 r593  
    2626//
    2727// $Id: G4SceneList.cc,v 1.6 2006/06/29 21:29:20 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030#include "G4SceneList.hh"
  • trunk/geant4/visualization/management/src/G4VGraphicsSystem.cc

    r531 r593  
    2626//
    2727// $Id: G4VGraphicsSystem.cc,v 1.11 2006/06/29 21:29:22 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/src/G4VSceneHandler.cc

    r561 r593  
    2525//
    2626//
    27 // $Id: G4VSceneHandler.cc,v 1.77 2006/11/21 14:23:53 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VSceneHandler.cc,v 1.82 2007/05/16 15:47:44 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
     
    7171#include "G4ModelingParameters.hh"
    7272#include "G4VTrajectory.hh"
     73#include "G4VTrajectoryPoint.hh"
     74#include "G4HitsModel.hh"
    7375#include "G4VHit.hh"
    7476#include "Randomize.hh"
     
    7779#include "G4Run.hh"
    7880#include "G4Transform3D.hh"
     81#include "G4AttHolder.hh"
     82#include "G4AttDef.hh"
    7983
    8084G4VSceneHandler::G4VSceneHandler (G4VGraphicsSystem& system, G4int id, const G4String& name):
     
    9599  fpObjectTransformation (0),
    96100  fNestingDepth          (0),
    97   fpVisAttribs           (0),
    98   fRequestedEvent        (0)
     101  fpVisAttribs           (0)
    99102{
    100103  G4VisManager* pVMan = G4VisManager::GetInstance ();
     
    421424  G4NURBS* pNURBS = 0;
    422425  G4Polyhedron* pPolyhedron = 0;
    423   const G4VisAttributes* pVisAttribs =
    424     fpViewer -> GetApplicableVisAttributes (fpVisAttribs);
    425426  switch (fpViewer -> GetViewParameters () . GetRepStyle ()) {
    426427  case G4ViewParameters::nurbs:
    427428    pNURBS = solid.CreateNURBS ();
    428429    if (pNURBS) {
    429       pNURBS -> SetVisAttributes
    430         (fpViewer -> GetApplicableVisAttributes (pVisAttribs));
     430      pNURBS -> SetVisAttributes (fpVisAttribs);
    431431      AddPrimitive (*pNURBS);
    432432      delete pNURBS;
     
    447447  case G4ViewParameters::polyhedron:
    448448  default:
    449     G4Polyhedron::SetNumberOfRotationSteps (GetNoOfSides (pVisAttribs));
     449    G4Polyhedron::SetNumberOfRotationSteps (GetNoOfSides (fpVisAttribs));
    450450    pPolyhedron = solid.GetPolyhedron ();
    451451    G4Polyhedron::ResetNumberOfRotationSteps ();
    452452    if (pPolyhedron) {
    453       pPolyhedron -> SetVisAttributes (pVisAttribs);
     453      pPolyhedron -> SetVisAttributes (fpVisAttribs);
    454454      AddPrimitive (*pPolyhedron);
    455455    }
     
    471471
    472472void G4VSceneHandler::ProcessScene (G4VViewer&) {
    473   printf("G4VSceneHandler::ProcessScene\n");
     473
    474474  if (!fpScene) return;
    475475
     
    545545  G4StateManager* stateManager = G4StateManager::GetStateManager();
    546546  G4ApplicationState state = stateManager->GetCurrentState();
    547 
    548   printf("G4VSceneHandler::ProcessScene 1\n");
    549547  if (state == G4State_Idle) {
    550   printf("G4VSceneHandler::ProcessScene 2 : idle\n");
    551548
    552549    visManager->SetEventRefreshing(true);
    553550
    554     if (fRequestedEvent) {
    555       DrawEvent(fRequestedEvent);
    556       printf("G4VSceneHandler::ProcessScene 3 : fRequestedEvent\n");
     551    if (visManager->GetRequestedEvent()) {
     552      DrawEvent(visManager->GetRequestedEvent());
    557553
    558554    } else {
    559       printf("G4VSceneHandler::ProcessScene 3 : not fRequestedEvent\n");
    560555
    561556      G4RunManager* runManager = G4RunManager::GetRunManager();
    562       const G4Run* run = runManager->GetCurrentRun();
    563       const std::vector<const G4Event*>* events =
    564         run? run->GetEventVector(): 0;
    565       size_t nKeptEvents = 0;
    566       if (events) nKeptEvents = events->size();
    567557      if (runManager) {
    568           printf("G4VSceneHandler::ProcessScene 4 : run manager OK\n");
    569         if (fpScene->GetRefreshAtEndOfEvent()) {
    570           printf("G4VSceneHandler::ProcessScene 5 : fpScene->GetRefreshAtEndOfEvent()\n");
    571 
    572           if (verbosity >= G4VisManager::confirmations) {
    573             G4cout << "Refreshing event..." << G4endl;
    574           }
    575           const G4Event* event = 0;
    576           if (events && events->size()) event = events->back();
    577           if (event) DrawEvent(event);
    578 
    579         } else {  // Accumulating events.
    580   printf("G4VSceneHandler::ProcessScene 7\n");
    581 
    582           if (verbosity >= G4VisManager::confirmations) {
    583             G4cout << "Refreshing events in run..." << G4endl;
    584           }
    585           for (size_t i = 0; i < nKeptEvents; ++i) {
    586             const G4Event* event = (*events)[i];
     558        const G4Run* run = runManager->GetCurrentRun();
     559        const std::vector<const G4Event*>* events =
     560          run? run->GetEventVector(): 0;
     561        size_t nKeptEvents = 0;
     562        if (events) nKeptEvents = events->size();
     563        if (nKeptEvents) {
     564
     565          if (fpScene->GetRefreshAtEndOfEvent()) {
     566
     567            if (verbosity >= G4VisManager::confirmations) {
     568              G4cout << "Refreshing event..." << G4endl;
     569            }
     570            const G4Event* event = 0;
     571            if (events && events->size()) event = events->back();
    587572            if (event) DrawEvent(event);
    588           }
    589 
    590           if (!fpScene->GetRefreshAtEndOfRun()) {
    591             if (verbosity >= G4VisManager::warnings) {
    592               G4cout <<
    593                 "WARNING: Cannot refresh events accumulated over more"
    594                 "\n  than one runs.  Refreshed just the last run..."
    595                      << G4endl;
     573
     574          } else {  // Accumulating events.
     575
     576            if (verbosity >= G4VisManager::confirmations) {
     577              G4cout << "Refreshing events in run..." << G4endl;
     578            }
     579            for (size_t i = 0; i < nKeptEvents; ++i) {
     580              const G4Event* event = (*events)[i];
     581              if (event) DrawEvent(event);
     582            }
     583
     584            if (!fpScene->GetRefreshAtEndOfRun()) {
     585              if (verbosity >= G4VisManager::warnings) {
     586                G4cout <<
     587                  "WARNING: Cannot refresh events accumulated over more"
     588                  "\n  than one runs.  Refreshed just the last run."
     589                       << G4endl;
     590              }
    596591            }
    597592          }
    598593        }
    599594      }
    600    }
    601    visManager->SetEventRefreshing(false);
    602  }
     595    }
     596    visManager->SetEventRefreshing(false);
     597  }
    603598
    604599  fMarkForClearingTransientStore = tmpMarkForClearingTransientStore;
    605   printf("G4VSceneHandler::ProcessScene terminé \n");
    606600}
    607601
    608602void G4VSceneHandler::DrawEvent(const G4Event* event)
    609603{
    610   printf("G4VSceneHandler::DrawEvent \n");
    611604  const std::vector<G4VModel*>& EOEModelList =
    612605    fpScene -> GetEndOfEventModelList ();
     
    718711}
    719712
     713void G4VSceneHandler::LoadAtts(const G4Visible& visible, G4AttHolder* holder)
     714{
     715  // Load G4Atts from G4VisAttributes, if any...
     716  const G4VisAttributes* va = visible.GetVisAttributes();
     717  if (va) {
     718    const std::map<G4String,G4AttDef>* vaDefs =
     719      va->GetAttDefs();
     720    if (vaDefs) {
     721      holder->AddAtts(visible.GetVisAttributes()->CreateAttValues(), vaDefs);
     722    }
     723  }
     724
     725  G4PhysicalVolumeModel* pPVModel =
     726    dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
     727  if (pPVModel) {
     728    // Load G4Atts from G4PhysicalVolumeModel...
     729    const std::map<G4String,G4AttDef>* defs = pPVModel->GetAttDefs();
     730    if (defs) {
     731      holder->AddAtts(pPVModel->CreateCurrentAttValues(), defs);
     732    }
     733  }
     734
     735  G4TrajectoriesModel* trajModel = dynamic_cast<G4TrajectoriesModel*>(fpModel);
     736  if (trajModel) {
     737    // Load G4Atts from trajectory...
     738    const G4VTrajectory* traj = trajModel->GetCurrentTrajectory();
     739    const std::map<G4String,G4AttDef>* defs = traj->GetAttDefs();
     740    if (defs) {
     741      holder->AddAtts(traj->CreateAttValues(), defs);
     742    }
     743    G4int nPoints = traj->GetPointEntries();
     744    for (G4int i = 0; i < nPoints; ++i) {
     745      G4VTrajectoryPoint* trajPoint = traj->GetPoint(i);
     746      const std::map<G4String,G4AttDef>* defs = trajPoint->GetAttDefs();
     747      if (defs) {
     748        holder->AddAtts(trajPoint->CreateAttValues(), defs);
     749      }
     750    }
     751  }
     752
     753  G4HitsModel* hitsModel = dynamic_cast<G4HitsModel*>(fpModel);
     754  if (hitsModel) {
     755    // Load G4Atts from hit...
     756    const G4VHit* hit = hitsModel->GetCurrentHit();
     757    const std::map<G4String,G4AttDef>* defs = hit->GetAttDefs();
     758    if (defs) {
     759      holder->AddAtts(hit->CreateAttValues(), defs);
     760    }
     761  }
     762}
     763
    720764const G4Colour& G4VSceneHandler::GetColour (const G4Visible& visible) {
    721765  // Colour is determined by the applicable vis attributes.
     
    734778}
    735779
    736 G4double G4VSceneHandler::GetLineWidth(const G4Visible& visible)
    737 {
    738   G4double lineWidth = fpViewer->
    739     GetApplicableVisAttributes(visible.GetVisAttributes())->GetLineWidth();
     780G4double G4VSceneHandler::GetLineWidth(const G4VisAttributes* pVisAttribs)
     781{
     782  G4double lineWidth = pVisAttribs->GetLineWidth();
    740783  if (lineWidth < 1.) lineWidth = 1.;
    741784  lineWidth *= fpViewer -> GetViewParameters().GetGlobalLineWidthScale();
     
    749792  // it can be overriddden by the ForceDrawingStyle flag in the vis
    750793  // attributes.
    751   G4ViewParameters::DrawingStyle style =
     794  G4ViewParameters::DrawingStyle style = 
    752795    fpViewer->GetViewParameters().GetDrawingStyle();
    753796  if (pVisAttribs -> IsForceDrawingStyle ()) {
     
    821864  // ForceLineSegmentsPerCircle in the vis attributes.
    822865  G4int lineSegmentsPerCircle = fpViewer->GetViewParameters().GetNoOfSides();
    823   if (pVisAttribs->GetForcedLineSegmentsPerCircle() > 0)
    824     lineSegmentsPerCircle = pVisAttribs->GetForcedLineSegmentsPerCircle();
    825   const G4int nSegmentsMin = 12;
    826   if (lineSegmentsPerCircle < nSegmentsMin) {
    827     lineSegmentsPerCircle = nSegmentsMin;
    828     G4cout <<
    829       "G4VSceneHandler::GetNoOfSides: attempt to set the"
    830       "\nnumber of line segements per circle < " << nSegmentsMin
    831          << "; forced to " << lineSegmentsPerCircle << G4endl;
     866  if (pVisAttribs) {
     867    if (pVisAttribs->IsForceLineSegmentsPerCircle())
     868      lineSegmentsPerCircle = pVisAttribs->GetForcedLineSegmentsPerCircle();
     869    const G4int nSegmentsMin = 12;
     870    if (lineSegmentsPerCircle < nSegmentsMin) {
     871      lineSegmentsPerCircle = nSegmentsMin;
     872      G4cout <<
     873        "G4VSceneHandler::GetNoOfSides: attempt to set the"
     874        "\nnumber of line segements per circle < " << nSegmentsMin
     875             << "; forced to " << lineSegmentsPerCircle << G4endl;
     876    }
    832877  }
    833878  return lineSegmentsPerCircle;
  • trunk/geant4/visualization/management/src/G4VViewer.cc

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VViewer.cc,v 1.23 2006/06/29 21:29:26 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     27// $Id: G4VViewer.cc,v 1.24 2007/01/05 16:25:15 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
     
    8282const G4VisAttributes* G4VViewer::GetApplicableVisAttributes
    8383(const G4VisAttributes* pVisAttribs) const {
    84   // If the pointer is null, pick up the default vis attributes from
     84  // If pVisAttribs is zero, pick up the default vis attributes from
    8585  // the view parameters.
    8686  if (!pVisAttribs)
  • trunk/geant4/visualization/management/src/G4VVisCommand.cc

    r531 r593  
    2626//
    2727// $Id: G4VVisCommand.cc,v 1.18 2006/06/29 21:29:28 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// Base class for visualization commands - John Allison  9th August 1998
  • trunk/geant4/visualization/management/src/G4ViewParameters.cc

    r531 r593  
    2525//
    2626//
    27 // $Id: G4ViewParameters.cc,v 1.28 2006/09/19 16:02:31 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4ViewParameters.cc,v 1.29 2007/04/03 13:33:16 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
     
    7272  fWindowSizeHintY (600),
    7373  fAutoRefresh (false),
    74   fBackgroundColour (G4Colour(0.,0.,0.))          // Black
     74  fBackgroundColour (G4Colour(0.,0.,0.)),         // Black
     75  fPicking (false)
    7576{
    7677  fDefaultMarker.SetScreenSize (5.);
     
    273274      (fXGeometryString      != v.fXGeometryString)      ||
    274275      (fAutoRefresh          != v.fAutoRefresh)          ||
    275       (fBackgroundColour     != v.fBackgroundColour))
     276      (fBackgroundColour     != v.fBackgroundColour)     ||
     277      (fPicking              != v.fPicking)
     278      )
    276279    G4cout << "Difference in 1st batch." << G4endl;
    277280
     
    439442
    440443  os << "\n  Background colour: " << v.fBackgroundColour;
     444
     445  os << "\n  Picking requested: ";
     446  if (v.fPicking) os << "true";
     447  else os << "false";
    441448
    442449  return os;
     
    480487      (fXGeometryString      != v.fXGeometryString)      ||
    481488      (fAutoRefresh          != v.fAutoRefresh)          ||
    482       (fBackgroundColour     != v.fBackgroundColour))
     489      (fBackgroundColour     != v.fBackgroundColour)     ||
     490      (fPicking              != v.fPicking)
     491      )
    483492    return true;
    484493
  • trunk/geant4/visualization/management/src/G4ViewerList.cc

    r531 r593  
    2626//
    2727// $Id: G4ViewerList.cc,v 1.4 2006/06/29 21:29:32 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030#include "G4ViewerList.hh"
  • 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  }
  • trunk/geant4/visualization/management/src/G4VisCommandsCompound.cc

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VisCommandsCompound.cc,v 1.35 2006/12/12 11:48:13 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VisCommandsCompound.cc,v 1.38 2007/03/27 15:41:34 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// Compound /vis/ commands - John Allison  15th May 2000
     
    202202  UImanager->SetVerboseLevel(newVerbose);
    203203  UImanager->ApplyCommand("/vis/scene/create");
    204 //  UImanager->ApplyCommand("/vis/scene/add/eventID");
    205204  UImanager->ApplyCommand(G4String("/vis/scene/add/volume " + newValue));
    206205  UImanager->ApplyCommand("/vis/sceneHandler/attach");
    207206  UImanager->SetVerboseLevel(keepVerbose);
    208207  static G4bool warned = false;
    209   if (verbosity >= G4VisManager::warnings && !warned) {
     208  if (verbosity >= G4VisManager::confirmations && !warned) {
    210209    G4cout <<
    211       "WARNING: For systems which are not \"auto-refresh\" you will need to"
     210      "NOTE: For systems which are not \"auto-refresh\" you will need to"
    212211      "\n  issue \"/vis/viewer/refresh\" or \"/vis/viewer/flush\"."
    213212           << G4endl;
     
    322321  UImanager->SetVerboseLevel(keepVerbose);
    323322  static G4bool warned = false;
    324   if (verbosity >= G4VisManager::warnings && !warned) {
     323  if (verbosity >= G4VisManager::confirmations && !warned) {
    325324    G4cout <<
    326       "WARNING: For systems which are not \"auto-refresh\" you will need to"
     325      "NOTE: For systems which are not \"auto-refresh\" you will need to"
    327326      "\n  issue \"/vis/viewer/refresh\" or \"/vis/viewer/flush\"."
    328327           << G4endl;
  • trunk/geant4/visualization/management/src/G4VisCommandsGeometry.cc

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VisCommandsGeometry.cc,v 1.3 2006/06/29 21:29:38 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     27// $Id: G4VisCommandsGeometry.cc,v 1.4 2007/01/05 16:29:38 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/geometry commands - John Allison  31st January 2006
     
    147147    return;
    148148  }
    149   G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/rebuild");
     149  if (fpVisManager->GetCurrentViewer()) {
     150    G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/rebuild");
     151  }
    150152}
  • trunk/geant4/visualization/management/src/G4VisCommandsGeometrySet.cc

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VisCommandsGeometrySet.cc,v 1.6 2006/09/19 16:05:13 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VisCommandsGeometrySet.cc,v 1.7 2007/01/05 16:24:19 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/geometry commands - John Allison  31st January 2006
     
    171171  G4bool omitable;
    172172  fpCommand = new G4UIcommand("/vis/geometry/set/daughtersInvisible", this);
    173   fpCommand->SetGuidance("Sets daughters of logical volume(s) invisible.");
     173  fpCommand->SetGuidance("Makes daughters of logical volume(s) invisible.");
    174174  fpCommand->SetGuidance("\"all\" sets all logical volumes.");
    175175  fpCommand->SetGuidance
     
    243243  fpCommand = new G4UIcommand("/vis/geometry/set/forceAuxEdgeVisible", this);
    244244  fpCommand->SetGuidance
    245     ("Sets auxiliary (soft) edges of logical volume(s) drawing visible.");
     245    ("Forces auxiliary (soft) edges of logical volume(s) to be visible,"
     246    "\nregardless of the view parameters.");
    246247  fpCommand->SetGuidance("\"all\" sets all logical volumes.");
    247248  fpCommand->SetGuidance
     
    288289}
    289290
     291////////////// /vis/geometry/set/forceLineSegmentsPerCircle /////////////////////////
     292
     293G4VisCommandGeometrySetForceLineSegmentsPerCircle::G4VisCommandGeometrySetForceLineSegmentsPerCircle()
     294{
     295  G4bool omitable;
     296  fpCommand = new G4UIcommand("/vis/geometry/set/forceLineSegmentsPerCircle", this);
     297  fpCommand->SetGuidance
     298    ("Forces number of line segments per circle, the precision with which a"
     299     "\ncurved line or surface is represented by a polygon or polyhedron,"
     300     "\nregardless of the view parameters.");
     301  fpCommand->SetGuidance("\"all\" sets all logical volumes.");
     302  fpCommand->SetGuidance
     303    ("Optionally propagates down hierarchy to given depth.");
     304  G4UIparameter* parameter;
     305  parameter = new G4UIparameter ("logical-volume-name", 's', omitable = true);
     306  parameter->SetDefaultValue("all");
     307  fpCommand->SetParameter(parameter);
     308  parameter = new G4UIparameter("depth", 'd', omitable = true);
     309  parameter->SetDefaultValue(0);
     310  parameter->SetGuidance
     311    ("Depth of propagation (-1 means unlimited depth).");
     312  fpCommand->SetParameter(parameter);
     313  parameter = new G4UIparameter("lineSegmentsPerCircle", 'd', omitable = true);
     314  parameter->SetGuidance
     315    ("< 0 means not forced, i.e., under control of viewer.");
     316  parameter->SetDefaultValue(-1);
     317  fpCommand->SetParameter(parameter);
     318}
     319
     320G4VisCommandGeometrySetForceLineSegmentsPerCircle::~G4VisCommandGeometrySetForceLineSegmentsPerCircle()
     321{
     322  delete fpCommand;
     323}
     324
     325G4String
     326G4VisCommandGeometrySetForceLineSegmentsPerCircle::GetCurrentValue(G4UIcommand*)
     327{
     328  return "";
     329}
     330
     331void G4VisCommandGeometrySetForceLineSegmentsPerCircle::SetNewValue
     332(G4UIcommand*, G4String newValue)
     333{
     334  G4String name;
     335  G4int requestedDepth;
     336  G4int lineSegmentsPerCircle;
     337  std::istringstream iss(newValue);
     338  iss >> name >> requestedDepth >> lineSegmentsPerCircle;
     339
     340  G4VisCommandGeometrySetForceLineSegmentsPerCircleFunction setForceLineSegmentsPerCircle(lineSegmentsPerCircle);
     341  Set(name, setForceLineSegmentsPerCircle, requestedDepth);
     342}
     343
    290344////////////// /vis/geometry/set/forceSolid /////////////////////////
    291345
     
    295349  fpCommand = new G4UIcommand("/vis/geometry/set/forceSolid", this);
    296350  fpCommand->SetGuidance
    297    ("Sets logical volume(s) drawing always to be as solid (surface drawing).");
     351   ("Forces logical volume(s) always to be drawn solid (surface drawing),"
     352    "\nregardless of the view parameters.");
    298353  fpCommand->SetGuidance("\"all\" sets all logical volumes.");
    299354  fpCommand->SetGuidance
     
    345400  fpCommand = new G4UIcommand("/vis/geometry/set/forceWireframe", this);
    346401  fpCommand->SetGuidance
    347    ("Sets logical volume(s) drawing always to be as wireframe.");
     402   ("Forces logical volume(s) always to be drawn as wireframe,"
     403    "\nregardless of the view parameters.");
    348404  fpCommand->SetGuidance("\"all\" sets all logical volumes.");
    349405  fpCommand->SetGuidance
  • trunk/geant4/visualization/management/src/G4VisCommandsScene.cc

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VisCommandsScene.cc,v 1.65 2006/11/26 19:37:54 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VisCommandsScene.cc,v 1.66 2007/05/25 10:49:55 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/scene commands - John Allison  9th August 1998
     
    480480  G4VSceneHandler* pCurrentSceneHandler =
    481481    fpVisManager -> GetCurrentSceneHandler();
     482  if (!pCurrentSceneHandler) {
     483    if (verbosity >= G4VisManager::warnings) {
     484      G4cout << "WARNING: No current scene handler."
     485             << G4endl;
     486    }
     487    return;
     488  }
    482489  G4VViewer* pCurrentViewer = fpVisManager -> GetCurrentViewer();
     490  if (!pCurrentViewer) {
     491    if (verbosity >= G4VisManager::warnings) {
     492      G4cout << "WARNING: No current viewer."
     493             << G4endl;
     494    }
     495    return;
     496  }
    483497  G4Scene* pCurrentScene = fpVisManager -> GetCurrentScene();
     498  if (!pCurrentScene) {
     499    if (verbosity >= G4VisManager::warnings) {
     500      G4cout << "WARNING: No current scene."
     501             << G4endl;
     502    }
     503    return;
     504  }
    484505  G4VisManager::Verbosity currentVerbosity = fpVisManager -> GetVerbosity();
    485506
  • trunk/geant4/visualization/management/src/G4VisCommandsSceneAdd.cc

    r531 r593  
    2626//
    2727// $Id: G4VisCommandsSceneAdd.cc,v 1.72 2006/11/25 15:37:31 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929// /vis/scene commands - John Allison  9th August 1998
    3030
  • trunk/geant4/visualization/management/src/G4VisCommandsSceneHandler.cc

    r531 r593  
    2626//
    2727// $Id: G4VisCommandsSceneHandler.cc,v 1.32 2006/06/29 21:29:46 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/sceneHandler commands - John Allison  10th October 1998
  • trunk/geant4/visualization/management/src/G4VisCommandsViewer.cc

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VisCommandsViewer.cc,v 1.66 2006/11/25 15:38:03 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VisCommandsViewer.cc,v 1.68 2007/01/11 16:41:30 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/viewer commands - John Allison  25th October 1998
     
    7373  fpCommand = new G4UIcommand ("/vis/viewer/addCutawayPlane", this);
    7474  fpCommand -> SetGuidance
    75     ("Add cutaway plane A*x + B*y + C*z + D = 0 to current viewer.");
     75    ("Add cutaway plane to current viewer.");
    7676  G4UIparameter* parameter;
    7777  parameter  =  new G4UIparameter("x",'d',omitable = true);
     
    11391139  G4Scene* scene = sceneHandler->GetScene();
    11401140  if (!scene) {
    1141     if (verbosity >= G4VisManager::warnings) {
    1142       G4cout << "WARNING: SceneHandler \"" << sceneHandler->GetName()
     1141    if (verbosity >= G4VisManager::confirmations) {
     1142      G4cout << "NOTE: SceneHandler \"" << sceneHandler->GetName()
    11431143             << "\", to which viewer \"" << refreshName << "\"" <<
    11441144        "\n  is attached, has no scene - \"/vis/scene/create\" and"
     
    14131413  G4Scene* scene = sceneHandler->GetScene();
    14141414  if (!scene) {
    1415     if (verbosity >= G4VisManager::warnings) {
    1416       G4cout << "WARNING: SceneHandler \"" << sceneHandler->GetName()
     1415    if (verbosity >= G4VisManager::confirmations) {
     1416      G4cout << "NOTE: SceneHandler \"" << sceneHandler->GetName()
    14171417             << "\", to which viewer \"" << updateName << "\"" <<
    14181418        "\n  is attached, has no scene - \"/vis/scene/create\" and"
  • trunk/geant4/visualization/management/src/G4VisCommandsViewerSet.cc

    r531 r593  
    2525//
    2626//
    27 // $Id: G4VisCommandsViewerSet.cc,v 1.47 2006/11/14 14:59:55 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4VisCommandsViewerSet.cc,v 1.49 2007/07/10 17:51:54 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030// /vis/viewer/set commands - John Allison  16th May 2000
     
    6767     "\nview parameters.");
    6868  fpCommandAutoRefresh->SetParameterName("auto-refresh",omitable = true);
    69   fpCommandAutoRefresh->SetDefaultValue(false);
     69  fpCommandAutoRefresh->SetDefaultValue(true);
    7070
    7171  fpCommandAuxEdge = new G4UIcmdWithABool
     
    7676     "\nsometimes called soft edges, become visible/invisible.");
    7777  fpCommandAuxEdge->SetParameterName("edge",omitable = true);
    78   fpCommandAuxEdge->SetDefaultValue(false);
     78  fpCommandAuxEdge->SetDefaultValue(true);
    7979
    8080  fpCommandBackground = new G4UIcommand
     
    247247  fpCommandLineSegments->SetParameterName("line-segments",omitable = true);
    248248  fpCommandLineSegments->SetDefaultValue(24);
     249
     250  fpCommandPicking = new G4UIcmdWithABool
     251    ("/vis/viewer/set/picking",this);
     252  fpCommandPicking->SetGuidance("Sets picking, if available.");
     253  fpCommandPicking->SetGuidance
     254    ("If true, view is set up for picking, if available."
     255     "\nFor required actions, watch for instructions for viewer.");
     256  fpCommandPicking->SetParameterName("picking",omitable = true);
     257  fpCommandPicking->SetDefaultValue(true);
    249258
    250259  fpCommandProjection = new G4UIcommand("/vis/viewer/set/projection",this);
     
    388397  delete fpCommandLightsThetaPhi;
    389398  delete fpCommandLightsVector;
     399  delete fpCommandPicking;
    390400  delete fpCommandProjection;
    391401  delete fpCommandSectionPlane;
     
    460470             << G4endl;
    461471    }
    462     currentViewer->SetViewParameters(vp);
    463     return;  // I.e., avoid a refresh for this command.
     472    if (!vp.IsAutoRefresh()) {
     473      currentViewer->SetViewParameters(vp);
     474      return;  // Avoid a refresh id auto-refresh has been set to off...
     475    }  // ...otherwise take normal action.
    464476  }
    465477
     
    754766  }
    755767
     768  else if (command == fpCommandPicking) {
     769    vp.SetPicking(G4UIcommand::ConvertToBool(newValue));
     770    if (verbosity >= G4VisManager::confirmations) {
     771      G4cout << "Picking ";
     772      if (vp.IsPicking()) G4cout << "requested.";
     773      else G4cout << "inhibited.";
     774      G4cout << G4endl;
     775    }
     776  }
     777
    756778  else if (command == fpCommandProjection) {
    757779    G4double fieldHalfAngle;
  • trunk/geant4/visualization/management/src/G4VisFeaturesOfDAWNFILE.cc

    r531 r593  
    2626//
    2727// $Id: G4VisFeaturesOfDAWNFILE.cc,v 1.6 2006/06/29 21:29:52 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030#include "G4VisFeaturesOfDAWNFILE.hh"
  • trunk/geant4/visualization/management/src/G4VisFeaturesOfFukuiRenderer.cc

    r531 r593  
    2626//
    2727// $Id: G4VisFeaturesOfFukuiRenderer.cc,v 1.5 2006/06/29 21:29:54 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • trunk/geant4/visualization/management/src/G4VisFeaturesOfOpenGL.cc

    r534 r593  
    2525//
    2626//
    27 // $Id: G4VisFeaturesOfOpenGL.cc,v 1.5 2006/06/29 21:29:56 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     27// $Id: G4VisFeaturesOfOpenGL.cc,v 1.6 2007/10/03 14:21:55 lgarnier Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030//
  • trunk/geant4/visualization/management/src/G4VisFeaturesOfOpenInventor.cc

    r531 r593  
    2626//
    2727// $Id: G4VisFeaturesOfOpenInventor.cc,v 1.5 2006/06/29 21:29:58 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
  • 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
  • trunk/geant4/visualization/management/src/G4VisStateDependent.cc

    r561 r593  
    2626//
    2727// $Id: G4VisStateDependent.cc,v 1.6 2006/06/29 21:30:02 gunter Exp $
    28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030#include "G4VisStateDependent.hh"
     
    4646  }
    4747  else if (previousState == G4State_EventProc &&  requestedState == G4State_GeomClosed) {
    48     printf("G4VisStateDependent::EndOfEvent \n");
    4948    fpVisManager -> EndOfEvent ();
    5049  }
Note: See TracChangeset for help on using the changeset viewer.