Ignore:
Timestamp:
Nov 3, 2009, 11:17:28 AM (15 years ago)
Author:
garnier
Message:

update to CVS

Location:
trunk/source/visualization
Files:
43 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/FukuiRenderer/GNUmakefile

    r834 r1140  
    1 # $Id: GNUmakefile,v 1.5 2004/06/03 11:40:12 gcosmo Exp $
     1# $Id: GNUmakefile,v 1.6 2009/10/21 14:59:17 allison Exp $
    22
    33name := G4FR
     
    2727CPPFLAGS += -I$(G4BASE)/geometry/solids/specific/include
    2828CPPFLAGS += -I$(G4BASE)/geometry/management/include
     29CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include
    2930
    3031include $(G4INSTALL)/config/common.gmk
  • trunk/source/visualization/FukuiRenderer/History

    r834 r1140  
    1 $Id: History,v 1.26 2006/07/10 15:32:27 allison Exp $
     1$Id: History,v 1.27 2009/10/21 14:59:17 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/FukuiRenderer sub-category
    2121---------------------------------------------------------
     22
     2321st October 2009  John Allison  (DAWN-V09-02-00 coworks greps-V09-02-02)
     24- Added default AddCompound (const G4THitsMap<G4double>&) methods.
     25  o Prevents warnings about hiding - calls G4VSceneHandler base class.
    2226
    232710th July 2006  John Allison  (DAWN-V08-01-00)
  • trunk/source/visualization/FukuiRenderer/include/G4DAWNFILESceneHandler.hh

    r944 r1140  
    2525//
    2626//
    27 // $Id: G4DAWNFILESceneHandler.hh,v 1.16 2006/06/29 21:16:30 gunter Exp $
     27// $Id: G4DAWNFILESceneHandler.hh,v 1.17 2009/10/21 14:59:17 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    9898    G4VSceneHandler::AddCompound(hit);
    9999  }
     100  void AddCompound ( const G4THitsMap<G4double> & hits) {
     101    G4VSceneHandler::AddCompound(hits);
     102  }
    100103
    101104  void ClearTransientStore();  // Used for triggering detector re-drawing.
  • trunk/source/visualization/FukuiRenderer/include/G4FukuiRendererSceneHandler.hh

    r944 r1140  
    2525//
    2626//
    27 // $Id: G4FukuiRendererSceneHandler.hh,v 1.15 2006/06/29 21:16:46 gunter Exp $
     27// $Id: G4FukuiRendererSceneHandler.hh,v 1.16 2009/10/21 14:59:17 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    100100  void AddCompound ( const G4VHit& hit) {
    101101    G4VSceneHandler::AddCompound(hit);
     102  }
     103  void AddCompound ( const G4THitsMap<G4double> & hits) {
     104    G4VSceneHandler::AddCompound(hits);
    102105  }
    103106
  • trunk/source/visualization/GNUmakefile

    r959 r1140  
    1 # $Id: GNUmakefile,v 1.23 2009/03/05 11:32:07 lgarnier Exp $
     1# $Id: GNUmakefile,v 1.24 2009/10/12 10:28:38 akimura Exp $
    22# -----------------------------------------------------------------------
    33# GNUmakefile for visualization and modeling.  John Allison, 5/7/95.
     
    2626
    2727# For Debug mode
    28 CPPFLAGS += -DG4DEBUG_VIS_OGL
    29 CPPFLAGS += -DG4DEBUG_VIS_OI
    30 CPPFLAGS += -DG4DEBUG_VIS_MANAGEMENT
     28# CPPFLAGS += -DG4DEBUG_VIS_OGL
     29# CPPFLAGS += -DG4DEBUG_VIS_OI
     30# CPPFLAGS += -DG4DEBUG_VIS_MANAGEMENT
    3131
    3232# Libraries which can be used without external packages or libraries...
     
    4646  SUBDIRS += XXX
    4747  SUBLIBS += G4visXXX
     48  SUBDIRS += gMocren
     49  SUBLIBS += G4GMocren
    4850
    4951ifdef G4VIS_BUILD_OPENGL_DRIVER
  • trunk/source/visualization/HepRep/History

    r1040 r1140  
    1 .$Id: History,v 1.129 2009/05/08 09:29:23 gcosmo Exp $
     1.$Id: History,v 1.131 2009/10/21 15:13:36 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/HepRep sub-category
    2121--------------------------------------------------
     22
     2321st October 2009  John Allison  (vis-HepRep-V09-02-02 coworks greps-V09-02-02)
     24- Added default AddCompound (const G4THitsMap<G4double>&) methods.
     25  o Prevents warnings about hiding - calls G4VSceneHandler base class.
    2226
    23278 May 2009  Gabriele Cosmo  (vis-HepRep-V09-02-00)
  • trunk/source/visualization/HepRep/include/G4HepRepFileSceneHandler.hh

    r944 r1140  
    2525//
    2626//
    27 // $Id: G4HepRepFileSceneHandler.hh,v 1.30 2008/01/04 22:11:31 allison Exp $
     27// $Id: G4HepRepFileSceneHandler.hh,v 1.31 2009/10/21 15:08:35 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    8282  void AddCompound (const G4VHit&);
    8383  void InitHit();
     84  void AddCompound (const G4THitsMap<G4double>& hits) {
     85    G4VSceneHandler::AddCompound(hits);
     86  }
    8487  // void PreAddSolid(const G4Transform3D& objectTransformation,
    8588  //                 const G4VisAttributes&);
  • trunk/source/visualization/HepRep/include/G4HepRepSceneHandler.hh

    r944 r1140  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HepRepSceneHandler.hh,v 1.42 2006/11/06 09:22:26 allison Exp $
     26// $Id: G4HepRepSceneHandler.hh,v 1.43 2009/10/21 15:08:35 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    8585        void AddCompound (const G4VTrajectory&);
    8686        void AddCompound (const G4VHit& hit);
     87        void AddCompound (const G4THitsMap<G4double>& hits) {
     88          G4VSceneHandler::AddCompound(hits);
     89        }
    8790
    8891        void PreAddSolid (const G4Transform3D& objectTransformation, const G4VisAttributes& visAttribs);
  • trunk/source/visualization/History

    r1136 r1140  
    1 $Id: History,v 1.445 2009/08/20 15:16:58 lgarnier Exp $
     1$Id: History,v 1.453 2009/10/25 10:43:42 allison Exp $
    22-------------------------------------------------------------------
    33
     
    3030 - G4OpenGLQtViewer.cc/G4OpenGLStoreQtViewer.cc : Fix problems with
    3131   mac OS X 10.6
     32
     3323rd October 2009  John Allison  (vis-V09-02-09, greps-V09-02-02, digits_hits-V09-02-02)
     34- visman-V09-02-05: Implemented default behaviour in
     35  G4VSceneHandler::AddCompound (const G4THitsMap<G4double>&).
     36
     3722nd October 2009  John Allison  (vis-V09-02-08, greps-V09-02-02, digits_hits-V09-02-02)
     38- modeling-V09-02-05: Added G4PSHitsModel for gMocren driver.
     39- gMocren-V09-02-00: G4PSHitsModel moved to modelling.
     40
     4121st October 2009  John Allison  (vis-V09-02-07 coworks greps-V09-02-02)
     42- greps-V09-02-02 adds new pure virtual function,
     43  AddCompound (const G4THitsMap<G4double>&).  The following tags
     44  accomodate:
     45  o modeling-V09-02-04
     46  o visman-V09-02-04
     47  o DAWN-V09-02-00
     48  o vis-HepRep-V09-02-02
     49  o opengl-V09-02-08
     50  o raytracer-V09-02-01
     51  o VRML-V09-02-01
     52  o visXXX-V09-02-00
     53
     5410th October 2009 Joseph Perl (vis-V09-02-06)
     55- new global tag for vis, in preparation for  addition of gMocren file driver
     56
     5710th October 2009  John Allison
     58- modeling-V09-02-03: Added G4PhysicalVolumeModelTouchable.  Used in
     59  ComputeMaterial.  Effective for nested parameterisations.
     60
     6129th September 2009  John Allison  (allison20090929)
     62- modeling-V09-02-02: Added warning if logical volume not defined.
     63- visman-V09-02-03:
     64  o Allow refresh in GeomClosed as well as Idle state.
     65  o Fixed uninitialised pointers.
     66  o G4VisManager.cc: Considerable tidy up.
     67- opengl-V09-02-07:  Tagged work by Laurent Garnier:
     68  o G4OpenGLXmViewer : Fix a wrong initialization introduce by the
     69    new way of handling window size hints (January 2009)
     70  o G4OpenGLQtViewer : Ensure the GL frame size will be correct
     71    by setting a 0 size margin around
     72  o G4OpenGLStoredQtViewer : Remove picking to true at initialisation
     73- openinventor-V09-02-02:  Tagged work by Laurent Garnier:
     74  o G4OpenInventorXt/WinViewer: Fix a wrong initialization introduce by the
     75    new way of handling window size hints (January 2009)
     76  o Remove Geant4_gl2ps.h gl2ps.cc gl2ps.h which were copied in external/gl2ps
     77    in february but forgot to remove them from OpenInventor
     78- vistest-V09-02-00: Changed main program, test19.cc, to use G4UIExecutive.
     79- VRML-V09-02-00: Tagged change of disclaimer on file headings (made long ago).
     80
     8116 September 2009  John Allison
     82- raytracer-V09-02-00: Cosmetic adjustments and tagging.
    3283
    338419 August 2009 Laurent Garnier
  • trunk/source/visualization/OpenGL/History

    r1135 r1140  
    1 $Id: History,v 1.155 2009/10/21 08:14:44 lgarnier Exp $
     1$Id: History,v 1.156 2009/10/21 15:21:09 allison Exp $
    22-------------------------------------------------------------------
    33
     
    202021 October 2009 Laurent Garnier
    2121 -  G4OpenGLQtViewer : Prepare to attach viewer In UI
     22
     2321st October 2009  John Allison  (opengl-V09-02-08 coworks greps-V09-02-02)
     24- Added default AddCompound (const G4THitsMap<G4double>&) methods.
     25  o Prevents warnings about hiding - calls G4VSceneHandler base class.
    2226
    232715 October 2009 Laurent Garnier
  • trunk/source/visualization/OpenGL/include/G4OpenGLSceneHandler.hh

    r1022 r1140  
    2525//
    2626//
    27 // $Id: G4OpenGLSceneHandler.hh,v 1.26 2009/04/23 10:13:56 lgarnier Exp $
     27// $Id: G4OpenGLSceneHandler.hh,v 1.27 2009/10/21 15:18:14 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    8383  void AddCompound (const G4VTrajectory&);
    8484  void AddCompound (const G4VHit&);
     85  void AddCompound (const G4THitsMap<G4double>&);
    8586
    8687protected:
  • trunk/source/visualization/OpenGL/src/G4OpenGLSceneHandler.cc

    r1129 r1140  
    2525//
    2626//
    27 // $Id: G4OpenGLSceneHandler.cc,v 1.55 2009/03/03 14:51:29 lgarnier Exp $
     27// $Id: G4OpenGLSceneHandler.cc,v 1.56 2009/10/21 15:18:43 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    879879}
    880880
     881void G4OpenGLSceneHandler::AddCompound(const G4THitsMap<G4double>& hits) {
     882  G4VSceneHandler::AddCompound(hits);  // For now.
     883}
     884
    881885#endif
  • trunk/source/visualization/RayTracer/History

    r1136 r1140  
    1 $Id: History,v 1.58 2009/09/16 16:58:26 allison Exp $
     1$Id: History,v 1.59 2009/10/21 15:24:53 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2424History file for Ray Tracer category
    2525---------------------------------------
     26
     2721st October 2009  John Allison  (raytracer-V09-02-01 coworks greps-V09-02-02)
     28- Added AddCompound (const G4THitsMap<G4double>&) methods.
     29  o Prevents warnings about hiding - calls G4VSceneHandler base class.
    2630
    273116 September 2009  John Allison  (raytracer-V09-02-00)
  • trunk/source/visualization/RayTracer/include/G4RayTracerSceneHandler.hh

    r954 r1140  
    2525//
    2626//
    27 // $Id: G4RayTracerSceneHandler.hh,v 1.11 2006/06/29 21:23:37 gunter Exp $
     27// $Id: G4RayTracerSceneHandler.hh,v 1.12 2009/10/21 15:24:53 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929
     
    6565  void AddCompound(const G4VTrajectory&){}
    6666  void AddCompound(const G4VHit&){}
     67  void AddCompound(const G4THitsMap<G4double>&) {}
    6768
    6869private:
  • trunk/source/visualization/Tree/src/G4ASCIITreeViewer.cc

    r954 r1140  
    3434  G4VTreeViewer(sceneHandler, name) {
    3535  // Make changes to view parameters for ASCIITree...
     36//   if (!fVP) {
     37    printf("G4ASCIITreeViewer::G4ASCIITreeViewer SHOULD CRASH HERE-----------------------------------------------------------\n");
     38//   } else {
     39//     printf("G4ASCIITreeViewer::G4ASCIITreeViewer SHOULD NOT CRASH HERE------------------------------------------------------------\n");
     40//   }
    3641  fVP.SetCulling(false);
     42  printf("G4ASCIITreeViewer::G4ASCIITreeViewer 2\n");
    3743  fDefaultVP.SetCulling(false);
     44  printf("G4ASCIITreeViewer::G4ASCIITreeViewer 3\n");
    3845}
    3946
  • trunk/source/visualization/VRML/GNUmakefile

    r834 r1140  
    1 # $Id: GNUmakefile,v 1.7 2004/06/03 11:40:14 gcosmo Exp $
     1# $Id: GNUmakefile,v 1.8 2009/10/21 15:27:21 allison Exp $
    22
    33# lib name
     
    2929CPPFLAGS += -I$(G4BASE)/geometry/management/include
    3030CPPFLAGS += -I$(G4BASE)/visualization/VRML/include
     31CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include
    3132
    3233include $(G4INSTALL)/config/common.gmk
  • trunk/source/visualization/VRML/History

    r834 r1140  
    1 $Id: History,v 1.15 2006/06/12 08:32:16 allison Exp $
     1$Id: History,v 1.17 2009/10/21 15:27:21 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/VRML sub-category
    2121------------------------------------------------
     22
     2321st October 2009  John Allison  (VRML-V09-02-01 coworks greps-V09-02-02)
     24- Added AddCompound (const G4THitsMap<G4double>&) methods.
     25  o Prevents warnings about hiding - calls G4VSceneHandler base class.
     26
     2729 September 2009  John Allison (VRML-V09-02-00)
     28- Tagged change of disclaimer on file headings (made long ago).
    2229
    233012th June 2006  John Allison  (VRML-V08-00-02)
  • trunk/source/visualization/VRML/include/G4VRML1FileSceneHandler.hh

    r944 r1140  
    2525//
    2626//
    27 // $Id: G4VRML1FileSceneHandler.hh,v 1.17 2006/06/29 21:25:27 gunter Exp $
     27// $Id: G4VRML1FileSceneHandler.hh,v 1.18 2009/10/21 15:27:21 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7373          G4VSceneHandler::AddCompound(hit);
    7474        }
     75        void AddCompound ( const G4THitsMap<G4double> & hits) {
     76          G4VSceneHandler::AddCompound(hits);
     77        }
    7578
    7679        void BeginPrimitives(const G4Transform3D& objectTransformation);
  • trunk/source/visualization/VRML/include/G4VRML1SceneHandler.hh

    r944 r1140  
    2525//
    2626//
    27 // $Id: G4VRML1SceneHandler.hh,v 1.14 2006/06/29 21:25:31 gunter Exp $
     27// $Id: G4VRML1SceneHandler.hh,v 1.15 2009/10/21 15:27:21 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7878          G4VSceneHandler::AddCompound(hit);
    7979        }
     80        void AddCompound ( const G4THitsMap<G4double> & hits) {
     81          G4VSceneHandler::AddCompound(hits);
     82        }
    8083
    8184        void BeginPrimitives(const G4Transform3D& objectTransformation);
  • trunk/source/visualization/VRML/include/G4VRML2FileSceneHandler.hh

    r944 r1140  
    2525//
    2626//
    27 // $Id: G4VRML2FileSceneHandler.hh,v 1.16 2006/06/29 21:25:39 gunter Exp $
     27// $Id: G4VRML2FileSceneHandler.hh,v 1.17 2009/10/21 15:27:21 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7373          G4VSceneHandler::AddCompound(hit);
    7474        }
     75        void AddCompound ( const G4THitsMap<G4double> & hits) {
     76          G4VSceneHandler::AddCompound(hits);
     77        }
    7578
    7679        void BeginPrimitives(const G4Transform3D& objectTransformation);
  • trunk/source/visualization/VRML/include/G4VRML2SceneHandler.hh

    r944 r1140  
    2525//
    2626//
    27 // $Id: G4VRML2SceneHandler.hh,v 1.13 2006/06/29 21:25:43 gunter Exp $
     27// $Id: G4VRML2SceneHandler.hh,v 1.14 2009/10/21 15:27:21 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7676          G4VSceneHandler::AddCompound(hit);
    7777        }
     78        void AddCompound ( const G4THitsMap<G4double> & hits) {
     79          G4VSceneHandler::AddCompound(hits);
     80        }
    7881
    7982        void BeginPrimitives(const G4Transform3D& objectTransformation);
  • trunk/source/visualization/XXX/GNUmakefile

    r834 r1140  
    1 # $Id: GNUmakefile,v 1.7 2006/03/28 17:16:41 allison Exp $
     1# $Id: GNUmakefile,v 1.8 2009/10/21 15:28:53 allison Exp $
    22
    33name := G4visXXX
     
    2828CPPFLAGS += -I$(G4BASE)/geometry/solids/specific/include
    2929CPPFLAGS += -I$(G4BASE)/tracking/include
     30CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include
    3031
    3132ifdef G4VIS_BUILD_XXXSG_DRIVER
  • trunk/source/visualization/XXX/History

    r834 r1140  
    1 $Id: History,v 1.27 2006/11/05 20:41:55 allison Exp $
     1$Id: History,v 1.28 2009/10/21 15:28:53 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/XXX sub-category (a template graphics system)
    2121---------------------------------------------------------------------------
     22
     2321st October 2009  John Allison  (visXXX-V09-02-00 coworks greps-V09-02-02)
     24- Added AddCompound (const G4THitsMap<G4double>&) methods.
     25  o Prevents warnings about hiding - calls G4VSceneHandler base class.
    2226
    23275th November 2006  John Allison  (visXXX-V08-01-06)
  • trunk/source/visualization/XXX/include/G4XXXFileSceneHandler.hh

    r944 r1140  
    2525//
    2626//
    27 // $Id: G4XXXFileSceneHandler.hh,v 1.3 2006/06/29 21:26:42 gunter Exp $
     27// $Id: G4XXXFileSceneHandler.hh,v 1.4 2009/10/21 15:28:53 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7676  // void AddCompound(const G4VTrajectory&);
    7777  // void AddCompound(const G4VHit&);
     78  // void AddCompound(const G4THitsMap<G4double>&);
    7879  // void PreAddSolid(const G4Transform3D& objectTransformation,
    7980  //       const G4VisAttributes&);
  • trunk/source/visualization/XXX/include/G4XXXSGSceneHandler.hh

    r944 r1140  
    2525//
    2626//
    27 // $Id: G4XXXSGSceneHandler.hh,v 1.3 2006/06/29 21:26:56 gunter Exp $
     27// $Id: G4XXXSGSceneHandler.hh,v 1.4 2009/10/21 15:28:53 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    8080  // void AddCompound(const G4VTrajectory&);
    8181  // void AddCompound(const G4VHit&);
     82  // void AddCompound(const G4THitsMap<G4double>&);
    8283  void PreAddSolid(const G4Transform3D& objectTransformation,
    8384                   const G4VisAttributes&);
  • trunk/source/visualization/XXX/include/G4XXXStoredSceneHandler.hh

    r944 r1140  
    2525//
    2626//
    27 // $Id: G4XXXStoredSceneHandler.hh,v 1.3 2006/06/29 21:27:06 gunter Exp $
     27// $Id: G4XXXStoredSceneHandler.hh,v 1.4 2009/10/21 15:28:53 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7878  // void AddCompound(const G4VTrajectory&);
    7979  // void AddCompound(const G4VHit&);
     80  // void AddCompound(const G4THitsMap<G4double>&);
    8081  void PreAddSolid(const G4Transform3D& objectTransformation,
    8182                   const G4VisAttributes&);
  • trunk/source/visualization/externals/gl2ps/GNUmakefile

    r1051 r1140  
    1 # $Id: GNUmakefile,v 1.1 2009/02/18 09:54:12 lgarnier Exp $
     1# $Id: GNUmakefile,v 1.2 2009/11/02 14:54:31 lgarnier Exp $
    22# -------------------------------------------------------------
    33# GNUmakefile for gl2ps.  Laurent Garnier, 6/2/09.
     
    66
    77# For debug mode
    8 CPPFLAGS += -DG4DEBUG_VIS_GL2PS
     8# CPPFLAGS += -DG4DEBUG_VIS_GL2PS
    99
    1010ifndef G4INSTALL
  • trunk/source/visualization/externals/gl2ps/History

    r1040 r1140  
    1 $Id: History,v 1.9 2009/04/29 19:23:10 allison Exp $
     1$Id: History,v 1.10 2009/11/02 14:54:31 lgarnier Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     202 Nov 2009, Laurent Garnier
     21 - Add debug flag in GNUMakefile
    1922
    202329 April 2009, Laurent Garnier (visexternal-V09-02-04)
  • trunk/source/visualization/management/History

    r1087 r1140  
    1 $Id: History,v 1.122 2009/07/24 09:20:52 lgarnier Exp $
     1$Id: History,v 1.127 2009/10/30 16:05:30 allison Exp $
    22
    33-------------------------------------------------------------------
     
    2626History file for visualization management sub-category
    2727------------------------------------------------------
     28
     2930th October 2009  John Allison  (visman-V09-02-06 coworks greps-V09-02-03)
     30- Added /vis/scene/add/psHits.
     31- G4VisManager.cc: As above and also:
     32  o Tidied view creation.
     33  o Improved message ("scene" should be "scene handler").
     34
     3523rd October 2009  John Allison  (visman-V09-02-05 coworks greps-V09-02-02)
     36- Implemented default behaviour in
     37  G4VSceneHandler::AddCompound (const G4THitsMap<G4double>&).
     38
     3921st October 2009  John Allison  (visman-V09-02-04 coworks greps-V09-02-02)
     40- G4VSceneHandler:
     41  o Added default AddCompound (const G4THitsMap<G4double>&) methods.
     42    (For time being just issues warning.)
     43
     4429th September 2009  John Allison  (visman-V09-02-03)
     45- G4VSceneHandler.cc: Allow refresh in GeomClosed as well as Idle state.
     46- G4VisCommandsSceneAdd.cc: Fixed uninitialised pointers.
     47- G4VisManager.cc: Considerable tidy up.
    2848
    294924th July 2009  Laurent Garnier
  • trunk/source/visualization/management/include/G4VSceneHandler.hh

    r954 r1140  
    2525//
    2626//
    27 // $Id: G4VSceneHandler.hh,v 1.40 2008/01/04 22:03:45 allison Exp $
     27// $Id: G4VSceneHandler.hh,v 1.41 2009/10/21 14:26:59 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4242#include "globals.hh"
    4343
    44 #include <stack>
    45 
    4644#include "G4VGraphicsScene.hh"
    4745#include "G4ViewerList.hh"
    4846#include "G4ViewParameters.hh"
     47#include "G4THitsMap.hh"
    4948
    5049class G4Scene;
     
    130129  virtual void AddCompound (const G4VTrajectory&);
    131130  virtual void AddCompound (const G4VHit&);
     131  virtual void AddCompound (const G4THitsMap<G4double>&);
    132132
    133133  //////////////////////////////////////////////////////////////
  • trunk/source/visualization/management/include/G4VisCommandsSceneAdd.hh

    r954 r1140  
    2525//
    2626//
    27 // $Id: G4VisCommandsSceneAdd.hh,v 1.17 2006/11/01 10:50:28 allison Exp $
     27// $Id: G4VisCommandsSceneAdd.hh,v 1.18 2009/10/30 15:58:50 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929
     
    133133};
    134134
     135class G4VisCommandSceneAddPSHits: public G4VVisCommandScene {
     136public:
     137  G4VisCommandSceneAddPSHits ();
     138  virtual ~G4VisCommandSceneAddPSHits ();
     139  G4String GetCurrentValue (G4UIcommand* command);
     140  void SetNewValue (G4UIcommand* command, G4String newValue);
     141private:
     142  G4VisCommandSceneAddPSHits (const G4VisCommandSceneAddPSHits&);
     143  G4VisCommandSceneAddPSHits& operator = (const G4VisCommandSceneAddPSHits&);
     144  G4UIcmdWithoutParameter* fpCommand;
     145};
     146
    135147class G4VisCommandSceneAddScale: public G4VVisCommandScene {
    136148public:
  • trunk/source/visualization/management/include/G4VisExecutive.icc

    r944 r1140  
    2525//
    2626//
    27 // $Id: G4VisExecutive.icc,v 1.21 2009/03/14 11:43:42 allison Exp $
     27// $Id: G4VisExecutive.icc,v 1.22 2009/10/12 11:54:50 akimura Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4747#include "G4VRML1File.hh"
    4848#include "G4VRML2File.hh"
     49#include "G4GMocrenFile.hh"
    4950
    5051// Needing external packages or libraries...
     
    110111  RegisterGraphicsSystem (new G4VRML1File);
    111112  RegisterGraphicsSystem (new G4VRML2File);
     113  RegisterGraphicsSystem (new G4GMocrenFile);
    112114  // Graphics systems needing external packages or libraries...
    113115
  • trunk/source/visualization/management/src/G4VSceneHandler.cc

    r1136 r1140  
    2525//
    2626//
    27 // $Id: G4VSceneHandler.cc,v 1.83 2008/01/04 22:03:46 allison Exp $
     27// $Id: G4VSceneHandler.cc,v 1.86 2009/10/23 07:58:36 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    262262
    263263void G4VSceneHandler::AddCompound (const G4VHit& hit) {
    264   ((G4VHit&)hit).Draw(); // Cast to non-const because Draw is non-const!!!!
     264  static_cast<G4VHit>(hit).Draw(); // Cast because Draw is non-const!!!!
     265}
     266
     267void G4VSceneHandler::AddCompound (const G4THitsMap<G4double>& hits) {
     268  // Cast because DrawAllHits is non-const!!!!
     269  static_cast<G4THitsMap<G4double> >(hits).DrawAllHits();
    265270}
    266271
     
    583588  printf("G4VSceneHandler::ProcessScene : Idle ?\n");
    584589#endif
    585   // Refresh event from end-of-event model list.  Allow only in Idle state...
     590  // Refresh event from end-of-event model list.
     591  // Allow only in Idle or GeomClosed state...
    586592  G4StateManager* stateManager = G4StateManager::GetStateManager();
    587593  G4ApplicationState state = stateManager->GetCurrentState();
    588   if (state == G4State_Idle) {
     594  if (state == G4State_Idle || state == G4State_GeomClosed) {
    589595#ifdef G4DEBUG_VIS_MANAGEMENT
    590596    printf("G4VSceneHandler::ProcessScene : IDLE\n");
  • trunk/source/visualization/management/src/G4VisCommandsSceneAdd.cc

    r1136 r1140  
    2525//
    2626//
    27 // $Id: G4VisCommandsSceneAdd.cc,v 1.74 2009/07/24 09:20:52 lgarnier Exp $
     27// $Id: G4VisCommandsSceneAdd.cc,v 1.76 2009/10/30 15:58:50 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 "G4PSHitsModel.hh"
    3940#include "G4TrajectoriesModel.hh"
    4041#include "G4ScaleModel.hh"
     
    229230  const G4Run* currentRun = 0;
    230231  G4RunManager* runManager = G4RunManager::GetRunManager();
    231   if (runManager)  currentRun = runManager->GetCurrentRun();
     232  if (runManager) currentRun = runManager->GetCurrentRun();
    232233
    233234  G4VModel* model = fpVisManager->GetCurrentSceneHandler()->GetModel();
    234   const G4ModelingParameters* mp;
    235   const G4Event* currentEvent;
     235  const G4ModelingParameters* mp = 0;
     236  const G4Event* currentEvent = 0;
    236237  if (model) {
    237238   mp = model->GetModelingParameters();
     
    240241    G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity();
    241242    if (verbosity >= G4VisManager::errors) {
    242       G4cout << "ERROR: No model defined for this SceneHandler : "<< fpVisManager->GetCurrentSceneHandler()->GetName() << G4endl;
     243      G4cout << "ERROR: No model defined for this SceneHandler : "
     244             << fpVisManager->GetCurrentSceneHandler()->GetName()
     245             << G4endl;
    243246    }
    244247  }
     
    890893  sceneHandler.AddPrimitive(*fp4);
    891894  sceneHandler.EndPrimitives();
     895}
     896
     897////////////// /vis/scene/add/psHits ///////////////////////////////////////
     898
     899G4VisCommandSceneAddPSHits::G4VisCommandSceneAddPSHits () {
     900  fpCommand = new G4UIcmdWithoutParameter ("/vis/scene/add/psHits", this);
     901  fpCommand -> SetGuidance
     902    ("Adds Primitive Scorer Hits (PSHits) to current scene.");
     903  fpCommand -> SetGuidance
     904    ("PSHits are drawn at end of run when the scene in which"
     905     "\nthey are added is current.");
     906}
     907
     908G4VisCommandSceneAddPSHits::~G4VisCommandSceneAddPSHits () {
     909  delete fpCommand;
     910}
     911
     912G4String G4VisCommandSceneAddPSHits::GetCurrentValue (G4UIcommand*) {
     913  return "";
     914}
     915
     916void G4VisCommandSceneAddPSHits::SetNewValue (G4UIcommand*, G4String) {
     917
     918  G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity();
     919  G4bool warn(verbosity >= G4VisManager::warnings);
     920
     921  G4Scene* pScene = fpVisManager->GetCurrentScene();
     922  if (!pScene) {
     923    if (verbosity >= G4VisManager::errors) {
     924      G4cout << "ERROR: No current scene.  Please create one." << G4endl;
     925    }
     926    return;
     927  }
     928
     929  G4PSHitsModel* model = new G4PSHitsModel;
     930  const G4String& currentSceneName = pScene -> GetName ();
     931  G4bool successful = pScene -> AddEndOfEventModel (model, warn);
     932  if (successful) {
     933    if (verbosity >= G4VisManager::confirmations) {
     934      G4cout << "Primitive Scorer hits will be drawn in scene \""
     935             << currentSceneName << "\"."
     936             << G4endl;
     937    }
     938  }
     939  else G4VisCommandsSceneAddUnsuccessful(verbosity);
     940  UpdateVisManagerScene (currentSceneName);
    892941}
    893942
  • trunk/source/visualization/management/src/G4VisManager.cc

    r1136 r1140  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VisManager.cc,v 1.118 2009/03/09 12:42:00 allison Exp $
     26// $Id: G4VisManager.cc,v 1.121 2009/10/30 16:03:41 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    656656        G4cout << "ERROR in G4VisManager::CreateSceneHandler during "
    657657               << fpGraphicsSystem -> GetName ()
    658                << " scene creation.\n  No action taken."
     658               << " scene handler creation.\n  No action taken."
    659659               << G4endl;
    660660      }
     
    669669  if (!fInitialised) Initialise ();
    670670
    671   if (fpSceneHandler) {
    672     printf("G4VisManager::CreateViewer 1-------------------- %s ----%s\n",name.c_str(),XGeometry.c_str());
    673     G4VViewer* p = fpGraphicsSystem -> CreateViewer (*fpSceneHandler, name);
    674     printf("G4VisManager::CreateViewer 2-------------------- %s ----%s\n",name.c_str(),XGeometry.c_str());
    675 
    676     // Viewer is created, now we can set geometry parameters
    677     // Before 12/2008, it was done in G4VViewer.cc but it did not have to be there!
     671  if (!fpSceneHandler) {
     672    PrintInvalidPointers ();
     673    return;
     674  }
     675
     676  printf("G4VisManager::CreateViewer 1-------------------- %s ----%s\n",name.c_str(),XGeometry.c_str());
     677  G4VViewer* p = fpGraphicsSystem -> CreateViewer (*fpSceneHandler, name);
     678  printf("G4VisManager::CreateViewer 2-------------------- %s ----%s\n",name.c_str(),XGeometry.c_str());
     679
     680  if (!p) {
     681    if (fVerbosity >= errors) {
     682      G4cout << "ERROR in G4VisManager::CreateViewer during "
     683             << fpGraphicsSystem -> GetName ()
     684             << " viewer creation.\n  No action taken."
     685             << G4endl;
     686    }
     687    return;
     688  }
     689
     690  if (p -> GetViewId() < 0) {
     691    if (fVerbosity >= errors) {
     692      G4cout << "ERROR in G4VisManager::CreateViewer during "
     693             << fpGraphicsSystem -> GetName ()
     694             << " viewer initialisation.\n  No action taken."
     695             << G4endl;
     696    }
     697    return;
     698  }
     699
     700  // Viewer is created, now we can set geometry parameters
     701  // Before 12/2008, it was done in G4VViewer.cc but it did not have to be there!
    678702   
    679     //    printf("G4VisManager::CreateViewer 3-------------------- %s ----%s\n",name.c_str(),XGeometry.c_str());
    680     G4ViewParameters vp = p->GetViewParameters();
    681     //    printf("G4VisManager::CreateViewer 4-------------------- %s ----%s\n",name.c_str(),XGeometry.c_str());
    682     vp.SetXGeometryString(XGeometry);
    683     p->SetViewParameters(vp); //parse string and store parameters
    684 
    685     if (!p) {
    686       if (fVerbosity >= errors) {
    687         G4cout << "ERROR in G4VisManager::CreateViewer during "
    688                << fpGraphicsSystem -> GetName ()
    689                << " viewer creation.\n  No action taken."
    690                << G4endl;
    691       }
    692     } else {
    693       p -> Initialise ();
    694       if (p -> GetViewId() < 0) {
    695         if (fVerbosity >= errors) {
    696         G4cout << "ERROR in G4VisManager::CreateViewer during "
    697                << fpGraphicsSystem -> GetName ()
    698                << " viewer initialisation.\n  No action taken."
    699                << G4endl;
    700         }
    701       } else {
    702         fpViewer = p;                             // Make current.
    703         fpSceneHandler -> AddViewerToList (fpViewer);
    704         fpSceneHandler -> SetCurrentViewer (fpViewer);
    705 
    706         if (fVerbosity >= confirmations) {
    707           G4cout << "G4VisManager::CreateViewer: new viewer created."
    708                  << G4endl;
    709         }
    710 
    711         const G4ViewParameters& vp = fpViewer->GetViewParameters();
    712         if (fVerbosity >= parameters) {
    713           G4cout << " view parameters are:\n  " << vp << G4endl;
    714         }
    715 
    716         if (vp.IsCulling () && vp.IsCullingInvisible ()) {
    717           static G4bool warned = false;
    718           if (fVerbosity >= confirmations) {
    719             if (!warned) {
    720               G4cout <<
     703  G4ViewParameters initialvp = p -> GetViewParameters();
     704  initialvp.SetXGeometryString(XGeometry); //parse string and store parameters
     705  p -> SetViewParameters(initialvp);
     706  p -> Initialise ();  // (Viewer itself may change view parameters further.)
     707
     708  fpViewer = p;                             // Make current.
     709  fpSceneHandler -> AddViewerToList (fpViewer);
     710  fpSceneHandler -> SetCurrentViewer (fpViewer);
     711  if (fVerbosity >= confirmations) {
     712    G4cout << "G4VisManager::CreateViewer: new viewer created."
     713           << G4endl;
     714  }
     715
     716  const G4ViewParameters& vp = fpViewer->GetViewParameters();
     717  if (fVerbosity >= parameters) {
     718    G4cout << " view parameters are:\n  " << vp << G4endl;
     719  }
     720
     721  if (vp.IsCulling () && vp.IsCullingInvisible ()) {
     722    static G4bool warned = false;
     723    if (fVerbosity >= confirmations) {
     724      if (!warned) {
     725        G4cout <<
    721726  "NOTE: objects with visibility flag set to \"false\""
    722727  " will not be drawn!"
    723728  "\n  \"/vis/viewer/set/culling global false\" to Draw such objects."
    724729  "\n  Also see other \"/vis/viewer/set\" commands."
    725                      << G4endl;
    726               warned = true;
    727             }
    728           }
    729         }
    730         if (vp.IsCullingCovered ()) {
    731           static G4bool warned = false;
    732           if (fVerbosity >= warnings) {
    733             if (!warned) {
    734               G4cout <<
     730               << G4endl;
     731        warned = true;
     732      }
     733    }
     734  }
     735  if (vp.IsCullingCovered ()) {
     736    static G4bool warned = false;
     737    if (fVerbosity >= warnings) {
     738      if (!warned) {
     739        G4cout <<
    735740  "WARNING: covered objects in solid mode will not be rendered!"
    736741  "\n  \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
    737742  "\n  Also see other \"/vis/viewer/set\" commands."
    738                      << G4endl;
    739               warned = true;
    740             }
    741           }
    742         }
    743       }
    744     }
    745   }
    746   else PrintInvalidPointers ();
     743               << G4endl;
     744        warned = true;
     745      }
     746    }
     747  }
    747748}
    748749
     
    10881089  RegisterMessenger(new G4VisCommandSceneAddLogicalVolume);
    10891090  RegisterMessenger(new G4VisCommandSceneAddLogo);
     1091  RegisterMessenger(new G4VisCommandSceneAddPSHits);
    10901092  RegisterMessenger(new G4VisCommandSceneAddScale);
    10911093  RegisterMessenger(new G4VisCommandSceneAddText);
     
    13311333          printf("G4VisManager::EndOfEvent 7 \n");
    13321334          G4cout <<
    1333             "WARNING: G4VisManager::EndOfEvent: Event keeping suspended."
    1334             "\n  The number of events exceeds the maximum that may be kept, "
    1335                  << maxNumberOfKeptEvents << '.'
     1335 "WARNING: G4VisManager::EndOfEvent: Automatic event keeping suspended."
     1336 "\n  The number of events exceeds the maximum, "
     1337                 << maxNumberOfKeptEvents <<
     1338 ", that can be kept by the vis manager."
    13361339                 << G4endl;
    13371340        }
     
    13711374    if (fEventKeepingSuspended && fVerbosity >= warnings) {
    13721375      G4cout <<
    1373         "WARNING: G4VisManager::EndOfRun: Event keeping was suspended."
    1374         "\n  The number of events in the run exceeded the maximum to be kept, "
    1375              << fpScene->GetMaxNumberOfKeptEvents() << '.' <<
    1376         "\n  The number of events to be kept can be changed with"
    1377         "\n  \"/vis/scene/endOfEventAction accumulate <N>\", where N is the"
    1378         "\n  maximum number you wish to allow.  N < 0 means \"unlimited\"."
     1376 "WARNING: G4VisManager::EndOfRun: Automatic event keeping has been suspended."
     1377 "\n  The number of events in the run exceeded the maximum, "
     1378             << fpScene->GetMaxNumberOfKeptEvents() <<
     1379 ", that can be kept by the vis manager." <<
     1380 "\n  The number of events kept by the vis manager can be changed with"
     1381 "\n  \"/vis/scene/endOfEventAction accumulate <N>\", where N is the"
     1382 "\n  maximum number you wish to allow.  N < 0 means \"unlimited\"."
    13791383             << G4endl;
    13801384    }
  • trunk/source/visualization/modeling/History

    r931 r1140  
    1 $Id: History,v 1.109 2009/02/25 14:21:45 allison Exp $
     1$Id: History,v 1.114 2009/10/22 15:40:00 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/modeling
    2121---------------------------------------
     22
     2322nd October 2009  John Allison  (modeling-V09-02-05 coworks greps-V09-02-02)
     24- Added G4PSHitsModel for gMocren driver.
     25
     2621st October 2009  John Allison  (modeling-V09-02-04 coworks greps-V09-02-02)
     27- G4BoundingSphereScene, G4PhysicalVolumeMassScene,
     28  G4PhysicalVolumeSearchScene:
     29  o Added empty AddCompound (const G4THitsMap<G4double>&) methods.
     30
     3110th October 2009  John Allison  (modeling-V09-02-03)
     32- G4PhysicalVolumeModel: Added G4PhysicalVolumeModelTouchable.  Used in
     33  ComputeMaterial.  Effective for nested parameterisations.
     34
     3529th September 2009  John Allison  (modeling-V09-02-02)
     36- G4PhysicalVolumeModel.cc: Added warning if logical volume not defined.
    2237
    233825th February 2009  John Allison  (modeling-V09-02-01 - needs greps-V09-02-01)
  • trunk/source/visualization/modeling/include/G4BoundingSphereScene.hh

    r954 r1140  
    2525//
    2626//
    27 // $Id: G4BoundingSphereScene.hh,v 1.18 2008/01/04 21:59:15 allison Exp $
     27// $Id: G4BoundingSphereScene.hh,v 1.19 2009/10/21 14:17:33 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7171  void AddCompound (const G4VTrajectory&) {}
    7272  void AddCompound (const G4VHit&) {}
     73  void AddCompound (const G4THitsMap<G4double>&) {}
    7374  G4VisExtent GetBoundingSphereExtent ();
    7475  const G4Point3D& GetCentre() const {return fCentre;}
  • trunk/source/visualization/modeling/include/G4PhysicalVolumeMassScene.hh

    r954 r1140  
    2525//
    2626//
    27 // $Id: G4PhysicalVolumeMassScene.hh,v 1.9 2008/01/04 21:59:15 allison Exp $
     27// $Id: G4PhysicalVolumeMassScene.hh,v 1.10 2009/10/21 14:17:33 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    109109  void AddCompound (const G4VTrajectory&) {}
    110110  void AddCompound (const G4VHit&) {}
     111  void AddCompound (const G4THitsMap<G4double>&) {}
    111112
    112113  ////////////////////////////////////////////////////////////////
  • trunk/source/visualization/modeling/include/G4PhysicalVolumeModel.hh

    r954 r1140  
    2525//
    2626//
    27 // $Id: G4PhysicalVolumeModel.hh,v 1.34 2007/04/03 13:46:49 allison Exp $
     27// $Id: G4PhysicalVolumeModel.hh,v 1.35 2009/10/10 14:29:59 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4949
    5050#include "G4VModel.hh"
     51#include "G4VTouchable.hh"
    5152
    5253#include "G4Transform3D.hh"
     
    7677  public:
    7778    G4PhysicalVolumeNodeID
    78     (G4VPhysicalVolume* pPV = 0, G4int iCopyNo = 0, G4int depth = 0):
    79       fpPV(pPV), fCopyNo(iCopyNo), fNonCulledDepth(depth) {}
     79    (G4VPhysicalVolume* pPV = 0,
     80     G4int iCopyNo = 0,
     81     G4int depth = 0,
     82     const G4Transform3D& transform = G4Transform3D()):
     83      fpPV(pPV),
     84      fCopyNo(iCopyNo),
     85      fNonCulledDepth(depth),
     86      fTransform(transform) {}
    8087    G4VPhysicalVolume* GetPhysicalVolume() const {return fpPV;}
    8188    G4int GetCopyNo() const {return fCopyNo;}
    8289    G4int GetNonCulledDepth() const {return fNonCulledDepth;}
     90    const G4Transform3D& GetTransform() const {return fTransform;}
    8391    G4bool operator< (const G4PhysicalVolumeNodeID& right) const;
    8492  private:
     
    8694    G4int fCopyNo;
    8795    G4int fNonCulledDepth;
     96    G4Transform3D fTransform;
    8897  };
    8998  // Nested class for identifying physical volume nodes.
     99
     100  class G4PhysicalVolumeModelTouchable: public G4VTouchable {
     101  public:
     102    G4PhysicalVolumeModelTouchable
     103    (const std::vector<G4PhysicalVolumeNodeID>& fullPVPath);
     104    const G4ThreeVector& GetTranslation(G4int depth) const;
     105    const G4RotationMatrix* GetRotation(G4int depth) const;
     106    G4VPhysicalVolume* GetVolume(G4int depth) const;
     107    G4VSolid* GetSolid(G4int depth) const;
     108    G4int GetReplicaNumber(G4int depth) const;
     109    G4int GetHistoryDepth() const {return fFullPVPath.size();}
     110  private:
     111    const std::vector<G4PhysicalVolumeNodeID>& fFullPVPath;
     112  };
     113  // Nested class for handling nested parameterisations.
    90114
    91115  G4PhysicalVolumeModel
  • trunk/source/visualization/modeling/include/G4PhysicalVolumeSearchScene.hh

    r954 r1140  
    2525//
    2626//
    27 // $Id: G4PhysicalVolumeSearchScene.hh,v 1.18 2008/01/04 21:59:15 allison Exp $
     27// $Id: G4PhysicalVolumeSearchScene.hh,v 1.19 2009/10/21 14:17:33 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7474  void AddCompound (const G4VTrajectory&) {}
    7575  void AddCompound (const G4VHit&) {}
     76  void AddCompound (const G4THitsMap<G4double>&) {}
    7677  G4int                GetFoundDepth          () const;
    7778  G4VPhysicalVolume*   GetFoundVolume         () const;
  • trunk/source/visualization/modeling/src/G4PhysicalVolumeModel.cc

    r1089 r1140  
    2525//
    2626//
    27 // $Id: G4PhysicalVolumeModel.cc,v 1.63 2007/11/10 14:56:36 allison Exp $
     27// $Id: G4PhysicalVolumeModel.cc,v 1.66 2009/10/23 08:08:19 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4646#include "G4TransportationManager.hh"
    4747#include "G4Polyhedron.hh"
     48#include "HepPolyhedronProcessor.h"
    4849#include "G4AttDefStore.hh"
    4950#include "G4AttDef.hh"
     
    5354
    5455#include <sstream>
    55 
    56 G4bool G4PhysicalVolumeModel::G4PhysicalVolumeNodeID::operator<
    57   (const G4PhysicalVolumeModel::G4PhysicalVolumeNodeID& right) const
    58 {
    59   if (fpPV < right.fpPV) return true;
    60   if (fpPV == right.fpPV) {
    61     if (fCopyNo < right.fCopyNo) return true;
    62     if (fCopyNo == right.fCopyNo)
    63       return fNonCulledDepth < right.fNonCulledDepth;
    64   }
    65   return false;
    66 }
    67 
    68 std::ostream& operator<<
    69   (std::ostream& os, const G4PhysicalVolumeModel::G4PhysicalVolumeNodeID node)
    70 {
    71   G4VPhysicalVolume* pPV = node.GetPhysicalVolume();
    72   if (pPV) {
    73     os << pPV->GetName()
    74        << ':' << node.GetCopyNo()
    75        << '[' << node.GetNonCulledDepth() << ']';
    76   } else {
    77     os << "Null node";
    78   }
    79   return os;
    80 }
    8156
    8257G4PhysicalVolumeModel::G4PhysicalVolumeModel
     
    232207    G4VPVParameterisation* pP = pVPV -> GetParameterisation ();
    233208    if (pP) {  // Parametrised volume.
     209      if (fCurrentDepth == 0) nReplicas = 1;  // Just draw first
    234210      for (int n = 0; n < nReplicas; n++) {
    235211        pSol = pP -> ComputeSolid (n, pVPV);
    236         pMaterial = pP -> ComputeMaterial (n, pVPV);
    237212        pP -> ComputeTransformation (n, pVPV);
    238213        pSol -> ComputeDimensions (pP, n, pVPV);
    239214        pVPV -> SetCopyNo (n);
     215        // Create a touchable of current parent for ComputeMaterial.
     216        // fFullPVPath has not been updated yet so at this point it
     217        // corresponds to the parent.
     218        G4PhysicalVolumeModelTouchable parentTouchable(fFullPVPath);
     219        pMaterial = pP -> ComputeMaterial (n, pVPV, &parentTouchable);
    240220        DescribeAndDescend (pVPV, requestedDepth, pLV, pSol, pMaterial,
    241221                            theAT, sceneHandler);
     
    363343  fpCurrentTransform = &theNewAT;
    364344
    365   /********************************************************
    366   G4cout << "G4PhysicalVolumeModel::DescribeAndDescend: "
    367          << pVPV -> GetName () << "." << pVPV -> GetCopyNo ();
    368   G4cout << "\n  theAT: ";
    369   G4cout << "\n    Rotation: ";
    370   G4RotationMatrix rotation = theAT.getRotation ();
    371   G4cout << rotation.thetaX() << ", "
    372          << rotation.phiX() << ", "
    373          << rotation.thetaY() << ", "
    374          << rotation.phiY() << ", "
    375          << rotation.thetaZ() << ", "
    376          << rotation.phiZ();
    377   G4cout << "\n    Translation: " << theAT.getTranslation();
    378   G4cout << "\n  theNewAT: ";
    379   G4cout << "\n    Rotation: ";
    380   rotation = theNewAT.getRotation ();
    381   G4cout << rotation.thetaX() << ", "
    382          << rotation.phiX() << ", "
    383          << rotation.thetaY() << ", "
    384          << rotation.phiY() << ", "
    385          << rotation.thetaZ() << ", "
    386          << rotation.phiZ();
    387   G4cout << "\n    Translation: " << theNewAT.getTranslation();
    388   G4cout << G4endl;
    389   **********************************************************/
    390 
    391345  // Make decision to draw...
    392346  const G4VisAttributes* pVisAttribs = pLV->GetVisAttributes();
     
    429383  G4int copyNo = fpCurrentPV->GetCopyNo();
    430384  fFullPVPath.push_back
    431     (G4PhysicalVolumeNodeID(fpCurrentPV,copyNo,fCurrentDepth));
     385    (G4PhysicalVolumeNodeID
     386     (fpCurrentPV,copyNo,fCurrentDepth,*fpCurrentTransform));
    432387
    433388  if (thisToBeDrawn) {
     
    436391    G4int copyNo = fpCurrentPV->GetCopyNo();
    437392    fDrawnPVPath.push_back
    438       (G4PhysicalVolumeNodeID(fpCurrentPV,copyNo,fCurrentDepth));
     393      (G4PhysicalVolumeNodeID
     394       (fpCurrentPV,copyNo,fCurrentDepth,*fpCurrentTransform));
    439395
    440396    if (fpMP->IsExplode() && fDrawnPVPath.size() == 1) {
     
    563519    G4Polyhedron* pOriginal = pSol->GetPolyhedron();
    564520    G4Polyhedron::ResetNumberOfRotationSteps();
     521
    565522    if (!pOriginal) {
    566         if (fpMP->IsWarning())
    567           G4cout <<
    568  "WARNING: G4PhysicalVolumeModel::DescribeSolid: solid\n  \""
    569                  << pSol->GetName() <<
    570  "\" has no polyhedron.  Cannot by clipped."
    571                  << G4endl;
    572         pSol -> DescribeYourselfTo (sceneHandler);  // Standard treatment.
     523
     524      if (fpMP->IsWarning())
     525        G4cout <<
     526          "WARNING: G4PhysicalVolumeModel::DescribeSolid: solid\n  \""
     527               << pSol->GetName() <<
     528          "\" has no polyhedron.  Cannot by clipped."
     529               << G4endl;
     530      pSol -> DescribeYourselfTo (sceneHandler);  // Standard treatment.
     531
    573532    } else {
    574533
    575534      G4Polyhedron resultant = *pOriginal;
     535      G4VisAttributes resultantVisAttribs(*pVisAttribs);
    576536
    577537      if (fpClippingPolyhedron) {
    578538        G4Polyhedron clipper = *fpClippingPolyhedron;  // Local copy.
    579539        clipper.Transform(theAT.inverse());
     540        HepPolyhedronProcessor processor;
    580541        switch (fClippingMode) {
    581542        default:
    582         case subtraction: resultant = resultant.subtract(clipper); break;
    583         case intersection: resultant = resultant.intersect(clipper); break;
     543        case subtraction: processor.push_back(HepPolyhedronProcessor::SUBTRACTION, clipper); break;
     544        case intersection: processor.push_back(HepPolyhedronProcessor::INTERSECTION, clipper); break;
    584545        }
    585         if(resultant.IsErrorBooleanProcess()) {
     546        if (!processor.execute(resultant)) {
    586547          if (fpMP->IsWarning())
    587548            G4cout <<
     
    589550 "\n  solid \"" << pSol->GetName() <<
    590551 "\" not defined due to error during Boolean processing."
     552 "\n  It will be drawn in red."
    591553                   << G4endl;
    592           // Nevertheless, keep resultant.
     554          // Nevertheless, keep resultant, but draw it in red
     555          resultantVisAttribs.SetColour(G4Colour::Red());
    593556        }
    594557      }
     
    597560        G4Polyhedron sectioner = *pSectionPolyhedron;  // Local copy.
    598561        sectioner.Transform(theAT.inverse());
    599         resultant = resultant.intersect(sectioner);
    600         if(resultant.IsErrorBooleanProcess()) {
     562        HepPolyhedronProcessor processor;
     563        processor.push_back(HepPolyhedronProcessor::INTERSECTION, sectioner);
     564        if (!processor.execute(resultant)) {
    601565          if (fpMP->IsWarning())
    602566            G4cout <<
     
    604568 "\n  solid \"" << pSol->GetName() <<
    605569 "\" not defined due to error during Boolean processing."
     570 "\n  It will be drawn in red."
    606571                   << G4endl;
    607           // Nevertheless, keep resultant.
     572          // Nevertheless, keep resultant, but draw it in red
     573          resultantVisAttribs.SetColour(G4Colour::Red());
    608574        }
    609575      }
     
    612578        G4Polyhedron cutter = *pCutawayPolyhedron;  // Local copy.
    613579        cutter.Transform(theAT.inverse());
    614         resultant = resultant.subtract(cutter);
    615         if(resultant.IsErrorBooleanProcess()) {
     580        HepPolyhedronProcessor processor;
     581        processor.push_back(HepPolyhedronProcessor::SUBTRACTION, cutter);
     582        if (!processor.execute(resultant)) {
    616583          if (fpMP->IsWarning())
    617584            G4cout <<
     
    619586 "\n  solid \"" << pSol->GetName() <<
    620587 "\" not defined due to error during Boolean processing."
     588 "\n  It will be drawn in red."
    621589                   << G4endl;
    622           // Nevertheless, keep resultant.
     590          // Nevertheless, keep resultant, but draw it in red
     591          resultantVisAttribs.SetColour(G4Colour::Red());
    623592        }
    624593      }
    625594
    626595      // Finally, force polyhedron drawing...
    627       resultant.SetVisAttributes(pVisAttribs);
     596      resultant.SetVisAttributes(resultantVisAttribs);
    628597      sceneHandler.BeginPrimitives(theAT);
    629598      sceneHandler.AddPrimitive(resultant);
     
    760729    if (i != fFullPVPath.size() - 1) oss << '/';
    761730  }
     731
     732  if (!fpCurrentLV) {
     733     G4Exception
     734        ("G4PhysicalVolumeModel::CreateCurrentAttValues",
     735         "",
     736         JustWarning,
     737         "Current logical volume not defined.");
     738     return values;
     739  }
     740
    762741  values->push_back(G4AttValue("PVPath", oss.str(),""));
    763742  if (fpCurrentLV) {
     
    787766  return values;
    788767}
     768
     769G4bool G4PhysicalVolumeModel::G4PhysicalVolumeNodeID::operator<
     770  (const G4PhysicalVolumeModel::G4PhysicalVolumeNodeID& right) const
     771{
     772  if (fpPV < right.fpPV) return true;
     773  if (fpPV == right.fpPV) {
     774    if (fCopyNo < right.fCopyNo) return true;
     775    if (fCopyNo == right.fCopyNo)
     776      return fNonCulledDepth < right.fNonCulledDepth;
     777  }
     778  return false;
     779}
     780
     781std::ostream& operator<<
     782  (std::ostream& os, const G4PhysicalVolumeModel::G4PhysicalVolumeNodeID node)
     783{
     784  G4VPhysicalVolume* pPV = node.GetPhysicalVolume();
     785  if (pPV) {
     786    os << pPV->GetName()
     787       << ':' << node.GetCopyNo()
     788       << '[' << node.GetNonCulledDepth() << ']'
     789       << ':' << node.GetTransform();
     790  } else {
     791    os << "Null node";
     792  }
     793  return os;
     794}
     795
     796G4PhysicalVolumeModel::G4PhysicalVolumeModelTouchable::G4PhysicalVolumeModelTouchable
     797(const std::vector<G4PhysicalVolumeNodeID>& fullPVPath):
     798  fFullPVPath(fullPVPath) {}
     799
     800const G4ThreeVector& G4PhysicalVolumeModel::G4PhysicalVolumeModelTouchable::GetTranslation(G4int depth) const
     801{
     802  size_t i = fFullPVPath.size() - depth - 1;
     803  if (i >= fFullPVPath.size()) {
     804    G4Exception("G4PhysicalVolumeModelTouchable::GetTranslation",
     805                "Index out of range",
     806                FatalErrorInArgument,
     807                "Asking for non-existent depth");
     808  }
     809  static G4ThreeVector tempTranslation;
     810  tempTranslation = fFullPVPath[i].GetTransform().getTranslation();
     811  return tempTranslation;
     812}
     813
     814const G4RotationMatrix* G4PhysicalVolumeModel::G4PhysicalVolumeModelTouchable::GetRotation(G4int depth) const
     815{
     816  size_t i = fFullPVPath.size() - depth - 1;
     817  if (i >= fFullPVPath.size()) {
     818    G4Exception("G4PhysicalVolumeModelTouchable::GetRotation",
     819                "Index out of range",
     820                FatalErrorInArgument,
     821                "Asking for non-existent depth");
     822  }
     823  static G4RotationMatrix tempRotation;
     824  tempRotation = fFullPVPath[i].GetTransform().getRotation();
     825  return &tempRotation;
     826}
     827
     828G4VPhysicalVolume* G4PhysicalVolumeModel::G4PhysicalVolumeModelTouchable::GetVolume(G4int depth) const
     829{
     830  size_t i = fFullPVPath.size() - depth - 1;
     831  if (i >= fFullPVPath.size()) {
     832    G4Exception("G4PhysicalVolumeModelTouchable::GetVolume",
     833                "Index out of range",
     834                FatalErrorInArgument,
     835                "Asking for non-existent depth");
     836  }
     837  return fFullPVPath[i].GetPhysicalVolume();
     838}
     839
     840G4VSolid* G4PhysicalVolumeModel::G4PhysicalVolumeModelTouchable::GetSolid(G4int depth) const
     841{
     842  size_t i = fFullPVPath.size() - depth - 1;
     843  if (i >= fFullPVPath.size()) {
     844    G4Exception("G4PhysicalVolumeModelTouchable::GetSolid",
     845                "Index out of range",
     846                FatalErrorInArgument,
     847                "Asking for non-existent depth");
     848  }
     849  return fFullPVPath[i].GetPhysicalVolume()->GetLogicalVolume()->GetSolid();
     850}
     851
     852G4int G4PhysicalVolumeModel::G4PhysicalVolumeModelTouchable::GetReplicaNumber(G4int depth) const
     853{
     854  size_t i = fFullPVPath.size() - depth - 1;
     855  if (i >= fFullPVPath.size()) {
     856    G4Exception("G4PhysicalVolumeModelTouchable::GetReplicaNumber",
     857                "Index out of range",
     858                FatalErrorInArgument,
     859                "Asking for non-existent depth");
     860  }
     861  return fFullPVPath[i].GetCopyNo();
     862}
  • trunk/source/visualization/test/History

    r1093 r1140  
    1 $Id: History,v 1.117 2009/07/28 12:50:51 lgarnier Exp $
     1$Id: History,v 1.119 2009/09/29 21:36:38 allison Exp $
    22
    33History file for visualization/test subdirectory
     
    55
    66$Log: History,v $
     7Revision 1.119  2009/09/29 21:36:38  allison
     8vistest-V09-02-00
     9
     10Revision 1.118  2009/09/29 21:35:56  allison
     11Changed main program, test19.cc, to use G4UIExecutive.
     12
    713Revision 1.117  2009/07/28 12:50:51  lgarnier
    814Adding Qt support for test19
  • trunk/source/visualization/test/test19.cc

    r1093 r1140  
    2525//
    2626//
    27 // $Id: test19.cc,v 1.30 2009/07/28 12:50:51 lgarnier Exp $
     27// $Id: test19.cc,v 1.31 2009/09/29 21:35:56 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4848#include "MySteppingAction.hh"
    4949
    50 #include "G4UIterminal.hh"
    51 #if defined(G4UI_USE_GAG)
    52   #include "G4UIGAG.hh"
    53 #elif defined(G4UI_USE_TCSH)
    54   #include "G4UItcsh.hh"
    55 #elif defined(G4UI_USE_WO)
    56   #include "G4UIWo.hh"
    57 #elif defined(G4UI_USE_XM)
    58   #include "G4UIXm.hh"
    59 #elif defined(G4UI_USE_XAW)
    60   #include "G4UIXaw.hh"
    61 #elif defined(G4UI_USE_WIN32)
    62   #include "G4UIWin32.hh"
    63 #elif defined(G4UI_USE_QT)
    64   #include "G4UIQt.hh"
     50#ifdef G4UI_USE
     51#include "G4UIExecutive.hh"
    6552#endif
    6653
     
    9380#endif
    9481
     82#ifdef G4UI_USE
    9583  // Choose (G)UI.
    96   G4UIsession* session;
    97 #ifdef G4UI_USE_WIN32
    98   session = new G4UIWin32 (hInstance,hPrevInstance,lpszCmdLine,nCmdShow);
    99 #else
    100   if (argc >= 2) {
    101   #if defined(G4UI_USE_TCSH)
    102     if (strcmp (argv[1], "tcsh")==0)     session =
    103       new G4UIterminal(new G4UItcsh);
    104   #elif defined(G4UI_USE_WO)
    105     if (strcmp (argv[1], "Wo")==0)  session = new G4UIWo (argc, argv);
    106   #elif defined(G4UI_USE_XM)
    107     if (strcmp (argv[1], "Xm")==0)  session = new G4UIXm (argc, argv);
    108   #elif defined(G4UI_USE_XAW)
    109     if (strcmp (argv[1], "Xaw")==0) session = new G4UIXaw (argc, argv);
    110   #elif defined(G4UI_USE_GAG)
    111     if (strcmp (argv[1], "gag")==0) session = new G4UIGAG ;
    112   #elif defined(G4UI_USE_QT)
    113     if (strcmp (argv[1], "Qt")==0)  session = new G4UIQt (argc, argv);
    114   #else
    115     session = new G4UIterminal();
    116   #endif
    117     else  session = new G4UIterminal();
    118   }
    119   else                                   
    120   {
    121     G4cerr << "You should define a UI in order to interact with test" << G4endl;
    122     return 0;
    123   }
     84  G4UIExecutive* UIexecutive = new G4UIExecutive(argc, argv);
     85  G4UImanager::GetUIpointer()->SetSession(UIexecutive->GetSession());  //So that Pause works..
    12486#endif
    125   G4UImanager::GetUIpointer()->SetSession(session);  //So that Pause works..
    12687
    12788  // Run manager
     
    159120
    160121  G4UImanager* UI = G4UImanager::GetUIpointer ();
    161 
    162122#ifdef G4UI_USE_WIN32
    163123  G4cout << "Reading win32.g4m file...." << G4endl;
     
    173133       << G4endl;
    174134
     135#ifdef G4UI_USE
    175136  // Start an interactive session.
    176   session -> SessionStart();
     137  UIexecutive -> SessionStart();
     138#endif
    177139
    178140#ifdef G4VIS_USE
     
    185147  G4cout << "vis_test19: Run manager deleted." << G4endl;
    186148  G4cout << "vis_test19: Deleting session..." << G4endl;
    187   delete session;
     149#ifdef G4UI_USE
     150  delete UIexecutive;
    188151  G4cout << "vis_test19: Session deleted." << G4endl;
     152#endif
    189153
    190154  return 0;
Note: See TracChangeset for help on using the changeset viewer.