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

update from CVS

Location:
trunk/source/visualization/management/include
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 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 {
Note: See TracChangeset for help on using the changeset viewer.