Import Geant4 4.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:18:25 +02:00
parent 36c080dca6
commit 921d3b1cda
3990 changed files with 185376 additions and 82884 deletions
+36 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.8 2001/02/03 18:39:56 johna Exp $
$Id: History,v 1.16 2001/08/24 20:36:11 johna Exp $
-------------------------------------------------------------------
=========================================================
@@ -20,6 +20,41 @@ committal in the CVS repository !
History file for visualization/modeling
---------------------------------------
24th August 2001 John Allison (vis-V03-02-13)
- Intoduced argument for printing in G4VModel::Validate(G4bool warn).
- Changed default return value in G4VModel::Validate(G4bool) to true.
- Invoke CalculateExtent after successful geometry change in
G4PhysicalVolumeModel::Validate, and other bug fixes..
14th August 2001 John Allison (vis-V03-02-11)
- Added sceneHandler.Begin/EndPrimitives messages to models (long
standing bug!).
9th August 2001 John Allison (vis-V03-02-10-00)
- Removed G4ModelingParameters::hierarchy. It is no longer used. The
textual or graphical representation of the geometry hierarchy is now
done in G4xxxTree classes in visua;ization/Tree.
25th July 2001 John Allison (modeling-V03-02-03)
- Added G4VModel::GetG4PhysicalVolumeModel().
- Added G4VModel* argument to G4BoundingSphereScene constructor.
Both the above are to facilitate access to a model, if it exists, and
to invoke methods of G4PhysicalVolumeModel if it is one.
- Added code to curtail G4PhysicalVolumeModel search in G4BoundingSphereScene.
24th July 2001 John Allison (modeling-V03-02-02)
- Added G4VModel::SetExtent(const G4VisExtent&).
- Cosmetic improvements to G4BoundingSphereScene.
- Augmented G4ScaleModel::fGlobalTag.
21st July 2001 John Allison (modeling-V03-02-01)
- Added G4ScaleModel.
- Fixed bug in G4BoundingSphereScene::::Accrue().
- Also a few cosmetic changes.
18th July 2001 John Allison (modeling-V03-02-00)
- Ensured rotation and translation of replica is restored.
3rd February 2001 John Allison (vis-V03-00-02)
- Tidied for CodeWizard.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4AxesModel.hh,v 1.1.2.1 2001/06/28 19:16:18 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4AxesModel.hh,v 1.4 2001/08/24 20:34:14 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 3rd April 2001
@@ -49,7 +49,7 @@ public: // With description
virtual ~G4AxesModel ();
virtual void DescribeYourselfTo (G4VGraphicsScene&);
// The main task of a model is to describe itself to the scene.
// The main task of a model is to describe itself to the graphics scene.
virtual G4String GetCurrentDescription () const;
// A description which depends on the current state of the model.
@@ -57,12 +57,9 @@ public: // With description
virtual G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
virtual G4bool Validate ();
// Validate, but allow internal changes (hence non-const function).
private:
// Private copy contructor and assignmen to forbid uset...
// Private copy contructor and assignment to forbid use...
G4AxesModel (const G4AxesModel&);
G4AxesModel& operator = (const G4AxesModel&);
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4AxesModel.icc,v 1.1.2.1 2001/06/28 19:16:18 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4AxesModel.icc,v 1.3 2001/08/24 20:34:15 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
inline G4String G4AxesModel::GetCurrentTag () const {
return fGlobalTag;
@@ -31,7 +31,3 @@ inline G4String G4AxesModel::GetCurrentTag () const {
inline G4String G4AxesModel::GetCurrentDescription () const {
return fGlobalDescription;
}
inline G4bool G4AxesModel::Validate () {
return true;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4BoundingSphereScene.hh,v 1.8.2.1 2001/06/28 19:16:18 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4BoundingSphereScene.hh,v 1.11 2001/07/25 21:08:14 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 7th June 1997
@@ -44,10 +44,12 @@
#include "G4Polycone.hh"
#include "G4Polyhedra.hh"
class G4VModel;
class G4BoundingSphereScene: public G4VGraphicsScene {
public:
G4BoundingSphereScene ();
G4BoundingSphereScene (G4VModel* pModel = 0);
virtual ~G4BoundingSphereScene ();
void AddThis (const G4Box& s) {Accrue (s);}
void AddThis (const G4Cons& s) {Accrue (s);}
@@ -80,6 +82,7 @@ public:
virtual void BeginPrimitives (const G4Transform3D& objectTransformation) {}
virtual void EndPrimitives () {}
virtual void AddPrimitive (const G4Polyline&) {}
virtual void AddPrimitive (const G4Scale&) {}
virtual void AddPrimitive (const G4Text&) {}
virtual void AddPrimitive (const G4Circle&) {}
virtual void AddPrimitive (const G4Square&) {}
@@ -89,6 +92,7 @@ public:
private:
void Accrue (const G4VSolid& solid);
G4VModel* fpModel; // Instantiating code may optionally set this.
G4Point3D fCentre;
G4double fRadius;
const G4Transform3D* fpObjectTransformation;
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4FlavoredParallelWorldModel.hh,v 1.5.4.1 2001/06/28 19:16:18 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4FlavoredParallelWorldModel.hh,v 1.6 2001/07/11 10:09:20 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// P. Mora de Freitas et M.Verderi - 19 June 1998.
//
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4HitsModel.hh,v 1.4.4.1 2001/06/28 19:16:18 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4HitsModel.hh,v 1.7 2001/08/24 20:36:13 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 26th August 1998.
@@ -49,7 +49,7 @@ public: // With description
virtual ~G4HitsModel ();
virtual void DescribeYourselfTo (G4VGraphicsScene&);
// The main task of a model is to describe itself to the scene.
// The main task of a model is to describe itself to the graphics scene.
virtual G4String GetCurrentDescription () const;
// A description which depends on the current state of the model.
@@ -57,9 +57,6 @@ public: // With description
virtual G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
virtual G4bool Validate ();
// Validate, but allow internal changes (hence non-const function).
};
#include "G4HitsModel.icc"
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4HitsModel.icc,v 1.4.4.1 2001/06/28 19:16:18 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4HitsModel.icc,v 1.6 2001/08/24 20:36:14 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
inline G4String G4HitsModel::GetCurrentTag () const {
return fGlobalTag;
@@ -31,7 +31,3 @@ inline G4String G4HitsModel::GetCurrentTag () const {
inline G4String G4HitsModel::GetCurrentDescription () const {
return fGlobalDescription;
}
inline G4bool G4HitsModel::Validate () {
return true;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4LogicalVolumeModel.hh,v 1.4.4.1 2001/06/28 19:16:18 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4LogicalVolumeModel.hh,v 1.5 2001/07/11 10:09:21 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 26th July 1999.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ModelingParameters.hh,v 1.5.4.1 2001/06/28 19:16:18 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4ModelingParameters.hh,v 1.7 2001/08/09 20:06:20 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 31st December 1997.
@@ -50,8 +50,7 @@ public: // With description
enum RepStyle {
wireframe, // Use G4Wireframe.
polyhedron, // Use G4Polyhedron.
nurbs, // Use G4NURBS.
hierarchy // Draw as geometry hierarchy (DTREE in GEANT3 language!).
nurbs // Use G4NURBS.
};
// RepStyle is used to determine which graphics_reps classes to use,
// if required.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ModelingParameters.icc,v 1.3.4.1 2001/06/28 19:16:18 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4ModelingParameters.icc,v 1.4 2001/07/11 10:09:21 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 31st December 1997.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NullModel.hh,v 1.4.4.1 2001/06/28 19:16:19 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4NullModel.hh,v 1.6 2001/08/24 20:36:15 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 4th April 1998.
@@ -45,9 +45,6 @@ public:
void DescribeYourselfTo (G4VGraphicsScene&);
// An exception is thrown if this is called!!!!!!!!!!!!!!!!!!!!
G4bool Validate ();
// Validate, but allow internal changes (hence non-const function).
/////////////////////////////////////////////////
// Access to other information: use GetModelingParameters()
// (inherited from G4VModel) and the access functions of
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeModel.hh,v 1.12.2.1 2001/06/28 19:16:19 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PhysicalVolumeModel.hh,v 1.16 2001/08/24 20:36:17 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 31st December 1997.
@@ -66,7 +66,7 @@ public: // With description
virtual ~G4PhysicalVolumeModel ();
void DescribeYourselfTo (G4VGraphicsScene&);
// The main task of a model is to describe itself to the scene
// The main task of a model is to describe itself to the graphics scene
// handler (a object which inherits G4VSceneHandler, which inherits
// G4VGraphicsScene). It can also provide special information
// through pointers to working space in the scene handler. These
@@ -85,7 +85,14 @@ public: // With description
G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
G4bool Validate ();
const G4PhysicalVolumeModel* GetG4PhysicalVolumeModel () const {
return this;
}
G4PhysicalVolumeModel* GetG4PhysicalVolumeModel () {
return this;
}
G4bool Validate (G4bool warn);
// Validate, but allow internal changes (hence non-const function).
void DefinePointersToWorkingSpace (G4int* pCurrentDepth,
@@ -121,6 +128,8 @@ protected:
G4bool IsDaughterCulled (const G4LogicalVolume* pMotherLV);
void CalculateExtent ();
/////////////////////////////////////////////////////////
// Data members...
@@ -129,6 +138,7 @@ protected:
G4int fTopPVCopyNo; // ...of the physical volume.
G4int fRequestedDepth;
// Requested depth of geom. hierarchy search.
G4bool fUseFullExtent; // ...if requested.
G4int fCurrentDepth; // Current depth of geom. hierarchy.
G4VPhysicalVolume* fpCurrentPV; // Current physical volume.
G4LogicalVolume* fpCurrentLV; // Current logical volume.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeSearchScene.hh,v 1.7.4.1 2001/06/28 19:16:19 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PhysicalVolumeSearchScene.hh,v 1.9 2001/07/22 01:00:24 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 10th August 1998.
@@ -77,6 +77,7 @@ public:
virtual void BeginPrimitives (const G4Transform3D& objectTransformation) {}
virtual void EndPrimitives () {}
virtual void AddPrimitive (const G4Polyline&) {}
virtual void AddPrimitive (const G4Scale&) {}
virtual void AddPrimitive (const G4Text&) {}
virtual void AddPrimitive (const G4Circle&) {}
virtual void AddPrimitive (const G4Square&) {}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeSearchScene.icc,v 1.3.4.1 2001/06/28 19:16:19 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PhysicalVolumeSearchScene.icc,v 1.4 2001/07/11 10:09:21 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 10th August 1998.
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * 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: G4ScaleModel.hh,v 1.2 2001/08/24 20:36:18 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 21st July 2001.
//
// Class Description:
//
// Model which knows how to draw a scale.
//
// For access to base class information, e.g., modeling parameters,
// use GetModelingParameters() inherited from G4VModel. See Class
// Description of the base class G4VModel.
#ifndef G4SCALEMODEL_HH
#define G4SCALEMODEL_HH
#include "G4VModel.hh"
#include "G4Scale.hh"
class G4ScaleModel: public G4VModel {
public: // With description
G4ScaleModel (const G4Scale&);
virtual ~G4ScaleModel ();
virtual void DescribeYourselfTo (G4VGraphicsScene&);
// The main task of a model is to describe itself to the graphics scene.
virtual G4String GetCurrentDescription () const;
// A description which depends on the current state of the model.
virtual G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
private:
// Private copy contructor and assignment to forbid use...
G4ScaleModel (const G4ScaleModel&);
G4ScaleModel& operator = (const G4ScaleModel&);
G4Scale fScale;
};
#include "G4ScaleModel.icc"
#endif
@@ -0,0 +1,33 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * 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: G4ScaleModel.icc,v 1.2 2001/08/24 20:36:19 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
inline G4String G4ScaleModel::GetCurrentTag () const {
return fGlobalTag;
}
inline G4String G4ScaleModel::GetCurrentDescription () const {
return fGlobalDescription;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4TextModel.hh,v 1.1.2.1 2001/06/28 19:16:19 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4TextModel.hh,v 1.4 2001/08/24 20:36:21 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 3rd April 2001
@@ -50,7 +50,7 @@ public: // With description
virtual ~G4TextModel ();
virtual void DescribeYourselfTo (G4VGraphicsScene&);
// The main task of a model is to describe itself to the scene.
// The main task of a model is to describe itself to the graphics scene.
virtual G4String GetCurrentDescription () const;
// A description which depends on the current state of the model.
@@ -58,12 +58,9 @@ public: // With description
virtual G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
virtual G4bool Validate ();
// Validate, but allow internal changes (hence non-const function).
private:
// Private copy contructor and assignmen to forbid uset...
// Private copy contructor and assignment to forbid use...
G4TextModel (const G4TextModel&);
G4TextModel& operator = (const G4TextModel&);
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4TextModel.icc,v 1.1.2.1 2001/06/28 19:16:19 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4TextModel.icc,v 1.3 2001/08/24 20:36:22 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
inline G4String G4TextModel::GetCurrentTag () const {
return fGlobalTag;
@@ -31,7 +31,3 @@ inline G4String G4TextModel::GetCurrentTag () const {
inline G4String G4TextModel::GetCurrentDescription () const {
return fGlobalDescription;
}
inline G4bool G4TextModel::Validate () {
return true;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4TrajectoriesModel.hh,v 1.4.4.1 2001/06/28 19:16:19 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4TrajectoriesModel.hh,v 1.7 2001/08/24 20:36:23 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 26th August 1998.
@@ -49,7 +49,7 @@ public: // With description
virtual ~G4TrajectoriesModel ();
virtual void DescribeYourselfTo (G4VGraphicsScene&);
// The main task of a model is to describe itself to the scene.
// The main task of a model is to describe itself to the graphics scene.
virtual G4String GetCurrentDescription () const;
// A description which depends on the current state of the model.
@@ -57,9 +57,6 @@ public: // With description
virtual G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
virtual G4bool Validate ();
// Validate, but allow internal changes (hence non-const function).
};
#include "G4TrajectoriesModel.icc"
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4TrajectoriesModel.icc,v 1.4.4.1 2001/06/28 19:16:19 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4TrajectoriesModel.icc,v 1.6 2001/08/24 20:36:24 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
inline G4String G4TrajectoriesModel::GetCurrentTag () const {
return fGlobalTag;
@@ -31,8 +31,3 @@ inline G4String G4TrajectoriesModel::GetCurrentTag () const {
inline G4String G4TrajectoriesModel::GetCurrentDescription () const {
return fGlobalDescription;
}
inline G4bool G4TrajectoriesModel::Validate () {
return true;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VModel.hh,v 1.8.2.1 2001/06/28 19:16:19 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VModel.hh,v 1.13 2001/08/24 20:36:26 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 31st December 1997.
@@ -33,6 +33,8 @@
// graphics-system-indepedent description of a Geant4 component.
// The key fuctionality of a model is to know how to describe itself
// to a scene handler. A scene is a collection of models.
// A special case is made for G4PhysicalVolumeModel - a non-null pointer
// is to be returned by G4PhysicalVolumeModel::GetG4PhysicalVolumeModel().
#ifndef G4VMODEL_HH
#define G4VMODEL_HH
@@ -44,6 +46,8 @@
class G4VGraphicsScene;
class G4ModelingParameters;
class G4PhysicalVolumeModel; // Special case - see above.
class G4VModel {
public: // With description
@@ -57,7 +61,7 @@ public: // With description
virtual ~G4VModel ();
virtual void DescribeYourselfTo (G4VGraphicsScene&) = 0;
// The main task of a model is to describe itself to the scene.
// The main task of a model is to describe itself to the graphics scene.
const G4ModelingParameters* GetModelingParameters () const;
@@ -82,9 +86,15 @@ public: // With description
const G4Transform3D& GetTransformation () const;
// Model transformation, i.e., position and orientation of model in world.
virtual const G4PhysicalVolumeModel* GetG4PhysicalVolumeModel () const;
virtual G4PhysicalVolumeModel* GetG4PhysicalVolumeModel ();
// Returns 0 unless implemented by derived class.
void SetModelingParameters (const G4ModelingParameters*);
virtual G4bool Validate ();
void SetExtent (const G4VisExtent&);
virtual G4bool Validate (G4bool warn = true);
// Validate, but allow internal changes (hence non-const function).
protected:
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VModel.icc,v 1.6.2.1 2001/06/28 19:16:19 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VModel.icc,v 1.9 2001/07/25 21:12:20 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 31st December 1997.
@@ -48,6 +48,19 @@ inline const G4Transform3D& G4VModel::GetTransformation () const {
return fTransform;
}
inline const G4PhysicalVolumeModel*
G4VModel::GetG4PhysicalVolumeModel () const {
return 0;
}
inline G4PhysicalVolumeModel* G4VModel::GetG4PhysicalVolumeModel () {
return 0;
}
inline void G4VModel::SetModelingParameters (const G4ModelingParameters* pMP) {
fpMP = pMP;
}
inline void G4VModel::SetExtent (const G4VisExtent& extent) {
fExtent = extent;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4AxesModel.cc,v 1.2.2.1 2001/06/28 19:16:19 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4AxesModel.cc,v 1.5 2001/08/14 18:43:29 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 3rd April 2001
@@ -45,7 +45,7 @@ G4AxesModel::G4AxesModel
fGlobalDescription = fGlobalTag;
}
void G4AxesModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
void G4AxesModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler) {
G4Polyline x_axis, y_axis, z_axis;
@@ -57,21 +57,25 @@ void G4AxesModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
G4VisAttributes ay(cy); // VA for y-axis
G4VisAttributes az(cz); // VA for z-axis
sceneHandler.BeginPrimitives();
//----- Draw x-axis
x_axis.SetVisAttributes(&ax);
x_axis.push_back(G4Point3D(fX0,fY0,fZ0));
x_axis.push_back(G4Point3D((fX0 + fLength),fY0,fZ0));
scene.AddPrimitive(x_axis);
sceneHandler.AddPrimitive(x_axis);
//----- Draw y-axis
y_axis.SetVisAttributes(&ay);
y_axis.push_back(G4Point3D(fX0,fY0,fZ0));
y_axis.push_back(G4Point3D(fX0,(fY0 + fLength),fZ0));
scene.AddPrimitive(y_axis);
sceneHandler.AddPrimitive(y_axis);
//----- Draw z-axis
z_axis.SetVisAttributes(&az);
z_axis.push_back(G4Point3D(fX0,fY0,fZ0));
z_axis.push_back(G4Point3D(fX0,fY0,(fZ0 + fLength)));
scene.AddPrimitive(z_axis);
sceneHandler.AddPrimitive(z_axis);
sceneHandler.EndPrimitives();
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4BoundingSphereScene.cc,v 1.4.4.1 2001/06/28 19:16:20 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4BoundingSphereScene.cc,v 1.8 2001/07/25 21:10:22 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 7th June 1997
@@ -31,9 +31,11 @@
#include "G4BoundingSphereScene.hh"
#include "G4VSolid.hh"
#include "G4PhysicalVolumeModel.hh"
#include "G4Vector3D.hh"
G4BoundingSphereScene::G4BoundingSphereScene ():
G4BoundingSphereScene::G4BoundingSphereScene (G4VModel* pModel):
fpModel (pModel),
fRadius (-1.),
fpObjectTransformation (0)
{}
@@ -51,17 +53,18 @@ G4VisExtent G4BoundingSphereScene::GetBoundingSphereExtent () {
}
void G4BoundingSphereScene::Accrue (const G4VSolid& solid) {
const G4VisExtent& thisExtent = solid.GetExtent ();
G4Point3D thisCentre = thisExtent.GetExtentCentre ();
const G4VisExtent& newExtent = solid.GetExtent ();
G4Point3D newCentre = newExtent.GetExtentCentre ();
if (fpObjectTransformation) {
thisCentre.transform (*fpObjectTransformation);
newCentre.transform (*fpObjectTransformation);
}
const G4double thisRadius = thisExtent.GetExtentRadius ();
AccrueBoundingSphere (thisCentre, thisRadius);
/***********************************************
G4cout << "G4BoundingSphereScene::Accrue: centre: " << fCentre
<< ", radius: " << fRadius << G4endl;
***********************************************/
const G4double newRadius = newExtent.GetExtentRadius ();
AccrueBoundingSphere (newCentre, newRadius);
// Curtail descent - can assume daughters are contained within mother...
G4PhysicalVolumeModel* pPVM = fpModel->GetG4PhysicalVolumeModel();
if (pPVM) pPVM->CurtailDescent();
}
void G4BoundingSphereScene::ResetBoundingSphere () {
@@ -71,28 +74,43 @@ void G4BoundingSphereScene::ResetBoundingSphere () {
}
void G4BoundingSphereScene::AccrueBoundingSphere
(const G4Point3D& thisCentre,
G4double thisRadius) {
(const G4Point3D& newCentre,
G4double newRadius) {
if (fRadius < 0 ) { // First time.
fCentre = thisCentre;
fRadius = thisRadius;
fCentre = newCentre;
fRadius = newRadius;
}
else {
G4Vector3D join = thisCentre - fCentre;
G4Vector3D join = newCentre - fCentre;
if (join == G4Vector3D (0., 0., 0.)) { // Centres coincide.
if (fRadius < thisRadius) fRadius = thisRadius;
if (fRadius < newRadius) fRadius = newRadius;
}
else if (join.mag () + thisRadius <= fRadius) { // Inside accrued sphere.
else if (join.mag () + newRadius <= fRadius) { // Inside accrued sphere.
// Do nothing.
}
else {
G4Vector3D unitJoin = join.unit ();
G4Point3D extremity1 = fCentre - fRadius * unitJoin;
G4Point3D extremity2 = thisCentre + thisRadius * unitJoin;
G4Point3D oldExtremity1 = fCentre - fRadius * unitJoin;
G4Point3D newExtremity1 = newCentre - newRadius * unitJoin;
G4Point3D oldExtremity2 = fCentre + fRadius * unitJoin;
G4Point3D newExtremity2 = newCentre + newRadius * unitJoin;
G4Point3D extremity1;
if (oldExtremity1 * unitJoin < newExtremity1 * unitJoin) {
extremity1 = oldExtremity1;
}
else {
extremity1 = newExtremity1;
}
G4Point3D extremity2;
if (oldExtremity2 * unitJoin > newExtremity2 * unitJoin) {
extremity2 = oldExtremity2;
}
else {
extremity2 = newExtremity2;
}
fCentre = 0.5 * (extremity2 + extremity1);
fRadius = 0.5 * (extremity2 - extremity1).mag ();
}
}
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4FlavoredParallelWorldModel.cc,v 1.4.4.1 2001/06/28 19:16:20 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4FlavoredParallelWorldModel.cc,v 1.5 2001/07/11 10:09:22 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// P. Mora de Freitas et M.Verderi - 19 June 1998.
// Model for flavored parallel world volumes.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4HitsModel.cc,v 1.4.4.1 2001/06/28 19:16:20 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4HitsModel.cc,v 1.7 2001/08/14 18:43:30 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 26th August 1998.
@@ -30,6 +30,7 @@
#include "G4HitsModel.hh"
#include "G4VGraphicsScene.hh"
#include "G4ModelingParameters.hh"
#include "G4RunManager.hh"
#include "G4Event.hh"
@@ -42,7 +43,7 @@ G4HitsModel::G4HitsModel () {
fGlobalDescription = fGlobalTag;
}
void G4HitsModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
void G4HitsModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler) {
if (fpMP && fpMP -> IsViewHits ()) {
G4RunManager* runManager = G4RunManager::GetRunManager ();
const G4Event* event = runManager -> GetCurrentEvent ();
@@ -50,9 +51,11 @@ void G4HitsModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
G4HCofThisEvent* HCE = event -> GetHCofThisEvent ();
if (HCE) {
G4int nHC = HCE -> GetCapacity ();
sceneHandler.BeginPrimitives ();
for (int iHC = 0; iHC < nHC; iHC++) {
HCE -> GetHC (iHC) -> DrawAllHits ();
}
sceneHandler.EndPrimitives ();
}
}
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4LogicalVolumeModel.cc,v 1.7.2.1 2001/06/28 19:16:20 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4LogicalVolumeModel.cc,v 1.8 2001/07/11 10:09:22 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 26th July 1999.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ModelingParameters.cc,v 1.4.4.1 2001/06/28 19:16:20 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4ModelingParameters.cc,v 1.5 2001/07/11 10:09:23 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 31st December 1997.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NullModel.cc,v 1.3.4.1 2001/06/28 19:16:20 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4NullModel.cc,v 1.6 2001/08/24 20:36:28 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 4th April 1998.
@@ -36,10 +36,6 @@ G4NullModel::G4NullModel (const G4ModelingParameters* pMP):
G4NullModel::~G4NullModel () {}
void G4NullModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
void G4NullModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler) {
G4Exception ("G4NullModel::DescribeYourselfTo called.");
}
G4bool G4NullModel::Validate () {
return true;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeModel.cc,v 1.15.2.1 2001/06/28 19:16:20 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PhysicalVolumeModel.cc,v 1.20 2001/08/24 20:34:25 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 31st December 1997.
@@ -55,6 +55,7 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
fTopPVName (pVPV -> GetName ()),
fTopPVCopyNo (pVPV -> GetCopyNo ()),
fRequestedDepth (requestedDepth),
fUseFullExtent (useFullExtent),
fCurrentDepth (0),
fpCurrentPV (0),
fpCurrentLV (0),
@@ -69,11 +70,17 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
fGlobalTag = fpTopPV -> GetName () + "." + a;
fGlobalDescription = "G4PhysicalVolumeModel " + fGlobalTag;
if (useFullExtent) {
CalculateExtent ();
}
G4PhysicalVolumeModel::~G4PhysicalVolumeModel () {}
void G4PhysicalVolumeModel::CalculateExtent () {
if (fUseFullExtent) {
fExtent = fpTopPV -> GetLogicalVolume () -> GetSolid () -> GetExtent ();
}
else {
G4BoundingSphereScene bsScene;
G4BoundingSphereScene bsScene(this);
const G4ModelingParameters* tempMP = fpMP;
G4ModelingParameters mParams
(0, // No default vis attributes.
@@ -94,8 +101,6 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
}
}
G4PhysicalVolumeModel::~G4PhysicalVolumeModel () {}
void G4PhysicalVolumeModel::DescribeYourselfTo
(G4VGraphicsScene& sceneHandler) {
@@ -225,6 +230,8 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
// They have phi of offset+n*width to offset+(n+1)*width where
// n=0..nReplicas-1
//
G4ThreeVector originalTranslation = pVPV -> GetTranslation ();
G4RotationMatrix* pOriginalRotation = pVPV -> GetRotation ();
for (int n = 0; n < nReplicas; n++) {
G4ThreeVector translation; // Null.
G4RotationMatrix rotation; // Null - life long enough for visualizing.
@@ -241,7 +248,7 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
translation = G4ThreeVector (0,0,-width*(nReplicas-1)*0.5+n*width);
break;
case kRho:
G4cerr <<
G4cout <<
"G4PhysicalVolumeModel::VisitGeometryAndGetVisReps: WARNING:"
"\n built-in replicated volumes replicated in radius are not yet"
"\n properly visualizable."
@@ -263,6 +270,9 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
DescribeAndDescend (pVPV, requestedDepth, pLV, pSol, pMaterial,
theAT, sceneHandler);
}
// Restore originals...
pVPV -> SetTranslation (originalTranslation);
pVPV -> SetRotation (pOriginalRotation);
}
}
@@ -432,32 +442,41 @@ G4bool G4PhysicalVolumeModel::IsDaughterCulled
}
}
G4bool G4PhysicalVolumeModel::Validate () {
G4bool G4PhysicalVolumeModel::Validate (G4bool warn) {
G4VPhysicalVolume* world =
G4TransportationManager::GetTransportationManager ()
-> GetNavigatorForTracking () -> GetWorldVolume ();
// The idea now is to seek a PV with the same name and copy no
// in the hope it's the same one!!
G4cout << "G4PhysicalVolumeModel::Validate() called." << G4endl;
if (warn) {
G4cout << "G4PhysicalVolumeModel::Validate() called." << G4endl;
}
G4PhysicalVolumeSearchScene searchScene (fTopPVName, fTopPVCopyNo);
G4PhysicalVolumeModel searchModel (world);
G4ModelingParameters mp; // Default modeling parameters for this search.
searchModel.SetModelingParameters (&mp);
searchModel.DescribeYourselfTo (searchScene);
G4VPhysicalVolume* foundVolume = searchScene.GetFoundVolume ();
if (foundVolume) {
G4cout << " Volume of the same name and copy number (\""
<< fTopPVName << "\", copy " << fTopPVCopyNo
<< ") still exists and is being used."
"\n Be warned that this does not necessarily guarantee it's the same"
"\n volume you originally specified in /vis/scene/add/."
<< G4endl;
if (warn) {
G4cout << " Volume of the same name and copy number (\""
<< fTopPVName << "\", copy " << fTopPVCopyNo
<< ") still exists and is being used."
"\n Be warned that this does not necessarily guarantee it's the same"
"\n volume you originally specified in /vis/scene/add/."
<< G4endl;
}
fpTopPV = foundVolume;
CalculateExtent ();
return true;
}
else {
G4cout << " A volume of the same name and copy number (\""
<< fTopPVName << "\", copy " << fTopPVCopyNo
<< ") no longer exists."
<< G4endl;
if (warn) {
G4cout << " A volume of the same name and copy number (\""
<< fTopPVName << "\", copy " << fTopPVCopyNo
<< ") no longer exists."
<< G4endl;
}
return false;
}
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeSearchScene.cc,v 1.5.2.1 2001/06/28 19:16:20 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PhysicalVolumeSearchScene.cc,v 1.6 2001/07/11 10:09:23 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 10th August 1998.
@@ -0,0 +1,58 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * 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: G4ScaleModel.cc,v 1.3 2001/08/14 18:43:31 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 21st July 2001.
// Model which knows how to draw scale.
#include "G4ScaleModel.hh"
#include "G4ModelingParameters.hh"
#include "G4VGraphicsScene.hh"
G4ScaleModel::~G4ScaleModel () {}
G4ScaleModel::G4ScaleModel (const G4Scale& scale): fScale(scale) {
fGlobalTag = "G4ScaleModel: " + fScale.GetAnnotation();
switch (fScale.GetDirection()) {
case G4Scale::x:
fGlobalTag += " x";
break;
case G4Scale::y:
fGlobalTag += " y";
break;
case G4Scale::z:
fGlobalTag += " z";
break;
}
fGlobalDescription = fGlobalTag;
}
void G4ScaleModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler) {
sceneHandler.BeginPrimitives ();
sceneHandler.AddPrimitive (fScale);
sceneHandler.EndPrimitives ();
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4TextModel.cc,v 1.1.2.1 2001/06/28 19:16:20 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4TextModel.cc,v 1.4 2001/08/14 18:43:32 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 3rd April 2001
@@ -40,6 +40,8 @@ G4TextModel::G4TextModel (const G4Text& text): fText(text) {
fGlobalDescription = fGlobalTag;
}
void G4TextModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
scene.AddPrimitive (fText);
void G4TextModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler) {
sceneHandler.BeginPrimitives ();
sceneHandler.AddPrimitive (fText);
sceneHandler.EndPrimitives ();
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4TrajectoriesModel.cc,v 1.6.4.1 2001/06/28 19:16:20 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4TrajectoriesModel.cc,v 1.9 2001/08/14 18:43:33 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 26th August 1998.
@@ -30,6 +30,7 @@
#include "G4TrajectoriesModel.hh"
#include "G4VGraphicsScene.hh"
#include "G4RunManager.hh"
#include "G4Event.hh"
@@ -40,13 +41,14 @@ G4TrajectoriesModel::G4TrajectoriesModel () {
fGlobalDescription = fGlobalTag;
}
void G4TrajectoriesModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
void G4TrajectoriesModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler) {
G4RunManager* runManager = G4RunManager::GetRunManager ();
const G4Event* event = runManager -> GetCurrentEvent ();
if (event) {
G4TrajectoryContainer* TC = event -> GetTrajectoryContainer ();
if (TC) {
G4int nT = TC -> entries ();
sceneHandler.BeginPrimitives ();
for (int iT = 0; iT < nT; iT++) {
// GB : default representation should be the most efficent one.
// Representation with a circle at each step should be an option
@@ -54,6 +56,7 @@ void G4TrajectoriesModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
// (*TC) [iT] -> DrawTrajectory (50);
(*TC) [iT] -> DrawTrajectory ();
}
sceneHandler.EndPrimitives ();
}
}
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VModel.cc,v 1.5.2.1 2001/06/28 19:16:20 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VModel.cc,v 1.7 2001/08/24 20:36:29 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 31st December 1997.
@@ -51,8 +51,8 @@ G4String G4VModel::GetCurrentDescription () const {
return G4String("Default Current Description");
}
G4bool G4VModel::Validate () {
return false;
G4bool G4VModel::Validate (G4bool warn) {
return true;
}
G4std::ostream& operator << (G4std::ostream& os, const G4VModel& m) {