Changeset 1288


Ignore:
Timestamp:
Jun 1, 2010, 6:36:22 PM (14 years ago)
Author:
garnier
Message:

update from CVS

Location:
trunk/source/visualization
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/OpenInventor/History

    r1228 r1288  
    1 $Id: History,v 1.104 2009/11/17 17:47:49 allison Exp $
     1$Id: History,v 1.105 2010/05/26 14:30:46 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/OpenInventor
    2121-------------------------------------------
     22
     2326th May 2010  John Allison  (openinventor-V09-03-00)
     24- G4OpenInventorWin.cc, G4OpenInventorXt.cc: Protection against
     25  repeated initialisation.
    2226
    232717th November 2009  John Allison  (openinventor-V09-02-03)
  • trunk/source/visualization/OpenInventor/src/G4OpenInventorWin.cc

    r1196 r1288  
    2525//
    2626//
    27 // $Id: G4OpenInventorWin.cc,v 1.7 2009/09/18 12:48:43 lgarnier Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4OpenInventorWin.cc,v 1.8 2010/05/26 14:30:46 allison Exp $
     28// GEANT4 tag $Name: openinventor-V09-03-00 $
    2929//
    3030// OpenInventor graphics system factory.
     
    5858  HWND toplevel = (HWND)GetInteractorManager()->GetMainInteractor();
    5959
    60   SoWin::init(toplevel);
     60  if(!SoWin::getTopLevelWidget()) SoWin::init(toplevel);
    6161
    6262  InitNodes();
  • trunk/source/visualization/OpenInventor/src/G4OpenInventorXt.cc

    r959 r1288  
    2525//
    2626//
    27 // $Id: G4OpenInventorXt.cc,v 1.4 2006/06/29 21:22:24 gunter Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4OpenInventorXt.cc,v 1.5 2010/05/26 14:30:46 allison Exp $
     28// GEANT4 tag $Name: openinventor-V09-03-00 $
    2929//
    3030//
     
    8181  }
    8282
    83   SoXt::init(top);
     83  if(!SoXt::getTopLevelWidget()) SoXt::init(top);
    8484
    8585  InitNodes();
  • trunk/source/visualization/gMocren/History

    r1274 r1288  
    1 $Id: History,v 1.11 2010/05/11 10:44:35 allison Exp $
     1$Id: History,v 1.13 2010/06/01 16:18:46 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/gMocren sub-category
    2121---------------------------------------------------
     22
     231st May 2010  John Allison  (gMocren-V09-03-03)
     24- G4GMocrenFileSceneHandler.cc: Removed dependency on G4VisManager.
     25
     2630th May 2010  John Allison  (gMocren-V09-03-02)
     27- G4GMocrenFileSceneHandler: Added AddCompound(const G4VDigi&).
     28  o Simply invokes G4VSceneHandler::AddCompound(const G4VDigi&) for now.
    2229
    233011 May 2010  John Allison  (gMocren-V09-03-01)
  • trunk/source/visualization/gMocren/include/G4GMocrenFileSceneHandler.hh

    r1142 r1288  
    2525//
    2626//
    27 // $Id: G4GMocrenFileSceneHandler.hh,v 1.5 2009/11/01 14:37:10 akimura Exp $
     27// $Id: G4GMocrenFileSceneHandler.hh,v 1.6 2010/05/30 10:04:16 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    103103  void AddCompound ( const G4VTrajectory& traj);
    104104  void AddCompound ( const G4VHit& hit);
     105  void AddCompound ( const G4VDigi& hit);
    105106  void AddCompound ( const G4THitsMap<G4double> & hits);
    106107
  • trunk/source/visualization/gMocren/src/G4GMocrenFileSceneHandler.cc

    r1274 r1288  
    2525//
    2626//
    27 // $Id: G4GMocrenFileSceneHandler.cc,v 1.14 2010/05/11 10:44:11 allison Exp $
     27// $Id: G4GMocrenFileSceneHandler.cc,v 1.16 2010/06/01 16:18:26 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7070#include "G4VVolumeMaterialScanner.hh"
    7171#include "G4VisTrajContext.hh"
    72 #include "G4VisManager.hh"
     72#include "G4TrajectoriesModel.hh"
    7373#include "G4VTrajectoryModel.hh"
    7474#include "G4TrajectoryDrawByCharge.hh"
     
    9696const G4bool GFDEBUG_TRK = false;//true;
    9797const G4bool GFDEBUG_HIT = false;//true;
     98const G4bool GFDEBUG_DIGI = false;//true;
    9899const G4int GFDEBUG_DET = 0; // 0: false
    99100
     
    15811582}
    15821583
     1584void G4GMocrenFileSceneHandler::AddCompound( const G4VDigi & digi) {
     1585  if(GFDEBUG_DIGI) G4cout << " ::AddCompound(const G4VDigi&) >>>>>>>>> " << G4endl;
     1586  G4VSceneHandler::AddCompound(digi);
     1587}
     1588
    15831589void G4GMocrenFileSceneHandler::AddCompound(const G4THitsMap<G4double> & hits) {
    15841590  if(GFDEBUG_HIT)
  • trunk/source/visualization/management/History

    r1274 r1288  
    1 $Id: History,v 1.143 2010/05/20 07:56:21 allison Exp $
     1$Id: History,v 1.150 2010/06/01 16:14:10 allison Exp $
    22
    33-------------------------------------------------------------------
     
    2626History file for visualization management sub-category
    2727------------------------------------------------------
     28
     291st June 2010  John Allison  (visman-V09-03-07)
     30- G4VisManager:
     31  o Made fVerbosity and GetVerbosity static (saves having to get vis
     32    manager pointer).
     33  o Some tidying.
     34- G4VisCommandsSceneAdd.cc: Fixed compiler warning.
     35
     3630th May 2010  John Allison  (visman-V09-03-06)
     37- Added /vis/scene/add/digiti[sz]ations.
     38- Added /vis/filtering/digi.
     39- G4VisManager, G4VisExecutive: Added registration and methods for digis.
     40- G4VSceneHandler: Added AddCompound(const G4VDigi&).
     41
     4229th May 2010  John Allison  (visman-V09-03-05)
     43- Co-works greps-V09-03-01 and tracking-V09-03-03.
     44- G4VisManager:
     45  o Introduced DispatchToModel without i_mode.
     46  o Moved i-mode deprecation warning to G4VTrajectory.
     47- G4VSceneHandler.cc:
     48  o Moved i-mode deprecation warning to G4VTrajectory.
     49- G4VisCommandsViewer.cc: /vis/viewer/rebuild:
     50  o Added sceneHandler->ClearTransientStore().
     51  o Added viewer->Set/Clear/DrawView().
     52
     5328th May 2010  John Allison  (visman-V09-03-04)
     54- G4VisManager, G4VisExecutive:
     55  Introduced optional verbosity string argument in constructor.  You
     56  can now write, for example:
     57    G4VisManager* visManager = new G4VisExecutive("quiet");
     58  Note that the default is "warnings":
     59    G4VisManager* visManager = new G4VisExecutive;
     60
     6128th May 2010  John Allison  (visman-V09-03-03)
     62- Co-works interfaces-V09-03-04.
     63- G4VisExecutive.icc: Change order of flags to follow G4UIExecutive.
     64
     6526th May 2010  John Allison  (visman-V09-03-02)
     66- G4VisExecutive.icc: Added drivers with generic nicknames:
     67  o OGL, OGLI, OGLS, OI.
     68  o The specific driver depends on G4VIS_USE and G4UI_USE flags.  So,
     69    for example, "/vis/open OGL" might open an OGLSX window on X or an
     70    OGLSWin32 on Windows.  It means that example vis.mac scripts can
     71    be written with this generic command that will work on all systems
     72    and all user choices.  In particular, it will open an OGLSQt
     73    window in a G4UIQt session.
    2874
    297520th May 2010  John Allison  (visman-V09-03-01)
  • trunk/source/visualization/management/include/G4VSceneHandler.hh

    r1258 r1288  
    2525//
    2626//
    27 // $Id: G4VSceneHandler.hh,v 1.43 2010/05/11 10:50:57 allison Exp $
     27// $Id: G4VSceneHandler.hh,v 1.44 2010/05/30 11:30:49 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    5959class G4Event;
    6060class G4AttHolder;
     61class G4VDigi;
    6162
    6263class G4VSceneHandler: public G4VGraphicsScene {
     
    129130  virtual void AddCompound (const G4VTrajectory&);
    130131  virtual void AddCompound (const G4VHit&);
     132  virtual void AddCompound (const G4VDigi&);
    131133  virtual void AddCompound (const G4THitsMap<G4double>&);
    132134
     
    319321  // object onto the G4AttHolder object.  It checks fpModel, and also
    320322  // loads the G4AttValues and G4AttDefs from G4PhysicalVolumeModel,
    321   // G4VTrajectory, G4VTrajectoryPoint, or G4VHits, as appropriate.
    322   // The G4AttHolder object is an object of a class that publicly
    323   // inherits G4AttHolder - see, e.g., SoG4Polyhedron in the Open
    324   // Inventor driver.  G4AttHolder deletes G4AttValues in its
     323  // G4VTrajectory, G4VTrajectoryPoint, G4VHit or G4VDigi, as
     324  // appropriate.  The G4AttHolder object is an object of a class that
     325  // publicly inherits G4AttHolder - see, e.g., SoG4Polyhedron in the
     326  // Open Inventor driver.  G4AttHolder deletes G4AttValues in its
    325327  // destructor to ensure proper clean-up of G4AttValues.
    326328
  • trunk/source/visualization/management/include/G4VisCommandsSceneAdd.hh

    r1170 r1288  
    2525//
    2626//
    27 // $Id: G4VisCommandsSceneAdd.hh,v 1.19 2009/11/04 13:15:02 allison Exp $
     27// $Id: G4VisCommandsSceneAdd.hh,v 1.20 2010/05/30 11:30:49 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929
     
    5151  G4VisCommandSceneAddAxes& operator = (const G4VisCommandSceneAddAxes&);
    5252  G4UIcommand* fpCommand;
     53};
     54
     55class G4VisCommandSceneAddDigis: public G4VVisCommandScene {
     56public:
     57  G4VisCommandSceneAddDigis ();
     58  virtual ~G4VisCommandSceneAddDigis ();
     59  G4String GetCurrentValue (G4UIcommand* command);
     60  void SetNewValue (G4UIcommand* command, G4String newValue);
     61private:
     62  G4VisCommandSceneAddDigis (const G4VisCommandSceneAddDigis&);
     63  G4VisCommandSceneAddDigis& operator = (const G4VisCommandSceneAddDigis&);
     64  G4UIcmdWithoutParameter* fpCommand;
     65  G4UIcmdWithoutParameter* fpCommandUS;
    5366};
    5467
  • trunk/source/visualization/management/include/G4VisExecutive.hh

    r1228 r1288  
    2525//
    2626//
    27 // $Id: G4VisExecutive.hh,v 1.9 2009/11/17 15:34:06 allison Exp $
     27// $Id: G4VisExecutive.hh,v 1.10 2010/05/28 16:48:03 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    5656// #ifdef G4VIS_USE
    5757//   // Instantiate and initialise Visualization Manager.
    58 //   G4VisManager* visManager = new G4VisExecutive;    // See Nore (a).
     58//   G4VisManager* visManager = new G4VisExecutive;    // See Note (a).
    5959//   visManager -> SetVerboseLevel (verbosityString);  // See Note (b).
    6060//   visManager -> RegisterGraphicsSystem (new myGS);  // See Note (c).
     
    7777// (b) The verbosityString ("quiet", "errors", "warnings",
    7878//     "confirmations", etc. - "help /vis/verbose" to see options) can be
    79 //     set here or with /vis/verbose.
     79//     set here or with /vis/verbose.  Alternatively, you can instantiate
     80//     with a verbosity string. e.g:
     81//       G4VisManager* visManager = new G4VisExecutive("quiet");
    8082// (c) You can register your own graphics system like this.
    8183// (d) Your can intialise like this with C++ code or use /vis/initialize.
     
    121123public: // With description
    122124
    123   G4VisExecutive () {}
     125  G4VisExecutive (const G4String& verbosityString = "warnings");
    124126
    125127private:
  • trunk/source/visualization/management/include/G4VisExecutive.icc

    r1140 r1288  
    2525//
    2626//
    27 // $Id: G4VisExecutive.icc,v 1.22 2009/10/12 11:54:50 akimura Exp $
     27// $Id: G4VisExecutive.icc,v 1.26 2010/05/30 11:30:49 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4343#include "G4RayTracer.hh"
    4444#include "G4HitFilterFactories.hh"
     45#include "G4DigiFilterFactories.hh"
    4546#include "G4TrajectoryFilterFactories.hh"
    4647#include "G4TrajectoryModelFactories.hh"
     
    9192#include "G4VRML2.hh"
    9293#endif
     94
     95  G4VisExecutive::G4VisExecutive (const G4String& verbosityString):
     96    G4VisManager(verbosityString)       
     97  {}
    9398
    9499// The inline keyword prevents the compiler making an external
     
    118123#endif
    119124
     125// Register OGL graphics system with generic nicknames
     126#ifdef G4VIS_USE_OPENGL
     127  G4VGraphicsSystem* ogl  = 0;
     128  G4VGraphicsSystem* ogli = 0;
     129  G4VGraphicsSystem* ogls = 0;
     130// Follow G4UIExecutive
     131#if defined(G4UI_USE_QT)
     132#ifdef G4VIS_USE_OPENGLQT
     133  ogl  = new G4OpenGLStoredQt;
     134  ogli = new G4OpenGLImmediateQt;
     135  ogls = new G4OpenGLStoredQt;
     136#endif
     137#elif defined(G4UI_USE_XM)
     138#ifdef G4VIS_USE_OPENGLXM
     139  ogl  = new G4OpenGLStoredXm;
     140  ogli = new G4OpenGLImmediateXm;
     141  ogls = new G4OpenGLStoredXm;
     142#endif
     143#elif defined(G4UI_USE_WIN32)
     144#ifdef G4VIS_USE_OPENGLWIN32
     145  ogl  = new G4OpenGLStoredWin32;
     146  ogli = new G4OpenGLImmediateWin32;
     147  ogls = new G4OpenGLStoredWin32;
     148#endif
     149#elif defined(G4UI_USE_TCSH)
     150#if defined (G4VIS_USE_OPENGLX)
     151  ogl  = new G4OpenGLStoredX;
     152  ogli = new G4OpenGLImmediateX;
     153  ogls = new G4OpenGLStoredX;
     154#elif defined (G4VIS_USE_OPENGLWIN32)
     155  ogl  = new G4OpenGLStoredWin32;
     156  ogli = new G4OpenGLImmediateWin32;
     157  ogls = new G4OpenGLStoredWin32;
     158#endif
     159#else
     160#if defined (G4VIS_USE_OPENGLX)
     161  ogl  = new G4OpenGLStoredX;
     162  ogli = new G4OpenGLImmediateX;
     163  ogls = new G4OpenGLStoredX;
     164#elif defined (G4VIS_USE_OPENGLWIN32)
     165  ogl  = new G4OpenGLStoredWin32;
     166  ogli = new G4OpenGLImmediateWin32;
     167  ogls = new G4OpenGLStoredWin32;
     168#endif
     169#endif
     170  if (ogl) {
     171    ogl->SetNickName("OGL");
     172    RegisterGraphicsSystem (ogl);
     173  }
     174  if (ogli) {
     175    ogli->SetNickName("OGLI");
     176    RegisterGraphicsSystem (ogli);
     177  }
     178  if (ogls) {
     179    ogls->SetNickName("OGLS");
     180    RegisterGraphicsSystem (ogls);
     181  }
     182#endif
     183
    120184#ifdef G4VIS_USE_OPENGLX
    121185  RegisterGraphicsSystem (new G4OpenGLImmediateX);
     
    136200  RegisterGraphicsSystem (new G4OpenGLImmediateQt);
    137201  RegisterGraphicsSystem (new G4OpenGLStoredQt);
     202#endif
     203
     204// Register OI graphics system with generic nickname
     205#ifdef G4VIS_USE_OI
     206  G4VGraphicsSystem* oi  = 0;
     207#ifdef G4VIS_USE_OIX
     208  oi = new G4OpenInventorX;
     209#endif
     210#ifdef G4VIS_USE_OIWIN32
     211  oi = new G4OpenInventorWin32;
     212#endif
     213  if (oi) {
     214    oi->SetNickName("OI");
     215    RegisterGraphicsSystem (oi);
     216  }
    138217#endif
    139218
     
    176255   // Hit filter models
    177256   RegisterModelFactory(new G4HitAttributeFilterFactory());
     257
     258   // Digi filter models
     259   RegisterModelFactory(new G4DigiAttributeFilterFactory());
    178260}
    179261
  • trunk/source/visualization/management/include/G4VisManager.hh

    r1274 r1288  
    2525//
    2626//
    27 // $Id: G4VisManager.hh,v 1.71 2010/05/20 07:54:31 allison Exp $
     27// $Id: G4VisManager.hh,v 1.75 2010/06/01 16:08:15 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    6666//
    6767// Each scene comprises drawable objects such as detector components
    68 // and hits when appropriate.  A scene handler translates a scene into
    69 // graphics-system-specific function calls and, possibly, a
    70 // graphics-system-dependent database - display lists, scene graphs,
    71 // etc.  Each viewer has its "view parameters" (see class description
    72 // of G4ViewParameters for available parameters and also for a
    73 // description of the concept of a "standard view" and all that).
     68// and trajectories, hits and digis when appropriate.  A scene handler
     69// translates a scene into graphics-system-specific function calls
     70// and, possibly, a graphics-system-dependent database - display
     71// lists, scene graphs, etc.  Each viewer has its "view parameters"
     72// (see class description of G4ViewParameters for available parameters
     73// and also for a description of the concept of a "standard view" and
     74// all that).
    7475//
    7576// A friend class G4VisStateDependent is "state dependent", i.e., it
    7677// is notified on change of state (G4ApplicationState).  This is used
    77 // to message the G4VisManager to draw hits and trajectories in the
    78 // current scene at the end of event, as required.
     78// to message the G4VisManager to draw hits, digis and trajectories in
     79// the current scene at the end of event, as required.
    7980
    8081#ifndef G4VISMANAGER_HH
     
    113114  typedef G4VModelFactory< G4VFilter<G4VTrajectory> > G4TrajFilterFactory;
    114115  typedef G4VModelFactory< G4VFilter<G4VHit> > G4HitFilterFactory;
     116  typedef G4VModelFactory< G4VFilter<G4VDigi> > G4DigiFilterFactory;
    115117}
    116118
     
    129131  friend class G4RayTracerSceneHandler;
    130132  friend class G4RTMessenger;
    131   friend class G4OpenGLStoredSceneHandler;
    132133  friend class G4OpenGLViewerMessenger;
    133   friend class G4OpenGLXViewerMessenger;
    134134  friend class G4OpenGLXmViewerMessenger;
    135   friend class G4XXXSceneHandler;
    136135  friend class G4HepRepFileSceneHandler;
    137136
     
    139138  friend class G4VSceneHandler;
    140139  friend class G4VViewer;
    141 
    142   friend std::ostream & operator <<
    143   (std::ostream &, const G4VGraphicsSystem &);
    144 
    145   friend std::ostream & operator <<
    146   (std::ostream &, const G4VSceneHandler &);
    147 
    148140  friend class G4VisStateDependent;
    149 
    150141  friend class G4VisCommandList;
     142
     143  // operator << friends...
     144  friend std::ostream& operator << (std::ostream&, const G4VGraphicsSystem&);
     145  friend std::ostream& operator << (std::ostream&, const G4VSceneHandler&);
    151146
    152147public: // With description
     
    165160protected: // With description
    166161
    167   G4VisManager ();
     162  G4VisManager (const G4String& verbosityString = "warnings");
    168163  // The constructor is protected so that an object of the derived
    169164  // class may be constructed.
     
    214209  void RegisterModel(G4VFilter<G4VHit>* filter);
    215210  // Register trajectory hit model. Assumes ownership of model.
     211
     212  void RegisterModelFactory(G4DigiFilterFactory* factory);
     213  // Register trajectory digi model factory. Assumes ownership of factory.
     214
     215  void RegisterModel(G4VFilter<G4VDigi>* filter);
     216  // Register trajectory digi model. Assumes ownership of model.
    216217
    217218  void SelectTrajectoryModel(const G4String& model);
     
    281282  void Draw (const G4VHit&);
    282283
     284  void Draw (const G4VDigi&);
     285
    283286  void Draw (const G4VTrajectory&, G4int i_mode);
    284287  // i_mode is a parameter that can be used to control the drawing of
     
    306309  // any, and redraw all views.
    307310
     311  void DispatchToModel(const G4VTrajectory&);
    308312  void DispatchToModel(const G4VTrajectory&, G4int i_mode);
    309313  // Draw the trajectory.
     
    311315  G4bool FilterTrajectory(const G4VTrajectory&);
    312316  G4bool FilterHit(const G4VHit&);
     317  G4bool FilterDigi(const G4VDigi&);
    313318
    314319  ////////////////////////////////////////////////////////////////////////
     
    329334  void EndOfEvent ();
    330335  // This is called on change of state (G4ApplicationState).  It is
    331   // used to draw hits and trajectories if included in the current
    332   // scene at the end of event, as required.
     336  // used to draw hits, digis and trajectories if included in the
     337  // current scene at the end of event, as required.
    333338
    334339  void EndOfRun ();
     
    357362  const G4SceneHandlerList&    GetAvailableSceneHandlers   () const;
    358363  const G4SceneList&           GetSceneList                () const;
    359   Verbosity                    GetVerbosity                () const;
     364  static Verbosity             GetVerbosity                ();
    360365  G4bool                       GetTransientsDrawnThisRun       () const;
    361366  G4bool                       GetTransientsDrawnThisEvent     () const;
     
    445450  G4SceneList           fSceneList;
    446451  G4SceneHandlerList    fAvailableSceneHandlers;
    447   Verbosity             fVerbosity;
     452  static Verbosity             fVerbosity;
    448453  std::vector<G4UImessenger*> fMessengerList;
    449454  std::vector<G4UIcommand*>   fDirectoryList;
     
    467472  G4VisFilterManager<G4VHit>* fpHitFilterMgr;
    468473
     474  // Digi filter model manager
     475  G4VisFilterManager<G4VDigi>* fpDigiFilterMgr;
     476
    469477};
    470478
  • trunk/source/visualization/management/include/G4VisManager.icc

    r954 r1288  
    2525//
    2626//
    27 // $Id: G4VisManager.icc,v 1.21 2009/01/13 09:55:15 lgarnier Exp $
     27// $Id: G4VisManager.icc,v 1.22 2010/06/01 16:08:15 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    6969}
    7070
    71 inline G4VisManager::Verbosity G4VisManager::GetVerbosity () const {
     71inline G4VisManager::Verbosity G4VisManager::GetVerbosity () {
    7272  return fVerbosity;
    7373}
    74 
    7574
    7675inline G4bool G4VisManager::GetTransientsDrawnThisEvent() const {
  • trunk/source/visualization/management/src/G4VSceneHandler.cc

    r1258 r1288  
    2525//
    2626//
    27 // $Id: G4VSceneHandler.cc,v 1.92 2010/05/11 10:55:07 allison Exp $
     27// $Id: G4VSceneHandler.cc,v 1.95 2010/06/01 16:08:15 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7575#include "G4HitsModel.hh"
    7676#include "G4VHit.hh"
     77#include "G4VDigi.hh"
    7778#include "G4ScoringManager.hh"
    7879#include "G4DefaultLinearColorMap.hh"
     
    263264  if (!trajectoriesModel) G4Exception
    264265    ("G4VSceneHandler::AddCompound(const G4VTrajectory&): Not a G4TrajectoriesModel.");
    265   G4VVisManager::IsDefaultDrawTrajectory = false;
    266266  if (trajectoriesModel->IsDrawingModeSet()) {
    267267    traj.DrawTrajectory(trajectoriesModel->GetDrawingMode());
     
    269269    traj.DrawTrajectory();
    270270  }
    271   if (!G4VVisManager::IsDefaultDrawTrajectory) {
    272     static G4bool warnedAboutIMode = false;
    273     if (!warnedAboutIMode) {
    274       G4Exception
    275         ("G4VSceneHandler::AddCompound(const G4VTrajectory&)",
    276          "",
    277          JustWarning,
    278   "WARNING: DEPRECATED: The use of the i_mode argument in DrawTrajectory"
    279   "\n  is deprecated and will be removed in a future major release.");
    280       warnedAboutIMode = true;
    281     }
    282   }
    283271}
    284272
     
    286274  // Cast away const because Draw is non-const!!!!
    287275  const_cast<G4VHit&>(hit).Draw();
     276}
     277
     278void G4VSceneHandler::AddCompound (const G4VDigi& digi) {
     279  // Cast away const because Draw is non-const!!!!
     280  const_cast<G4VDigi&>(digi).Draw();
    288281}
    289282
     
    498491    }
    499492    else {
    500       G4VisManager::Verbosity verbosity =
    501         G4VisManager::GetInstance()->GetVerbosity();
     493      G4VisManager::Verbosity verbosity = G4VisManager::GetVerbosity();
    502494      if (verbosity >= G4VisManager::errors) {
    503495        G4cout <<
     
    519511    }
    520512    else {
    521       G4VisManager::Verbosity verbosity =
    522         G4VisManager::GetInstance()->GetVerbosity();
     513      G4VisManager::Verbosity verbosity = G4VisManager::GetVerbosity();
    523514      if (verbosity >= G4VisManager::errors) {
    524515        G4cout <<
     
    754745
    755746  pModelingParams->SetWarning
    756     (G4VisManager::GetInstance()->GetVerbosity() >= G4VisManager::warnings);
     747    (G4VisManager::GetVerbosity() >= G4VisManager::warnings);
    757748
    758749  pModelingParams->SetExplodeFactor(vp.GetExplodeFactor());
  • trunk/source/visualization/management/src/G4VisCommandsSceneAdd.cc

    r1258 r1288  
    2525//
    2626//
    27 // $Id: G4VisCommandsSceneAdd.cc,v 1.79 2010/05/11 10:58:49 allison Exp $
     27// $Id: G4VisCommandsSceneAdd.cc,v 1.81 2010/06/01 16:08:15 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929// /vis/scene commands - John Allison  9th August 1998
     
    3737#include "G4ModelingParameters.hh"
    3838#include "G4HitsModel.hh"
     39#include "G4DigiModel.hh"
    3940#include "G4PSHitsModel.hh"
    4041#include "G4TrajectoriesModel.hh"
     
    157158}
    158159
     160
     161////////////// /vis/scene/add/digis ///////////////////////////////////////
     162
     163G4VisCommandSceneAddDigis::G4VisCommandSceneAddDigis () {
     164  fpCommand = new G4UIcmdWithoutParameter ("/vis/scene/add/digitisations", this);
     165  fpCommand -> SetGuidance ("Adds digis to current scene.");
     166  fpCommand -> SetGuidance
     167    ("Digis are drawn at end of event when the scene in which"
     168     "\nthey are added is current.");
     169
     170  fpCommandUS = new G4UIcmdWithoutParameter ("/vis/scene/add/digitizations", this);
     171  fpCommandUS -> SetGuidance ("Adds digis to current scene.");
     172  fpCommandUS -> SetGuidance
     173    ("Digis are drawn at end of event when the scene in which"
     174     "\nthey are added is current.");
     175}
     176
     177G4VisCommandSceneAddDigis::~G4VisCommandSceneAddDigis () {
     178  delete fpCommandUS;
     179  delete fpCommand;
     180}
     181
     182G4String G4VisCommandSceneAddDigis::GetCurrentValue (G4UIcommand*) {
     183  return "";
     184}
     185
     186void G4VisCommandSceneAddDigis::SetNewValue (G4UIcommand*, G4String) {
     187
     188  G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity();
     189  G4bool warn(verbosity >= G4VisManager::warnings);
     190
     191  G4Scene* pScene = fpVisManager->GetCurrentScene();
     192  if (!pScene) {
     193    if (verbosity >= G4VisManager::errors) {
     194      G4cout << "ERROR: No current scene.  Please create one." << G4endl;
     195    }
     196    return;
     197  }
     198
     199  G4DigiModel* model = new G4DigiModel;
     200  const G4String& currentSceneName = pScene -> GetName ();
     201  G4bool successful = pScene -> AddEndOfEventModel (model, warn);
     202  if (successful) {
     203    if (verbosity >= G4VisManager::confirmations) {
     204      G4cout << "Digis will be drawn in scene \""
     205             << currentSceneName << "\"."
     206             << G4endl;
     207    }
     208  }
     209  else G4VisCommandsSceneAddUnsuccessful(verbosity);
     210  UpdateVisManagerScene (currentSceneName);
     211}
    159212
    160213////////////// /vis/scene/add/eventID ///////////////////////////////////////
  • trunk/source/visualization/management/src/G4VisCommandsViewer.cc

    r1170 r1288  
    2525//
    2626//
    27 // $Id: G4VisCommandsViewer.cc,v 1.75 2009/01/19 15:47:49 lgarnier Exp $
     27// $Id: G4VisCommandsViewer.cc,v 1.76 2010/05/29 21:20:20 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929
     
    10381038
    10391039  G4String& rebuildName = newValue;
     1040
    10401041  G4VViewer* viewer = fpVisManager -> GetViewer (rebuildName);
    10411042  if (!viewer) {
     
    10481049  }
    10491050
     1051  G4VSceneHandler* sceneHandler = viewer->GetSceneHandler();
     1052  if (!sceneHandler) {
     1053    if (verbosity >= G4VisManager::errors) {
     1054      G4cout << "ERROR: Viewer \"" << viewer->GetName() << "\"" <<
     1055        " has no scene handler - report serious bug."
     1056             << G4endl;
     1057    }
     1058    return;
     1059  }
     1060
     1061  sceneHandler->ClearTransientStore();
    10501062  viewer->NeedKernelVisit();
     1063  viewer->SetView();
     1064  viewer->ClearView();
     1065  viewer->DrawView();
    10511066
    10521067  // Check auto-refresh and print confirmations, but without changing
  • trunk/source/visualization/management/src/G4VisManager.cc

    r1258 r1288  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VisManager.cc,v 1.124 2010/05/11 11:02:19 allison Exp $
     26// $Id: G4VisManager.cc,v 1.128 2010/06/01 16:08:15 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    7979G4VisManager* G4VisManager::fpInstance = 0;
    8080
    81 G4VisManager::G4VisManager ():
     81G4VisManager::Verbosity G4VisManager::fVerbosity = G4VisManager::warnings;
     82
     83G4VisManager::G4VisManager (const G4String& verbosityString):
    8284  fVerbose         (1),
    8385  fInitialised     (false),
     
    8789  fpSceneHandler   (0),
    8890  fpViewer         (0),
    89   fVerbosity       (warnings),
    9091  fpStateDependent (0),
    9192  fEventRefreshing          (false),
     
    101102  fpTrajFilterMgr = new G4VisFilterManager<G4VTrajectory>("/vis/filtering/trajectories");
    102103  fpHitFilterMgr = new G4VisFilterManager<G4VHit>("/vis/filtering/hits");
     104  fpDigiFilterMgr = new G4VisFilterManager<G4VDigi>("/vis/filtering/digi");
    103105
    104106  VerbosityGuidanceStrings.push_back
     
    123125      ("G4VisManager: attempt to Construct more than one VisManager.");
    124126  }
    125   else {
    126 
    127     fpInstance = this;
    128     SetConcreteInstance(this);
    129 
    130     fpStateDependent = new G4VisStateDependent (this);
    131     // No need to delete this; G4StateManager does this.
    132 
    133     if (fVerbosity >= startup) {
    134       G4cout << "Visualization Manager instantiating..." << G4endl;
    135     }
    136 
    137     // Note: The specific graphics systems must be instantiated in a
    138     // higher level library to avoid circular dependencies.  Also,
    139     // some specifically need additional external libararies that the
    140     // user must supply.  Therefore we ask the user to implement
    141     // RegisterGraphicsSystems() and RegisterModelFactories()
    142     // in a subclass.  We have to wait for the subclass to instantiate
    143     // so RegisterGraphicsSystems() cannot be called from this
    144     // constructor; it is called from Initialise().  So we ask the
    145     // user:
    146     //   (a) to write a subclass and implement  RegisterGraphicsSystems()
    147     //       and RegisterModelFactories().  See
    148     //       visualization/include/G4VisExecutive.hh/icc as an example.
    149     //   (b) instantiate the subclass.
    150     //   (c) invoke the Initialise() method of the subclass.
    151     // For example:
    152     //   ...
    153     // #ifdef G4VIS_USE
    154     //   // Instantiate and initialise Visualization Manager.
    155     //   G4VisManager* visManager = new G4VisExecutive;
    156     //   visManager -> SetVerboseLevel (Verbose);
    157     //   visManager -> Initialise ();
    158     // #endif
    159     //   // (Don't forget to delete visManager;)
    160     //   ...
    161 
    162     // Make top level command directory...
    163     G4UIcommand* directory;
    164     directory = new G4UIdirectory ("/vis/");
    165     directory -> SetGuidance ("Visualization commands.");
    166     fDirectoryList.push_back (directory);
    167 
    168     // Instantiate top level basic commands
    169     G4VVisCommand::SetVisManager (this);  // Sets shared pointer
    170     RegisterMessenger(new G4VisCommandVerbose);
    171     RegisterMessenger(new G4VisCommandInitialize);
    172   }
     127
     128  fpInstance = this;
     129  SetConcreteInstance(this);
     130
     131  fpStateDependent = new G4VisStateDependent (this);
     132  // No need to delete this; G4StateManager does this.
     133
     134  fVerbosity = GetVerbosityValue(verbosityString);
     135  if (fVerbosity >= startup) {
     136      G4cout
     137        << "Visualization Manager instantiating with verbosity \""
     138        << VerbosityString(fVerbosity)
     139        << "\"..." << G4endl;
     140  }
     141
     142  // Note: The specific graphics systems must be instantiated in a
     143  // higher level library to avoid circular dependencies.  Also,
     144  // some specifically need additional external libararies that the
     145  // user must supply.  Therefore we ask the user to implement
     146  // RegisterGraphicsSystems() and RegisterModelFactories()
     147  // in a subclass.  We have to wait for the subclass to instantiate
     148  // so RegisterGraphicsSystems() cannot be called from this
     149  // constructor; it is called from Initialise().  So we ask the
     150  // user:
     151  //   (a) to write a subclass and implement  RegisterGraphicsSystems()
     152  //       and RegisterModelFactories().  See
     153  //       visualization/include/G4VisExecutive.hh/icc as an example.
     154  //   (b) instantiate the subclass.
     155  //   (c) invoke the Initialise() method of the subclass.
     156  // For example:
     157  //   ...
     158  // #ifdef G4VIS_USE
     159  //   // Instantiate and initialise Visualization Manager.
     160  //   G4VisManager* visManager = new G4VisExecutive;
     161  //   visManager -> SetVerboseLevel (Verbose);
     162  //   visManager -> Initialise ();
     163  // #endif
     164  //   // (Don't forget to delete visManager;)
     165  //   ...
     166
     167  // Make top level command directory...
     168  G4UIcommand* directory;
     169  directory = new G4UIdirectory ("/vis/");
     170  directory -> SetGuidance ("Visualization commands.");
     171  fDirectoryList.push_back (directory);
     172
     173  // Instantiate top level basic commands
     174  G4VVisCommand::SetVisManager (this);  // Sets shared pointer
     175  RegisterMessenger(new G4VisCommandVerbose);
     176  RegisterMessenger(new G4VisCommandInitialize);
    173177}
    174178
     
    200204  }
    201205
     206  delete fpDigiFilterMgr;
     207  delete fpHitFilterMgr;
     208  delete fpTrajFilterMgr;
    202209  delete fpTrajDrawModelMgr;
    203   delete fpTrajFilterMgr;
    204   delete fpHitFilterMgr;
    205210}
    206211
     
    288293  directory -> SetGuidance ("Create hit filters and messengers.");
    289294  fDirectoryList.push_back (directory);
     295  directory = new G4UIdirectory ("/vis/filtering/digi/");
     296  directory -> SetGuidance ("Digi filtering commands.");
     297  fDirectoryList.push_back (directory);
     298  directory = new G4UIdirectory ("/vis/filtering/digi/create/");
     299  directory -> SetGuidance ("Create digi filters and messengers.");
     300  fDirectoryList.push_back (directory);
    290301
    291302  RegisterMessengers ();
     
    436447}
    437448
     449void G4VisManager::RegisterModel(G4VFilter<G4VDigi>* model)
     450{
     451  fpDigiFilterMgr->Register(model);
     452}
     453
     454void
     455G4VisManager::RegisterModelFactory(G4DigiFilterFactory* factory)
     456{
     457  fpDigiFilterMgr->Register(factory);
     458}
     459
    438460void G4VisManager::SelectTrajectoryModel(const G4String& model)
    439461{
     
    613635    ClearTransientStoreIfMarked();
    614636    fpSceneHandler -> AddCompound (hit);
     637  }
     638}
     639
     640void G4VisManager::Draw (const G4VDigi& digi) {
     641  if (IsValidView ()) {
     642    ClearTransientStoreIfMarked();
     643    fpSceneHandler -> AddCompound (digi);
    615644  }
    616645}
     
    872901}   
    873902
     903G4bool G4VisManager::FilterDigi(const G4VDigi& digi)
     904{
     905  return fpDigiFilterMgr->Accept(digi);
     906}   
     907
     908void G4VisManager::DispatchToModel(const G4VTrajectory& trajectory)
     909{
     910  G4bool visible(true);
     911
     912  // See if trajectory passes filter
     913  G4bool passed = FilterTrajectory(trajectory);
     914
     915  if (!passed) {
     916    // Draw invisible trajectory if trajectory failed filter and
     917    // are filtering in soft mode
     918    if (fpTrajFilterMgr->GetMode() == FilterMode::Soft) visible = false;
     919    else {return;}
     920  }
     921
     922  // Go on to draw trajectory
     923  assert (0 != fpTrajDrawModelMgr);
     924
     925  const G4VTrajectoryModel* trajectoryModel = CurrentTrajDrawModel();
     926
     927  assert (0 != trajectoryModel); // Should exist
     928
     929  trajectoryModel->Draw(trajectory, visible);
     930}
     931
    874932void G4VisManager::DispatchToModel(const G4VTrajectory& trajectory, G4int i_mode)
    875933{
     
    902960    }
    903961  } else {
    904     //G4Exception("G4VisManager::DispatchToModel: Not a G4TrajectoriesModel.");
    905962    // Just draw at user's request
    906963    trajectoryModel->Draw(trajectory, i_mode, visible);
    907     static G4bool warnedAboutIMode = false;
    908     if (!warnedAboutIMode) {
    909       G4Exception
    910         ("G4VisManager::DispatchToModel",
    911          "",
    912          JustWarning,
    913   "WARNING: DEPRECATED: The use of the i_mode argument in DrawTrajectory"
    914   "\n  is deprecated and will be removed at the next major release.");
    915       warnedAboutIMode = true;
    916     }
    917    }
    918 }
     964  }
     965}
    919966
    920967void G4VisManager::SetUserAction
     
    11051152  RegisterMessenger(new G4VisCommandSceneAddGhosts);
    11061153  RegisterMessenger(new G4VisCommandSceneAddHits);
     1154  RegisterMessenger(new G4VisCommandSceneAddDigis);
    11071155  RegisterMessenger(new G4VisCommandSceneAddLogicalVolume);
    11081156  RegisterMessenger(new G4VisCommandSceneAddLogo);
     
    11661214  RegisterMessenger(new G4VisCommandManagerMode< G4VisFilterManager<G4VHit> >
    11671215                    (fpHitFilterMgr, fpHitFilterMgr->Placement()));
     1216
     1217  // Digi filter manager commands
     1218  RegisterMessenger(new G4VisCommandListManagerList< G4VisFilterManager<G4VDigi> >
     1219                    (fpDigiFilterMgr, fpDigiFilterMgr->Placement()));
     1220  RegisterMessenger(new G4VisCommandManagerMode< G4VisFilterManager<G4VDigi> >
     1221                    (fpDigiFilterMgr, fpDigiFilterMgr->Placement()));
    11681222}
    11691223
     
    14021456        "  Only useful if before starting the run:"
    14031457        "\n    a) trajectories are stored (\"/vis/scene/add/trajectories [smooth|rich]\"), or"
    1404         "\n    b) the Draw method of any hits is implemented."
    1405         "\n  To view trajectories and hits:"
     1458        "\n    b) the Draw method of any hits or digis is implemented."
     1459        "\n  To view trajectories, hits or digis:"
    14061460        "\n    open a viewer, draw a volume, \"/vis/scene/add/trajectories\""
    1407         "\n    \"/vis/scene/add/hits\" and, possibly, \"/vis/viewer/flush\"."
     1461        "\n    \"/vis/scene/add/hits\" or \"/vis/scene/add/digitisations\""
     1462        "\n    and, possibly, \"/vis/viewer/flush\"."
    14081463        "\n  To see all events: \"/vis/scene/endOfEventAction accumulate\"."
    14091464        "\n  To see events individually: \"/vis/reviewKeptEvents\"."
  • trunk/source/visualization/modeling/History

    r1258 r1288  
    1 $Id: History,v 1.117 2010/05/11 11:58:41 allison Exp $
     1$Id: History,v 1.119 2010/05/30 11:24:57 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/modeling
    2121---------------------------------------
     22
     2330th May 2010  John Allison  (modeling-V09-03-02)
     24- Added G4DigiModel and G4DigiFilterFactories.
     25- G4BoundingSphereScene, G4PhysicalVolumeMassScene,
     26  G4PhysicalVolumeSearchScene:
     27  o Added AddCompound(const G4VDigi&).
     28
     2928th May 2010  John Allison  (modeling-V09-03-01)
     30- G4TrajectoryDrawByAttribute.cc, G4TrajectoryDrawByCharge.cc,
     31  G4TrajectoryDrawByOriginVolume.cc, G4TrajectoryDrawByParticleID.cc:
     32  o Fixed unused parameter 'i_mode' warning.
    2233
    233411th May 2010  John Allison  (modeling-V09-03-00)
  • trunk/source/visualization/modeling/include/G4BoundingSphereScene.hh

    r1140 r1288  
    2525//
    2626//
    27 // $Id: G4BoundingSphereScene.hh,v 1.19 2009/10/21 14:17:33 allison Exp $
     27// $Id: G4BoundingSphereScene.hh,v 1.20 2010/05/30 11:23:25 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7171  void AddCompound (const G4VTrajectory&) {}
    7272  void AddCompound (const G4VHit&) {}
     73  void AddCompound (const G4VDigi&) {}
    7374  void AddCompound (const G4THitsMap<G4double>&) {}
    7475  G4VisExtent GetBoundingSphereExtent ();
  • trunk/source/visualization/modeling/include/G4PhysicalVolumeMassScene.hh

    r1140 r1288  
    2525//
    2626//
    27 // $Id: G4PhysicalVolumeMassScene.hh,v 1.10 2009/10/21 14:17:33 allison Exp $
     27// $Id: G4PhysicalVolumeMassScene.hh,v 1.11 2010/05/30 11:23:25 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    109109  void AddCompound (const G4VTrajectory&) {}
    110110  void AddCompound (const G4VHit&) {}
     111  void AddCompound (const G4VDigi&) {}
    111112  void AddCompound (const G4THitsMap<G4double>&) {}
    112113
  • trunk/source/visualization/modeling/include/G4PhysicalVolumeSearchScene.hh

    r1140 r1288  
    2525//
    2626//
    27 // $Id: G4PhysicalVolumeSearchScene.hh,v 1.19 2009/10/21 14:17:33 allison Exp $
     27// $Id: G4PhysicalVolumeSearchScene.hh,v 1.20 2010/05/30 11:23:25 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7474  void AddCompound (const G4VTrajectory&) {}
    7575  void AddCompound (const G4VHit&) {}
     76  void AddCompound (const G4VDigi&) {}
    7677  void AddCompound (const G4THitsMap<G4double>&) {}
    7778  G4int                GetFoundDepth          () const;
  • trunk/source/visualization/modeling/src/G4HitFilterFactories.cc

    r954 r1288  
    2424// ********************************************************************
    2525//
    26 /// $Id: G4HitFilterFactories.cc,v 1.1 2006/09/12 18:53:03 tinslay Exp $
     26/// $Id: G4HitFilterFactories.cc,v 1.2 2010/05/30 11:24:03 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
    2929//
    30 // Trajectory filter model factories creating filters
     30// Hits filter model factories creating filters
    3131// and associated messengers.
    3232//
  • trunk/source/visualization/modeling/src/G4TrajectoryDrawByAttribute.cc

    r1258 r1288  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawByAttribute.cc,v 1.4 2010/05/11 11:31:31 allison Exp $
     26// $Id: G4TrajectoryDrawByAttribute.cc,v 1.5 2010/05/28 02:00:59 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    6363void
    6464G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object,
    65                                   const G4int& i_mode,
     65                                  const G4int&,
    6666                                  const G4bool& visible) const
    6767{
  • trunk/source/visualization/modeling/src/G4TrajectoryDrawByCharge.cc

    r1258 r1288  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawByCharge.cc,v 1.9 2010/05/11 11:31:31 allison Exp $
     26// $Id: G4TrajectoryDrawByCharge.cc,v 1.10 2010/05/28 02:00:59 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    5858void
    5959G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& object,
    60                                const G4int& i_mode,
     60                               const G4int&,
    6161                               const G4bool& visible) const
    6262{
  • trunk/source/visualization/modeling/src/G4TrajectoryDrawByOriginVolume.cc

    r1258 r1288  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawByOriginVolume.cc,v 1.5 2010/05/11 11:31:31 allison Exp $
     26// $Id: G4TrajectoryDrawByOriginVolume.cc,v 1.6 2010/05/28 02:00:59 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    4646void
    4747G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& object,
    48                                      const G4int& i_mode,
     48                                     const G4int&,
    4949                                     const G4bool& visible) const
    5050{
  • trunk/source/visualization/modeling/src/G4TrajectoryDrawByParticleID.cc

    r1258 r1288  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawByParticleID.cc,v 1.9 2010/05/11 11:31:31 allison Exp $
     26// $Id: G4TrajectoryDrawByParticleID.cc,v 1.10 2010/05/28 02:00:59 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    4444void
    4545G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& object,
    46                                    const G4int& i_mode,
     46                                   const G4int&,
    4747                                   const G4bool& visible) const
    4848{
Note: See TracChangeset for help on using the changeset viewer.