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
@@ -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.