Import Geant4 0.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:09:25 +02:00
parent b97f8d0df7
commit aaa409b6ee
2922 changed files with 55107 additions and 81674 deletions
+1 -2
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 2.3 1998/09/22 08:42:04 barrand Exp $
# $Id: GNUmakefile,v 1.2 1999/04/16 09:06:07 mora Exp $
# -------------------------------------------------------------
# GNUmakefile for visualization library. John Allison, 5/7/95.
@@ -36,7 +36,6 @@ CPPFLAGS += -I$(G4BASE)/digits+hits/hits/include
CPPFLAGS += -I$(G4BASE)/digits+hits/digits/include
CPPFLAGS += -I$(G4BASE)/digits+hits/detector/include
CPPFLAGS += -I$(G4BASE)/processes/management/include
CPPFLAGS += -I$(G4BASE)/processes/parameterisation/include
CPPFLAGS += -I$(G4BASE)/particles/management/include
CPPFLAGS += -I$(G4BASE)/materials/include
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4GraphicsSystemList.hh,v 2.0 1998/07/02 16:49:36 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4GraphicsSystemList.hh,v 1.2 1999/01/09 16:30:38 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 2nd April 1996
@@ -5,20 +5,16 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SceneData.hh,v 2.7 1998/11/29 15:34:00 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Scene.hh,v 1.3 1999/05/25 09:14:06 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// Scene data John Allison 19th July 1996.
// Scene John Allison 19th July 1996.
//
// Defines the scene in terms of GEANT4 objects. All other parameters are
// in G4ViewParamaters.
//
// Note that although the C++ name is G4SceneData, it is often simply
// referred to as the scene.
// Defines the viewable scene.
#ifndef G4SCENEDATA_HH
#define G4SCENEDATA_HH
#ifndef G4SCENE_HH
#define G4SCENE_HH
#include "globals.hh"
#include "G4ios.hh"
@@ -30,23 +26,22 @@ class G4VPhysicalVolume;
#include "G4VModel.hh"
#include <rw/tpordvec.h>
class G4SceneData {
class G4Scene {
friend ostream& operator << (ostream& os, const G4SceneData& d);
friend G4bool operator != (const G4SceneData& d1,
const G4SceneData& d2);
public:
friend ostream& operator << (ostream& os, const G4Scene& d);
enum {UNLIMITED = -1};
G4SceneData (const G4String& name = "invalid scene");
~G4SceneData ();
G4Scene (const G4String& name = "scene-with-unspecified-name");
~G4Scene ();
// Makes use of default (compiler generated) copy constructor and
// assignment operator.
// For RWTPtrOrderedVector...
G4bool operator == (const G4SceneData& sd) const;
G4bool operator == (const G4Scene&) const;
G4bool operator != (const G4Scene&) const;
//////////////////////////////////////////////////////
// Get functions...
@@ -76,6 +71,11 @@ public:
// Adds models of type which are expected to last for the duration
// of the run, for example geometry volumes.
void AddWorldIfEmpty ();
// In some situations, if the user asks for a drawing and has not
// yet set any run duration models it makes sense to put the "world"
// in there by default.
void AddEndOfEventModel (G4VModel*);
// Adds models of type which are described at the end of event when
// the scene is current.
@@ -97,6 +97,6 @@ private:
G4Point3D fStandardTargetPoint;
};
#include "G4SceneData.icc"
#include "G4Scene.icc"
#endif
@@ -5,53 +5,53 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SceneData.icc,v 2.5 1998/11/29 15:34:01 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Scene.icc,v 1.2 1999/05/25 09:14:08 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// Scene data John Allison 19th July 1996.
inline G4bool G4SceneData::operator == (const G4SceneData& sd) const {
return !(*this != sd);
inline G4bool G4Scene::operator == (const G4Scene& s) const {
return !(G4Scene::operator != (s));
}
inline const G4String& G4SceneData::GetName () const {
inline const G4String& G4Scene::GetName () const {
return fName;
}
inline G4bool G4SceneData::IsEmpty () const {
inline G4bool G4Scene::IsEmpty () const {
return fRunDurationModelList.entries () == 0 &&
fEndOfEventModelList.entries () == 0;
}
inline const RWTPtrOrderedVector <G4VModel>&
G4SceneData::GetRunDurationModelList () const {
G4Scene::GetRunDurationModelList () const {
return fRunDurationModelList;
}
inline const RWTPtrOrderedVector <G4VModel>&
G4SceneData::GetEndOfEventModelList () const {
G4Scene::GetEndOfEventModelList () const {
return fEndOfEventModelList;
}
inline const G4VisExtent& G4SceneData::GetExtent () const {
inline const G4VisExtent& G4Scene::GetExtent () const {
return fExtent;
}
inline const G4Point3D& G4SceneData::GetStandardTargetPoint () const {
inline const G4Point3D& G4Scene::GetStandardTargetPoint () const {
return fStandardTargetPoint;
}
inline RWTPtrOrderedVector <G4VModel>& G4SceneData::SetRunDurationModelList ()
inline RWTPtrOrderedVector <G4VModel>& G4Scene::SetRunDurationModelList ()
{
return fRunDurationModelList;
}
inline RWTPtrOrderedVector <G4VModel>& G4SceneData::SetEndOfEventModelList ()
inline RWTPtrOrderedVector <G4VModel>& G4Scene::SetEndOfEventModelList ()
{
return fRunDurationModelList;
}
inline void G4SceneData::AddEndOfEventModel (G4VModel* pModel) {
inline void G4Scene::AddEndOfEventModel (G4VModel* pModel) {
fEndOfEventModelList.append (pModel);
}
@@ -1,41 +0,0 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SceneDataObjectList.hh,v 2.1 1998/08/09 17:54:15 allison Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// John Allison 9th August 1998
#ifndef G4SCENEDATAOBJECTLIST_HH
#define G4SCENEDATAOBJECTLIST_HH
#include "G4SceneData.hh"
#include "globals.hh"
#include <rw/tvhdict.h>
class G4SceneDataObjectList:
public RWTValHashDictionary <G4String, G4SceneData>
// Each scene data object is keyed to a name.
{
public:
G4SceneDataObjectList
(
unsigned (*)(const G4String&), // Hashing function
size_t size = RWDEFAULT_CAPACITY // No. of buckets
);
friend class G4SceneDataObjectListIterator;
};
class G4SceneDataObjectListIterator:
public RWTValHashDictionaryIterator <G4String, G4SceneData>
{
public:
G4SceneDataObjectListIterator (G4SceneDataObjectList&);
};
#endif
@@ -0,0 +1,23 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SceneHandlerList.hh,v 1.1 1999/01/09 16:30:42 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison May 1996
#ifndef G4SCENEHANDLERLIST_HH
#define G4SCENEHANDLERLIST_HH
#include <rw/tpordvec.h>
#include "G4VSceneHandler.hh"
class G4SceneHandlerList: public RWTPtrOrderedVector<G4VSceneHandler> {
};
#endif
@@ -5,19 +5,18 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SceneList.hh,v 2.0 1998/07/02 16:48:25 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4SceneList.hh,v 1.3 1999/01/11 00:48:14 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison May 1996
// John Allison 9th August 1998
#ifndef G4SCENELIST_HH
#define G4SCENELIST_HH
#include "G4Scene.hh"
#include <rw/tpordvec.h>
#include "G4VScene.hh"
class G4SceneList: public RWTPtrOrderedVector<G4VScene> {
};
class G4SceneList: public RWTPtrOrderedVector <G4Scene> {};
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VGraphicsSystem.hh,v 2.1 1998/11/06 13:43:02 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VGraphicsSystem.hh,v 1.3 1999/01/11 00:48:14 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 27th March 1996
@@ -17,8 +17,8 @@
#include "globals.hh"
class G4VScene;
class G4VView;
class G4VSceneHandler;
class G4VViewer;
class G4VGraphicsSystem {
@@ -50,8 +50,9 @@ public:
// For RWTPtrOrderedVector...
G4bool operator == (const G4VGraphicsSystem& system) const;
virtual G4VScene* CreateScene (const G4String& name) = 0;
virtual G4VView* CreateView (G4VScene&, const G4String& name) = 0;
virtual G4VSceneHandler* CreateSceneHandler (const G4String& name) = 0;
virtual G4VViewer* CreateViewer (G4VSceneHandler&, const G4String& name) = 0;
// Access functions.
const G4String& GetName () const;
@@ -5,15 +5,13 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VGraphicsSystem.icc,v 2.0 1998/07/02 16:48:28 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VGraphicsSystem.icc,v 1.3 1999/05/10 14:04:03 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 27th March 1996
// Abstract interface class for graphics systems.
inline G4VGraphicsSystem::~G4VGraphicsSystem () {}
inline G4bool
G4VGraphicsSystem::operator == (const G4VGraphicsSystem& system) const {
return this == &system;
@@ -1,148 +0,0 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VScene.icc,v 2.3 1998/11/06 13:43:04 allison Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// John Allison 19th July 1996.
inline G4bool G4VScene::operator == (const G4VScene& scene) const {
return this == &scene;
}
inline void G4VScene::EndModeling () {}
inline void G4VScene::AddThis (const G4Box& box) {
RequestPrimitives (box);
// If your graphics system is sophisticated enough to handle a
// particular solid shape as a primitive, in your derived class write a
// function to override this. (Note: some compilers warn that your
// function "hides" this one. That's OK.)
// Your function might look like this...
// void G4MyScene::AddThis (const G4Box& box) {
// Get parameters of appropriate object, e.g.:
// G4double dx = box.GetXHalfLength ();
// G4double dy = box.GetYHalfLength ();
// G4double dz = box.GetZHalfLength ();
// and Draw or Store in your display List.
}
inline void G4VScene::AddThis (const G4Tubs& tubs) {
RequestPrimitives (tubs);
}
inline void G4VScene::AddThis (const G4Cons& cons) {
RequestPrimitives (cons);
}
inline void G4VScene::AddThis (const G4Trd& trd) {
RequestPrimitives (trd);
}
inline void G4VScene::AddThis (const G4Trap& trap) {
RequestPrimitives (trap);
}
inline void G4VScene::AddThis (const G4Sphere& sphere) {
RequestPrimitives ( sphere );
}
inline void G4VScene::AddThis (const G4Para& para ) {
RequestPrimitives ( para );
}
inline void G4VScene::AddThis (const G4Torus& torus ) {
RequestPrimitives ( torus );
}
inline void G4VScene::AddThis (const G4VSolid& solid) {
RequestPrimitives (solid);
}
inline void G4VScene::PreAddThis (const G4Transform3D& objectTransformation,
const G4VisAttributes& visAttribs) {
fpObjectTransformation = &objectTransformation;
fpVisAttribs = &visAttribs;
}
inline void G4VScene::PostAddThis () {}
inline void G4VScene::ClearStore () {}
inline G4VGraphicsSystem* G4VScene::GetGraphicsSystem () const {
return &fSystem;
}
inline G4int G4VScene::GetSceneId () const {
return fSceneId;
}
inline G4int G4VScene::GetViewCount () const {
return fViewCount;
}
inline
G4double G4VScene::GetMarkerDiameter (const G4VMarker& marker,
G4VScene::MarkerSizeType& sizeType) {
return GetMarkerSize (marker, sizeType);
}
inline
G4double G4VScene::GetMarkerRadius (const G4VMarker& marker,
G4VScene::MarkerSizeType& sizeType) {
return GetMarkerSize (marker, sizeType) / 2.;
}
inline G4int G4VScene::IncrementViewCount () {
return fViewCount++;
}
inline const G4String& G4VScene::GetName () const {
return fName;
}
inline void G4VScene::SetName (const G4String& name) {
fName = name;
}
inline const G4SceneData& G4VScene::GetSceneData () const {
return fSD;
}
inline const G4VViewList& G4VScene::GetViewList () const {
return fViewList;
}
inline const G4VModel* G4VScene::GetModel () const {
return fpModel;
}
inline G4VView* G4VScene::GetCurrentView () const {
return fpView;
}
inline void G4VScene::SetCurrentView (G4VView* pView) {
fpView = pView;
}
inline G4VViewList& G4VScene::SetViewList () {
return fViewList;
}
inline void
G4VScene::SetModel (const G4VModel* pModel) {
fpModel = pModel;
}
inline const G4Colour& G4VScene::GetColor (const G4Visible& visible) {
return GetColour (visible);
}
inline const G4Colour& G4VScene::GetTextColor (const G4Text& text) {
return GetTextColour (text);
}
@@ -5,26 +5,23 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VScene.hh,v 2.4 1998/12/09 23:56:21 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VSceneHandler.hh,v 1.4 1999/05/12 13:57:25 barrand Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 19th July 1996.
// Abstract interface class for graphics scenes.
// Abstract interface class for graphics scene handlers.
// Inherits from G4VGraphicsScene, in the graphics_reps component, which is
// a minimal abstract interface for the GEANT4 kernel.
// A scene is a set of objects which are sufficient to describe what
// is to be viewed.
#ifndef G4VSCENE_HH
#define G4VSCENE_HH
#ifndef G4VSCENEHANDLER_HH
#define G4VSCENEHANDLER_HH
#include "globals.hh"
#include "G4VGraphicsScene.hh"
#include "G4SceneData.hh"
#include "G4VViewList.hh"
#include "G4Scene.hh"
#include "G4ViewerList.hh"
#include "G4ViewParameters.hh"
#include "G4Box.hh"
#include "G4Cons.hh"
@@ -34,11 +31,13 @@
#include "G4Sphere.hh"
#include "G4Para.hh"
#include "G4Torus.hh"
#include "G4Polycone.hh"
#include "G4Polyhedra.hh"
#include "G4Transform3D.hh"
#include "G4VModel.hh"
class G4VGraphicsSystem;
class G4VView;
class G4VViewer;
class G4VSolid;
class G4Polyline;
class G4Text;
@@ -54,20 +53,20 @@ class G4VSolid;
class G4ModelingParameters;
class G4LogicalVolume;
class G4VScene: public G4VGraphicsScene {
class G4VSceneHandler: public G4VGraphicsScene {
friend ostream& operator << (ostream& os, const G4VScene& s);
friend ostream& operator << (ostream& os, const G4VSceneHandler& s);
public:
enum MarkerSizeType {world, screen};
G4VScene (G4VGraphicsSystem& system, G4int id, const G4String& name = "");
G4VSceneHandler (G4VGraphicsSystem& system, G4int id, const G4String& name = "");
virtual ~G4VScene ();
virtual ~G4VSceneHandler ();
// For RWTPtrOrderedVector...
G4bool operator == (const G4VScene& scene) const;
G4bool operator == (const G4VSceneHandler& scene) const;
//////////////////////////////////////////////////////////////
// Functions for adding raw GEANT4 objects, if the graphics system
@@ -75,7 +74,7 @@ public:
// system). If your graphics system is sophisticated enough to
// handle a particular solid shape as a primitive, in your derived
// class write a function to override one or more of the following.
// See the implementation of G4VScene::AddThis (const G4Box& box) for
// See the implementation of G4VSceneHandler::AddThis (const G4Box& box) for
// more suggestions. If not, please implement the base class
// invocation.
virtual void AddThis (const G4Box&);
@@ -86,6 +85,8 @@ public:
virtual void AddThis (const G4Sphere&);
virtual void AddThis (const G4Para&);
virtual void AddThis (const G4Torus&);
virtual void AddThis (const G4Polycone&);
virtual void AddThis (const G4Polyhedra&);
virtual void AddThis (const G4VSolid&); // For solids not above.
///////////////////////////////////////////////////////////////
@@ -104,7 +105,7 @@ public:
// IMPORTANT: invoke this from your polymorphic versions, e.g.:
// void MyXXXScene::PreAddThis (const G4Transform3D& objectTransformation,
// const G4VisAttributes& visAttribs) {
// G4VScene::PreAddThis (objectTransformation, visAttribs);
// G4VSceneHandler::PreAddThis (objectTransformation, visAttribs);
// ...
// }
@@ -112,7 +113,7 @@ public:
// IMPORTANT: invoke this from your polymorphic versions, e.g.:
// void MyXXXScene::PostAddThis () {
// ...
// G4VScene::PostAddThis (objectTransformation, visAttribs);
// G4VSceneHandler::PostAddThis (objectTransformation, visAttribs);
// }
//////////////////////////////////////////////////////////////
@@ -121,7 +122,7 @@ public:
virtual void BeginModeling ();
// IMPORTANT: invoke this from your polymorphic versions, e.g.:
// void MyXXXScene::BeginModeling () {
// G4VScene::BeginModeling ();
// G4VSceneHandler::BeginModeling ();
// ...
// }
@@ -129,14 +130,14 @@ public:
// IMPORTANT: invoke this from your polymorphic versions, e.g.:
// void MyXXXScene::EndModeling () {
// ...
// G4VScene::EndModeling ();
// G4VSceneHandler::EndModeling ();
// }
virtual void BeginPrimitives (const G4Transform3D& objectTransformation);
// IMPORTANT: invoke this from your polymorphic versions, e.g.:
// void MyXXXScene::BeginPrimitives
// (const G4Transform3D& objectTransformation) {
// G4VScene::BeginPrimitives (objectTransformation);
// G4VSceneHandler::BeginPrimitives (objectTransformation);
// ...
// }
@@ -144,7 +145,7 @@ public:
// IMPORTANT: invoke this from your polymorphic versions, e.g.:
// void MyXXXScene::EndPrimitives () {
// ...
// G4VScene::EndPrimitives ();
// G4VSceneHandler::EndPrimitives ();
// }
virtual void AddPrimitive (const G4Polyline&) = 0;
@@ -157,19 +158,19 @@ public:
//////////////////////////////////////////////////////////////
// Access functions.
const G4String& GetName () const;
void SetName (const G4String&);
G4int GetSceneId () const;
G4int GetViewCount () const;
G4VGraphicsSystem* GetGraphicsSystem () const;
const G4SceneData& GetSceneData () const;
const G4VViewList& GetViewList () const;
const G4VModel* GetModel () const;
G4VView* GetCurrentView () const;
void SetCurrentView (G4VView*);
void SetSceneData (const G4SceneData&);
G4VViewList& SetViewList (); // Non-const if you need to change.
void SetModel (const G4VModel*);
const G4String& GetName () const;
void SetName (const G4String&);
G4int GetSceneId () const;
G4int GetViewCount () const;
G4VGraphicsSystem* GetGraphicsSystem () const;
G4Scene* GetScene () const;
const G4ViewerList& GetViewerList () const;
const G4VModel* GetModel () const;
G4VViewer* GetCurrentViewer () const;
void SetCurrentViewer (G4VViewer*);
void SetScene (G4Scene*);
G4ViewerList& SetViewerList (); // Non-const so you can change.
void SetModel (const G4VModel*);
//////////////////////////////////////////////////////////////
// Public utility functions.
@@ -217,10 +218,11 @@ public:
G4int IncrementViewCount ();
virtual void ClearStore ();
virtual void ClearTransientStore ();
// Clears graphics database (display lists) if any.
void AddViewToList (G4VView* pView); // Add view to view List.
void RemoveViewFromList (G4VView* pView); // Remove view from view List.
void AddViewerToList (G4VViewer* pView); // Add view to view List.
void RemoveViewerFromList (G4VViewer* pView); // Remove view from view List.
protected:
@@ -232,13 +234,13 @@ protected:
//////////////////////////////////////////////////////////////
// Data members
G4VGraphicsSystem& fSystem; // Abstract system for this scene.
G4VGraphicsSystem& fSystem; // Graphics system.
const G4int fSceneId; // Id of this instance.
G4String fName;
G4int fViewCount; // To determine view ids for this scene.
G4VViewList fViewList; // Views.
G4VView* fpView; // Current view.
G4SceneData fSD; // Scene data for this scene.
G4int fViewCount; // To determine view ids.
G4ViewerList fViewerList; // Viewers.
G4VViewer* fpViewer; // Current viewer.
G4Scene* fpScene; // Scene for this scene handler.
//////////////////////////////////////////////////////////////
// Workspace...
@@ -256,16 +258,16 @@ private:
//////////////////////////////////////////////////////////////
// Friend function accessed only by views of this scene.
friend void G4VView::ProcessView ();
friend void G4VViewer::ProcessView ();
//////////////////////////////////////////////////////////////
// Private functions, etc..
void ProcessScene (G4VView& view);
// Accessed by G4VView::ProcessView ().
void ProcessScene (G4VViewer& view);
// Accessed by G4VViewer::ProcessView ().
};
#include "G4VScene.icc"
#include "G4VSceneHandler.icc"
#endif
@@ -0,0 +1,102 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VSceneHandler.icc,v 1.5 1999/05/12 13:57:26 barrand Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 19th July 1996.
inline G4bool G4VSceneHandler::operator == (const G4VSceneHandler& scene) const {
return this == &scene;
}
inline void G4VSceneHandler::EndModeling () {}
inline void G4VSceneHandler::PreAddThis (const G4Transform3D& objectTransformation,
const G4VisAttributes& visAttribs) {
fpObjectTransformation = &objectTransformation;
fpVisAttribs = &visAttribs;
}
inline void G4VSceneHandler::PostAddThis () {}
inline void G4VSceneHandler::ClearStore () {}
inline void G4VSceneHandler::ClearTransientStore () {}
inline G4VGraphicsSystem* G4VSceneHandler::GetGraphicsSystem () const {
return &fSystem;
}
inline G4int G4VSceneHandler::GetSceneId () const {
return fSceneId;
}
inline G4int G4VSceneHandler::GetViewCount () const {
return fViewCount;
}
inline
G4double G4VSceneHandler::GetMarkerDiameter (const G4VMarker& marker,
G4VSceneHandler::MarkerSizeType& sizeType) {
return GetMarkerSize (marker, sizeType);
}
inline
G4double G4VSceneHandler::GetMarkerRadius (const G4VMarker& marker,
G4VSceneHandler::MarkerSizeType& sizeType) {
return GetMarkerSize (marker, sizeType) / 2.;
}
inline G4int G4VSceneHandler::IncrementViewCount () {
return fViewCount++;
}
inline const G4String& G4VSceneHandler::GetName () const {
return fName;
}
inline void G4VSceneHandler::SetName (const G4String& name) {
fName = name;
}
inline G4Scene* G4VSceneHandler::GetScene () const {
return fpScene;
}
inline const G4ViewerList& G4VSceneHandler::GetViewerList () const {
return fViewerList;
}
inline const G4VModel* G4VSceneHandler::GetModel () const {
return fpModel;
}
inline G4VViewer* G4VSceneHandler::GetCurrentViewer () const {
return fpViewer;
}
inline void G4VSceneHandler::SetCurrentViewer (G4VViewer* pViewer) {
fpViewer = pViewer;
}
inline G4ViewerList& G4VSceneHandler::SetViewerList () {
return fViewerList;
}
inline void
G4VSceneHandler::SetModel (const G4VModel* pModel) {
fpModel = pModel;
}
inline const G4Colour& G4VSceneHandler::GetColor (const G4Visible& visible) {
return GetColour (visible);
}
inline const G4Colour& G4VSceneHandler::GetTextColor (const G4Text& text) {
return GetTextColour (text);
}
@@ -1,42 +0,0 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VView.icc,v 2.1 1998/10/14 14:15:06 allison Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// John Allison 30th December 1996
inline G4bool G4VView::operator == (const G4VView& view) const{
return this == &view;
}
inline G4int G4VView::GetViewId () const {
return fViewId;
}
inline const G4String& G4VView::GetName () const {
return fName;
}
inline void G4VView::SetName (const G4String& name) {
fName = name;
}
inline G4VScene* G4VView::GetScene () const {
return &fScene;
}
inline const G4ViewParameters& G4VView::GetViewParameters () const {
return fVP;
}
inline void G4VView::SetNeedKernelVisit () {
fNeedKernelVisit = true;
}
inline void G4VView::FinishView () {}
@@ -5,33 +5,33 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VView.hh,v 2.3 1998/11/06 13:43:05 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VViewer.hh,v 1.2 1999/01/11 00:48:16 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 27th March 1996
// Abstract interface class for graphics views.
// Abstract interface class for graphics viewers.
#ifndef G4VVIEW_HH
#define G4VVIEW_HH
#ifndef G4VVIEWER_HH
#define G4VVIEWER_HH
#include "globals.hh"
#include "G4ViewParameters.hh"
class G4VScene;
class G4VSceneHandler;
class G4VView {
class G4VViewer {
friend ostream& operator << (ostream& os, const G4VView& v);
friend ostream& operator << (ostream& os, const G4VViewer& v);
public:
G4VView (G4VScene& scene, G4int id, const G4String& name = "");
virtual ~G4VView ();
G4VViewer (G4VSceneHandler& scene, G4int id, const G4String& name = "");
virtual ~G4VViewer ();
// For RWTPtrOrderedVector...
G4bool operator == (const G4VView& view) const;
G4bool operator == (const G4VViewer& view) const;
//////////////////////////////////////////////////////////////
// View manipulation functions.
@@ -63,7 +63,7 @@ public:
const G4String& GetName () const;
void SetName (const G4String&);
G4int GetViewId () const;
G4VScene* GetScene () const;
G4VSceneHandler* GetScene () const;
const G4ViewParameters& GetViewParameters () const;
void SetViewParameters (const G4ViewParameters& vp);
@@ -87,7 +87,7 @@ protected:
//////////////////////////////////////////////////////////////
// Data members
G4VScene& fScene; // Abstract scene for this view.
G4VSceneHandler& fSceneHandler; // Abstract scene for this view.
G4int fViewId; // Id of this instance.
G4String fName;
G4ViewParameters fVP; // Viewing parameters.
@@ -98,14 +98,14 @@ protected:
G4bool fNeedKernelVisit; // See DrawView() for comments.
};
#include "G4VView.icc"
#include "G4VViewer.icc"
/*********************************************
Here is a minimal DrawView () as it might be implemented in the
concrete view.
void G4VView::DrawView () { // Default - concrete view usually overrides.
void G4VViewer::DrawView () { // Default - concrete view usually overrides.
// First, a view should decide when to re-visit the G4 kernel.
// Sometimes it might not be necessary, e.g., if the scene is stored
@@ -0,0 +1,42 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VViewer.icc,v 1.2 1999/01/11 00:48:17 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 30th December 1996
inline G4bool G4VViewer::operator == (const G4VViewer& view) const{
return this == &view;
}
inline G4int G4VViewer::GetViewId () const {
return fViewId;
}
inline const G4String& G4VViewer::GetName () const {
return fName;
}
inline void G4VViewer::SetName (const G4String& name) {
fName = name;
}
inline G4VSceneHandler* G4VViewer::GetScene () const {
return &fSceneHandler;
}
inline const G4ViewParameters& G4VViewer::GetViewParameters () const {
return fVP;
}
inline void G4VViewer::SetNeedKernelVisit () {
fNeedKernelVisit = true;
}
inline void G4VViewer::FinishView () {}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VVisCommand.hh,v 2.4 1998/12/09 23:56:22 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VVisCommand.hh,v 1.3 1999/05/10 14:04:05 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// Base class for visualization commands - John Allison 9th August 1998
// It is really a messenger - we have one command per messenger.
@@ -22,8 +22,9 @@ class G4UIcmdWithAString;
class G4VVisCommand: public G4UImessenger {
public:
// Uses compiler defaults for destructor, copy constructor and assignment.
// Uses compiler defaults for copy constructor and assignment.
G4VVisCommand ();
virtual ~G4VVisCommand ();
static void SetVisManager (G4VisManager*);
protected:
static G4VisManager* fpVisManager;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VVisCommand.icc,v 2.1 1998/08/09 17:54:17 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VVisCommand.icc,v 1.2 1999/01/09 16:30:51 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// Base class for visualization commands - John Allison 9th August 1998
// It is really a messenger - we have one command per messenger.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ViewParameters.hh,v 2.3 1998/11/25 16:31:26 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ViewParameters.hh,v 1.3 1999/05/25 09:14:09 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 19th July 1996
@@ -72,8 +72,7 @@ typedef RWTValOrderedVector<G4Plane3D> G4Planes;
class G4ViewParameters {
friend ostream& operator << (ostream& os, const G4ViewParameters& v);
friend G4bool operator != (const G4ViewParameters& v1,
const G4ViewParameters& v2);
public:
enum DrawingStyle {
@@ -93,6 +92,8 @@ public:
// Note: uses default assignment operator and copy constructor.
G4bool operator != (const G4ViewParameters&) const;
// Get and Is functions.
DrawingStyle GetDrawingStyle () const;
RepStyle GetRepStyle () const;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ViewParameters.icc,v 2.0 1998/07/02 16:48:54 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ViewParameters.icc,v 1.2 1999/01/09 16:30:52 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 20th October 1996
@@ -5,18 +5,18 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VViewList.hh,v 2.0 1998/07/02 16:48:51 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ViewerList.hh,v 1.1 1999/01/09 16:30:53 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison May 1996
#ifndef G4VVIEWLIST_HH
#define G4VVIEWLIST_HH
#ifndef G4VIEWERLIST_HH
#define G4VIEWERLIST_HH
#include <rw/tpordvec.h>
#include "G4VView.hh"
#include "G4VViewer.hh"
class G4VViewList: public RWTPtrOrderedVector<G4VView> {};
class G4ViewerList: public RWTPtrOrderedVector<G4VViewer> {};
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandTemplates.hh,v 2.1 1998/07/12 03:09:54 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandTemplates.hh,v 1.2 1999/01/09 16:30:53 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// Visualization Command Messenger Templates.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandTemplates.icc,v 2.4 1998/07/19 05:53:51 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandTemplates.icc,v 1.2 1999/01/09 16:30:54 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// Command Messenger Templates.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsCamera.hh,v 2.2 1998/07/12 03:09:56 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsCamera.hh,v 1.2 1999/01/09 16:30:55 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// /vis~/camera/ commands
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsCameraMessengers.hh,v 2.3 1998/07/12 03:44:45 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsCameraMessengers.hh,v 1.2 1999/01/09 16:30:55 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// Messengers for /vis~/camera commands - John Allison 6th April 1998.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsClear.hh,v 2.2 1998/07/12 03:09:58 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsClear.hh,v 1.3 1999/01/11 00:48:19 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// /vis~/clear/ commands
@@ -31,6 +31,7 @@ public:
}
};
/****************
///////////////////////////////////////// /vis~/clear/scene ////
//clear \hline
//clear /vis~/clear/scene &&
@@ -53,6 +54,7 @@ public:
}
}
};
******************/
//////////////////////////////////////// /vis~/clear/view ////
//clear \hline
@@ -75,6 +77,7 @@ public:
}
};
/****************************
/////////////////////////////////////// /vis~/clear/view_and_scene ////
//clear \hline
//clear /vis~/clear/view\_and\_scene &&
@@ -99,5 +102,6 @@ public:
}
}
};
********************/
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsCopy.hh,v 2.2 1998/07/12 03:09:59 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsCopy.hh,v 1.3 1999/01/11 00:48:23 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// /vis~/copy/ commands
@@ -31,6 +31,7 @@ public:
}
};
/*****************************
////////////////////////////////////////////// /vis~/copy/all ////
//copy \hline
//copy /vis~/copy/all &&
@@ -49,7 +50,7 @@ public:
G4VisManager* pVMan = G4VisManager::GetInstance ();
if (pVMan -> IsValidView ()) {
pVMan -> CopyScene ();
pVMan -> CopyView ();
pVMan -> CopyViewParameters ();
if (pVMan -> GetVerboseLevel () > 1) {
pVMan -> PrintCurrentView ();
}
@@ -82,6 +83,7 @@ public:
}
}
};
*********************/
////////////////////////////////////////// /vis~/copy/view ////
//copy \hline
@@ -98,7 +100,7 @@ public:
void SetValue () {
G4VisManager* pVMan = G4VisManager::GetInstance ();
if (pVMan -> IsValidView ()) {
pVMan -> CopyView ();
pVMan -> CopyViewParameters ();
if (pVMan -> GetVerboseLevel () > 1) {
pVMan -> PrintCurrentView ();
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsCreateScene.hh,v 2.2 1998/07/12 03:10:00 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsCreateScene.hh,v 1.2 1999/01/09 16:30:57 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// /vis~/create_scene/ commands
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsCreateView.hh,v 2.3 1998/10/14 14:15:07 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsCreateView.hh,v 1.3 1999/01/11 00:48:24 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// /vis~/create_view/ commands
@@ -43,8 +43,8 @@ public:
void SetValue () {
G4VisManager* pVMan = G4VisManager::GetInstance ();
if (pVMan -> IsValidView ()) {
pVMan -> CreateScene ();
pVMan -> CreateView ();
pVMan -> CreateSceneHandler ();
pVMan -> CreateViewer ();
if (pVMan -> GetVerboseLevel () > 1) {
pVMan -> PrintCurrentScene ();
}
@@ -67,7 +67,7 @@ public:
void SetValue () {
G4VisManager* pVMan = G4VisManager::GetInstance ();
if (pVMan -> IsValidView ()) {
pVMan -> CreateView ();
pVMan -> CreateViewer ();
if (pVMan -> GetVerboseLevel () > 1) {
pVMan -> PrintCurrentView ();
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsDelete.hh,v 2.2 1998/07/12 03:10:02 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsDelete.hh,v 1.3 1999/01/11 00:48:24 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// /vis~/delete/ commands
@@ -46,7 +46,7 @@ public:
if (pVMan -> GetVerboseLevel () > 1) {
pVMan -> PrintCurrentView ();
}
pVMan -> DeleteCurrentScene ();
pVMan -> DeleteCurrentSceneHandler ();
if (pVMan -> GetVerboseLevel () > 1) {
pVMan -> PrintCurrentView ();
}
@@ -68,7 +68,7 @@ public:
if (pVMan -> GetVerboseLevel () > 1) {
pVMan -> PrintCurrentView ();
}
pVMan -> DeleteCurrentView ();
pVMan -> DeleteCurrentViewer ();
if (pVMan -> GetVerboseLevel () > 1) {
pVMan -> PrintCurrentView ();
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsDraw.hh,v 2.3 1998/07/16 01:59:27 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsDraw.hh,v 1.2 1999/01/09 16:30:59 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// /vis~/draw/ commands
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsLights.hh,v 2.3 1998/07/13 17:12:16 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsLights.hh,v 1.3 1999/01/11 00:48:25 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// /vis~/lights/ commands
@@ -49,7 +49,7 @@ public:
void SetValue (G4bool value) {
G4VisManager* pVMan = G4VisManager::GetInstance ();
pVMan -> SetCurrentViewParameters ().SetLightsMoveWithCamera (value);
G4VView* pView = pVMan -> GetCurrentView ();
G4VViewer* pView = pVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (pVMan -> GetCurrentViewParameters ());
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsPrint.hh,v 2.3 1998/07/16 01:59:28 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsPrint.hh,v 1.2 1999/01/09 16:31:00 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// /vis~/print/ commands
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsRefresh.hh,v 2.2 1998/07/12 03:10:05 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsRefresh.hh,v 1.2 1999/01/09 16:31:00 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// /vis~/refresh/ commands
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsScene.hh,v 2.8 1998/12/09 23:56:23 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsScene.hh,v 1.5 1999/05/10 14:04:06 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// /vis/scene commands - John Allison 9th August 1998
@@ -21,14 +21,12 @@ class G4UIcmdWithoutParameter;
class G4VVisCommandScene: public G4VVisCommand {
public:
// Uses compiler defaults for destructor, copy constructor and assignment.
// Uses compiler defaults for copy constructor and assignment.
G4VVisCommandScene ();
~G4VVisCommandScene ();
protected:
void UpdateCandidateLists ();
void UpdateVisManagerSceneDataAndViewParameters
(const G4String& sceneName = "");
static G4String fSceneNameList;
// member so that it has long life - static because shared between objects.
void UpdateVisManagerSceneAndViewParameters (const G4String& sceneName = "");
};
class G4VisCommandSceneCreate: public G4VVisCommandScene {
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsSceneAdd.hh,v 2.1 1998/08/22 16:40:56 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsSceneAdd.hh,v 1.2 1999/01/09 16:31:02 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// /vis/scene commands - John Allison 9th August 1998
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsSceneHandler.hh,v 1.3 1998/12/09 23:56:24 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsSceneHandler.hh,v 1.3 1999/05/10 14:04:08 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// /vis/sceneHandler commands - John Allison 10th October 1998
@@ -20,8 +20,9 @@ class G4UIcmdWithAString;
class G4VVisCommandSceneHandler: public G4VVisCommand {
public:
// Uses compiler defaults for destructor, copy constructor and assignment.
// Uses compiler defaults for copy constructor and assignment.
G4VVisCommandSceneHandler ();
~G4VVisCommandSceneHandler ();
protected:
void UpdateCandidateLists ();
static G4String fSceneHandlerNameList;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsSceneInclude.hh,v 2.1 1998/08/27 15:32:34 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsSceneInclude.hh,v 1.2 1999/01/09 16:31:03 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// /vis/scene commands - John Allison 9th August 1998
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsSet.hh,v 2.3 1998/07/13 17:12:17 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsSet.hh,v 1.3 1999/01/11 00:48:26 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// /vis~/set/ commands
@@ -49,7 +49,7 @@ public:
void SetValue (G4bool value) {
G4VisManager* pVMan = G4VisManager::GetInstance ();
pVMan -> SetCurrentViewParameters ().SetCulling (value);
G4VView* pView = pVMan -> GetCurrentView ();
G4VViewer* pView = pVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (pVMan -> GetCurrentViewParameters ());
@@ -82,7 +82,7 @@ public:
<< endl;
G4VisManager* pVMan = G4VisManager::GetInstance ();
pVMan -> SetCurrentViewParameters ().SetCullingCovered (value);
G4VView* pView = pVMan -> GetCurrentView ();
G4VViewer* pView = pVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (pVMan -> GetCurrentViewParameters ());
@@ -111,7 +111,7 @@ public:
void SetValue (G4bool value) {
G4VisManager* pVMan = G4VisManager::GetInstance ();
pVMan -> SetCurrentViewParameters ().SetCullingInvisible (value);
G4VView* pView = pVMan -> GetCurrentView ();
G4VViewer* pView = pVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (pVMan -> GetCurrentViewParameters ());
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsShow.hh,v 2.2 1998/07/12 03:10:07 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsShow.hh,v 1.2 1999/01/09 16:31:04 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// /vis~/show/ commands
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsViewer.hh,v 2.3 1998/12/09 23:56:25 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsViewer.hh,v 1.3 1999/05/10 14:04:09 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// /vis/viewer commands - John Allison 25th October 1998
@@ -22,6 +22,7 @@ class G4VVisCommandViewer: public G4VVisCommand {
public:
// Uses compiler defaults for destructor, copy constructor and assignment.
G4VVisCommandViewer ();
~G4VVisCommandViewer ();
protected:
G4String ShortName (const G4String &);
void UpdateCandidateLists ();
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisFeaturesOfDAWNFILE.hh,v 2.0 1998/07/02 16:49:28 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisFeaturesOfDAWNFILE.hh,v 1.2 1999/01/09 16:31:05 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
#ifndef G4VISFEATURESOFDAWNFILE_HH
#define G4VISFEATURESOFDAWNFILE_HH
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisFeaturesOfFukuiRenderer.hh,v 2.0 1998/07/02 16:49:29 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisFeaturesOfFukuiRenderer.hh,v 1.2 1999/01/09 16:31:06 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisFeaturesOfOpenGL.hh,v 2.0 1998/07/02 16:49:31 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisFeaturesOfOpenGL.hh,v 1.2 1999/01/09 16:31:06 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisFeaturesOfOpenInventor.hh,v 1.1 1998/09/11 15:11:11 jkallenb Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisFeaturesOfOpenInventor.hh,v 1.2 1999/01/09 16:31:07 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisFeaturesOfRay.hh,v 2.0 1998/07/02 16:49:32 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisFeaturesOfRay.hh,v 1.2 1999/01/09 16:31:08 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisManMessenger.hh,v 2.2 1998/07/12 03:44:48 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisManMessenger.hh,v 1.2 1999/01/09 16:31:08 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// GEANT4 Visualization Manager Messenger - John Allison 22nd July 1996.
@@ -5,42 +5,38 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisManager.hh,v 2.10 1998/11/29 15:34:03 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisManager.hh,v 1.5 1999/02/07 17:32:15 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// The GEANT4 Visualization Manager - John Allison 02/Jan/1996.
// This is a "Singleton", i.e., only one instance of it may exist. A
// G4Exception is thrown if an attempt to instantiate more than one is
// made.
// This is a "Singleton", i.e., only one instance may exist. A
// G4Exception is thrown if an attempt is made to instantiate more
// than one.
// Graphics system registration is normally Done through the protected
// Graphics system registration is normally done through the protected
// pure virtual function RegisterGraphicsSystems called from
// Initialise (). You must define your own subclass and implement
// RegisterGraphicsSystems. You can also use the public function
// RegisterGraphicsSystem (new MyGraphicsSystem) if you have your own
// graphics system.
// RegisterGraphicsSystems - for an example see
// visualization/include/MyVisManager.hh/cc. You can also use the
// public function RegisterGraphicsSystem (new MyGraphicsSystem) if
// you have your own graphics system.
// The VisManager creates graphics systems, scenes and views and
// manages them. You can have any number. It has the concept of a
// "current view", and the "current scene" and "current graphics
// system" which go with it. You can select the current view. Most
// of the the operations of the VisManager take place on the current
// view, in particular, the Draw operations.
// The VisManager creates graphics systems, scenes, scene handlers and
// viewers and manages them. You can have any number. It has the
// concept of a "current viewer", and the "current scene handler", the
// "current scene" and the "current graphics system" which go with it.
// You can select the current viewer. Most of the the operations of
// the VisManager take place with the current viewer, in particular,
// the Draw operations.
// Each scene has its "scene data".
// Each view has its "view parameters".
// The VisManager also has the concept of "current scene data" and
// "current view parameters" which, in general, will be different to
// those of any scene or view. When a view is drawn, it is given the
// current data and parameters; this might trigger "consequent
// actions", such as reconstruction of display lists. If the
// differences are minor, e.g, if only the viewpoint direction has
// changed, then it might not be necessary to reconstruct the display
// lists - each system must decide.
// Each scene comprises drawable objects such as detector components
// and hits when appropriate. A scene handler translates a scene into
// graphics-system-specific function calls and, possibly, a
// graphics-system-dependent database - display lists, scene graphs,
// etc. Each viewer has its "view parameters".
// G4VisManager is "state dependent", i.e., it is notified on change
// of state (G4ApplicationState). This is used to draw hits and
@@ -53,9 +49,9 @@
#include "globals.hh"
#include "G4GraphicsSystemList.hh"
#include "G4SceneHandlerList.hh"
#include "G4Scene.hh"
#include "G4SceneList.hh"
#include "G4SceneData.hh"
#include "G4SceneDataObjectList.hh"
#include "G4ViewParameters.hh"
#include "G4Transform3D.hh"
#include "G4UImessenger.hh"
@@ -68,8 +64,8 @@ class G4VPhysicalVolume;
class G4LogicalVolume;
class G4VSolid;
class G4VGraphicsSystem;
class G4VScene;
class G4VView;
class G4VSceneHandler;
class G4VViewer;
class G4Polyline;
class G4Text;
class G4Circle;
@@ -80,17 +76,61 @@ class G4NURBS;
class G4VisManager: public G4VVisManager, public G4VStateDependent {
// List of classes and functions which need access to private
// members of G4VisManager. This is mainly to obtain access to
// GetInstance (), which is private. The correct way for normal
// users to obtain a pointer to the vis manager is with
// G4VVisManager::GetConcreteInstance (), always testing for
// non-zero.
friend void G4OpenGLXmViewerSecondaryLoopPostAction (); // Mmmm!
friend class G4VSceneHandler;
friend class G4VViewer;
friend class ostream & operator <<
(class ostream &, const class G4VGraphicsSystem &);
friend class ostream & operator <<
(class ostream &, const class G4VSceneHandler &);
// Now classes associated with the old commands...
friend class G4VisManMessenger;
friend class G4VisCommandCameraReset;
friend class G4VisCommandClearScene;
friend class G4VisCommandClearView;
friend class G4VisCommandClearViewAndScene;
friend class G4VisCommandCopyAll;
friend class G4VisCommandCopyScene;
friend class G4VisCommandCopyView;
friend class G4VisCommandCreateViewNewScene;
friend class G4VisCommandCreateViewNewView;
friend class G4VisCommandDeleteScene;
friend class G4VisCommandDeleteView;
friend class G4VisCommandDrawCurrent;
friend class G4VisCommandLightsMoveWithCamera;
friend class G4VisCommandRefreshView;
friend class G4VisCommandSetCulling;
friend class G4VisCommandSetCullCoveredDaughters;
friend class G4VisCommandSetCullInvisible;
friend class G4VisCommandShowView;
public:
G4VisManager ();
virtual ~G4VisManager ();
private:
static G4VisManager* GetInstance ();
// Returns pointer to itself. Throws a G4Exception if called before
// instantiation. The general user should instead use
// G4VVisManager::GetConcreteInstance() to get a "higher level"
// pointer for general use - but always test for non-zero.
// instantiation. Private so that only friends can use; the normal
// user should instead use G4VVisManager::GetConcreteInstance () to
// get a "higher level" pointer for general use - but always test
// for non-zero.
public:
void Initialise ();
void Initialize (); // Alias Initialise ().
@@ -99,34 +139,20 @@ public:
//////////////////////////////////////////////////////////////////////
// Drawing routines!
void Clear ();
// Clear current scene and current view, marking all its views as
// needing refreshing. This is a comprehensive clear which clears
// both framebuffers of a double buffered system and clears the
// scene's graphics databse (display lists, etc.) and clears the
// current scene data.
void ClearScene ();
// Clear current scene, marking all its views as needing refreshing.
// Clears the scene's graphics databse (display lists, etc.)
// Clears the current scene data.
void ClearView ();
// Clear visible window of current view (both buffers of a double
// Clear visible window of current viewer (both buffers of a double
// buffered system).
void Draw ();
// Draw current scene in current view.
void Show ();
// Show current view (for graphics systems which require to process
// all drawn objects before finalising the view).
// Show current view (initiates post-procesing of graphical
// databases for graphics systems which require it.)
// Now functions for drawing hits, digis, etc. These are treated as
// "transients", in contrast to the scene (as defined by the Scene
// Data), which is treated as "permanent". The crucial difference
// is that a scene can be recreated by a visit to the GEANT4 kernel
// if the graphics system requires it; transient objects cannot.
// ///////////////////////////////////////////////////////////////
// Now functions for drawing various visualization primitives,
// useful for representing hits, digis, etc.
void Draw (const G4Polyline&,
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
@@ -149,9 +175,10 @@ public:
void Draw (const G4NURBS&,
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
// Now Follow functions for drawing a GEANT4 geometry object. Note
// that the 2nd argument overrides any visualization attributes that
// are associated with the object itself.
// //////////////////////////////////////////////////////////////////
// Now functions for drawing a GEANT4 geometry object. Note that
// the 2nd argument overrides any visualization attributes that are
// associated with the object itself.
void Draw (const G4VSolid&, const G4VisAttributes&,
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
@@ -164,25 +191,34 @@ public:
G4bool Notify (G4ApplicationState requestedState);
// This is called on change of state (G4ApplicationState). It is
// used to draw hits and trajectories in the current scene at the
// end of event, as required.
// used to draw hits and trajectories if included in the current
// scene at the end of event, as required.
////////////////////////////////////////////////////////////////////////
// Administration routines.
void ClearCurrentSceneData ();
void CopyScene ();
// Copy scene data of current scene into current scene data.
void CopyView ();
// Copy view parameters of current view into current view parameters.
void CreateScene (G4String name = "");
// Creates scene of the current system.
void CreateView (G4String name = "");
// Creates view of the current scene.
void DeleteCurrentScene (); // Leaves current scene and view undefined!
void DeleteCurrentView (); // Leaves current scene and view undefined!
void GeometryHasChanged (); // Used by run manager to notify change.
void RefreshCurrentView (); // Soft clear, then redraw.
void CopyViewParameters ();
// Copy view parameters of current viewer into current view parameters.
void CreateSceneHandler (G4String name = "");
// Creates scene handler for the current system.
void CreateViewer (G4String name = "");
// Creates viewer for the current scene handler.
void DeleteCurrentSceneHandler ();
// Leaves current scene handler and viewer undefined!
void DeleteCurrentViewer ();
// Leaves current scene and view undefined!
void GeometryHasChanged ();
// Used by run manager to notify change.
void RefreshCurrentView ();
// Soft clear, then redraw.
// These can go when OLD STYLE commands go...
void PrintCurrentSystem () const;
void PrintCurrentSystems () const;
void PrintCurrentScene () const;
@@ -192,27 +228,27 @@ public:
// Access functions.
G4VGraphicsSystem* GetCurrentGraphicsSystem () const;
G4VScene* GetCurrentScene () const;
G4VView* GetCurrentView () const;
const G4SceneData& GetCurrentSceneData () const;
G4Scene* GetCurrentScene () const;
G4VSceneHandler* GetCurrentSceneHandler () const;
G4VViewer* GetCurrentViewer () const;
const G4ViewParameters& GetCurrentViewParameters () const;
const G4GraphicsSystemList& GetAvailableGraphicsSystems ();
// The above is non-const because it checks and updates the List by
// calling RegisterGraphicsSystems() if no graphics systems are
// already registered.
const G4SceneList& GetAvailableScenes () const;
const G4SceneDataObjectList& GetSceneDataObjectList () const;
const G4SceneHandlerList& GetAvailableSceneHandlers () const;
const G4SceneList& GetSceneList () const;
G4int GetVerboseLevel () const;
G4bool IsValidView ();
void SetCurrentGraphicsSystemAndCreateView
void SetCurrentGraphicsSystemAndCreateViewer
(G4VGraphicsSystem* pSystem);
void SetCurrentGraphicsSystem (G4VGraphicsSystem* pSystem);
void SetCurrentScene (G4VScene* pScene);
void SetCurrentView (G4VView* pView);
G4SceneData& SetCurrentSceneData (); // Returns lvalue.
void SetCurrentScene (G4Scene*);
void SetCurrentSceneHandler (G4VSceneHandler* pScene);
void SetCurrentViewer (G4VViewer* pView);
G4ViewParameters& SetCurrentViewParameters (); // Returns lvalue.
G4SceneList& SetAvailableScenes (); // Returns lvalue.
G4SceneDataObjectList& SetSceneDataObjectList (); // Returns lvalue.
G4SceneHandlerList& SetAvailableSceneHandlers (); // Returns lvalue.
G4SceneList& SetSceneList (); // Returns lvalue.
void SetVerboseLevel (G4int vLevel);
protected:
@@ -226,12 +262,12 @@ protected:
static G4VisManager* fpInstance; // Pointer to single instance.
G4bool fInitialised;
G4VGraphicsSystem* fpGraphicsSystem; // Current graphics system.
G4VScene* fpScene; // Current graphics model.
G4VView* fpView; // Current view.
G4Scene* fpScene; // Current scene.
G4VSceneHandler* fpSceneHandler; // Current scene handler.
G4VViewer* fpViewer; // Current viewer.
G4GraphicsSystemList fAvailableGraphicsSystems;
G4SceneList fAvailableScenes;
G4SceneDataObjectList fSceneDataObjectList;
G4SceneData fSD; // Current scene data object.
G4SceneList fSceneList;
G4SceneHandlerList fAvailableSceneHandlers;
G4ViewParameters fVP; // Current viewing parameters.
G4int fVerbose; // Verbosity level 0-10.
G4VisManMessenger* fpMessenger; // Pointer to messenger.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisManager.icc,v 2.6 1998/11/06 13:43:08 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisManager.icc,v 1.4 1999/01/11 00:48:27 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// GEANT4 Visualization Manager - John Allison 02/Jan/1996.
@@ -15,31 +15,30 @@ inline void G4VisManager::Initialize () {
Initialise ();
}
inline G4VScene* G4VisManager::GetCurrentScene () const {
inline G4VSceneHandler* G4VisManager::GetCurrentSceneHandler () const {
return fpSceneHandler;
}
inline G4VViewer* G4VisManager::GetCurrentViewer () const {
return fpViewer;
}
inline G4Scene* G4VisManager::GetCurrentScene () const {
return fpScene;
}
inline G4VView* G4VisManager::GetCurrentView () const {
return fpView;
}
inline const G4SceneData& G4VisManager::GetCurrentSceneData () const {
return fSD;
}
inline const G4ViewParameters&
G4VisManager::GetCurrentViewParameters () const {
return fVP;
}
inline const G4SceneList&
G4VisManager::GetAvailableScenes () const {
return fAvailableScenes;
inline const G4SceneHandlerList&
G4VisManager::GetAvailableSceneHandlers () const {
return fAvailableSceneHandlers;
}
inline const G4SceneDataObjectList&
G4VisManager::GetSceneDataObjectList () const {
return fSceneDataObjectList;
inline const G4SceneList& G4VisManager::GetSceneList () const {
return fSceneList;
}
inline G4VGraphicsSystem*
@@ -51,21 +50,20 @@ inline G4int G4VisManager::GetVerboseLevel () const {
return fVerbose;
}
inline G4SceneData& G4VisManager::SetCurrentSceneData () {
return fSD;
inline void G4VisManager::SetCurrentScene (G4Scene* pScene) {
fpScene = pScene;
}
inline G4ViewParameters& G4VisManager::SetCurrentViewParameters () {
return fVP;
}
inline G4SceneDataObjectList&
G4VisManager::SetSceneDataObjectList () {
return fSceneDataObjectList;
inline G4SceneList& G4VisManager::SetSceneList () {
return fSceneList;
}
inline G4SceneList& G4VisManager::SetAvailableScenes () {
return fAvailableScenes;
inline G4SceneHandlerList& G4VisManager::SetAvailableSceneHandlers () {
return fAvailableSceneHandlers;
}
inline void G4VisManager::SetVerboseLevel (G4int vLevel) {
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisToOldVisCommands.hh,v 1.1 1998/12/09 23:54:58 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisToOldVisCommands.hh,v 1.2 1999/01/09 16:31:10 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// Implements some /vis/ commands as /vis~/ temporarily.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: MyVisManager.cc,v 2.4 1998/11/09 04:20:16 stanaka Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: MyVisManager.cc,v 1.2 1999/01/09 16:31:11 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 24th January 1998.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: MyVisManager.hh,v 2.3 1998/07/12 03:10:10 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: MyVisManager.hh,v 1.2 1999/01/09 16:31:11 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 24th January 1998.
@@ -5,24 +5,27 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SceneData.cc,v 2.7 1998/11/29 15:34:05 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Scene.cc,v 1.3 1999/05/25 09:14:15 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// Scene data John Allison 19th July 1996.
#include "G4SceneData.hh"
#include "G4Scene.hh"
#include "G4Vector3D.hh"
#include "G4BoundingSphereScene.hh"
#include "G4VisAttributes.hh"
#include "G4PhysicalVolumeModel.hh"
#include "G4TransportationManager.hh"
G4SceneData::G4SceneData (const G4String& name):
G4Scene::G4Scene (const G4String& name):
fName (name)
{} // Note all data members have default initial values.
G4SceneData::~G4SceneData () {}
G4Scene::~G4Scene () {}
void G4SceneData::AddRunDurationModel (G4VModel* pModel) {
void G4Scene::AddRunDurationModel (G4VModel* pModel) {
fRunDurationModelList.append (pModel);
G4int nModels = fRunDurationModelList.entries ();
G4BoundingSphereScene boundingSphereScene;
@@ -44,12 +47,39 @@ void G4SceneData::AddRunDurationModel (G4VModel* pModel) {
fStandardTargetPoint = fExtent.GetExtentCentre ();
}
void G4SceneData::Clear () {
void G4Scene::AddWorldIfEmpty () {
if (IsEmpty ()) {
G4VPhysicalVolume* pWorld =
G4TransportationManager::GetTransportationManager ()
-> GetNavigatorForTracking () -> GetWorldVolume ();
if (pWorld) {
const G4VisAttributes* pVisAttribs =
pWorld -> GetLogicalVolume () -> GetVisAttributes ();
if (!pVisAttribs || pVisAttribs -> IsVisible ()) {
G4cout <<
"Your \"world\" has no vis attributes or is marked as visible."
"\n For a better view of the contents, mark the world as"
" invisible, e.g.,"
"\n myWorldLogicalVol ->"
" SetVisAttributes (G4VisAttributes::Invisible);"
<< endl;
}
AddRunDurationModel (new G4PhysicalVolumeModel (pWorld));
// Note: default depth and no modeling parameters.
G4cout <<
"G4Scene::AddWorldIfEmpty: The scene was empty,"
"\n \"world\" has been added.";
G4cout << endl;
}
}
}
void G4Scene::Clear () {
fRunDurationModelList.clearAndDestroy ();
fEndOfEventModelList.clearAndDestroy ();
}
ostream& operator << (ostream& os, const G4SceneData& d) {
ostream& operator << (ostream& os, const G4Scene& d) {
os << "Scene data:";
@@ -70,17 +100,16 @@ ostream& operator << (ostream& os, const G4SceneData& d) {
return os;
}
G4bool operator != (const G4SceneData& d1,
const G4SceneData& d2) {
G4bool G4Scene::operator != (const G4Scene& s) const {
if (
(d1.fRunDurationModelList.entries () !=
d2.fRunDurationModelList.entries ()) ||
(d1.fExtent != d2.fExtent) ||
!(d1.fStandardTargetPoint == d2.fStandardTargetPoint)
(fRunDurationModelList.entries () !=
s.fRunDurationModelList.entries ()) ||
(fExtent != s.fExtent) ||
!(fStandardTargetPoint == s.fStandardTargetPoint)
) return true;
for (int i = 0; i < d1.fRunDurationModelList.entries (); i++) {
if (d1.fRunDurationModelList[i] != d2.fRunDurationModelList[i])
for (int i = 0; i < fRunDurationModelList.entries (); i++) {
if (fRunDurationModelList[i] != s.fRunDurationModelList[i])
return true;
}
@@ -1,27 +0,0 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SceneDataObjectList.cc,v 2.2 1998/08/10 10:19:09 allison Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// John Allison 9th August 1998
#include "G4SceneDataObjectList.hh"
G4SceneDataObjectList::G4SceneDataObjectList
(
unsigned (*hashFun)(const G4String&), // Hashing function
size_t size // No. of buckets
):
RWTValHashDictionary <G4String, G4SceneData> (hashFun, size)
{}
G4SceneDataObjectListIterator::G4SceneDataObjectListIterator
(G4SceneDataObjectList& list):
RWTValHashDictionaryIterator <G4String, G4SceneData> (list)
{}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VGraphicsSystem.cc,v 2.1 1998/11/06 13:43:10 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VGraphicsSystem.cc,v 1.4 1999/05/10 14:04:11 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 27th March 1996
@@ -16,6 +16,8 @@
#include "G4VisManager.hh"
G4VGraphicsSystem::~G4VGraphicsSystem () {}
G4VGraphicsSystem::G4VGraphicsSystem (const G4String& name,
Functionality f):
fName (name),
@@ -42,7 +44,7 @@ G4VGraphicsSystem::G4VGraphicsSystem (const G4String& name,
ostream& operator << (ostream& os, const G4VGraphicsSystem& gs) {
G4VisManager* pVMan = G4VisManager::GetInstance ();
const G4SceneList& scenes = pVMan -> GetAvailableScenes ();
const G4SceneHandlerList& scenes = pVMan -> GetAvailableSceneHandlers ();
os << "Graphics System: " << gs.GetName ();
if (gs.GetNickname () != "") {
os << ", nickname: " << gs.GetNickname ();
@@ -5,14 +5,14 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VScene.cc,v 2.8 1998/11/29 15:34:06 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VSceneHandler.cc,v 1.4 1999/05/10 14:04:13 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 19th July 1996
// Abstract interface class for graphics scenes.
#include "G4VScene.hh"
#include "G4VSceneHandler.hh"
#include "G4ios.hh"
#ifdef WIN32
@@ -23,7 +23,7 @@
#include "G4VisManager.hh"
#include "G4VGraphicsSystem.hh"
#include "G4VView.hh"
#include "G4VViewer.hh"
#include "G4VSolid.hh"
#include "G4RotationMatrix.hh"
#include "G4ThreeVector.hh"
@@ -42,11 +42,11 @@
#include "G4PhysicalVolumeModel.hh"
#include "G4ModelingParameters.hh"
G4VScene::G4VScene (G4VGraphicsSystem& system, G4int id, const G4String& name):
G4VSceneHandler::G4VSceneHandler (G4VGraphicsSystem& system, G4int id, const G4String& name):
fSystem (system),
fSceneId (id),
fViewCount (0),
fpView (0),
fpViewer (0),
fReadyForTransients (false),
fpModel (0),
fpObjectTransformation (0),
@@ -56,7 +56,7 @@ G4VScene::G4VScene (G4VGraphicsSystem& system, G4int id, const G4String& name):
fpCurrentLV (0)
{
G4VisManager* pVMan = G4VisManager::GetInstance ();
fSD = pVMan -> GetCurrentSceneData ();
fpScene = pVMan -> GetCurrentScene ();
if (name == "") {
char charname [50];
ostrstream ost (charname, 50);
@@ -68,33 +68,88 @@ G4VScene::G4VScene (G4VGraphicsSystem& system, G4int id, const G4String& name):
}
}
G4VScene::~G4VScene () {
fViewList.clearAndDestroy ();
G4VSceneHandler::~G4VSceneHandler () {
fViewerList.clearAndDestroy ();
}
void G4VScene::AddViewToList (G4VView* pView) {
fViewList.append (pView);
void G4VSceneHandler::AddThis (const G4Box& box) {
RequestPrimitives (box);
// If your graphics system is sophisticated enough to handle a
// particular solid shape as a primitive, in your derived class write a
// function to override this. (Note: some compilers warn that your
// function "hides" this one. That's OK.)
// Your function might look like this...
// void G4MyScene::AddThis (const G4Box& box) {
// Get parameters of appropriate object, e.g.:
// G4double dx = box.GetXHalfLength ();
// G4double dy = box.GetYHalfLength ();
// G4double dz = box.GetZHalfLength ();
// and Draw or Store in your display List.
}
void G4VScene::EstablishSpecials (G4PhysicalVolumeModel& pvModel) {
void G4VSceneHandler::AddThis (const G4Tubs& tubs) {
RequestPrimitives (tubs);
}
void G4VSceneHandler::AddThis (const G4Cons& cons) {
RequestPrimitives (cons);
}
void G4VSceneHandler::AddThis (const G4Trd& trd) {
RequestPrimitives (trd);
}
void G4VSceneHandler::AddThis (const G4Trap& trap) {
RequestPrimitives (trap);
}
void G4VSceneHandler::AddThis (const G4Sphere& sphere) {
RequestPrimitives (sphere );
}
void G4VSceneHandler::AddThis (const G4Para& para) {
RequestPrimitives (para);
}
void G4VSceneHandler::AddThis (const G4Torus& torus) {
RequestPrimitives (torus);
}
void G4VSceneHandler::AddThis (const G4Polycone& polycone) {
RequestPrimitives (polycone);
}
void G4VSceneHandler::AddThis (const G4Polyhedra& polyhedra) {
RequestPrimitives (polyhedra);
}
void G4VSceneHandler::AddThis (const G4VSolid& solid) {
RequestPrimitives (solid);
}
void G4VSceneHandler::AddViewerToList (G4VViewer* pViewer) {
fViewerList.append (pViewer);
}
void G4VSceneHandler::EstablishSpecials (G4PhysicalVolumeModel& pvModel) {
pvModel.DefinePointersToWorkingSpace (&fCurrentDepth,
&fpCurrentPV,
&fpCurrentLV);
}
void G4VScene::BeginModeling () {
if (!GetModel ()) G4Exception ("G4VScene::BeginModeling: NO MODEL!!!");
void G4VSceneHandler::BeginModeling () {
if (!GetModel ()) G4Exception ("G4VSceneHandler::BeginModeling: NO MODEL!!!");
}
void G4VScene::BeginPrimitives
void G4VSceneHandler::BeginPrimitives
(const G4Transform3D& objectTransformation) {
if (!GetModel ()) G4Exception ("G4VScene::BeginPrimitives: NO MODEL!!!");
if (!GetModel ()) G4Exception ("G4VSceneHandler::BeginPrimitives: NO MODEL!!!");
fpObjectTransformation = &objectTransformation;
}
void G4VScene::EndPrimitives () {}
void G4VSceneHandler::EndPrimitives () {}
void G4VScene::AddPrimitive (const G4Polymarker& polymarker) {
void G4VSceneHandler::AddPrimitive (const G4Polymarker& polymarker) {
switch (polymarker.GetMarkerType()) {
default:
case G4Polymarker::line:
@@ -138,19 +193,19 @@ void G4VScene::AddPrimitive (const G4Polymarker& polymarker) {
}
}
void G4VScene::RemoveViewFromList (G4VView* pView) {
fViewList.remove (pView);
void G4VSceneHandler::RemoveViewerFromList (G4VViewer* pViewer) {
fViewerList.remove (pViewer);
}
void G4VScene::SetSceneData (const G4SceneData& sd) {
fSD = sd;
// Notify all views that a kernel visit is required.
for (int i = 0; i < fViewList.entries (); i++) {
fViewList [i] -> SetNeedKernelVisit ();
void G4VSceneHandler::SetScene (G4Scene* pScene) {
fpScene = pScene;
// Notify all viewers that a kernel visit is required.
for (int i = 0; i < fViewerList.entries (); i++) {
fViewerList [i] -> SetNeedKernelVisit ();
}
}
void G4VScene::RequestPrimitives (const G4VSolid& solid) {
void G4VSceneHandler::RequestPrimitives (const G4VSolid& solid) {
G4Polyhedron* pPolyhedron;
G4NURBS* pNURBS;
BeginPrimitives (*fpObjectTransformation);
@@ -159,7 +214,7 @@ void G4VScene::RequestPrimitives (const G4VSolid& solid) {
pNURBS = solid.CreateNURBS ();
if (pNURBS) {
pNURBS -> SetVisAttributes
(fpView -> GetApplicableVisAttributes (fpVisAttribs));
(fpViewer -> GetApplicableVisAttributes (fpVisAttribs));
AddPrimitive (*pNURBS);
delete pNURBS;
break;
@@ -177,7 +232,7 @@ void G4VScene::RequestPrimitives (const G4VSolid& solid) {
G4Polyhedron::ResetNumberOfRotationSteps ();
if (pPolyhedron) {
pPolyhedron -> SetVisAttributes
(fpView -> GetApplicableVisAttributes (fpVisAttribs));
(fpViewer -> GetApplicableVisAttributes (fpVisAttribs));
AddPrimitive (*pPolyhedron);
delete pPolyhedron;
}
@@ -198,56 +253,54 @@ void G4VScene::RequestPrimitives (const G4VSolid& solid) {
EndPrimitives ();
}
void G4VScene::ProcessScene (G4VView& view) {
void G4VSceneHandler::ProcessScene (G4VViewer& view) {
fReadyForTransients = false;
// Clear stored scene, if any, i.e., display lists, scene graphs.
ClearStore ();
if (fpView -> GetViewParameters ().IsViewGeom ()) {
// Traverse geometry tree and send drawing primitives to window(s).
// Traverse geometry tree and send drawing primitives to window(s).
const RWTPtrOrderedVector <G4VModel>& runDurationModelList =
fpScene -> GetRunDurationModelList ();
const RWTPtrOrderedVector <G4VModel>& runDurationModelList =
fSD.GetRunDurationModelList ();
if (runDurationModelList.entries ()) {
G4cout << "Traversing scene data..." << endl;
G4ModelingParameters* pMP = CreateModelingParameters ();
for (int i = 0; i < runDurationModelList.entries (); i++) {
G4VModel* pModel = runDurationModelList[i];
const G4ModelingParameters* tempMP =
pModel -> GetModelingParameters ();
// NOTE THAT tempMP COULD BE ZERO.
// (Not sure the above is necessary; but in future we might
// want to take notice of the modeling parameters with which
// the model was created. For the time being we are ignoring
// them and simply using the view parameters. When the time
// comes to do this, then perhaps there should be a default
// set of modeling parameters in the view parameters for the
// case of a zero modeling parameters pointer.)
pModel -> SetModelingParameters (pMP);
SetModel (pModel); // Store for use by derived class.
BeginModeling ();
pModel -> DescribeYourselfTo (*this);
EndModeling ();
pModel -> SetModelingParameters (tempMP);
}
delete pMP;
SetModel (0); // Flags invalid model.
}
else {
G4cerr << "No run-duration models in scene data." << endl;
if (runDurationModelList.entries ()) {
G4cout << "Traversing scene data..." << endl;
G4ModelingParameters* pMP = CreateModelingParameters ();
for (int i = 0; i < runDurationModelList.entries (); i++) {
G4VModel* pModel = runDurationModelList[i];
const G4ModelingParameters* tempMP =
pModel -> GetModelingParameters ();
// NOTE THAT tempMP COULD BE ZERO.
// (Not sure the above is necessary; but in future we might
// want to take notice of the modeling parameters with which
// the model was created. For the time being we are ignoring
// them and simply using the view parameters. When the time
// comes to do this, then perhaps there should be a default
// set of modeling parameters in the view parameters for the
// case of a zero modeling parameters pointer.)
// (I think for the G4 Vis System we'll rely on view parameters and convert.
pModel -> SetModelingParameters (pMP);
SetModel (pModel); // Store for use by derived class.
BeginModeling ();
pModel -> DescribeYourselfTo (*this);
EndModeling ();
pModel -> SetModelingParameters (tempMP);
}
delete pMP;
SetModel (0); // Flags invalid model.
}
else {
G4cerr << "No run-duration models in scene data." << endl;
}
fReadyForTransients = true;
}
G4ModelingParameters* G4VScene::CreateModelingParameters () {
G4ModelingParameters* G4VSceneHandler::CreateModelingParameters () {
// Create modeling parameters from View Parameters...
const G4ViewParameters& vp = fpView -> GetViewParameters ();
const G4ViewParameters& vp = fpViewer -> GetViewParameters ();
// Convert rep styles...
G4ModelingParameters::RepStyle modelRepStyle =
G4ModelingParameters::wireframe;
@@ -285,43 +338,47 @@ G4ModelingParameters* G4VScene::CreateModelingParameters () {
vp.IsDensityCulling (),
vp.GetVisibleDensity (),
reallyCullCovered,
vp.GetNoOfSides ());
vp.GetNoOfSides (),
vp.IsViewGeom (),
vp.IsViewHits (),
vp.IsViewDigis ()
);
return pModelingParams;
}
const G4Colour& G4VScene::GetColour (const G4Visible& visible) {
const G4Colour& G4VSceneHandler::GetColour (const G4Visible& visible) {
// Colour is determined by the applicable (real) vis attributes.
const G4VisAttributes* pVA = visible.GetVisAttributes ();
pVA = fpView -> GetApplicableVisAttributes (pVA);
pVA = fpViewer -> GetApplicableVisAttributes (pVA);
return pVA -> GetColour ();
}
const G4Colour& G4VScene::GetTextColour (const G4Text& text) {
const G4Colour& G4VSceneHandler::GetTextColour (const G4Text& text) {
const G4VisAttributes* pVA = text.GetVisAttributes ();
if (!pVA) {
pVA = fpView -> GetViewParameters (). GetDefaultTextVisAttributes ();
pVA = fpViewer -> GetViewParameters (). GetDefaultTextVisAttributes ();
}
return pVA -> GetColour ();
}
G4ViewParameters::DrawingStyle G4VScene::GetDrawingStyle
G4ViewParameters::DrawingStyle G4VSceneHandler::GetDrawingStyle
(const G4Visible& visible) {
// Drawing style is determined by the applicable (real) vis
// attributes, except when overridden - see GetDrawingStyle (const
// G4VisAttributes* pVisAttribs).
const G4VisAttributes* pVA = visible.GetVisAttributes ();
pVA = fpView -> GetApplicableVisAttributes (pVA);
pVA = fpViewer -> GetApplicableVisAttributes (pVA);
return GetDrawingStyle (pVA);
}
G4ViewParameters::DrawingStyle G4VScene::GetDrawingStyle
G4ViewParameters::DrawingStyle G4VSceneHandler::GetDrawingStyle
(const G4VisAttributes* pVisAttribs) {
// Drawing style is normally determined by the view parameters, but
// it can be overriddden by the ForceDrawingStyle flag in the vis
// attributes.
G4ViewParameters::DrawingStyle style =
fpView->GetViewParameters().GetDrawingStyle();
fpViewer->GetViewParameters().GetDrawingStyle();
if (pVisAttribs -> IsForceDrawingStyle ()) {
G4VisAttributes::ForcedDrawingStyle forcedStyle =
pVisAttribs -> GetForcedDrawingStyle ();
@@ -362,11 +419,11 @@ G4ViewParameters::DrawingStyle G4VScene::GetDrawingStyle
return style;
}
G4double G4VScene::GetMarkerSize (const G4VMarker& marker,
G4VScene::MarkerSizeType& markerSizeType) {
G4double G4VSceneHandler::GetMarkerSize (const G4VMarker& marker,
G4VSceneHandler::MarkerSizeType& markerSizeType) {
G4bool userSpecified = marker.GetWorldSize() || marker.GetScreenSize();
const G4VMarker& defaultMarker =
fpView -> GetViewParameters().GetDefaultMarker();
fpViewer -> GetViewParameters().GetDefaultMarker();
G4double size;
if (size = // Assignment intentional.
userSpecified ? marker.GetWorldSize() : defaultMarker.GetWorldSize()) {
@@ -380,21 +437,21 @@ G4double G4VScene::GetMarkerSize (const G4VMarker& marker,
markerSizeType = screen;
}
if (size <= 0.) size = 1.;
size *= fpView -> GetViewParameters().GetGlobalMarkerScale();
size *= fpViewer -> GetViewParameters().GetGlobalMarkerScale();
return size;
}
ostream& operator << (ostream& os, const G4VScene& s) {
ostream& operator << (ostream& os, const G4VSceneHandler& s) {
G4VisManager* pVMan = G4VisManager::GetInstance ();
os << "Scene " << s.fName << " has "
<< s.fViewList.entries () << " views:";
for (int i = 0; i < s.fViewList.entries (); i++) {
os << "\n " << s.fViewList [i];
<< s.fViewerList.entries () << " viewers:";
for (int i = 0; i < s.fViewerList.entries (); i++) {
os << "\n " << s.fViewerList [i];
}
os << "\n " << s.fSD;
os << "\n " << *s.fpScene;
return os;
}
@@ -5,14 +5,14 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VView.cc,v 2.5 1998/11/06 13:43:12 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VViewer.cc,v 1.3 1999/01/11 00:48:30 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 27th March 1996
// Abstract interface class for graphics views.
#include "G4VView.hh"
#include "G4VViewer.hh"
#include "G4ios.hh"
#ifdef WIN32
@@ -23,20 +23,13 @@
#include "G4VisManager.hh"
#include "G4VGraphicsSystem.hh"
#include "G4VScene.hh"
#include "G4VSceneHandler.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Transform3D.hh"
#include "G4Event.hh"
// Forward declaration for g++ linker.
#ifdef GNU_GCC
#include <rw/tvvector.h>
#include "G4Plane3D.hh"
template class RWTValVector<G4Plane3D>;
#endif
G4VView::G4VView (G4VScene& scene, G4int id, const G4String& name):
fScene (scene),
G4VViewer::G4VViewer (G4VSceneHandler& scene, G4int id, const G4String& name):
fSceneHandler (scene),
fViewId (id),
fModified (true),
fNeedKernelVisit (true)
@@ -46,7 +39,7 @@ fNeedKernelVisit (true)
if (name == "") {
char charname [50];
ostrstream ost (charname, 50);
ost << fScene.GetName () << '-' << fViewId << ends;
ost << fSceneHandler.GetName () << '-' << fViewId << ends;
fName = charname;
}
else {
@@ -54,9 +47,9 @@ fNeedKernelVisit (true)
}
}
G4VView::~G4VView () {}
G4VViewer::~G4VViewer () {}
const G4VisAttributes* G4VView::GetApplicableVisAttributes
const G4VisAttributes* G4VViewer::GetApplicableVisAttributes
(const G4VisAttributes* pVisAttribs) const {
// If the pointer is null, pick up the default vis attributes from
// the view parameters.
@@ -65,17 +58,17 @@ const G4VisAttributes* G4VView::GetApplicableVisAttributes
return pVisAttribs;
}
void G4VView::NeedKernelVisit () {
void G4VViewer::NeedKernelVisit () {
// Notify all views that a kernel visit is required.
const G4VViewList& viewList = fScene.GetViewList ();
const G4ViewerList& viewList = fSceneHandler.GetViewerList ();
for (int i = 0; i < viewList.entries (); i++) {
viewList [i] -> SetNeedKernelVisit ();
}
}
void G4VView::ShowView () {}
void G4VViewer::ShowView () {}
void G4VView::ProcessView () {
void G4VViewer::ProcessView () {
// If view parameters have been modified, SetView () works out consequences.
if (fModified) {
@@ -84,41 +77,21 @@ void G4VView::ProcessView () {
}
// If the scene data has changed (fNeedVisit is set to true in
// G4VScene::SetSceneData), or if the concrete view has decided that it
// G4VSceneHandler::SetSceneData), or if the concrete view has decided that it
// necessary to visit the kernel (this should be Done in the concrete
// object's DrawView ())...
if (fNeedKernelVisit) {
fNeedKernelVisit = false;
fScene.ProcessScene (*this);
fSceneHandler.ProcessScene (*this);
}
/*********************************************
Note that hits and digi drawing is totally the responsibility of the
"user" at present. So the following code just represents an
alternative approach, namely, the user sets a flag, then the Vis
Manager draws them. I will leave the code hear for now; also the
flags and methods in G4ViewParameters.
// If event data is available...
G4Event* pEvent = G4VisManager::GetInstance () -> GetEvent ();
if (pEvent) {
if (fVP.IsViewHits ()) {
G4cout << "Drawing hits..." << endl;
}
if (fVP.IsViewDigis ()) {
G4cout << "Drawing digis..." << endl;
}
}
***********************************************/
}
void G4VView::SetViewParameters (const G4ViewParameters& vp) {
void G4VViewer::SetViewParameters (const G4ViewParameters& vp) {
fVP = vp;
fModified = true;
}
ostream& operator << (ostream& os, const G4VView& v) {
ostream& operator << (ostream& os, const G4VViewer& v) {
os << "View " << v.fName << ":\n";
os << v.fVP;
return os;
@@ -5,14 +5,16 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VVisCommand.cc,v 2.4 1998/12/09 23:56:27 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VVisCommand.cc,v 1.3 1999/05/10 14:04:14 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// Base class for visualization commands - John Allison 9th August 1998
// It is really a messenger - we have one command per messenger.
#include "G4VVisCommand.hh"
G4VVisCommand::~G4VVisCommand () {}
G4VisManager* G4VVisCommand::fpVisManager = 0;
G4UIcmdWithAString* G4VVisCommand::fpCommandSceneNotifyHandlers = 0;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ViewParameters.cc,v 2.4 1998/11/25 16:31:28 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ViewParameters.cc,v 1.4 1999/05/25 09:14:17 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 19th July 1996
@@ -39,8 +39,8 @@ G4ViewParameters::G4ViewParameters ():
fActualLightpointDirection (G4Vector3D (1., 1., 1.)),
fLightsMoveWithCamera (false),
fViewGeom (true),
fViewHits (false),
fViewDigis (false),
fViewHits (true),
fViewDigis (true),
fDefaultTextVisAttributes (G4Colour (0., 0., 1.)),
fGlobalMarkerScale (1.),
fMarkerNotHidden (true),
@@ -367,8 +367,8 @@ ostream& operator << (ostream& os, const G4ViewParameters& v) {
os << "\n Global marker scale: " << v.fGlobalMarkerScale;
os << "\n Marker ";
if (v.fMarkerNotHidden) os << "not";
os << " hidden by surfaces.";
if (v.fMarkerNotHidden) os << "not ";
os << "hidden by surfaces.";
os << "\n Window size hint: "
<< v.fWindowSizeHintX << 'x'<< v.fWindowSizeHintX;
@@ -376,62 +376,61 @@ ostream& operator << (ostream& os, const G4ViewParameters& v) {
return os;
}
G4bool operator != (const G4ViewParameters& v1,
const G4ViewParameters& v2) {
G4bool G4ViewParameters::operator != (const G4ViewParameters& v) const {
// Put performance-sensitive parameters first.
if (
// This first to optimise spin, etc.
(v1.fViewpointDirection != v2.fViewpointDirection) ||
(fViewpointDirection != v.fViewpointDirection) ||
// No particular order from here on.
(v1.fDrawingStyle != v2.fDrawingStyle) ||
(v1.fRepStyle != v2.fRepStyle) ||
(v1.fCulling != v2.fCulling) ||
(v1.fCullInvisible != v2.fCullInvisible) ||
(v1.fDensityCulling != v2.fDensityCulling) ||
(v1.fCullCovered != v2.fCullCovered) ||
(v1.fSection != v2.fSection) ||
(v1.fCutaway != v2.fCutaway) ||
(v1.fExplode != v2.fExplode) ||
(v1.fNoOfSides != v2.fNoOfSides) ||
(v1.fUpVector != v2.fUpVector) ||
(v1.fFieldHalfAngle != v2.fFieldHalfAngle) ||
(v1.fZoomFactor != v2.fZoomFactor) ||
(v1.fCurrentTargetPoint != v2.fCurrentTargetPoint) ||
(v1.fDolly != v2.fDolly) ||
(v1.fRelativeLightpointDirection != v2.fRelativeLightpointDirection) ||
(v1.fLightsMoveWithCamera != v2.fLightsMoveWithCamera) ||
(v1.fViewGeom != v2.fViewGeom) ||
(v1.fViewHits != v2.fViewHits) ||
(v1.fViewDigis != v2.fViewDigis) ||
(v1.fDefaultVisAttributes != v2.fDefaultVisAttributes) ||
(v1.fDefaultTextVisAttributes != v2.fDefaultTextVisAttributes) ||
(v1.fDefaultMarker != v2.fDefaultMarker) ||
(v1.fGlobalMarkerScale != v2.fGlobalMarkerScale) ||
(v1.fMarkerNotHidden != v2.fMarkerNotHidden) ||
(v1.fWindowSizeHintX != v2.fWindowSizeHintX) ||
(v1.fWindowSizeHintY != v2.fWindowSizeHintY))
(fDrawingStyle != v.fDrawingStyle) ||
(fRepStyle != v.fRepStyle) ||
(fCulling != v.fCulling) ||
(fCullInvisible != v.fCullInvisible) ||
(fDensityCulling != v.fDensityCulling) ||
(fCullCovered != v.fCullCovered) ||
(fSection != v.fSection) ||
(fCutaway != v.fCutaway) ||
(fExplode != v.fExplode) ||
(fNoOfSides != v.fNoOfSides) ||
(fUpVector != v.fUpVector) ||
(fFieldHalfAngle != v.fFieldHalfAngle) ||
(fZoomFactor != v.fZoomFactor) ||
(fCurrentTargetPoint != v.fCurrentTargetPoint) ||
(fDolly != v.fDolly) ||
(fRelativeLightpointDirection != v.fRelativeLightpointDirection) ||
(fLightsMoveWithCamera != v.fLightsMoveWithCamera) ||
(fViewGeom != v.fViewGeom) ||
(fViewHits != v.fViewHits) ||
(fViewDigis != v.fViewDigis) ||
(fDefaultVisAttributes != v.fDefaultVisAttributes) ||
(fDefaultTextVisAttributes != v.fDefaultTextVisAttributes) ||
(fDefaultMarker != v.fDefaultMarker) ||
(fGlobalMarkerScale != v.fGlobalMarkerScale) ||
(fMarkerNotHidden != v.fMarkerNotHidden) ||
(fWindowSizeHintX != v.fWindowSizeHintX) ||
(fWindowSizeHintY != v.fWindowSizeHintY))
return true;
if (v1.fDensityCulling &&
(v1.fVisibleDensity != v2.fVisibleDensity)) return true;
if (fDensityCulling &&
(fVisibleDensity != v.fVisibleDensity)) return true;
if (v1.fSection &&
(!(v1.fSectionPlane == v2.fSectionPlane))) return true;
if (fSection &&
(!(fSectionPlane == v.fSectionPlane))) return true;
if (v1.fCutaway) {
if (v1.fCutawayPlanes.entries () != v2.fCutawayPlanes.entries ())
if (fCutaway) {
if (fCutawayPlanes.entries () != v.fCutawayPlanes.entries ())
return true;
else {
for (int i = 0; i < v1.fCutawayPlanes.entries (); i++) {
if (!(v1.fCutawayPlanes (i) == v2.fCutawayPlanes (i))) return true;
for (int i = 0; i < fCutawayPlanes.entries (); i++) {
if (!(fCutawayPlanes (i) == v.fCutawayPlanes (i))) return true;
}
}
}
if (v1.fExplode &&
(v1.fExplodeFactor != v2.fExplodeFactor)) return true;
if (fExplode &&
(fExplodeFactor != v.fExplodeFactor)) return true;
return false;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandTemplates.cc,v 2.2 1998/07/13 17:12:26 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandTemplates.cc,v 1.2 1999/01/09 16:31:18 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// Visualization Command Messenger Template private functions.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsCamera.cc,v 2.2 1998/07/23 02:18:55 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsCamera.cc,v 1.3 1999/01/11 00:48:31 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
@@ -15,15 +15,19 @@
void G4VisCommandCameraReset::SetValue () {
G4VisManager* pVMan = G4VisManager::GetInstance ();
if (pVMan -> IsValidView ()) {
const G4SceneData& sd = pVMan -> GetCurrentSceneData ();
const G4Scene* pScene = pVMan -> GetCurrentScene ();
G4ViewParameters& vp = pVMan -> SetCurrentViewParameters ();
vp.SetCurrentTargetPoint (sd.GetStandardTargetPoint ());
vp.SetCurrentTargetPoint (pScene -> GetStandardTargetPoint ());
vp.SetZoomFactor (1.);
vp.SetDolly (0.);
vp.SetViewpointDirection (G4Vector3D (0., 0., 1.));
vp.SetUpVector (G4Vector3D (0., 1., 0.));
if (pVMan -> GetVerboseLevel () > 0) {
G4cout << "Target point reset";
G4cout << "\nZoom factor reset to 1.";
G4cout << "\nDolly distance reset to 0.";
G4cout << "\nViewpoint direction reset to +z.";
G4cout << "\nUp vector set to +y.";
G4cout << endl;
if (pVMan -> GetVerboseLevel () > 1) {
pVMan -> PrintCurrentView ();
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsCameraMessengers.cc,v 2.3 1998/07/12 03:44:55 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsCameraMessengers.cc,v 1.2 1999/01/09 16:31:19 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// Messengers for /vis~/camera commands - John Allison 6th April 1998.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsScene.cc,v 2.12 1998/12/09 23:56:28 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsScene.cc,v 1.7 1999/05/10 14:04:15 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// /vis/scene commands - John Allison 9th August 1998
@@ -16,6 +16,7 @@
#include "G4TransportationManager.hh"
#include "G4PhysicalVolumeModel.hh"
#include "G4ApplicationState.hh"
#include "G4UImanager.hh"
#include "G4UIcommand.hh"
#include "G4UIcmdWithAString.hh"
#include "G4ios.hh"
@@ -27,57 +28,55 @@
G4VVisCommandScene::G4VVisCommandScene () {}
G4VVisCommandScene::~G4VVisCommandScene () {}
void G4VVisCommandScene::UpdateCandidateLists () {
G4SceneDataObjectList& list = fpVisManager -> SetSceneDataObjectList ();
// Seems it has to be non-const to satisfy iterator.
G4SceneDataObjectListIterator iterator (list);
G4String fSceneNameList;
while (++iterator) {
fSceneNameList += iterator.key () + " ";
G4SceneList& sceneList = fpVisManager -> SetSceneList ();
G4int iScene, nScenes = sceneList.entries ();
G4String nameList;
for (iScene = 0; iScene < nScenes; iScene++) {
nameList += sceneList [iScene] -> GetName () + " ";
}
fSceneNameList = fSceneNameList.strip ();
nameList = nameList.strip ();
if (fpCommandSceneNotifyHandlers) {
fpCommandSceneNotifyHandlers -> GetParameter (0) ->
SetParameterCandidates (fSceneNameList);
SetParameterCandidates (nameList);
}
if (fpCommandSceneRemove) {
fpCommandSceneRemove -> GetParameter (0) ->
SetParameterCandidates (fSceneNameList);
SetParameterCandidates (nameList);
}
if (fpCommandSceneSelect) {
fpCommandSceneSelect -> GetParameter (0) ->
SetParameterCandidates (fSceneNameList);
SetParameterCandidates (nameList);
}
if (fpCommandSceneHandlerAttach) {
fpCommandSceneHandlerAttach -> GetParameter (0) ->
SetParameterCandidates (fSceneNameList);
SetParameterCandidates (nameList);
}
}
void G4VVisCommandScene::UpdateVisManagerSceneDataAndViewParameters
void G4VVisCommandScene::UpdateVisManagerSceneAndViewParameters
(const G4String& sceneName) {
G4SceneData& currentScene = fpVisManager -> SetCurrentSceneData ();
G4SceneDataObjectList& sceneList = fpVisManager -> SetSceneDataObjectList ();
if (sceneList.contains (sceneName)) {
currentScene = sceneList [sceneName];
G4ViewParameters& currentVP = fpVisManager -> SetCurrentViewParameters ();
currentVP.SetCurrentTargetPoint (currentScene.GetStandardTargetPoint ());
currentVP.SetZoomFactor (1.);
currentVP.SetDolly (0.);
G4SceneList& sceneList = fpVisManager -> SetSceneList ();
G4int iScene, nScenes = sceneList.entries ();
for (iScene = 0; iScene < nScenes; iScene++) {
if (sceneList [iScene] -> GetName () == sceneName) break;
}
if (iScene < nScenes) {
fpVisManager -> SetCurrentScene (sceneList [iScene]);
G4UImanager::GetUIpointer () -> ApplyCommand ("/vis/camera/reset");
}
else {
currentScene = G4SceneData ("invalid scene");
fpVisManager -> SetCurrentScene (0);
}
}
G4String G4VVisCommandScene::fSceneNameList;
////////////// /vis/scene/create ///////////////////////////////////////
G4VisCommandSceneCreate::G4VisCommandSceneCreate (): fId (0) {
@@ -117,16 +116,20 @@ void G4VisCommandSceneCreate::SetNewValue (G4UIcommand* command,
}
if (newName == nextName) fId++;
G4SceneDataObjectList& list = fpVisManager -> SetSceneDataObjectList ();
if (list.contains (newName)) {
G4SceneList& sceneList = fpVisManager -> SetSceneList ();
G4int iScene, nScenes = sceneList.entries ();
for (iScene = 0; iScene < nScenes; iScene++) {
if (sceneList [iScene] -> GetName () == newName) break;
}
if (iScene < nScenes) {
G4cout << "Scene \"" << newName << "\" already exists." << endl;
}
else {
list [newName] = G4SceneData (newName);
sceneList.append (new G4Scene (newName));
// Adds empty scene data object to list.
UpdateVisManagerSceneDataAndViewParameters (newName);
UpdateVisManagerSceneAndViewParameters (newName);
G4cout << "New empty scene \"" << newName << "\" created." << endl;
UpdateCandidateLists ();
@@ -171,17 +174,18 @@ void G4VisCommandSceneList::SetNewValue (G4UIcommand* command,
istrstream is ((char*)newValue.data());
is >> name >> verbosity;
G4SceneDataObjectList& list = fpVisManager -> SetSceneDataObjectList ();
G4SceneDataObjectListIterator iterator (list);
G4SceneList& sceneList = fpVisManager -> SetSceneList ();
G4int iScene, nScenes = sceneList.entries ();
G4bool found = false;
while (++iterator) {
for (iScene = 0; iScene < nScenes; iScene++) {
const G4String& iName = sceneList [iScene] -> GetName ();
if (name != "all") {
if (name != iterator.key ()) continue;
if (name != iName) continue;
}
found = true;
G4cout << "Scene name: \"" << iterator.key () << "\"";
G4cout << "Scene name: \"" << iName << "\"";
if (verbosity > 0) {
G4cout << ", " << iterator.value ();
G4cout << ", " << *sceneList [iScene];
}
G4cout << endl;
}
@@ -202,7 +206,9 @@ G4VisCommandSceneNotifyHandlers::G4VisCommandSceneNotifyHandlers () {
fpCommand -> SetGuidance ("/vis/scene/notifyHandlers [<scene-name>]");
fpCommand -> SetGuidance
("Notifies scene handlers of possible changes of scene.");
fpCommand -> SetGuidance ("<scene-name> default is current scene.");
fpCommand -> SetGuidance ("<scene-name> default is current scene name.");
fpCommand -> SetGuidance
("This command does not change current scene, scene handler or viewer.");
fpCommand -> SetParameterName ("scene-name",
omitable = true,
currentAsDefault = true);
@@ -215,28 +221,46 @@ G4VisCommandSceneNotifyHandlers::~G4VisCommandSceneNotifyHandlers () {
G4String G4VisCommandSceneNotifyHandlers::GetCurrentValue
(G4UIcommand* command) {
return fpVisManager -> GetCurrentSceneData ().GetName ();
return fpVisManager -> GetCurrentScene () -> GetName ();
}
void G4VisCommandSceneNotifyHandlers::SetNewValue (G4UIcommand* command,
G4String newValue) {
G4String& sceneName = newValue;
const G4SceneDataObjectList& sceneList =
fpVisManager -> GetSceneDataObjectList ();
G4SceneList& sceneHandlerList = fpVisManager -> SetAvailableScenes ();
const G4SceneList& sceneList = fpVisManager -> GetSceneList ();
G4SceneHandlerList& sceneHandlerList =
fpVisManager -> SetAvailableSceneHandlers ();
// Check scene name.
const G4int nScenes = sceneList.entries ();
G4int iScene;
for (iScene = 0; iScene < nScenes; iScene++) {
G4Scene* scene = sceneList [iScene];
if (sceneName == scene -> GetName ()) {
scene -> AddWorldIfEmpty ();
break;
}
}
if (iScene >= nScenes ) {
G4cout << "Scene \"" << sceneName << "\" not found."
"\n /vis/scene/list to see scenes."
<< endl;
return;
}
// For each scene handler, if it contains the scene, for each viewer
// clear, (re)draw, and show.
// set (make current), clear, (re)draw, and show.
const G4int nSceneHandlers = sceneHandlerList.entries ();
for (G4int iSH = 0; iSH < nSceneHandlers; iSH++) {
G4VScene* aSceneHandler = sceneHandlerList [iSH];
const G4SceneData& theScene = aSceneHandler -> GetSceneData ();
const G4String& theSceneName = theScene.GetName ();
G4VSceneHandler* aSceneHandler = sceneHandlerList [iSH];
G4Scene* theScene = aSceneHandler -> GetScene ();
const G4String& theSceneName = theScene -> GetName ();
if (sceneName == theSceneName) {
G4VViewList& viewerList = aSceneHandler -> SetViewList ();
G4ViewerList& viewerList = aSceneHandler -> SetViewerList ();
const G4int nViewers = viewerList.entries ();
for (G4int iV = 0; iV < nViewers; iV++) {
G4VView* aViewer = viewerList [iV];
G4VViewer* aViewer = viewerList [iV];
aViewer -> SetView ();
aViewer -> ClearView ();
aViewer -> DrawView ();
aViewer -> ShowView ();
@@ -269,30 +293,33 @@ G4VisCommandSceneRemove::~G4VisCommandSceneRemove () {
}
G4String G4VisCommandSceneRemove::GetCurrentValue (G4UIcommand* command) {
return fpVisManager -> GetCurrentSceneData ().GetName ();
return fpVisManager -> GetCurrentScene () -> GetName ();
}
void G4VisCommandSceneRemove::SetNewValue (G4UIcommand* command,
G4String newValue) {
G4String& removeName = newValue;
G4SceneDataObjectList& list = fpVisManager -> SetSceneDataObjectList ();
const G4String& currentSceneName =
fpVisManager -> GetCurrentSceneData ().GetName ();
if (list.contains (removeName)) {
list.remove (removeName);
fpVisManager -> GetCurrentScene () -> GetName ();
G4SceneList& sceneList = fpVisManager -> SetSceneList ();
G4int iScene, nScenes = sceneList.entries ();
for (iScene = 0; iScene < nScenes; iScene++) {
if (sceneList [iScene] -> GetName () == removeName) break;
}
if (iScene < nScenes) {
delete sceneList [iScene];
sceneList.removeAt (iScene);
G4cout << "Scene \"" << removeName << "\" removed." << endl;
UpdateCandidateLists ();
if (list.isEmpty ()) {
UpdateVisManagerSceneDataAndViewParameters ();
if (sceneList.isEmpty ()) {
UpdateVisManagerSceneAndViewParameters ();
G4cout << "No scenes left. Please create a new one." << endl;
}
else {
if (currentSceneName == removeName) {
G4SceneDataObjectListIterator iterator (list);
++iterator;
UpdateVisManagerSceneDataAndViewParameters (iterator.key ());
UpdateVisManagerSceneAndViewParameters (sceneList [0] -> GetName ());
G4cout << "Current scene is now \""
<< fpVisManager -> GetCurrentSceneData ().GetName ()
<< fpVisManager -> GetCurrentScene () -> GetName ()
<< "\"" << endl;
}
else {
@@ -327,16 +354,20 @@ G4VisCommandSceneSelect::~G4VisCommandSceneSelect () {
}
G4String G4VisCommandSceneSelect::GetCurrentValue (G4UIcommand* command) {
return fpVisManager -> GetCurrentSceneData ().GetName ();
return fpVisManager -> GetCurrentScene () -> GetName ();
}
void G4VisCommandSceneSelect::SetNewValue (G4UIcommand* command,
G4String newValue) {
G4String& selectName = newValue;
G4SceneDataObjectList& list = fpVisManager -> SetSceneDataObjectList ();
G4SceneList& sceneList = fpVisManager -> SetSceneList ();
G4int iScene, nScenes = sceneList.entries ();
for (iScene = 0; iScene < nScenes; iScene++) {
if (sceneList [iScene] -> GetName () == selectName) break;
}
G4cout << "Scene \"" << selectName;
if (list.contains (selectName)) {
UpdateVisManagerSceneDataAndViewParameters (selectName);
if (iScene < nScenes) {
UpdateVisManagerSceneAndViewParameters (selectName);
G4cout << "\" selected." << endl;
}
else {
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsSceneAdd.cc,v 2.6 1998/11/29 15:34:08 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsSceneAdd.cc,v 1.5 1999/04/16 09:06:09 mora Exp $
// GEANT4 tag $Name: geant4-00-01 $
// /vis/scene commands - John Allison 9th August 1998
@@ -17,7 +17,7 @@
#include "G4PhysicalVolumeModel.hh"
#include "G4ModelingParameters.hh"
#include "G4PhysicalVolumeSearchScene.hh"
#include "G4GlobalFastSimulationManager.hh"
#include "G4VGlobalFastSimulationManager.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4FlavoredParallelWorldModel.hh"
@@ -42,11 +42,13 @@ G4VisCommandSceneAddVolume::G4VisCommandSceneAddVolume () {
fpCommand -> SetGuidance ("Adds a physical volume to the current scene.");
fpCommand -> SetGuidance
("1st parameter: volume name (default \"world\").");
fpCommand -> SetGuidance
(" \"list\" to list all volumes.");
fpCommand -> SetGuidance
("2nd parameter: copy number (default 0).");
fpCommand -> SetGuidance
("3rd parameter: depth of descending geometry hierarchy"
" (default G4SceneData::UNLIMITED (-1)).");
" (default G4Scene::UNLIMITED (-1)).");
G4UIparameter* parameter;
parameter = new G4UIparameter ("volume", 's', omitable = true);
parameter -> SetDefaultValue ("world");
@@ -55,7 +57,7 @@ G4VisCommandSceneAddVolume::G4VisCommandSceneAddVolume () {
parameter -> SetDefaultValue (0);
fpCommand -> SetParameter (parameter);
parameter = new G4UIparameter ("depth", 'i', omitable = true);
parameter -> SetDefaultValue (G4SceneData::UNLIMITED);
parameter -> SetDefaultValue (G4Scene::UNLIMITED);
fpCommand -> SetParameter (parameter);
}
@@ -64,13 +66,13 @@ G4VisCommandSceneAddVolume::~G4VisCommandSceneAddVolume () {
}
G4String G4VisCommandSceneAddVolume::GetCurrentValue (G4UIcommand* command) {
return "";
return "world 0 -1";
}
void G4VisCommandSceneAddVolume::SetNewValue (G4UIcommand* command,
G4String newValue) {
G4SceneDataObjectList& list = fpVisManager -> SetSceneDataObjectList ();
if (list.isEmpty ()) {
G4SceneList& sceneList = fpVisManager -> SetSceneList ();
if (sceneList.isEmpty ()) {
G4cout << "No scenes - please create one before adding anything."
<< endl;
return;
@@ -101,13 +103,23 @@ void G4VisCommandSceneAddVolume::SetNewValue (G4UIcommand* command,
}
}
else {
// Create search scene, model and modeling parameters with
// long-enough life...
G4PhysicalVolumeSearchScene searchScene (name, copyNo);
G4PhysicalVolumeModel searchModel (world);
G4ModelingParameters mp;
searchModel.SetModelingParameters (&mp);
// Initiate search...
searchModel.DescribeYourselfTo (searchScene);
// OK, what have we got...?
foundVolume = searchScene.GetFoundVolume ();
const G4Transform3D&
transformation = searchScene.GetFoundTransformation ();
foundDepth = searchScene.GetFoundDepth ();
if (foundVolume) {
model = new G4PhysicalVolumeModel (foundVolume,
requestedDepthOfDescent,
@@ -120,10 +132,10 @@ void G4VisCommandSceneAddVolume::SetNewValue (G4UIcommand* command,
}
if (model) {
const G4String& currentSceneName =
fpVisManager -> GetCurrentSceneData ().GetName ();
(list [currentSceneName]).AddRunDurationModel (model);
UpdateVisManagerSceneDataAndViewParameters (currentSceneName);
G4Scene* pScene = fpVisManager -> GetCurrentScene ();
const G4String& currentSceneName = pScene -> GetName ();
pScene -> AddRunDurationModel (model);
UpdateVisManagerSceneAndViewParameters (currentSceneName);
G4cout << "First occurrence of \"" << foundVolume -> GetName ()
<< "\", copy no. " << copyNo
<< ", found at depth " << foundDepth
@@ -160,40 +172,40 @@ G4String G4VisCommandSceneAddGhosts::GetCurrentValue (G4UIcommand* command) {
void G4VisCommandSceneAddGhosts::SetNewValue (G4UIcommand* command,
G4String newValue) {
const G4String& currentSceneName =
fpVisManager -> GetCurrentSceneData ().GetName ();
G4Scene* pCurrentScene = fpVisManager -> GetCurrentScene ();
const G4String& currentSceneName = pCurrentScene -> GetName ();
G4SceneDataObjectList& list = fpVisManager -> SetSceneDataObjectList ();
if (list.isEmpty ()) {
G4SceneList& sceneList = fpVisManager -> SetSceneList ();
if (sceneList.isEmpty ()) {
G4cout << "No scenes - please create one before adding anything."
<< endl;
return;
}
G4GlobalFastSimulationManager* theGlobalFastSimulationManager;
G4VGlobalFastSimulationManager* theGlobalFastSimulationManager;
if(!(theGlobalFastSimulationManager =
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager())){
G4VGlobalFastSimulationManager::GetConcreteInstance ())){
G4cout<< "WARNING: no G4GlobalFastSimulationManager" << endl;
return;
}
G4ParticleTable* theParticleTable=G4ParticleTable::GetParticleTable();
if(newValue=="all") {
G4FlavoredParallelWorld* CurrentFlavoredWorld;
G4VFlavoredParallelWorld* CurrentFlavoredWorld;
for (G4int iParticle=0; iParticle<theParticleTable->entries();
iParticle++)
if(CurrentFlavoredWorld=theGlobalFastSimulationManager->
GetFlavoredWorldForThis(theParticleTable->
GetParticle(iParticle)))
(list [currentSceneName]).AddRunDurationModel
pCurrentScene -> AddRunDurationModel
(new G4FlavoredParallelWorldModel (CurrentFlavoredWorld));
UpdateVisManagerSceneDataAndViewParameters ();
UpdateVisManagerSceneAndViewParameters ();
G4cout << "Ghosts added to the Scene, refresh the view to see it."
<< endl;
return;
}
G4ParticleDefinition* currentParticle =
theParticleTable->FindParticle(newValue);
if (currentParticle == NULL) {
@@ -201,12 +213,12 @@ void G4VisCommandSceneAddGhosts::SetNewValue (G4UIcommand* command,
return;
}
G4FlavoredParallelWorld* worldForThis;
G4VFlavoredParallelWorld* worldForThis;
if(worldForThis=theGlobalFastSimulationManager->
GetFlavoredWorldForThis(currentParticle)) {
(list [currentSceneName]).AddRunDurationModel
pCurrentScene -> AddRunDurationModel
(new G4FlavoredParallelWorldModel (worldForThis));
UpdateVisManagerSceneDataAndViewParameters (currentSceneName);
UpdateVisManagerSceneAndViewParameters (currentSceneName);
G4cout << "Ghosts added to the Scene, refresh the view to see it."
<< endl;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsSceneHandler.cc,v 1.5 1998/12/09 23:56:29 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsSceneHandler.cc,v 1.7 1999/05/12 13:58:48 barrand Exp $
// GEANT4 tag $Name: geant4-00-01 $
// /vis/sceneHandler commands - John Allison 10th October 1998
@@ -15,6 +15,7 @@
#include "G4VisManager.hh"
#include "G4GraphicsSystemList.hh"
#include "G4VisCommandsScene.hh"
#include "G4UImanager.hh"
#include "G4UIcommand.hh"
#include "G4UIcmdWithAString.hh"
#include "G4ios.hh"
@@ -26,13 +27,16 @@
G4VVisCommandSceneHandler::G4VVisCommandSceneHandler () {}
G4VVisCommandSceneHandler::~G4VVisCommandSceneHandler () {}
void G4VVisCommandSceneHandler::UpdateCandidateLists () {
const G4SceneList& list = fpVisManager -> GetAvailableScenes ();
const G4SceneHandlerList& list =
fpVisManager -> GetAvailableSceneHandlers ();
fSceneHandlerNameList = G4String ();
for (int iScene = 0; iScene < list.entries (); iScene++) {
G4VScene* sceneHandler = list [iScene];
G4VSceneHandler* sceneHandler = list [iScene];
fSceneHandlerNameList += sceneHandler -> GetName () + " ";
}
fSceneHandlerNameList = fSceneHandlerNameList.strip ();
@@ -79,7 +83,8 @@ G4VisCommandSceneHandlerAttach::~G4VisCommandSceneHandlerAttach () {
}
G4String G4VisCommandSceneHandlerAttach::GetCurrentValue (G4UIcommand* command) {
return fpVisManager -> GetCurrentSceneData ().GetName ();
G4Scene* pScene = fpVisManager -> GetCurrentScene ();
return pScene ? pScene -> GetName () : G4String("");
}
void G4VisCommandSceneHandlerAttach::SetNewValue (G4UIcommand* command,
@@ -93,7 +98,7 @@ void G4VisCommandSceneHandlerAttach::SetNewValue (G4UIcommand* command,
return;
}
G4VScene* pSceneHandler = fpVisManager -> GetCurrentScene ();
G4VSceneHandler* pSceneHandler = fpVisManager -> GetCurrentSceneHandler ();
if (!pSceneHandler) {
G4cout <<
"Current scene handler not defined. Please select or create one."
@@ -101,12 +106,24 @@ void G4VisCommandSceneHandlerAttach::SetNewValue (G4UIcommand* command,
return;
}
G4SceneDataObjectList& sceneList =
fpVisManager -> SetSceneDataObjectList ();
if (sceneList.contains (sceneName)) {
const G4SceneData& scene = sceneList [sceneName];
pSceneHandler -> SetSceneData (scene);
fpVisManager -> SetCurrentSceneData () = scene;
G4SceneList& sceneList =
fpVisManager -> SetSceneList ();
if (sceneList.isEmpty ()) {
G4cout <<
"No valid scenes available yet. Please create one."
<< endl;
return;
}
G4int iScene, nScenes = sceneList.entries ();
for (iScene = 0; iScene < nScenes; iScene++) {
if (sceneList [iScene] -> GetName () == sceneName) break;
}
if (iScene < nScenes) {
G4Scene* pScene = sceneList [iScene];
pSceneHandler -> SetScene (pScene);
fpVisManager -> SetCurrentScene (pScene);
G4cout << "Scene \"" << sceneName
<< "\" attached to scene handler \"" << pSceneHandler -> GetName ()
<< "." << endl;
@@ -124,28 +141,41 @@ G4VisCommandSceneHandlerCreate::G4VisCommandSceneHandlerCreate (): fId (0) {
G4bool omitable;
fpCommand = new G4UIcommand ("/vis/sceneHandler/create", this);
fpCommand -> SetGuidance
("/vis/sceneHandler/create [<graphics-system>] [<scene-handler-name>]");
("/vis/sceneHandler/create");
fpCommand -> SetGuidance
(" <graphics-system> [<scene-handler-name>] [<scene-name>]");
fpCommand -> SetGuidance
("Creates an scene handler for a specific graphics system.");
fpCommand -> SetGuidance
("Default graphics system is current graphics system.");
fpCommand -> SetGuidance ("Invents a name if not supplied.");
("Attaches specified scene.");
fpCommand -> SetGuidance
("This graphics system and scene handler become current.");
("Default graphics system is current graphics system.");
fpCommand -> SetGuidance
("Invents a name if not supplied.");
fpCommand -> SetGuidance
("Default scene is current scene. You can change attached scenes with");
fpCommand -> SetGuidance
(" /vis/sceneHandler/attach [<scene-name>].");
fpCommand -> SetGuidance
("This graphics system, scene handler and scene become current.");
G4UIparameter* parameter;
parameter = new G4UIparameter ("graphics-system", 's', omitable = true);
parameter -> SetCurrentAsDefault (true);
parameter = new G4UIparameter ("graphics-system", 's', omitable = false);
//parameter -> SetCurrentAsDefault (true);
const G4GraphicsSystemList& gslist =
fpVisManager -> GetAvailableGraphicsSystems ();
G4String candidates;
for (int igslist = 0; igslist < gslist.entries (); igslist++) {
G4String name = gslist (igslist) -> GetName ();
G4String nickname = gslist (igslist) -> GetNickname ();
if (nickname.length () > 0) {
candidates += nickname + " ";
const G4String& name = gslist (igslist) -> GetName ();
const G4String& nickname = gslist (igslist) -> GetNickname ();
if (nickname.isNull ()) {
candidates += name;
}
candidates += name + " ";
else {
candidates += nickname;
}
candidates += " ";
}
candidates = candidates.strip ();
parameter -> SetParameterCandidates(candidates);
fpCommand -> SetParameter (parameter);
parameter = new G4UIparameter
@@ -167,23 +197,41 @@ G4String G4VisCommandSceneHandlerCreate::NextName () {
G4String G4VisCommandSceneHandlerCreate::GetCurrentValue
(G4UIcommand* command) {
G4String graphicsSystemName;
const G4GraphicsSystemList& gslist =
fpVisManager -> GetAvailableGraphicsSystems ();
if (gslist.entries ()) {
graphicsSystemName = gslist [0] -> GetName ();
const G4VGraphicsSystem* graphicsSystem =
fpVisManager -> GetCurrentGraphicsSystem ();
if (graphicsSystem) {
graphicsSystemName = graphicsSystem -> GetName ();
}
else {
graphicsSystemName = "none";
const G4GraphicsSystemList& gslist =
fpVisManager -> GetAvailableGraphicsSystems ();
if (gslist.entries ()) {
graphicsSystemName = gslist [0] -> GetName ();
}
else {
graphicsSystemName = "none";
}
}
return graphicsSystemName + " " + NextName ();
G4String sceneName;
const G4VSceneHandler* scene = fpVisManager -> GetCurrentSceneHandler ();
if (scene) {
sceneName = scene -> GetName ();
}
else {
sceneName = "none";
}
return graphicsSystemName + " " + NextName () + " " + sceneName;
}
void G4VisCommandSceneHandlerCreate::SetNewValue (G4UIcommand* command,
G4String newValue) {
G4String graphicsSystem, newName;
G4String graphicsSystem, newName, sceneName;
istrstream is ((char*)newValue.data());
is >> graphicsSystem >> newName;
is >> graphicsSystem >> newName >> sceneName;
const G4GraphicsSystemList& gsl =
fpVisManager -> GetAvailableGraphicsSystems ();
@@ -219,9 +267,6 @@ void G4VisCommandSceneHandlerCreate::SetNewValue (G4UIcommand* command,
fpVisManager -> SetCurrentGraphicsSystem (pSystem);
if (fpVisManager -> GetVerboseLevel () > 0) {
G4cout << "Graphics system set to " << pSystem -> GetName () << endl;
if (fpVisManager -> GetVerboseLevel () > 1) {
fpVisManager -> PrintCurrentSystem ();
}
}
// Now deal with name of scene handler.
@@ -231,10 +276,10 @@ void G4VisCommandSceneHandlerCreate::SetNewValue (G4UIcommand* command,
}
if (newName == nextName) fId++;
const G4SceneList& list = fpVisManager -> GetAvailableScenes ();
const G4SceneHandlerList& list = fpVisManager -> GetAvailableSceneHandlers ();
int iScene;
for (iScene = 0; iScene < list.entries (); iScene++) {
G4VScene* sceneHandler = list [iScene];
G4VSceneHandler* sceneHandler = list [iScene];
if (sceneHandler -> GetName () == newName) {
G4cout << "Scene handler \"" << newName << "\" already exists." << endl;
return;
@@ -242,9 +287,13 @@ void G4VisCommandSceneHandlerCreate::SetNewValue (G4UIcommand* command,
}
//Create scene handler.
fpVisManager -> CreateScene (newName);
fpVisManager -> CreateSceneHandler (newName);
G4cout << "New scene handler \"" << newName << "\" created." << endl;
// Attach scene.
G4String commandString = "/vis/sceneHandler/attach " + sceneName;
G4UImanager::GetUIpointer () -> ApplyCommand (commandString);
UpdateCandidateLists ();
}
@@ -287,7 +336,7 @@ void G4VisCommandSceneHandlerList::SetNewValue (G4UIcommand* command,
istrstream is ((char*)newValue.data());
is >> name >> verbosity;
const G4SceneList& list = fpVisManager -> GetAvailableScenes ();
const G4SceneHandlerList& list = fpVisManager -> GetAvailableSceneHandlers ();
G4bool found = false;
for (int iSH = 0; iSH < list.entries (); iSH++) {
if (name != "all") {
@@ -331,7 +380,7 @@ G4VisCommandSceneHandlerRemove::~G4VisCommandSceneHandlerRemove () {
}
G4String G4VisCommandSceneHandlerRemove::GetCurrentValue (G4UIcommand* command) {
G4VScene* sceneHandler = fpVisManager -> GetCurrentScene ();
G4VSceneHandler* sceneHandler = fpVisManager -> GetCurrentSceneHandler ();
if (sceneHandler) {
return sceneHandler -> GetName ();
}
@@ -343,13 +392,14 @@ G4String G4VisCommandSceneHandlerRemove::GetCurrentValue (G4UIcommand* command)
void G4VisCommandSceneHandlerRemove::SetNewValue (G4UIcommand* command,
G4String newValue) {
G4String& removeName = newValue;
G4VScene* currentSceneHandler = fpVisManager -> GetCurrentScene ();
G4VSceneHandler* currentSceneHandler =
fpVisManager -> GetCurrentSceneHandler ();
G4String currentName;
if (currentSceneHandler) {
currentName = currentSceneHandler -> GetName ();
}
G4SceneList& list = fpVisManager -> SetAvailableScenes ();
G4SceneHandlerList& list = fpVisManager -> SetAvailableSceneHandlers ();
G4int iSH;
for (iSH = 0; iSH < list.entries (); iSH++) {
if (list [iSH] -> GetName () == removeName) break;
@@ -364,7 +414,7 @@ void G4VisCommandSceneHandlerRemove::SetNewValue (G4UIcommand* command,
G4cout << "Scene handler \"" << removeName << "\" removed." << endl;
if (removeName == currentName) {
fpVisManager -> DeleteCurrentScene ();
fpVisManager -> DeleteCurrentSceneHandler ();
}
else {
list.remove (list [iSH]);
@@ -396,7 +446,7 @@ G4VisCommandSceneHandlerSelect::~G4VisCommandSceneHandlerSelect () {
G4String G4VisCommandSceneHandlerSelect::GetCurrentValue
(G4UIcommand* command) {
G4VScene* sceneHandler = fpVisManager -> GetCurrentScene ();
G4VSceneHandler* sceneHandler = fpVisManager -> GetCurrentSceneHandler ();
if (sceneHandler) {
return sceneHandler -> GetName ();
}
@@ -408,19 +458,19 @@ G4String G4VisCommandSceneHandlerSelect::GetCurrentValue
void G4VisCommandSceneHandlerSelect::SetNewValue (G4UIcommand* command,
G4String newValue) {
G4String& selectName = newValue;
const G4SceneList& list = fpVisManager -> GetAvailableScenes ();
const G4SceneHandlerList& list = fpVisManager -> GetAvailableSceneHandlers ();
G4cout << "Scene handler \"" << selectName << "\"";
G4int iSH;
for (iSH = 0; iSH < list.entries (); iSH++) {
if (list [iSH] -> GetName () == selectName) break;
}
if (iSH < list.entries ()) {
if (fpVisManager -> GetCurrentScene () -> GetName () == selectName) {
if (fpVisManager -> GetCurrentSceneHandler () -> GetName () == selectName) {
G4cout << " already selected." << endl;
}
else {
G4cout << " being selected." << endl;
fpVisManager -> SetCurrentScene (list [iSH]);
fpVisManager -> SetCurrentSceneHandler (list [iSH]);
}
}
else {
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsSceneInclude.cc,v 2.3 1998/11/29 15:34:10 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsSceneInclude.cc,v 1.3 1999/01/11 00:48:34 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// /vis/scene commands - John Allison 9th August 1998
@@ -39,7 +39,7 @@ G4String G4VisCommandSceneIncludeHits::GetCurrentValue (G4UIcommand* command) {
void G4VisCommandSceneIncludeHits::SetNewValue (G4UIcommand* command,
G4String newValue) {
G4SceneDataObjectList& list = fpVisManager -> SetSceneDataObjectList ();
G4SceneList& list = fpVisManager -> SetSceneList ();
if (list.isEmpty ()) {
G4cout << "No scenes - please create one before adding anything."
<< endl;
@@ -47,12 +47,11 @@ void G4VisCommandSceneIncludeHits::SetNewValue (G4UIcommand* command,
}
G4HitsModel* model = new G4HitsModel;
const G4String& currentSceneName =
fpVisManager -> GetCurrentSceneData ().GetName ();
(list [currentSceneName]).AddEndOfEventModel (model);
UpdateVisManagerSceneDataAndViewParameters ();
G4cout << "Hits will be drawn at end of event when scene \""
<< currentSceneName << "\" is current"
G4Scene* pCurrentScene = fpVisManager -> GetCurrentScene ();
const G4String& currentSceneName = pCurrentScene -> GetName ();
pCurrentScene -> AddEndOfEventModel (model);
G4cout << "Hits will be drawn in scene \""
<< currentSceneName << "\"."
<< endl;
}
@@ -79,7 +78,7 @@ G4String G4VisCommandSceneIncludeTrajectories::GetCurrentValue (G4UIcommand* com
void G4VisCommandSceneIncludeTrajectories::SetNewValue (G4UIcommand* command,
G4String newValue) {
G4SceneDataObjectList& list = fpVisManager -> SetSceneDataObjectList ();
G4SceneList& list = fpVisManager -> SetSceneList ();
if (list.isEmpty ()) {
G4cout << "No scenes - please create one before adding anything."
<< endl;
@@ -87,11 +86,10 @@ void G4VisCommandSceneIncludeTrajectories::SetNewValue (G4UIcommand* command,
}
G4TrajectoriesModel* model = new G4TrajectoriesModel;
const G4String& currentSceneName =
fpVisManager -> GetCurrentSceneData ().GetName ();
(list [currentSceneName]).AddEndOfEventModel (model);
UpdateVisManagerSceneDataAndViewParameters ();
G4cout << "Trajectories will be drawn at end of event when scene \""
<< currentSceneName << "\" is current"
G4Scene* pCurrentScene = fpVisManager -> GetCurrentScene ();
const G4String& currentSceneName = pCurrentScene -> GetName ();
pCurrentScene -> AddEndOfEventModel (model);
G4cout << "Trajectories will be drawn in scene \""
<< currentSceneName << "\"."
<< endl;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisCommandsViewer.cc,v 2.3 1998/12/09 23:56:30 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisCommandsViewer.cc,v 1.6 1999/05/10 14:04:18 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// /vis/viewer commands - John Allison 25th October 1998
@@ -26,23 +26,25 @@
G4VVisCommandViewer::G4VVisCommandViewer () {}
G4VVisCommandViewer::~G4VVisCommandViewer () {}
G4String G4VVisCommandViewer::ShortName (const G4String& name) {
G4String shortName = name;
if (name.contains (' ')) {
shortName = name (0, name.first (' '));
G4String shortName (name);
if (shortName.contains (' ')) {
shortName = shortName (0, shortName.first (' '));
}
return shortName;
}
void G4VVisCommandViewer::UpdateCandidateLists () {
const G4SceneList& sceneHandlerList = fpVisManager -> GetAvailableScenes ();
const G4SceneHandlerList& sceneHandlerList = fpVisManager -> GetAvailableSceneHandlers ();
G4int nHandlers = sceneHandlerList.entries ();
fViewerNameList = G4String ();
for (int iHandler = 0; iHandler < nHandlers; iHandler++) {
G4VScene* sceneHandler = sceneHandlerList [iHandler];
const G4VViewList& viewerList = sceneHandler -> GetViewList ();
G4VSceneHandler* sceneHandler = sceneHandlerList [iHandler];
const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
for (int iViewer = 0; iViewer < viewerList.entries (); iViewer++) {
const G4String& viewerName = viewerList [iViewer] -> GetName ();
fViewerNameList += ShortName (viewerName) + " ";
@@ -99,7 +101,7 @@ G4String G4VisCommandViewerCreate::NextName () {
const int charLength = 100;
char nextName [charLength];
ostrstream ost (nextName, charLength);
G4VScene* sceneHandler = fpVisManager -> GetCurrentScene ();
G4VSceneHandler* sceneHandler = fpVisManager -> GetCurrentSceneHandler ();
ost << "viewer-" << fId << " (";
if (sceneHandler) {
ost << sceneHandler -> GetGraphicsSystem () -> GetName ();
@@ -113,7 +115,8 @@ G4String G4VisCommandViewerCreate::NextName () {
G4String G4VisCommandViewerCreate::GetCurrentValue (G4UIcommand* command) {
G4String currentValue;
G4VScene* currentSceneHandler = fpVisManager -> GetCurrentScene ();
G4VSceneHandler* currentSceneHandler =
fpVisManager -> GetCurrentSceneHandler ();
if (currentSceneHandler) {
currentValue = currentSceneHandler -> GetName ();
}
@@ -152,11 +155,11 @@ void G4VisCommandViewerCreate::SetNewValue (G4UIcommand* command,
newName = newName.strip (G4String::both, ' ');
newName = newName.strip (G4String::both, '"');
const G4SceneList& sceneHandlerList = fpVisManager -> GetAvailableScenes ();
const G4SceneHandlerList& sceneHandlerList = fpVisManager -> GetAvailableSceneHandlers ();
G4int nHandlers = sceneHandlerList.entries ();
if (nHandlers <= 0) {
G4cout << "G4VisCommandViewerCreate::SetNewValue: no scene handlers."
"\n Create a scene handler with \"/vis/create/sceneHandler\""
"\n Create a scene handler with \"/vis/sceneHandler/create\""
<< endl;
return;
}
@@ -177,9 +180,9 @@ void G4VisCommandViewerCreate::SetNewValue (G4UIcommand* command,
// Valid index. Set current scene handler and graphics system in
// preparation for creating viewer.
G4VScene* sceneHandler = sceneHandlerList [iHandler];
if (sceneHandler != fpVisManager -> GetCurrentScene ()) {
fpVisManager -> SetCurrentScene (sceneHandler);
G4VSceneHandler* sceneHandler = sceneHandlerList [iHandler];
if (sceneHandler != fpVisManager -> GetCurrentSceneHandler ()) {
fpVisManager -> SetCurrentSceneHandler (sceneHandler);
}
// Now deal with name of viewer.
@@ -190,8 +193,8 @@ void G4VisCommandViewerCreate::SetNewValue (G4UIcommand* command,
if (newName == nextName) fId++;
for (iHandler = 0; iHandler < nHandlers; iHandler++) {
G4VScene* sceneHandler = sceneHandlerList [iHandler];
const G4VViewList& viewerList = sceneHandler -> GetViewList ();
G4VSceneHandler* sceneHandler = sceneHandlerList [iHandler];
const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
for (int iViewer = 0; iViewer < viewerList.entries (); iViewer++) {
if (viewerList [iViewer] -> GetName () == newName ) {
G4cout << "Viewer \"" << newName << "\" already exists." << endl;
@@ -201,7 +204,7 @@ void G4VisCommandViewerCreate::SetNewValue (G4UIcommand* command,
}
// Create viewer.
fpVisManager -> CreateView (newName);
fpVisManager -> CreateViewer (newName);
G4cout << "New viewer \"" << newName << "\" created." << endl;
UpdateCandidateLists ();
@@ -245,34 +248,67 @@ void G4VisCommandViewerList::SetNewValue (G4UIcommand* command,
G4int verbosity;
istrstream is ((char*)newValue.data());
is >> name >> verbosity;
G4String shortName = ShortName (name);
G4bool found = false;
const G4SceneList& sceneHandlerList = fpVisManager -> GetAvailableScenes ();
const G4VViewer* currentViewer = fpVisManager -> GetCurrentViewer ();
G4String currentViewerShortName;
if (currentViewer) {
currentViewerShortName = ShortName (currentViewer -> GetName ());
}
else {
currentViewerShortName = "none";
}
const G4SceneHandlerList& sceneHandlerList = fpVisManager -> GetAvailableSceneHandlers ();
G4int nHandlers = sceneHandlerList.entries ();
G4bool found = false;
G4bool foundCurrent = false;
for (int iHandler = 0; iHandler < nHandlers; iHandler++) {
G4VScene* sceneHandler = sceneHandlerList [iHandler];
const G4VViewList& viewerList = sceneHandler -> GetViewList ();
for (int iViewer = 0; iViewer < viewerList.entries (); iViewer++) {
if (name != "all") {
if (name != viewerList [iViewer] -> GetName ()) continue;
}
found = true;
G4cout << "Scene handler \"" << sceneHandler -> GetName ()
<< "\": viewer \"" << viewerList [iViewer] -> GetName ()
<< "\"";
if (verbosity > 0) {
G4cout << "\n " << *(viewerList [iViewer]);
G4VSceneHandler* sceneHandler = sceneHandlerList [iHandler];
const G4Scene* pScene = sceneHandler -> GetScene ();
const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
G4cout << "Scene handler \"" << sceneHandler -> GetName ()
<< "\", scene \"" << pScene -> GetName () << "\":";
G4int nViewers = viewerList.entries ();
if (nViewers == 0) {
G4cout << "\n No viewers for this scene handler." << endl;
}
else {
for (int iViewer = 0; iViewer < nViewers; iViewer++) {
const G4VViewer* thisViewer = viewerList [iViewer];
G4String thisName = thisViewer -> GetName ();
G4String thisShortName = ShortName (thisName);
if (name != "all") {
if (thisShortName != shortName) continue;
}
found = true;
G4cout << "\n ";
if (thisShortName == currentViewerShortName) {
foundCurrent = true;
G4cout << "(current)";
}
else {
G4cout << " ";
}
G4cout << " viewer \"" << thisName << "\"";
if (verbosity > 0) {
G4cout << "\n " << *thisViewer << '\n';
}
}
G4cout << endl;
}
}
if (!foundCurrent) {
G4cout << "No valid current viewer - please create or select one." << endl;
}
if (!found) {
G4cout << "No viewers found";
G4cout << "No viewers";
if (name != "all") {
G4cout << " of name \"" << name << "\"";
}
G4cout << "." << endl;
G4cout << " found." << endl;
}
}
@@ -297,7 +333,7 @@ G4VisCommandViewerRemove::~G4VisCommandViewerRemove () {
}
G4String G4VisCommandViewerRemove::GetCurrentValue (G4UIcommand* command) {
G4VView* viewer = fpVisManager -> GetCurrentView ();
G4VViewer* viewer = fpVisManager -> GetCurrentViewer ();
if (viewer) {
return viewer -> GetName ();
}
@@ -310,22 +346,25 @@ void G4VisCommandViewerRemove::SetNewValue (G4UIcommand* command,
G4String newValue) {
G4String& removeName = newValue;
G4String removeShortName = ShortName (removeName);
G4VView* currentViewer = fpVisManager -> GetCurrentView ();
G4VViewer* currentViewer = fpVisManager -> GetCurrentViewer ();
G4String currentName;
if (currentViewer) {
currentName = currentViewer -> GetName ();
}
else {
currentName = "none";
}
G4String currentShortName = ShortName (currentName);
const G4SceneList& sceneHandlerList = fpVisManager -> GetAvailableScenes ();
const G4SceneHandlerList& sceneHandlerList = fpVisManager -> GetAvailableSceneHandlers ();
G4int nHandlers = sceneHandlerList.entries ();
G4int iHandler, iViewer;
G4VScene* sceneHandler;
G4VView* viewer;
G4VSceneHandler* sceneHandler;
G4VViewer* viewer;
G4bool found = false;
for (iHandler = 0; iHandler < nHandlers; iHandler++) {
sceneHandler = sceneHandlerList [iHandler];
const G4VViewList& viewerList = sceneHandler -> GetViewList ();
const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
for (iViewer = 0; iViewer < viewerList.entries (); iViewer++) {
viewer = viewerList [iViewer];
const G4String& viewerName = viewer -> GetName ();
@@ -345,10 +384,10 @@ void G4VisCommandViewerRemove::SetNewValue (G4UIcommand* command,
G4cout << "Viewer \"" << removeName << "\" removed." << endl;
if (removeShortName == currentShortName) {
fpVisManager -> DeleteCurrentView ();
fpVisManager -> DeleteCurrentViewer ();
}
else {
sceneHandler -> SetViewList ().remove (viewer);
sceneHandler -> SetViewerList ().remove (viewer);
G4cout << "Current viewer unchanged." << endl;
}
@@ -377,7 +416,7 @@ G4VisCommandViewerSelect::~G4VisCommandViewerSelect () {
G4String G4VisCommandViewerSelect::GetCurrentValue
(G4UIcommand* command) {
G4VView* viewer = fpVisManager -> GetCurrentView ();
G4VViewer* viewer = fpVisManager -> GetCurrentViewer ();
if (viewer) {
return viewer -> GetName ();
}
@@ -391,15 +430,16 @@ void G4VisCommandViewerSelect::SetNewValue (G4UIcommand* command,
G4String& selectName = newValue;
G4String selectShortName = ShortName (selectName);
const G4SceneList& sceneHandlerList = fpVisManager -> GetAvailableScenes ();
const G4SceneHandlerList& sceneHandlerList =
fpVisManager -> GetAvailableSceneHandlers ();
G4int nHandlers = sceneHandlerList.entries ();
G4int iHandler, iViewer;
G4VScene* sceneHandler;
G4VView* viewer;
G4VSceneHandler* sceneHandler;
G4VViewer* viewer;
G4bool found = false;
for (iHandler = 0; iHandler < nHandlers; iHandler++) {
sceneHandler = sceneHandlerList [iHandler];
const G4VViewList& viewerList = sceneHandler -> GetViewList ();
const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
for (iViewer = 0; iViewer < viewerList.entries (); iViewer++) {
viewer = viewerList [iViewer];
if (selectShortName == ShortName (viewer -> GetName ())) {
@@ -407,17 +447,19 @@ void G4VisCommandViewerSelect::SetNewValue (G4UIcommand* command,
break;
}
}
if (found) break;
}
G4cout << "Viewer \"" << selectName << "\"";
if (found) {
if (ShortName (fpVisManager -> GetCurrentView () -> GetName ())
== selectShortName) {
G4VViewer* currentViewer = fpVisManager -> GetCurrentViewer ();
if (currentViewer &&
ShortName (currentViewer -> GetName ()) == selectShortName) {
G4cout << " already selected." << endl;
}
else {
G4cout << " being selected." << endl;
fpVisManager -> SetCurrentView (viewer);
fpVisManager -> SetCurrentViewer (viewer);
}
}
else {
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisFeaturesOfDAWNFILE.cc,v 2.2 1998/07/12 03:10:19 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisFeaturesOfDAWNFILE.cc,v 1.2 1999/01/09 16:31:25 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
#include "G4VisFeaturesOfDAWNFILE.hh"
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisFeaturesOfFukuiRenderer.cc,v 2.2 1998/07/12 03:10:20 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisFeaturesOfFukuiRenderer.cc,v 1.2 1999/01/09 16:31:26 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisFeaturesOfOpenGL.cc,v 2.1 1998/07/12 03:10:21 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisFeaturesOfOpenGL.cc,v 1.2 1999/01/09 16:31:26 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisFeaturesOfOpenInventor.cc,v 2.1 1998/09/11 15:10:41 jkallenb Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisFeaturesOfOpenInventor.cc,v 1.2 1999/01/09 16:31:27 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisFeaturesOfRay.cc,v 2.0 1998/07/02 16:49:56 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisFeaturesOfRay.cc,v 1.2 1999/01/09 16:31:27 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisManMessCamera.cc,v 2.3 1998/07/13 17:12:30 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisManMessCamera.cc,v 1.3 1999/01/11 00:48:35 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// GEANT4 Visualization Manager Messenger - John Allison 22nd July 1996.
@@ -200,10 +200,10 @@ void G4VisManMessenger::DoCommandCamera (const G4String& commandPath,
fpVMan -> PrintCurrentView ();
}
}
// fpVMan -> GetCurrentView () -> ClearView (); // Clears buffer only.
// fpVMan -> GetCurrentViewer () -> ClearView (); // Clears buffer only.
// fpVMan -> Draw ();
// fpVMan -> Show ();
G4VView* pView = fpVMan -> GetCurrentView ();
G4VViewer* pView = fpVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (fpVMan -> GetCurrentViewParameters ());
@@ -225,7 +225,7 @@ void G4VisManMessenger::DoCommandCamera (const G4String& commandPath,
fpVMan -> SetCurrentViewParameters ().SetLightsMoveWithCamera (false);
for (int i = 0; i < nFrames; i++) {
RotateViewpointAboutUpVectorBy (dbeta);
fpVMan -> GetCurrentView () -> ClearView (); // Clears buffer only.
fpVMan -> GetCurrentViewer () -> ClearView (); // Clears buffer only.
fpVMan -> Draw ();
fpVMan -> Show ();
}
@@ -248,10 +248,10 @@ void G4VisManMessenger::DoCommandCamera (const G4String& commandPath,
fpVMan -> PrintCurrentView ();
}
}
// fpVMan -> GetCurrentView () -> ClearView (); // Clears buffer only.
// fpVMan -> GetCurrentViewer () -> ClearView (); // Clears buffer only.
// fpVMan -> Draw ();
// fpVMan -> Show ();
G4VView* pView = fpVMan -> GetCurrentView ();
G4VViewer* pView = fpVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (fpVMan -> GetCurrentViewParameters ());
@@ -312,11 +312,11 @@ void G4VisManMessenger::DoCommandCamera (const G4String& commandPath,
}
}
// if (ViewValid ()) {
// fpVMan -> GetCurrentView () -> ClearView ();
// fpVMan -> GetCurrentViewer () -> ClearView ();
// fpVMan -> Draw ();
// fpVMan -> Show ();
// }
G4VView* pView = fpVMan -> GetCurrentView ();
G4VViewer* pView = fpVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (fpVMan -> GetCurrentViewParameters ());
@@ -338,7 +338,7 @@ void G4VisManMessenger::DoCommandCamera (const G4String& commandPath,
fpVMan -> SetCurrentViewParameters ().SetLightsMoveWithCamera (true);
for (int i = 0; i < nFrames; i++) {
RotateViewpointAboutUpVectorBy (dbeta);
fpVMan -> GetCurrentView () -> ClearView (); // Clears buffer only.
fpVMan -> GetCurrentViewer () -> ClearView (); // Clears buffer only.
fpVMan -> Draw ();
fpVMan -> Show ();
}
@@ -369,11 +369,11 @@ void G4VisManMessenger::DoCommandCamera (const G4String& commandPath,
}
}
// if (ViewValid ()) {
// fpVMan -> GetCurrentView () -> ClearView (); // Clears buffer only.
// fpVMan -> GetCurrentViewer () -> ClearView (); // Clears buffer only.
// fpVMan -> Draw ();
// fpVMan -> Show ();
// }
G4VView* pView = fpVMan -> GetCurrentView ();
G4VViewer* pView = fpVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (fpVMan -> GetCurrentViewParameters ());
@@ -411,10 +411,10 @@ void G4VisManMessenger::DoCommandCamera (const G4String& commandPath,
fpVMan -> PrintCurrentView ();
}
}
// fpVMan -> GetCurrentView () -> ClearView (); // Clears buffer only.
// fpVMan -> GetCurrentViewer () -> ClearView (); // Clears buffer only.
// fpVMan -> Draw ();
// fpVMan -> Show ();
G4VView* pView = fpVMan -> GetCurrentView ();
G4VViewer* pView = fpVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (fpVMan -> GetCurrentViewParameters ());
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisManMessCreateView.cc,v 2.4 1998/07/13 17:12:31 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisManMessCreateView.cc,v 1.3 1999/01/11 00:48:36 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// GEANT4 Visualization Manager Messenger - John Allison 22nd July 1996.
@@ -140,7 +140,7 @@ void G4VisManMessenger::DoCommandCreateView (const G4String& commandPath,
if (iGS >=0 && iGS < nSystems) {
// Valid index. Create view.
G4VGraphicsSystem* pSystem = gsl [iGS];;
fpVMan -> SetCurrentGraphicsSystemAndCreateView (pSystem);
fpVMan -> SetCurrentGraphicsSystemAndCreateViewer (pSystem);
if (fpVMan -> GetVerboseLevel () > 0) {
G4cout << "Graphics system set to " << pSystem -> GetName () << endl;
if (fpVMan -> GetVerboseLevel () > 1) {
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisManMessDraw.cc,v 2.7 1998/08/14 08:48:45 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisManMessDraw.cc,v 1.4 1999/04/16 09:06:09 mora Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// GEANT4 Visualization Manager Messenger - John Allison 22nd July 1996.
@@ -23,7 +23,7 @@
#include "G4UnitsTable.hh"
#include "G4ios.hh"
#include "G4GlobalFastSimulationManager.hh"
#include "G4VGlobalFastSimulationManager.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4FlavoredParallelWorldModel.hh"
@@ -226,24 +226,24 @@ void G4VisManMessenger::DoCommandDraw (const G4String& commandPath,
G4cout<< "grafic system not yet avaliable." << endl;
return;
}
G4GlobalFastSimulationManager* theGlobalFastSimulationManager;
G4VGlobalFastSimulationManager* theGlobalFastSimulationManager;
if(!(theGlobalFastSimulationManager =
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager())){
G4VGlobalFastSimulationManager::GetConcreteInstance ())){
G4cout<< "WARNING: none G4GlobalFastSimulationManager" << endl;
return;
}
G4ParticleTable* theParticleTable=G4ParticleTable::GetParticleTable();
G4SceneData& currentScene = theVisManager -> SetCurrentSceneData ();
G4Scene* currentScene = theVisManager -> GetCurrentScene ();
// Ok, lets look on the parameters
if(newValues=="all") {
G4FlavoredParallelWorld* CurrentFlavoredWorld;
G4VFlavoredParallelWorld* CurrentFlavoredWorld;
for (G4int iParticle=0; iParticle<theParticleTable->entries();
iParticle++)
if(CurrentFlavoredWorld=theGlobalFastSimulationManager->
GetFlavoredWorldForThis(theParticleTable->
GetParticle(iParticle)))
currentScene.AddRunDurationModel
currentScene -> AddRunDurationModel
(new G4FlavoredParallelWorldModel (CurrentFlavoredWorld));
G4cout << "Ghosts added to the Scene, refresh the view to see it."
<< endl;
@@ -255,13 +255,13 @@ void G4VisManMessenger::DoCommandDraw (const G4String& commandPath,
G4cout << newValues << ": not found this particle name!" << endl;
return;
}
G4FlavoredParallelWorld* worldForThis;
G4VFlavoredParallelWorld* worldForThis;
if(worldForThis=theGlobalFastSimulationManager->
GetFlavoredWorldForThis(currentParticle)) {
currentScene.AddRunDurationModel
currentScene -> AddRunDurationModel
(new G4FlavoredParallelWorldModel (worldForThis));
G4cout << "Ghosts added to the Scene, refresh the view to see it."
<< endl;
<< endl;
}
else G4cout << "There are no ghosts for "<<newValues<<endl;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisManMessExpert.cc,v 2.4 1998/07/16 02:06:08 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisManMessExpert.cc,v 1.3 1999/01/11 00:48:37 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// GEANT4 Visualization Manager Messenger - John Allison 22nd July 1996.
@@ -285,7 +285,7 @@ void G4VisManMessenger::DoCommandExpert (const G4String& commandPath,
// Given a physical volume...
G4VPhysicalVolume* pPhysVol =
fpVMan -> GetCurrentSceneData ().GetPhysicalVolume ();
fpVMan -> GetCurrentScene ().GetPhysicalVolume ();
// Given its transformation (normally, this would be known from
// the hits or digis information)...
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisManMessLights.cc,v 2.3 1998/07/13 17:12:35 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisManMessLights.cc,v 1.3 1999/01/11 00:48:38 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// GEANT4 Visualization Manager Messenger - John Allison 22nd July 1996.
@@ -70,7 +70,7 @@ void G4VisManMessenger::DoCommandLights (const G4String& commandPath,
}
}
if (ViewValid ()) {
fpVMan -> GetCurrentView () -> ClearView (); // Clears buffer only.
fpVMan -> GetCurrentViewer () -> ClearView (); // Clears buffer only.
fpVMan -> Draw ();
fpVMan -> Show ();
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisManMessSet.cc,v 2.5 1998/07/19 05:53:54 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisManMessSet.cc,v 1.3 1999/01/11 00:48:39 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// GEANT4 Visualization Manager Messenger - John Allison 22nd July 1996.
@@ -236,7 +236,7 @@ void G4VisManMessenger::DoCommandSet (const G4String& commandPath,
G4cout << "\nDensity cut is now: "
<< getVP.GetVisibleDensity () * cm3 / g << " g/cm3.";
G4cout << endl;
G4VView* pView = fpVMan -> GetCurrentView ();
G4VViewer* pView = fpVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (getVP);
@@ -340,7 +340,7 @@ void G4VisManMessenger::DoCommandSet (const G4String& commandPath,
fpVMan -> PrintCurrentView ();
}
//}
G4VView* pView = fpVMan -> GetCurrentView ();
G4VViewer* pView = fpVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (getVP);
@@ -386,7 +386,7 @@ void G4VisManMessenger::DoCommandSet (const G4String& commandPath,
if (getVP.IsMarkerNotHidden ()) G4cout << "not";
G4cout << " hidden by surfaces." << endl;
//}
G4VView* pView = fpVMan -> GetCurrentView ();
G4VViewer* pView = fpVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (getVP);
@@ -441,7 +441,7 @@ void G4VisManMessenger::DoCommandSet (const G4String& commandPath,
G4cout << "\nSection plane is now: "
<< getVP.GetSectionPlane ();
G4cout << endl;
G4VView* pView = fpVMan -> GetCurrentView ();
G4VViewer* pView = fpVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (getVP);
@@ -488,7 +488,7 @@ void G4VisManMessenger::DoCommandSet (const G4String& commandPath,
fpVMan -> PrintCurrentView ();
}
}
G4VView* pView = fpVMan -> GetCurrentView ();
G4VViewer* pView = fpVMan -> GetCurrentViewer ();
if (pView) {
// Copy current view parameters into current view.
pView -> SetViewParameters (fpVMan -> GetCurrentViewParameters ());
@@ -554,7 +554,7 @@ void G4VisManMessenger::DoCommandSet (const G4String& commandPath,
G4cout << "Temporary algorithm..." << endl;
G4VPhysicalVolume* pVPV =
fpVMan -> GetCurrentSceneData ().GetPhysicalVolume ();
fpVMan -> GetCurrentScene ().GetPhysicalVolume ();
G4VPhysicalVolume* pNewVPV = 0;
if (pVPV) {
@@ -631,15 +631,15 @@ void G4VisManMessenger::DoCommandSet (const G4String& commandPath,
/////////////////////////////////////////// /vis~/set/view /////////
if (commandPath == "/vis~/set/view") {
// Make List of available views.
RWTPtrOrderedVector<G4VView> vList;
const G4SceneList& gml = fpVMan -> GetAvailableScenes ();
RWTPtrOrderedVector<G4VViewer> vList;
const G4SceneHandlerList& gml = fpVMan -> GetAvailableSceneHandlers ();
G4int nViewTotal = 0;
G4int iGM, nScenes = gml.entries ();
for (iGM = 0; iGM < nScenes; iGM++) {
const G4VViewList& views = gml [iGM] -> GetViewList ();
const G4ViewerList& views = gml [iGM] -> GetViewerList ();
int nViews = views.entries ();
for (int iView = 0; iView < nViews; iView++) {
G4VView* pView = views [iView];
G4VViewer* pView = views [iView];
vList.append (pView);
nViewTotal++;
}
@@ -655,8 +655,8 @@ void G4VisManMessenger::DoCommandSet (const G4String& commandPath,
if (iSelect < 0 || iSelect >= nViewTotal) {
G4cout << "Available views:";
for (int iView = 0; iView < nViewTotal; iView++) {
const G4VView* pView = vList [iView];
const G4VScene* pScene = pView -> GetScene ();
const G4VViewer* pView = vList [iView];
const G4VSceneHandler* pScene = pView -> GetScene ();
const G4VGraphicsSystem* pSystem = pScene -> GetGraphicsSystem ();
G4cout << "\n " << iView << ") " << pView -> GetName ();
}
@@ -664,8 +664,8 @@ void G4VisManMessenger::DoCommandSet (const G4String& commandPath,
G4cout << endl;
}
else {
G4VView* pView = vList[iSelect];
fpVMan -> SetCurrentView (pView);
G4VViewer* pView = vList[iSelect];
fpVMan -> SetCurrentViewer (pView);
if (fpVMan -> GetVerboseLevel () > 0) {
G4cout << "Current view now " << pView -> GetName () << endl;
if (fpVMan -> GetVerboseLevel () > 1) {
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisManMessenger.cc,v 2.6 1998/08/09 17:54:42 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisManMessenger.cc,v 1.2 1999/01/09 16:31:32 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// GEANT4 Visualization Manager Messenger - John Allison 22nd July 1996.
File diff suppressed because it is too large Load Diff
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisManagerRegisterMessengers.cc,v 2.10 1998/12/09 23:55:57 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisManagerRegisterMessengers.cc,v 1.6 1999/05/25 09:14:21 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// G4VisManager::RegisterMessengers - John Allison 30/July/1998.
@@ -48,20 +48,6 @@ Introduction
============
This note defines the concepts of scene, scene handler and viewers.
For reasons which are lost in history they correspond to confusingly
differently named objects in Geant4. What we would like to call a
scene is a G4SceneData object and a G4VScene object is a scene
handler. Similarly a viewer is represented by a G4VView object.
However, this is historical, and changing C++ names is a pain. I dont
plan to change names right now!!
The situation ca be summarised as follows:
Working Concept (Terms Used Below) Geant4 C++ Object
---------------------------------- -----------------
scene G4SceneData
scene handler Sub-class of G4VScene
viewer Sub-class of G4VView
Scenes
======
@@ -88,7 +74,7 @@ manages a list of scenes.
* /vis/scene/set/hitOption accumulate|byEvent
* /vis/scene/set/notifyOption immediate|delayed
* /vis/scene/set/modelingStyle [<modeling-style>]
* /vis/scene/notifyHandlers
/vis/scene/notifyHandlers
Scene Handlers
@@ -99,7 +85,8 @@ into something that the graphics system can understand.
The commands would look something like:
/vis/sceneHandler/create <graphics-system> [<scene-handler-name>]
/vis/sceneHandler/create
<graphics-system> [<scene-handler-name>] [<scene-name>]
/vis/sceneHandler/attach [<scene-name>]
/vis/sceneHandler/list
/vis/sceneHandler/select [<scene-handler-name>]
@@ -193,7 +180,7 @@ or some such.
command -> SetGuidance ("Operations on Geant4 scenes.");
fMessengerList.append (new G4VisCommandSceneCreate);
fMessengerList.append (new G4VisCommandSceneList);
// fMessengerList.append (new G4VisCommandSceneNotifyHandlers); (Not ready!)
fMessengerList.append (new G4VisCommandSceneNotifyHandlers);
fMessengerList.append (new G4VisCommandSceneSelect);
fMessengerList.append (new G4VisCommandSceneRemove);
command = new G4UIdirectory ("/vis/scene/add/");
@@ -227,20 +214,20 @@ or some such.
// Clear - OLD STYLE!!
fMessengerList.append
(new G4VisCommandDirectoryMessenger <G4VisCommandClear>);
fMessengerList.append
(new G4VisSimpleCommandMessenger <G4VisCommandClearScene>);
// fMessengerList.append
// (new G4VisSimpleCommandMessenger <G4VisCommandClearScene>);
fMessengerList.append
(new G4VisSimpleCommandMessenger <G4VisCommandClearView>);
fMessengerList.append
(new G4VisSimpleCommandMessenger <G4VisCommandClearViewAndScene>);
// fMessengerList.append
// (new G4VisSimpleCommandMessenger <G4VisCommandClearViewAndScene>);
// Copy - OLD STYLE!!
fMessengerList.append
(new G4VisCommandDirectoryMessenger <G4VisCommandCopy>);
fMessengerList.append
(new G4VisSimpleCommandMessenger <G4VisCommandCopyAll>);
fMessengerList.append
(new G4VisSimpleCommandMessenger <G4VisCommandCopyScene>);
// fMessengerList.append
// (new G4VisSimpleCommandMessenger <G4VisCommandCopyAll>);
// fMessengerList.append
// (new G4VisSimpleCommandMessenger <G4VisCommandCopyScene>);
fMessengerList.append
(new G4VisSimpleCommandMessenger <G4VisCommandCopyView>);
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VisToOldVisCommands.cc,v 1.1 1998/12/09 23:55:00 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VisToOldVisCommands.cc,v 1.3 1999/06/19 16:29:01 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// Implements some /vis/ commands as /vis~/ temporarily.
@@ -67,7 +67,7 @@ void G4VisToOldVisCommands::SetNewValue
"\n /vis/viewer/create"
"\nThis way you can also use \"/vis/scene/addVolume\" to select"
"\n sub-detector components. (The command is still available"
"\n as \"/vis~/create_view/new_graphics/system " << newValues <<
"\n as \"/vis~/create_view/new_graphics_system " << newValues <<
"\".)"
<< endl;
}