Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
+2 -1
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.2 1999/04/16 09:05:36 mora Exp $
# $Id: GNUmakefile,v 1.3 1999/11/10 18:20:55 johna Exp $
# --------------------------------------------------------------
# GNUmakefile for modeling library. John Allison, 31/12/1997.
# --------------------------------------------------------------
@@ -17,6 +17,7 @@ CPPFLAGS += -I$(G4BASE)/global/HEPGeometry/include
CPPFLAGS += -I$(G4BASE)/geometry/management/include
CPPFLAGS += -I$(G4BASE)/geometry/volumes/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/CSG/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/Boolean/include
CPPFLAGS += -I$(G4BASE)/materials/include
CPPFLAGS += -I$(G4BASE)/global/HEPRandom/include
CPPFLAGS += -I$(G4BASE)/processes/electromagnetic/utils/include
+6 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.2 1999/02/07 17:24:13 johna Exp $
$Id: History,v 1.3 1999/11/25 14:18:40 johna Exp $
-------------------------------------------------------------------
=========================================================
@@ -20,6 +20,11 @@ committal in the CVS repository !
History file for visualization/modeling
---------------------------------------
vis-V00-01-10 25th November 1999 John Allison
- Adapted header files of modeling for Software Reference Manual.
vis-01-00-05 7th February 1999 John Allison
vis-01-00-05 7th February 1999 John Allison
- Added list facility to G4PhysicalVolumeSearchScene.
- Added virtual functions AddThis (const G4Polycone and G4Polyhedra to
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4BoundingSphereScene.hh,v 1.4 1999/05/10 14:04:20 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4BoundingSphereScene.hh,v 1.5.6.1 1999/12/07 20:54:04 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 7th June 1997
@@ -52,7 +52,6 @@ public:
G4VisExtent GetBoundingSphereExtent ();
////////////////////////////////////////////////////////////////
// The following 2 functions can be used by any code which wishes to
// accrue a bounding sphere. Just instantiate a
// G4BoundingSphereScene and use AccrueBoundingSphere.
@@ -61,6 +60,19 @@ public:
void AccrueBoundingSphere (const G4Point3D& centre,
G4double radius);
////////////////////////////////////////////////////////////////
// Functions not used by required by the abstract interface.
virtual void BeginPrimitives (const G4Transform3D& objectTransformation) {}
virtual void EndPrimitives () {}
virtual void AddPrimitive (const G4Polyline&) {}
virtual void AddPrimitive (const G4Text&) {}
virtual void AddPrimitive (const G4Circle&) {}
virtual void AddPrimitive (const G4Square&) {}
virtual void AddPrimitive (const G4Polymarker&) {}
virtual void AddPrimitive (const G4Polyhedron&) {}
virtual void AddPrimitive (const G4NURBS&) {}
private:
void Accrue (const G4VSolid& solid);
G4Point3D fCentre;
@@ -1,15 +1,20 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4FlavoredParallelWorldModel.hh,v 1.3 1999/04/16 09:05:39 mora Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4FlavoredParallelWorldModel.hh,v 1.4.2.1 1999/12/07 20:54:04 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// P. Mora de Freitas et M.Verderi - 19 June 1998.
// Model for flavored parallel world volumes.
//
// Class Description:
//
// Model for flavored parallel world volumes. Inherits from
// G4PhysicalVolumeModel; for more information see that class
// description.
#ifndef G4FLAVOREDPARALLELWORLDMODEL_HH
#define G4FLAVOREDPARALLELWORLDMODEL_HH
@@ -20,7 +25,7 @@ class G4VFlavoredParallelWorld;
class G4FlavoredParallelWorldModel : public G4PhysicalVolumeModel {
public:
public: // With description
G4FlavoredParallelWorldModel
(G4VFlavoredParallelWorld* FPW,
@@ -1,16 +1,23 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4HitsModel.hh,v 1.2 1999/01/11 00:48:43 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4HitsModel.hh,v 1.3.2.1 1999/12/07 20:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 26th August 1998.
//
// Class Description:
//
// Model which knows how to draw GEANT4 hits.
//
// For access to base class information, e.g., modeling parameters,
// use GetModelingParameters() inherited from G4VModel. See Class
// Description of the base class G4VModel.
#ifndef G4HITSMODEL_HH
#define G4HITSMODEL_HH
@@ -19,7 +26,7 @@
class G4HitsModel: public G4VModel {
public:
public: // With description
G4HitsModel ();
@@ -28,12 +35,12 @@ public:
virtual void DescribeYourselfTo (G4VGraphicsScene&);
// The main task of a model is to describe itself to the scene.
virtual G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
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.
virtual G4bool Validate ();
// Validate, but allow internal changes (hence non-const function).
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4HitsModel.icc,v 1.3 1999/05/10 14:04:22 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4HitsModel.icc,v 1.3.8.1 1999/12/07 20:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
inline G4String G4HitsModel::GetCurrentTag () const {
return fGlobalTag;
@@ -0,0 +1,59 @@
// 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: G4LogicalVolumeModel.hh,v 1.2.2.1 1999/12/07 20:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 26th July 1999.
//
// Class Description:
//
// Model for logical volumes. It describes a logical volume and its
// daughters to any depth - usually only the first by default.
//
// Inherits from G4PhysicalVolumeModel; for more information see that
// class description.
#ifndef G4LOGICALVOLUMEMODEL_HH
#define G4LOGICALVOLUMEMODEL_HH
#include "G4PhysicalVolumeModel.hh"
#include "globals.hh"
#include "G4Transform3D.hh"
class G4LogicalVolume;
class G4ModelingParameters;
class G4LogicalVolumeModel: public G4PhysicalVolumeModel {
public: // With description
G4LogicalVolumeModel
(G4LogicalVolume*,
G4int soughtDepth = 1,
const G4Transform3D& modelTransformation = G4Transform3D::Identity,
const G4ModelingParameters* = 0);
virtual ~G4LogicalVolumeModel ();
void DescribeYourselfTo (G4VGraphicsScene&);
G4String GetCurrentDescription () const;
// A description which depends on the current state of the model.
protected:
/////////////////////////////////////////////////////////
// Data members...
G4LogicalVolume* fpLV;
};
#endif
@@ -1,15 +1,18 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4ModelingParameters.hh,v 1.3 1999/05/25 09:14:23 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4ModelingParameters.hh,v 1.4.2.1 1999/12/07 20:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 31st December 1997.
//
// Class Description:
//
// Parameters associated with the modeling of GEANT4 objects.
#ifndef G4MODELINGPARAMETERS_HH
@@ -24,9 +27,9 @@ class G4VisAttributes;
class G4ModelingParameters {
friend ostream& operator << (ostream& os, const G4ModelingParameters&);
public: // With description
public:
friend ostream& operator << (ostream& os, const G4ModelingParameters&);
enum RepStyle {
wireframe, // Use G4Wireframe.
@@ -46,8 +49,7 @@ public:
G4bool isDensityCulling,
G4double visibleDensity,
G4bool isCullingCovered,
G4int noOfSides
);
G4int noOfSides);
// noOfSides is suggested no. of sides per circle in case a
// polygonal representation is produced.
@@ -61,8 +63,7 @@ public:
G4int noOfSides,
G4bool isViewGeom,
G4bool isViewHits,
G4bool isViewDigis
);
G4bool isViewDigis);
// noOfSides is suggested no. of sides per circle in case a
// polygonal representation is produced.
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4ModelingParameters.icc,v 1.2 1999/01/10 13:25:49 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4ModelingParameters.icc,v 1.2.8.1 1999/12/07 20:54:06 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 31st December 1997.
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4NullModel.hh,v 1.3 1999/05/10 14:04:23 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4NullModel.hh,v 1.3.8.1 1999/12/07 20:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 4th April 1998.
@@ -1,19 +1,25 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4PhysicalVolumeModel.hh,v 1.3 1999/05/10 14:04:24 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4PhysicalVolumeModel.hh,v 1.6.2.1 1999/12/07 20:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 31st December 1997.
// Model for physical volumes.
// It describes a physical volume and its daughters to any desired depth.
// Note: the "sought depth" is specified in the modeling parameters.
//
// Class Description:
//
// Model for physical volumes. It describes a physical volume and its
// daughters to any desired depth. Note: the "sought depth" is
// specified in the modeling parameters.
//
// For access to base class information, e.g., modeling parameters,
// use GetModelingParameters() inherited from G4VModel. See Class
// Description of the base class G4VModel.
#ifndef G4PHYSICALVOLUMEMODEL_HH
#define G4PHYSICALVOLUMEMODEL_HH
@@ -26,10 +32,11 @@ class G4VPhysicalVolume;
class G4LogicalVolume;
class G4VSolid;
class G4Material;
class G4VisAttributes;
class G4PhysicalVolumeModel: public G4VModel {
public:
public: // With description
enum {UNLIMITED = -1};
@@ -37,57 +44,62 @@ public:
(G4VPhysicalVolume*,
G4int soughtDepth = UNLIMITED,
const G4Transform3D& modelTransformation = G4Transform3D::Identity,
const G4ModelingParameters* = 0);
const G4ModelingParameters* = 0,
G4bool useFullExtent = false);
virtual ~G4PhysicalVolumeModel ();
void DescribeYourselfTo (G4VGraphicsScene&);
// The main task of a model is to describe itself to the scene. It
// can also provide special information through pointers to working
// space in the scene. These pointers must be set up (if required
// by the scene) in the scene's implementaion of EstablishSpecials
// The main task of a model is to describe itself to the 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
// pointers must be set up (if required by the scene handler) in the
// scene handler's implementaion of EstablishSpecials
// (G4PhysicalVolumeModel&) which is called from here. To do this,
// the scene should call DefinePointersToWorkingSpace - see below.
// DecommissionSpecials (G4PhysicalVolumeModel&) is also called from
// here. To see how this works, look at the implementation of this
// function and G4VScene::Establish/DecommissionSpecials.
G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
// the scene handler should call DefinePointersToWorkingSpace - see
// below. DecommissionSpecials (G4PhysicalVolumeModel&) is also
// called from here. To see how this works, look at the
// implementation of this function and
// G4VSceneHandler::Establish/DecommissionSpecials.
G4String GetCurrentDescription () const;
// A description which depends on the current state of the model.
G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
G4bool Validate ();
// Validate, but allow internal changes (hence non-const function).
//////////////////////////////////////////////////////////
// Access functions.
void DefinePointersToWorkingSpace (G4int* pCurrentDepth,
G4VPhysicalVolume** ppCurrentPV,
G4LogicalVolume** ppCurrentLV);
// For use (optional) by the scene handler if it needs to know about
// the current information maintained through these pointers.
/////////////////////////////////////////////////
// Access to other information: use GetModelingParameters()
// (inherited from G4VModel) and the access functions of
// G4ModelingParameters.
protected:
private:
void VisitGeometryAndGetVisReps (G4VPhysicalVolume* pVPV,
void VisitGeometryAndGetVisReps (G4VPhysicalVolume*,
G4int soughtDepth,
const G4Transform3D& theAT,
G4VGraphicsScene& scene);
void DescribeAndDescend (G4VPhysicalVolume* pVPV,
const G4Transform3D&,
G4VGraphicsScene&);
void DescribeAndDescend (G4VPhysicalVolume*,
G4int soughtDepth,
G4LogicalVolume* pLV,
G4VSolid* pSol,
const G4Material* pMaterial,
const G4Transform3D& theAT,
G4VGraphicsScene& scene);
G4bool IsThisCulled (const G4LogicalVolume* pLV,
const G4Material* pMaterial);
G4LogicalVolume*,
G4VSolid*,
const G4Material*,
const G4Transform3D&,
G4VGraphicsScene&);
void DescribeSolids (const G4Transform3D& theAT,
G4VSolid* pSol,
const G4VisAttributes* pVisAttribs,
G4VGraphicsScene& sceneHandler);
G4bool IsThisCulled (const G4LogicalVolume*,
const G4Material*);
G4bool IsDaughterCulled (const G4LogicalVolume* pMotherLV);
/////////////////////////////////////////////////////////
@@ -110,6 +122,4 @@ private:
};
#include "G4PhysicalVolumeModel.icc"
#endif
@@ -1,15 +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: G4PhysicalVolumeModel.icc,v 1.2 1999/01/11 00:48:45 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 31st December 1997.
// Model for physical volumes.
inline G4PhysicalVolumeModel::~G4PhysicalVolumeModel () {}
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4PhysicalVolumeSearchScene.hh,v 1.4 1999/05/10 14:04:25 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4PhysicalVolumeSearchScene.hh,v 1.5.6.1 1999/12/07 20:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 10th August 1998.
@@ -55,6 +55,19 @@ public:
G4VPhysicalVolume* GetFoundVolume () const;
const G4Transform3D& GetFoundTransformation () const;
////////////////////////////////////////////////////////////////
// Functions not used by required by the abstract interface.
virtual void BeginPrimitives (const G4Transform3D& objectTransformation) {}
virtual void EndPrimitives () {}
virtual void AddPrimitive (const G4Polyline&) {}
virtual void AddPrimitive (const G4Text&) {}
virtual void AddPrimitive (const G4Circle&) {}
virtual void AddPrimitive (const G4Square&) {}
virtual void AddPrimitive (const G4Polymarker&) {}
virtual void AddPrimitive (const G4Polyhedron&) {}
virtual void AddPrimitive (const G4NURBS&) {}
private:
void FindVolume (const G4VSolid&);
G4String fRequiredPhysicalVolumeName;
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4PhysicalVolumeSearchScene.icc,v 1.2 1999/01/11 00:48:46 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4PhysicalVolumeSearchScene.icc,v 1.2.8.1 1999/12/07 20:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 10th August 1998.
@@ -1,16 +1,23 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4TrajectoriesModel.hh,v 1.2 1999/01/11 00:48:47 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4TrajectoriesModel.hh,v 1.3.2.1 1999/12/07 20:54:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 26th August 1998.
//
// Class Description:
//
// Model which knows how to draw GEANT4 trajectories.
//
// For access to base class information, e.g., modeling parameters,
// use GetModelingParameters() inherited from G4VModel. See Class
// Description of the base class G4VModel.
#ifndef G4TRAJECTORIESMODEL_HH
#define G4TRAJECTORIESMODEL_HH
@@ -19,7 +26,7 @@
class G4TrajectoriesModel: public G4VModel {
public:
public: // With description
G4TrajectoriesModel ();
@@ -28,12 +35,12 @@ public:
virtual void DescribeYourselfTo (G4VGraphicsScene&);
// The main task of a model is to describe itself to the scene.
virtual G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
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.
virtual G4bool Validate ();
// Validate, but allow internal changes (hence non-const function).
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4TrajectoriesModel.icc,v 1.3 1999/05/10 14:04:27 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4TrajectoriesModel.icc,v 1.3.8.1 1999/12/07 20:54:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
inline G4String G4TrajectoriesModel::GetCurrentTag () const {
return fGlobalTag;
@@ -1,16 +1,22 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4VModel.hh,v 1.2 1999/01/11 00:48:49 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VModel.hh,v 1.4.2.1 1999/12/07 20:54:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 31st December 1997.
// Base class for models.
//
// Class Description:
//
// G4VModel is a base class for visualization models. A model is a
// 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.
#ifndef G4VMODEL_HH
#define G4VMODEL_HH
@@ -24,9 +30,9 @@ class G4ModelingParameters;
class G4VModel {
friend ostream& operator << (ostream& os, const G4VModel&);
public: // With description
public:
friend ostream& operator << (ostream& os, const G4VModel&);
G4VModel
(const G4Transform3D& modelTransformation = G4Transform3D::Identity,
@@ -34,36 +40,34 @@ public:
virtual ~G4VModel ();
// For RWTPtrOrderedVector...
public: // Without description
G4bool operator == (const G4VModel&) const;
// For G4RWTPtrOrderedVector...
public: // With description
virtual void DescribeYourselfTo (G4VGraphicsScene&) = 0;
// The main task of a model is to describe itself to the scene.
virtual G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
const G4ModelingParameters* GetModelingParameters () const;
virtual G4String GetCurrentDescription () const;
// A description which depends on the current state of the model.
virtual G4bool Validate ();
// Validate, but allow internal changes (hence non-const function).
virtual G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
//////////////////////////////////////////////////////////
// Access functions...
const G4ModelingParameters* GetModelingParameters () const;
const G4String& GetGlobalTag () const;
// A tag which does not change and lasts the life of the model.
const G4VisExtent& GetExtent () const;
// Extent of visible objects in local coordinate system.
// Define protected data member in derived class constructor.
const G4String& GetGlobalDescription () const;
// A description which does not change and lasts the life of the model.
// Define protected data member in derived class constructor.
const G4VisExtent& GetExtent () const;
// Extent of visible objects in local coordinate system.
const G4String& GetGlobalTag () const;
// A tag which does not change and lasts the life of the model.
// Define protected data member in derived class constructor.
const G4Transform3D& GetTransformation () const;
@@ -71,6 +75,9 @@ public:
void SetModelingParameters (const G4ModelingParameters*);
virtual G4bool Validate ();
// Validate, but allow internal changes (hence non-const function).
protected:
G4String fGlobalTag;
@@ -1,20 +1,18 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4VModel.icc,v 1.2 1999/01/11 00:48:50 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VModel.icc,v 1.3.6.1 1999/12/07 20:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 31st December 1997.
// Base class for models.
inline G4VModel::~G4VModel () {}
inline G4bool G4VModel::operator == (const G4VModel& model) const{
inline G4bool G4VModel::operator == (const G4VModel& model) const {
return this == &model;
}
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4BoundingSphereScene.cc,v 1.2 1999/01/11 00:48:50 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4BoundingSphereScene.cc,v 1.2.8.1 1999/12/07 20:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 7th June 1997
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4FlavoredParallelWorldModel.cc,v 1.3 1999/04/16 09:05:41 mora Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4FlavoredParallelWorldModel.cc,v 1.3.8.1 1999/12/07 20:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// P. Mora de Freitas et M.Verderi - 19 June 1998.
// Model for flavored parallel world volumes.
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4HitsModel.cc,v 1.3 1999/05/10 14:04:28 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4HitsModel.cc,v 1.3.8.1 1999/12/07 20:54:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 26th August 1998.
@@ -0,0 +1,85 @@
// 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: G4LogicalVolumeModel.cc,v 1.1.6.1 1999/12/07 20:54:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 26th July 1999.
// Model for logical volumes.
#include "G4LogicalVolumeModel.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4ModelingParameters.hh"
#include "G4VGraphicsScene.hh"
////////////////#include "G4DrawVoxels.hh"
G4LogicalVolumeModel::G4LogicalVolumeModel
(G4LogicalVolume* pLV,
G4int soughtDepth,
const G4Transform3D& modelTransformation,
const G4ModelingParameters* pMP):
// Instantiate a G4PhysicalVolumeModel with a G4PVPlacement to
// represent this logical volume. It has no rotation and a null
// translation so that the logical volume will be seen in its own
// reference system. It will be added to the physical volume store
// but it will not be part of the normal geometry heirarchy so it
// has no mother.
G4PhysicalVolumeModel
(new G4PVPlacement (0, // No rotation.
G4ThreeVector(), // Null traslation.
"PhysVol representaion of LogVol " + pLV -> GetName (),
pLV,
0, // No mother.
false, // Not "MANY".
0), // Copy number.
soughtDepth,
modelTransformation,
pMP,
true), // Use full extent.
fpLV (pLV)
{
fGlobalTag = fpLV -> GetName ();
fGlobalDescription = "G4LogicalVolumeModel " + fGlobalTag;
}
G4LogicalVolumeModel::~G4LogicalVolumeModel () {}
G4String G4LogicalVolumeModel::GetCurrentDescription () const {
return "G4LogicalVolumeModel " + GetCurrentTag ();
}
void G4LogicalVolumeModel::DescribeYourselfTo
(G4VGraphicsScene& sceneHandler) {
// Store current modeling parameters and ensure nothing is culled.
const G4ModelingParameters* tpMP = fpMP;
G4ModelingParameters nonCulledMP (*fpMP);
nonCulledMP.SetCulling (false);
fpMP = &nonCulledMP;
G4PhysicalVolumeModel::DescribeYourselfTo (sceneHandler);
fpMP = tpMP;
/*****************************
// Add Voxels.
G4DrawVoxels dv;
G4PlacedPolyhedronList* pPPL =
dv.CreatePlacedPolyhedra (fpTopPV -> GetLogicalVolume ());
for (int i = 0; i < pPPL -> entries (); i++) {
const G4Transform3D& transform = (*pPPL)[i].GetTransform ();
const G4Polyhedron& polyhedron = (*pPPL)[i].GetPolyhedron ();
sceneHandler.BeginPrimitives (transform);
sceneHandler.AddPrimitive (polyhedron);
sceneHandler.EndPrimitives ();
}
delete pPPL;
*********************************/
}
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4ModelingParameters.cc,v 1.3 1999/05/25 09:14:26 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4ModelingParameters.cc,v 1.3.8.1 1999/12/07 20:54:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 31st December 1997.
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4NullModel.cc,v 1.2 1999/01/11 00:48:52 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4NullModel.cc,v 1.2.8.1 1999/12/07 20:54:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 4th April 1998.
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4PhysicalVolumeModel.cc,v 1.3 1999/01/10 13:25:51 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4PhysicalVolumeModel.cc,v 1.6.2.1 1999/12/07 20:54:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 31st December 1997.
@@ -20,6 +20,8 @@
#include "G4VPVParameterisation.hh"
#include "G4LogicalVolume.hh"
#include "G4VSolid.hh"
#include "G4BooleanSolid.hh"
#include "G4DisplacedSolid.hh"
#include "G4Material.hh"
#include "G4VisAttributes.hh"
#include "G4BoundingSphereScene.hh"
@@ -36,7 +38,8 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
(G4VPhysicalVolume* pVPV,
G4int soughtDepth,
const G4Transform3D& modelTransformation,
const G4ModelingParameters* pMP):
const G4ModelingParameters* pMP,
G4bool useFullExtent):
G4VModel (modelTransformation, pMP),
fpTopPV (pVPV),
fTopPVName (pVPV -> GetName ()),
@@ -55,46 +58,51 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
fGlobalTag = fpTopPV -> GetName () + "." + a;
fGlobalDescription = "G4PhysicalVolumeModel " + fGlobalTag;
G4BoundingSphereScene bsScene;
const G4ModelingParameters* tempMP = fpMP;
G4ModelingParameters mParams
(0, // No default vis attributes.
G4ModelingParameters::wireframe,
true, // Global culling.
true, // Cull invisible volumes.
false, // Density culling.
0., // Density (not relevant if density culling false).
true, // Cull daughters of opaque mothers.
24, // No of sides (not relevant for this operation).
true, // View geometry.
false, // View hits - not relevant for physical volume model.
false); // View digis - not relevant for physical volume model.
fpMP = &mParams;
//bsScene.SetBoundingSphereExtent
// (fpTopPV -> GetLogicalVolume () -> GetSolid () -> GetExtent ());
DescribeYourselfTo (bsScene);
fExtent = bsScene.GetBoundingSphereExtent ();
fpMP = tempMP;
if (useFullExtent) {
fExtent = fpTopPV -> GetLogicalVolume () -> GetSolid () -> GetExtent ();
}
else {
G4BoundingSphereScene bsScene;
const G4ModelingParameters* tempMP = fpMP;
G4ModelingParameters mParams
(0, // No default vis attributes.
G4ModelingParameters::wireframe,
true, // Global culling.
true, // Cull invisible volumes.
false, // Density culling.
0., // Density (not relevant if density culling false).
true, // Cull daughters of opaque mothers.
24, // No of sides (not relevant for this operation).
true, // View geometry.
false, // View hits - not relevant for physical volume model.
false); // View digis - not relevant for physical volume model.
fpMP = &mParams;
DescribeYourselfTo (bsScene);
fExtent = bsScene.GetBoundingSphereExtent ();
fpMP = tempMP;
}
}
void G4PhysicalVolumeModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
G4PhysicalVolumeModel::~G4PhysicalVolumeModel () {}
void G4PhysicalVolumeModel::DescribeYourselfTo
(G4VGraphicsScene& sceneHandler) {
if (fpMP && fpMP -> IsViewGeom ()) {
scene.EstablishSpecials (*this);
sceneHandler.EstablishSpecials (*this);
// See .hh file for explanation of this mechanism.
fCurrentDepth = 0;
// Store in working space (via pointer to working space).
if (fpCurrentDepth) *fpCurrentDepth = fCurrentDepth;
//G4Transform3D startingTransformation = fTransform;
G4Transform3D startingTransformation;
G4Transform3D startingTransformation = fTransform;
VisitGeometryAndGetVisReps (fpTopPV,
fSoughtDepth,
startingTransformation,
scene);
sceneHandler);
// Clear current data and working space (via pointers to working space).
fCurrentDepth = 0;
@@ -104,7 +112,7 @@ void G4PhysicalVolumeModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
if (fppCurrentPV) *fppCurrentPV = fpCurrentPV;
if (fppCurrentLV) *fppCurrentLV = fpCurrentLV;
scene.DecommissionSpecials (*this);
sceneHandler.DecommissionSpecials (*this);
// Clear pointers to working space.
fpCurrentDepth = 0;
@@ -142,11 +150,11 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
(G4VPhysicalVolume* pVPV,
G4int soughtDepth,
const G4Transform3D& theAT,
G4VGraphicsScene& scene) {
G4VGraphicsScene& sceneHandler) {
// Visits geometry structure to a given depth (soughtDepth), starting
// at given physical volume with given starting transformation and
// describes volumes to the scene.
// describes volumes to the scene handler.
// soughtDepth < 0 (default) implies full visit.
// theAT is the Accumulated Transformation.
@@ -164,7 +172,16 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
G4VSolid* pSol;
G4Material* pMaterial;
if (pVPV -> IsReplicated ()) {
if (!(pVPV -> IsReplicated ())) {
// Non-replicated physical volume.
pSol = pLV -> GetSolid ();
pMaterial = pLV -> GetMaterial ();
DescribeAndDescend (pVPV, soughtDepth, pLV, pSol, pMaterial,
theAT, sceneHandler);
}
else {
// Replicated or parametrised physical volume.
EAxis axis;
G4int nReplicas;
G4double width;
@@ -180,7 +197,7 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
pSol -> ComputeDimensions (pP, n, pVPV);
pVPV -> SetCopyNo (n);
DescribeAndDescend (pVPV, soughtDepth, pLV, pSol, pMaterial,
theAT, scene);
theAT, sceneHandler);
}
}
else { // Plain replicated volume. From geometry_guide.txt...
@@ -240,15 +257,10 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
pSol = pLV -> GetSolid ();
pMaterial = pLV -> GetMaterial ();
DescribeAndDescend (pVPV, soughtDepth, pLV, pSol, pMaterial,
theAT, scene);
theAT, sceneHandler);
}
}
}
else {
pSol = pLV -> GetSolid ();
pMaterial = pLV -> GetMaterial ();
DescribeAndDescend (pVPV, soughtDepth, pLV, pSol, pMaterial, theAT, scene);
}
return;
}
@@ -260,12 +272,12 @@ void G4PhysicalVolumeModel::DescribeAndDescend
G4VSolid* pSol,
const G4Material* pMaterial,
const G4Transform3D& theAT,
G4VGraphicsScene& scene) {
G4VGraphicsScene& sceneHandler) {
const HepRotation* pObjectRotation = pVPV -> GetObjectRotation ();
const Hep3Vector& translation = pVPV -> GetTranslation ();
G4Transform3D theLT = G4Transform3D (*pObjectRotation, translation);
G4Transform3D theNewAT = theAT * theLT;
G4Transform3D theLT (G4Transform3D (*pObjectRotation, translation));
G4Transform3D theNewAT (theAT * theLT);
/********************************************************
G4cout << "G4PhysicalVolumeModel::DescribeAndDescend: "
@@ -296,9 +308,9 @@ void G4PhysicalVolumeModel::DescribeAndDescend
// Make decision to Draw.
G4bool thisToBeDrawn = !IsThisCulled (pLV, pMaterial);
if (thisToBeDrawn) {
scene.PreAddThis (theNewAT, *(pLV -> GetVisAttributes ()));
pSol -> DescribeYourselfTo (scene);
scene.PostAddThis ();
const G4VisAttributes* pVisAttribs = pLV -> GetVisAttributes ();
if (!pVisAttribs) pVisAttribs = fpMP -> GetDefaultVisAttributes ();
DescribeSolids (theNewAT, pSol, pVisAttribs, sceneHandler);
}
// First check if mother covers...
@@ -316,7 +328,8 @@ void G4PhysicalVolumeModel::DescribeAndDescend
G4VPhysicalVolume* pVPV = pLV -> GetDaughter (iDaughter);
// Descend the geometry structure recursively...
fCurrentDepth++;
VisitGeometryAndGetVisReps (pVPV, soughtDepth - 1, theNewAT, scene);
VisitGeometryAndGetVisReps
(pVPV, soughtDepth - 1, theNewAT, sceneHandler);
fCurrentDepth--;
}
}
@@ -324,6 +337,37 @@ void G4PhysicalVolumeModel::DescribeAndDescend
}
}
void G4PhysicalVolumeModel::DescribeSolids
(const G4Transform3D& theAT,
G4VSolid* pSol,
const G4VisAttributes* pVisAttribs,
G4VGraphicsScene& sceneHandler) {
// Look for "constituents". Could be a Boolean solid.
G4VSolid* pBoolSolA = pSol -> GetConstituentSolid (0);
if (pBoolSolA) {
// Boolean solid - display components...
DescribeSolids (theAT, pBoolSolA, pVisAttribs, sceneHandler);
G4VSolid* pBoolSolB = pSol -> GetConstituentSolid (1);
if (!pBoolSolB) {
G4Exception
("G4PhysicalVolumeModel::DescribeSolids:"
" 2nd component solid is missing.");
}
G4Transform3D theBT (theAT);
G4DisplacedSolid* pDisSol = pBoolSolB -> GetDisplacedSolidPtr ();
if (pDisSol) {
theBT = theBT * G4Transform3D (pDisSol -> GetObjectRotation ().inverse (),
pDisSol -> GetObjectTranslation ());
}
DescribeSolids (theBT, pBoolSolB, pVisAttribs, sceneHandler);
}
else { // Non-boolean solid.
sceneHandler.PreAddThis (theAT, *pVisAttribs);
pSol -> DescribeYourselfTo (sceneHandler);
sceneHandler.PostAddThis ();
}
}
G4bool G4PhysicalVolumeModel::IsThisCulled (const G4LogicalVolume* pLV,
const G4Material* pMaterial) {
// If true, cull, i.e., do not Draw.
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4PhysicalVolumeSearchScene.cc,v 1.3 1999/02/07 17:23:22 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4PhysicalVolumeSearchScene.cc,v 1.3.8.1 1999/12/07 20:54:12 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 10th August 1998.
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4TrajectoriesModel.cc,v 1.5 1999/05/26 02:11:42 stanaka Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4TrajectoriesModel.cc,v 1.5.8.1 1999/12/07 20:54:12 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 26th August 1998.
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4VModel.cc,v 1.2 1999/01/11 00:48:54 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VModel.cc,v 1.3.6.1 1999/12/07 20:54:12 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// John Allison 31st December 1997.
@@ -25,6 +25,8 @@ G4VModel::G4VModel (const G4Transform3D& modelTransformation,
fGlobalDescription = "Default Global Description";
}
G4VModel::~G4VModel () {}
ostream& operator << (ostream& os, const G4VModel& m) {
os << m.fGlobalDescription;
os << "\n Modeling parameters:";