Import Geant4 7.1.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.8 2004/06/08 08:18:26 gcosmo Exp $
|
||||
# $Id: GNUmakefile,v 1.9 2005/02/15 14:51:15 johna Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for modeling library. John Allison, 31/12/1997.
|
||||
# --------------------------------------------------------------
|
||||
@@ -34,6 +34,7 @@ CPPFLAGS += -I$(G4BASE)/run/include
|
||||
CPPFLAGS += -I$(G4BASE)/event/include
|
||||
CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include
|
||||
CPPFLAGS += -I$(G4BASE)/digits_hits/digits/include
|
||||
CPPFLAGS += -I$(G4BASE)/digits_hits/detector/include
|
||||
CPPFLAGS += -I$(G4BASE)/tracking/include
|
||||
CPPFLAGS += -I$(G4BASE)/track/include
|
||||
CPPFLAGS += -I$(G4BASE)/intercoms/include
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.30 2004/11/11 16:07:33 johna Exp $
|
||||
$Id: History,v 1.35 2005/06/07 16:56:40 allison Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -20,6 +20,22 @@ committal in the CVS repository !
|
||||
History file for visualization/modeling
|
||||
---------------------------------------
|
||||
|
||||
7th June 2005 John Allison (modeling-V07-00-02)
|
||||
- G4PhysicalVolumeModel: fixed case of off-origin volume.
|
||||
- G4TextModel: Further small improvement.
|
||||
|
||||
31st May 2005 John Allison (modeling-V07-00-01)
|
||||
- G4TextModel: Improved global tag for better identification.
|
||||
|
||||
6th May 2005 John Allison (modeling-V07-00-00)
|
||||
- G4PhysicalVolumeModel: SetCopyNo of replicas and paramaterised volumes.
|
||||
|
||||
3rd March 2005 John Allison (vis-V07-00-08)
|
||||
- Added Set methods to G4VModel.
|
||||
- Added argument to G4CallbackModel::operator()(const G4Transform3D&) so that
|
||||
the model could implement a given transformation. Provided default for
|
||||
G4VUserVisAction::(const G4Transform3D& = G4Transform3D::Identity).
|
||||
|
||||
11th November 2004 John Allison (vis-V06-02-05)
|
||||
- Made use use of smart method GetPolyhedron for solids. This greatly
|
||||
speeds 2nd and subsequent drawings when kernel access is required.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AxesModel.hh,v 1.4 2001/08/24 20:34:14 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 3rd April 2001
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AxesModel.icc,v 1.3 2001/08/24 20:34:15 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
|
||||
inline G4String G4AxesModel::GetCurrentTag () const {
|
||||
return fGlobalTag;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4BoundingSphereScene.hh,v 1.13 2003/05/30 13:01:31 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4BoundingSphereScene.hh,v 1.15 2005/06/07 16:54:33 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 7th June 1997
|
||||
@@ -51,23 +51,27 @@ class G4BoundingSphereScene: public G4VGraphicsScene {
|
||||
public:
|
||||
G4BoundingSphereScene (G4VModel* pModel = 0);
|
||||
virtual ~G4BoundingSphereScene ();
|
||||
void AddThis (const G4Box& s) {Accrue (s);}
|
||||
void AddThis (const G4Cons& s) {Accrue (s);}
|
||||
void AddThis (const G4Tubs& s) {Accrue (s);}
|
||||
void AddThis (const G4Trd& s) {Accrue (s);}
|
||||
void AddThis (const G4Trap& s) {Accrue (s);}
|
||||
void AddThis (const G4Sphere& s) {Accrue (s);}
|
||||
void AddThis (const G4Para& s) {Accrue (s);}
|
||||
void AddThis (const G4Torus& s) {Accrue (s);}
|
||||
void AddThis (const G4Polycone& s) {Accrue (s);}
|
||||
void AddThis (const G4Polyhedra& s) {Accrue (s);}
|
||||
void AddThis (const G4VSolid& s) {Accrue (s);}
|
||||
void AddThis (const G4VTrajectory&) {}
|
||||
void AddThis (const G4VHit&) {}
|
||||
void PreAddThis (const G4Transform3D& objectTransformation,
|
||||
const G4VisAttributes&);
|
||||
void PostAddThis () {}
|
||||
void PreAddSolid (const G4Transform3D& objectTransformation,
|
||||
const G4VisAttributes&);
|
||||
void PostAddSolid () {}
|
||||
void AddSolid (const G4Box& s) {Accrue (s);}
|
||||
void AddSolid (const G4Cons& s) {Accrue (s);}
|
||||
void AddSolid (const G4Tubs& s) {Accrue (s);}
|
||||
void AddSolid (const G4Trd& s) {Accrue (s);}
|
||||
void AddSolid (const G4Trap& s) {Accrue (s);}
|
||||
void AddSolid (const G4Sphere& s) {Accrue (s);}
|
||||
void AddSolid (const G4Para& s) {Accrue (s);}
|
||||
void AddSolid (const G4Torus& s) {Accrue (s);}
|
||||
void AddSolid (const G4Polycone& s) {Accrue (s);}
|
||||
void AddSolid (const G4Polyhedra& s) {Accrue (s);}
|
||||
void AddSolid (const G4VSolid& s) {Accrue (s);}
|
||||
void AddCompound (const G4VTrajectory&) {}
|
||||
void AddCompound (const G4VHit&) {}
|
||||
G4VisExtent GetBoundingSphereExtent ();
|
||||
const G4Point3D& GetCentre() const {return fCentre;}
|
||||
G4double GetRadius() const {return fRadius;}
|
||||
|
||||
void SetCentre(const G4Point3D& centre) {fCentre = centre;}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// The following 2 functions can be used by any code which wishes to
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4CallbackModel.hh,v 1.3 2005/03/03 16:22:02 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
// G4CallbackModel calls a user-defined function containing, for
|
||||
// example, calls to the Draw methods of G4VVisManager. This allows
|
||||
// the user to add his own graphical objects to a scene. The idea is
|
||||
// that the callback function is invoked by the vis system to refresh
|
||||
// the screen or remake a graphical database whenever required.
|
||||
//
|
||||
// The user instantiates a function object containing, for example,
|
||||
// calls to the Draw methods of G4VVisManager. A base class
|
||||
// G4VUserVisAction is provided in the visualisation category. A
|
||||
// G4CallbackModel is made by instantiating this template with a
|
||||
// pointer to the function object. The G4VisManager does this for the
|
||||
// user if he/she registers it (SetUserAction) and issues the command
|
||||
// /vis/scene/add/userAction. See the User Guide for Application
|
||||
// Developers, Section 8.8.7 and 8.8.8.
|
||||
|
||||
#ifndef G4CALLBACKMODEL_HH
|
||||
#define G4CALLBACKMODEL_HH
|
||||
|
||||
#include "G4VModel.hh"
|
||||
|
||||
template <class F> class G4CallbackModel: public G4VModel {
|
||||
|
||||
public:
|
||||
G4CallbackModel(F* function):
|
||||
fFunction(function) {}
|
||||
~G4CallbackModel() {}
|
||||
void DescribeYourselfTo(G4VGraphicsScene&) {
|
||||
(*fFunction)(fTransform);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
F* fFunction;
|
||||
|
||||
private:
|
||||
|
||||
// Private copy constructor and assigment operator - copying and
|
||||
// assignment not allowed. Keeps CodeWizard happy.
|
||||
G4CallbackModel (const G4CallbackModel&);
|
||||
G4CallbackModel& operator = (const G4CallbackModel&);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FlavoredParallelWorldModel.hh,v 1.6 2001/07/11 10:09:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
// P. Mora de Freitas et M.Verderi - 19 June 1998.
|
||||
//
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HitsModel.hh,v 1.7 2001/08/24 20:36:13 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 26th August 1998.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HitsModel.icc,v 1.6 2001/08/24 20:36:14 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
|
||||
inline G4String G4HitsModel::GetCurrentTag () const {
|
||||
return fGlobalTag;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4LogicalVolumeModel.hh,v 1.5 2001/07/11 10:09:21 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4LogicalVolumeModel.hh,v 1.6 2005/02/15 14:51:25 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 26th July 1999.
|
||||
@@ -53,6 +53,9 @@ public: // With description
|
||||
G4LogicalVolumeModel
|
||||
(G4LogicalVolume*,
|
||||
G4int soughtDepth = 1,
|
||||
G4bool booleans = true,
|
||||
G4bool voxels = true,
|
||||
G4bool readout = true,
|
||||
const G4Transform3D& modelTransformation = G4Transform3D::Identity,
|
||||
const G4ModelingParameters* = 0);
|
||||
|
||||
@@ -77,6 +80,9 @@ protected:
|
||||
// Data members...
|
||||
|
||||
G4LogicalVolume* fpLV;
|
||||
G4bool fBooleans; // Flag for drawing boolean components.
|
||||
G4bool fVoxels; // Flag for drawing voxels.
|
||||
G4bool fReadout; // Flag for drawing readout geometry.
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ModelingParameters.hh,v 1.8 2003/06/16 17:14:28 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4ModelingParameters.hh,v 1.10 2005/03/15 12:56:29 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
@@ -109,7 +109,7 @@ public: // With description
|
||||
void SetDensityCulling (G4bool);
|
||||
void SetVisibleDensity (G4double);
|
||||
void SetCullingCovered (G4bool);
|
||||
void SetNoOfSides (G4int);
|
||||
G4int SetNoOfSides (G4int); // Returns actual number set.
|
||||
void SetViewGeom ();
|
||||
void UnsetViewGeom ();
|
||||
void SetViewHits ();
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ModelingParameters.icc,v 1.4 2001/07/11 10:09:21 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4NullModel.hh,v 1.6 2001/08/24 20:36:15 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 4th April 1998.
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeMassScene.hh,v 1.2 2004/12/10 18:19:40 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-05 $
|
||||
// $Id: G4PhysicalVolumeMassScene.hh,v 1.4 2005/01/27 20:06:35 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 12th September 2004
|
||||
@@ -66,6 +66,7 @@
|
||||
class G4VPhysicalVolume;
|
||||
class G4LogicalVolume;
|
||||
class G4PhysicalVolumeModel;
|
||||
class G4Material;
|
||||
|
||||
class G4PhysicalVolumeMassScene: public G4VGraphicsScene {
|
||||
|
||||
@@ -87,21 +88,21 @@ public: // With description
|
||||
public:
|
||||
|
||||
// Force execution of AccrueMass for all solids...
|
||||
void AddThis (const G4Box& s) {AccrueMass (s);}
|
||||
void AddThis (const G4Cons & s) {AccrueMass (s);}
|
||||
void AddThis (const G4Tubs& s) {AccrueMass (s);}
|
||||
void AddThis (const G4Trd& s) {AccrueMass (s);}
|
||||
void AddThis (const G4Trap& s) {AccrueMass (s);}
|
||||
void AddThis (const G4Sphere& s) {AccrueMass (s);}
|
||||
void AddThis (const G4Para& s) {AccrueMass (s);}
|
||||
void AddThis (const G4Torus& s) {AccrueMass (s);}
|
||||
void AddThis (const G4Polycone& s) {AccrueMass (s);}
|
||||
void AddThis (const G4Polyhedra& s) {AccrueMass (s);}
|
||||
void AddThis (const G4VSolid& s) {AccrueMass (s);}
|
||||
void AddThis (const G4VTrajectory&) {}
|
||||
void AddThis (const G4VHit&) {}
|
||||
void PreAddThis (const G4Transform3D&, const G4VisAttributes&) {}
|
||||
void PostAddThis () {}
|
||||
void PreAddSolid (const G4Transform3D&, const G4VisAttributes&) {}
|
||||
void PostAddSolid () {}
|
||||
void AddSolid (const G4Box& s) {AccrueMass (s);}
|
||||
void AddSolid (const G4Cons & s) {AccrueMass (s);}
|
||||
void AddSolid (const G4Tubs& s) {AccrueMass (s);}
|
||||
void AddSolid (const G4Trd& s) {AccrueMass (s);}
|
||||
void AddSolid (const G4Trap& s) {AccrueMass (s);}
|
||||
void AddSolid (const G4Sphere& s) {AccrueMass (s);}
|
||||
void AddSolid (const G4Para& s) {AccrueMass (s);}
|
||||
void AddSolid (const G4Torus& s) {AccrueMass (s);}
|
||||
void AddSolid (const G4Polycone& s) {AccrueMass (s);}
|
||||
void AddSolid (const G4Polyhedra& s) {AccrueMass (s);}
|
||||
void AddSolid (const G4VSolid& s) {AccrueMass (s);}
|
||||
void AddCompound (const G4VTrajectory&) {}
|
||||
void AddCompound (const G4VHit&) {}
|
||||
void EstablishSpecials (G4PhysicalVolumeModel&);
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
@@ -130,6 +131,7 @@ private:
|
||||
G4int fCurrentDepth; // Current depth of geom. hierarchy.
|
||||
G4VPhysicalVolume* fpCurrentPV; // Current physical volume.
|
||||
G4LogicalVolume* fpCurrentLV; // Current logical volume.
|
||||
G4Material* fpCurrentMaterial; // Current material.
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeModel.hh,v 1.17 2004/09/13 18:04:55 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4PhysicalVolumeModel.hh,v 1.20 2005/03/09 16:23:21 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
@@ -49,6 +49,7 @@ class G4LogicalVolume;
|
||||
class G4VSolid;
|
||||
class G4Material;
|
||||
class G4VisAttributes;
|
||||
class G4Polyhedron;
|
||||
|
||||
class G4PhysicalVolumeModel: public G4VModel {
|
||||
|
||||
@@ -88,23 +89,34 @@ public: // With description
|
||||
const G4PhysicalVolumeModel* GetG4PhysicalVolumeModel () const {
|
||||
return this;
|
||||
}
|
||||
|
||||
G4PhysicalVolumeModel* GetG4PhysicalVolumeModel () {
|
||||
return this;
|
||||
}
|
||||
|
||||
const G4VPhysicalVolume* GetTopPhysicalVolume () const {return fpTopPV;}
|
||||
|
||||
G4int GetRequestedDepth () const {return fRequestedDepth;}
|
||||
|
||||
const G4Polyhedron* GetClippingVolume () const {
|
||||
return fpClippingPolyhedron;
|
||||
}
|
||||
|
||||
void SetRequestedDepth (G4int requestedDepth) {
|
||||
fRequestedDepth = requestedDepth;
|
||||
}
|
||||
|
||||
void SetClippingPolyhedron (const G4Polyhedron* pClippingPolyhedron) {
|
||||
fpClippingPolyhedron = pClippingPolyhedron;
|
||||
}
|
||||
|
||||
G4bool Validate (G4bool warn);
|
||||
// Validate, but allow internal changes (hence non-const function).
|
||||
|
||||
void DefinePointersToWorkingSpace (G4int* pCurrentDepth,
|
||||
G4VPhysicalVolume** ppCurrentPV,
|
||||
G4LogicalVolume** ppCurrentLV);
|
||||
G4LogicalVolume** ppCurrentLV,
|
||||
G4Material** ppCurrentMaterial);
|
||||
// For use (optional) by the scene handler if it needs to know about
|
||||
// the current information maintained through these pointers.
|
||||
|
||||
@@ -121,7 +133,7 @@ protected:
|
||||
G4int requestedDepth,
|
||||
G4LogicalVolume*,
|
||||
G4VSolid*,
|
||||
const G4Material*,
|
||||
G4Material*,
|
||||
const G4Transform3D&,
|
||||
G4VGraphicsScene&);
|
||||
|
||||
@@ -149,7 +161,9 @@ protected:
|
||||
G4int fCurrentDepth; // Current depth of geom. hierarchy.
|
||||
G4VPhysicalVolume* fpCurrentPV; // Current physical volume.
|
||||
G4LogicalVolume* fpCurrentLV; // Current logical volume.
|
||||
G4Material* fpCurrentMaterial; // Current material.
|
||||
G4bool fCurtailDescent;// Can be set to curtail descent.
|
||||
const G4Polyhedron*fpClippingPolyhedron;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Pointers to working space in scene, if required.
|
||||
@@ -157,6 +171,7 @@ protected:
|
||||
G4int* fpCurrentDepth; // Current depth of geom. hierarchy.
|
||||
G4VPhysicalVolume** fppCurrentPV; // Current physical volume.
|
||||
G4LogicalVolume** fppCurrentLV; // Current logical volume.
|
||||
G4Material** fppCurrentMaterial; // Current material.
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeSearchScene.hh,v 1.11 2003/05/30 13:01:31 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4PhysicalVolumeSearchScene.hh,v 1.13 2005/01/27 20:06:37 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 10th August 1998.
|
||||
@@ -52,22 +52,22 @@ public:
|
||||
G4PhysicalVolumeSearchScene
|
||||
(const G4String& requiredPhysicalVolumeName, G4int requiredCopyNo);
|
||||
virtual ~G4PhysicalVolumeSearchScene ();
|
||||
void AddThis (const G4Box& s) {FindVolume (s);}
|
||||
void AddThis (const G4Cons & s) {FindVolume (s);}
|
||||
void AddThis (const G4Tubs& s) {FindVolume (s);}
|
||||
void AddThis (const G4Trd& s) {FindVolume (s);}
|
||||
void AddThis (const G4Trap& s) {FindVolume (s);}
|
||||
void AddThis (const G4Sphere& s) {FindVolume (s);}
|
||||
void AddThis (const G4Para& s) {FindVolume (s);}
|
||||
void AddThis (const G4Torus& s) {FindVolume (s);}
|
||||
void AddThis (const G4Polycone& s) {FindVolume (s);}
|
||||
void AddThis (const G4Polyhedra& s) {FindVolume (s);}
|
||||
void AddThis (const G4VSolid& s) {FindVolume (s);}
|
||||
void AddThis (const G4VTrajectory&) {}
|
||||
void AddThis (const G4VHit&) {}
|
||||
void PreAddThis (const G4Transform3D& objectTransformation,
|
||||
const G4VisAttributes&);
|
||||
void PostAddThis ();
|
||||
void PreAddSolid (const G4Transform3D& objectTransformation,
|
||||
const G4VisAttributes&);
|
||||
void PostAddSolid ();
|
||||
void AddSolid (const G4Box& s) {FindVolume (s);}
|
||||
void AddSolid (const G4Cons & s) {FindVolume (s);}
|
||||
void AddSolid (const G4Tubs& s) {FindVolume (s);}
|
||||
void AddSolid (const G4Trd& s) {FindVolume (s);}
|
||||
void AddSolid (const G4Trap& s) {FindVolume (s);}
|
||||
void AddSolid (const G4Sphere& s) {FindVolume (s);}
|
||||
void AddSolid (const G4Para& s) {FindVolume (s);}
|
||||
void AddSolid (const G4Torus& s) {FindVolume (s);}
|
||||
void AddSolid (const G4Polycone& s) {FindVolume (s);}
|
||||
void AddSolid (const G4Polyhedra& s) {FindVolume (s);}
|
||||
void AddSolid (const G4VSolid& s) {FindVolume (s);}
|
||||
void AddCompound (const G4VTrajectory&) {}
|
||||
void AddCompound (const G4VHit&) {}
|
||||
void EstablishSpecials (G4PhysicalVolumeModel&);
|
||||
G4int GetFoundDepth () const;
|
||||
G4VPhysicalVolume* GetFoundVolume () const;
|
||||
@@ -94,6 +94,7 @@ private:
|
||||
G4int fCurrentDepth; // Current depth of geom. hierarchy.
|
||||
G4VPhysicalVolume* fpCurrentPV; // Current physical volume.
|
||||
G4LogicalVolume* fpCurrentLV; // Current logical volume.
|
||||
G4Material* fpCurrentMaterial; // Current material.
|
||||
const G4Transform3D* fpCurrentObjectTransformation;
|
||||
G4int fFoundDepth; // Found depth.
|
||||
G4VPhysicalVolume* fpFoundPV; // Found physical volume.
|
||||
|
||||
@@ -21,20 +21,20 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeSearchScene.icc,v 1.4 2001/07/11 10:09:21 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4PhysicalVolumeSearchScene.icc,v 1.5 2005/01/27 20:06:42 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 10th August 1998.
|
||||
// An artificial scene to find physical volumes.
|
||||
|
||||
inline void G4PhysicalVolumeSearchScene::PreAddThis
|
||||
inline void G4PhysicalVolumeSearchScene::PreAddSolid
|
||||
(const G4Transform3D& objectTransformation,
|
||||
const G4VisAttributes&) {
|
||||
fpCurrentObjectTransformation = &objectTransformation;
|
||||
}
|
||||
|
||||
inline void G4PhysicalVolumeSearchScene::PostAddThis () {}
|
||||
inline void G4PhysicalVolumeSearchScene::PostAddSolid () {}
|
||||
|
||||
inline G4int G4PhysicalVolumeSearchScene::GetFoundDepth () const {
|
||||
return fFoundDepth;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ScaleModel.hh,v 1.2 2001/08/24 20:36:18 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 21st July 2001.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ScaleModel.icc,v 1.2 2001/08/24 20:36:19 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
|
||||
inline G4String G4ScaleModel::GetCurrentTag () const {
|
||||
return fGlobalTag;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TextModel.hh,v 1.4 2001/08/24 20:36:21 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4TextModel.hh,v 1.5 2005/05/31 17:01:25 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 3rd April 2001
|
||||
@@ -64,7 +64,7 @@ private:
|
||||
G4TextModel (const G4TextModel&);
|
||||
G4TextModel& operator = (const G4TextModel&);
|
||||
|
||||
G4Text fText;
|
||||
G4Text fG4Text;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4TextModel.icc,v 1.3 2001/08/24 20:36:22 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
|
||||
inline G4String G4TextModel::GetCurrentTag () const {
|
||||
return fGlobalTag;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4TrajectoriesModel.hh,v 1.8 2002/11/11 18:39:28 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 26th August 1998.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4TrajectoriesModel.icc,v 1.6 2001/08/24 20:36:24 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
|
||||
inline G4String G4TrajectoriesModel::GetCurrentTag () const {
|
||||
return fGlobalTag;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VModel.hh,v 1.14 2003/06/16 17:14:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4VModel.hh,v 1.16 2005/03/03 16:39:15 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
@@ -73,26 +73,28 @@ public: // With description
|
||||
|
||||
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 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;
|
||||
// Model transformation, i.e., position and orientation of model in world.
|
||||
// Model transformation, i.e., position and orientation of model in
|
||||
// world. It is the responsibility of the model to apply this
|
||||
// transformation before passing items to the graphics scene.
|
||||
|
||||
virtual const G4PhysicalVolumeModel* GetG4PhysicalVolumeModel () const;
|
||||
virtual G4PhysicalVolumeModel* GetG4PhysicalVolumeModel ();
|
||||
// Returns 0 unless implemented by derived class.
|
||||
|
||||
// Set methods for above...
|
||||
void SetModelingParameters (const G4ModelingParameters*);
|
||||
|
||||
void SetExtent (const G4VisExtent&);
|
||||
void SetGlobalDescription (const G4String&);
|
||||
void SetGlobalTag (const G4String&);
|
||||
void SetTransformation (const G4Transform3D&);
|
||||
|
||||
virtual G4bool Validate (G4bool warn = true);
|
||||
// Validate, but allow internal changes (hence non-const function).
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VModel.icc,v 1.9 2001/07/25 21:12:20 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4VModel.icc,v 1.10 2005/03/03 16:39:15 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
@@ -64,3 +64,15 @@ inline void G4VModel::SetModelingParameters (const G4ModelingParameters* pMP) {
|
||||
inline void G4VModel::SetExtent (const G4VisExtent& extent) {
|
||||
fExtent = extent;
|
||||
}
|
||||
|
||||
inline void G4VModel::SetGlobalDescription (const G4String& desc) {
|
||||
fGlobalDescription = desc;
|
||||
}
|
||||
|
||||
inline void G4VModel::SetGlobalTag (const G4String& tag) {
|
||||
fGlobalTag = tag;
|
||||
}
|
||||
|
||||
inline void G4VModel::SetTransformation (const G4Transform3D& transform) {
|
||||
fTransform = transform;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AxesModel.cc,v 1.5 2001/08/14 18:43:29 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 3rd April 2001
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4BoundingSphereScene.cc,v 1.8 2001/07/25 21:10:22 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4BoundingSphereScene.cc,v 1.9 2005/01/27 20:06:49 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 7th June 1997
|
||||
@@ -42,7 +42,7 @@ G4BoundingSphereScene::G4BoundingSphereScene (G4VModel* pModel):
|
||||
|
||||
G4BoundingSphereScene::~G4BoundingSphereScene () {}
|
||||
|
||||
void G4BoundingSphereScene::PreAddThis
|
||||
void G4BoundingSphereScene::PreAddSolid
|
||||
(const G4Transform3D& objectTransformation,
|
||||
const G4VisAttributes&) {
|
||||
fpObjectTransformation = &objectTransformation;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FlavoredParallelWorldModel.cc,v 1.6 2002/11/20 17:21:47 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
// 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.9 2002/10/24 15:07:21 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4HitsModel.cc,v 1.11 2005/01/27 20:06:52 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 26th August 1998.
|
||||
@@ -54,10 +54,9 @@ void G4HitsModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler) {
|
||||
for (int iHC = 0; iHC < nHC; iHC++) {
|
||||
G4VHitsCollection* HC = HCE -> GetHC (iHC);
|
||||
if (HC) {
|
||||
size_t nHits = HC -> GetSize ();
|
||||
for(size_t iHit = 0; iHit < nHits; ++iHit) {
|
||||
for(size_t iHit = 0; iHit < HC->GetSize(); ++iHit) {
|
||||
G4VHit* hit = HC -> GetHit (iHit);
|
||||
sceneHandler.AddThis (*hit);
|
||||
sceneHandler.AddCompound (*hit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4LogicalVolumeModel.cc,v 1.9 2003/11/03 17:08:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4LogicalVolumeModel.cc,v 1.11 2005/02/15 14:51:33 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 26th July 1999.
|
||||
@@ -36,10 +36,15 @@
|
||||
#include "G4ModelingParameters.hh"
|
||||
#include "G4VGraphicsScene.hh"
|
||||
#include "G4DrawVoxels.hh"
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "G4VReadOutGeometry.hh"
|
||||
|
||||
G4LogicalVolumeModel::G4LogicalVolumeModel
|
||||
(G4LogicalVolume* pLV,
|
||||
G4int soughtDepth,
|
||||
G4bool booleans,
|
||||
G4bool voxels,
|
||||
G4bool readout,
|
||||
const G4Transform3D& modelTransformation,
|
||||
const G4ModelingParameters* pMP):
|
||||
// Instantiate a G4PhysicalVolumeModel with a G4PVPlacement to
|
||||
@@ -60,7 +65,10 @@ G4LogicalVolumeModel::G4LogicalVolumeModel
|
||||
modelTransformation,
|
||||
pMP,
|
||||
true), // Use full extent.
|
||||
fpLV (pLV)
|
||||
fpLV (pLV),
|
||||
fBooleans (booleans),
|
||||
fVoxels (voxels),
|
||||
fReadout (readout)
|
||||
{
|
||||
fGlobalTag = fpLV -> GetName ();
|
||||
fGlobalDescription = "G4LogicalVolumeModel " + fGlobalTag;
|
||||
@@ -83,19 +91,39 @@ void G4LogicalVolumeModel::DescribeYourselfTo
|
||||
G4PhysicalVolumeModel::DescribeYourselfTo (sceneHandler);
|
||||
fpMP = tpMP;
|
||||
|
||||
if (fpTopPV->GetLogicalVolume()->GetVoxelHeader()) {
|
||||
// Add Voxels.
|
||||
G4DrawVoxels dv;
|
||||
G4PlacedPolyhedronList* pPPL =
|
||||
dv.CreatePlacedPolyhedra (fpTopPV -> GetLogicalVolume ());
|
||||
for (size_t i = 0; i < pPPL -> size (); i++) {
|
||||
const G4Transform3D& transform = (*pPPL)[i].GetTransform ();
|
||||
const G4Polyhedron& polyhedron = (*pPPL)[i].GetPolyhedron ();
|
||||
sceneHandler.BeginPrimitives (transform);
|
||||
sceneHandler.AddPrimitive (polyhedron);
|
||||
sceneHandler.EndPrimitives ();
|
||||
if (fVoxels) {
|
||||
if (fpTopPV->GetLogicalVolume()->GetVoxelHeader()) {
|
||||
// Add Voxels.
|
||||
G4DrawVoxels dv;
|
||||
G4PlacedPolyhedronList* pPPL =
|
||||
dv.CreatePlacedPolyhedra (fpTopPV -> GetLogicalVolume ());
|
||||
for (size_t i = 0; i < pPPL -> size (); i++) {
|
||||
const G4Transform3D& transform = (*pPPL)[i].GetTransform ();
|
||||
const G4Polyhedron& polyhedron = (*pPPL)[i].GetPolyhedron ();
|
||||
sceneHandler.BeginPrimitives (transform);
|
||||
sceneHandler.AddPrimitive (polyhedron);
|
||||
sceneHandler.EndPrimitives ();
|
||||
}
|
||||
delete pPPL;
|
||||
}
|
||||
}
|
||||
|
||||
if (fReadout) {
|
||||
// Draw readout geometry...
|
||||
G4VSensitiveDetector* sd = fpLV->GetSensitiveDetector();
|
||||
if (sd) {
|
||||
G4VReadOutGeometry* roGeom = sd->GetROgeometry();
|
||||
if (roGeom) {
|
||||
G4VPhysicalVolume* roWorld = roGeom->GetROWorld();
|
||||
G4cout << "Readout geometry \"" << roGeom->GetName()
|
||||
<< "\" with top physical volume \""
|
||||
<< roWorld->GetName()
|
||||
<< "\"" << G4endl;
|
||||
G4PhysicalVolumeModel pvModel(roWorld);
|
||||
pvModel.SetModelingParameters(fpMP);
|
||||
pvModel.DescribeYourselfTo(sceneHandler);
|
||||
}
|
||||
}
|
||||
delete pPPL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,23 +134,27 @@ void G4LogicalVolumeModel::DescribeSolid
|
||||
G4VSolid* pSol,
|
||||
const G4VisAttributes* pVisAttribs,
|
||||
G4VGraphicsScene& sceneHandler) {
|
||||
// Look for "constituents". Could be a Boolean solid.
|
||||
G4VSolid* pSol0 = pSol -> GetConstituentSolid (0);
|
||||
if (pSol0) { // Composite solid...
|
||||
G4VSolid* pSol1 = pSol -> GetConstituentSolid (1);
|
||||
if (!pSol1) {
|
||||
G4Exception
|
||||
("G4PhysicalVolumeModel::DescribeSolid:"
|
||||
" 2nd component solid is missing.");
|
||||
|
||||
if (fBooleans) {
|
||||
// Look for "constituents". Could be a Boolean solid.
|
||||
G4VSolid* pSol0 = pSol -> GetConstituentSolid (0);
|
||||
if (pSol0) { // Composite solid...
|
||||
G4VSolid* pSol1 = pSol -> GetConstituentSolid (1);
|
||||
if (!pSol1) {
|
||||
G4Exception
|
||||
("G4PhysicalVolumeModel::DescribeSolid:"
|
||||
" 2nd component solid is missing.");
|
||||
}
|
||||
// Draw these constituents white and "forced wireframe"...
|
||||
G4VisAttributes constituentAttributes;
|
||||
constituentAttributes.SetForceWireframe(true);
|
||||
DescribeSolid (theAT, pSol0, &constituentAttributes, sceneHandler);
|
||||
DescribeSolid (theAT, pSol1, &constituentAttributes, sceneHandler);
|
||||
}
|
||||
// Draw these constituents white and "forced wireframe"...
|
||||
G4VisAttributes constituentAttributes;
|
||||
constituentAttributes.SetForceWireframe(true);
|
||||
DescribeSolid (theAT, pSol0, &constituentAttributes, sceneHandler);
|
||||
DescribeSolid (theAT, pSol1, &constituentAttributes, sceneHandler);
|
||||
}
|
||||
|
||||
// In any case draw the original/resultant solid...
|
||||
sceneHandler.PreAddThis (theAT, *pVisAttribs);
|
||||
sceneHandler.PreAddSolid (theAT, *pVisAttribs);
|
||||
pSol -> DescribeYourselfTo (sceneHandler);
|
||||
sceneHandler.PostAddThis ();
|
||||
sceneHandler.PostAddSolid ();
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ModelingParameters.cc,v 1.6 2003/06/16 17:14:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4ModelingParameters.cc,v 1.7 2005/03/15 12:56:29 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
@@ -115,8 +115,8 @@ void G4ModelingParameters::SetVisibleDensity (G4double visibleDensity) {
|
||||
}
|
||||
}
|
||||
|
||||
void G4ModelingParameters::SetNoOfSides (G4int nSides) {
|
||||
const G4int nSidesMin = 3;
|
||||
G4int G4ModelingParameters::SetNoOfSides (G4int nSides) {
|
||||
const G4int nSidesMin = 12;
|
||||
if (nSides < nSidesMin) {
|
||||
nSides = nSidesMin;
|
||||
G4cout << "G4ModelingParameters::SetNoOfSides: attempt to set the"
|
||||
@@ -124,6 +124,7 @@ void G4ModelingParameters::SetNoOfSides (G4int nSides) {
|
||||
<< "; forced to" << nSides << G4endl;
|
||||
}
|
||||
fNoOfSides = nSides;
|
||||
return fNoOfSides;
|
||||
}
|
||||
|
||||
void G4ModelingParameters::PrintDifferences
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4NullModel.cc,v 1.7 2003/05/30 13:01:32 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 4th April 1998.
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeMassScene.cc,v 1.3 2004/11/11 16:06:49 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4PhysicalVolumeMassScene.cc,v 1.4 2005/01/26 16:48:56 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 10th August 1998.
|
||||
@@ -48,7 +48,8 @@ G4PhysicalVolumeMassScene::G4PhysicalVolumeMassScene ():
|
||||
fLastDensity (0.),
|
||||
fCurrentDepth (0),
|
||||
fpCurrentPV (0),
|
||||
fpCurrentLV (0)
|
||||
fpCurrentLV (0),
|
||||
fpCurrentMaterial (0)
|
||||
{}
|
||||
|
||||
G4PhysicalVolumeMassScene::~G4PhysicalVolumeMassScene () {}
|
||||
@@ -57,7 +58,8 @@ void G4PhysicalVolumeMassScene::EstablishSpecials
|
||||
(G4PhysicalVolumeModel& pvModel) {
|
||||
pvModel.DefinePointersToWorkingSpace (&fCurrentDepth,
|
||||
&fpCurrentPV,
|
||||
&fpCurrentLV);
|
||||
&fpCurrentLV,
|
||||
&fpCurrentMaterial);
|
||||
}
|
||||
|
||||
void G4PhysicalVolumeMassScene::Reset ()
|
||||
@@ -72,7 +74,7 @@ void G4PhysicalVolumeMassScene::Reset ()
|
||||
fCurrentDepth = 0;
|
||||
fpCurrentPV = 0;
|
||||
fpCurrentLV = 0;
|
||||
|
||||
fpCurrentMaterial = 0;
|
||||
}
|
||||
|
||||
void G4PhysicalVolumeMassScene::AccrueMass (const G4VSolid& solid)
|
||||
@@ -82,8 +84,9 @@ void G4PhysicalVolumeMassScene::AccrueMass (const G4VSolid& solid)
|
||||
fPVPCount = 0;
|
||||
}
|
||||
|
||||
G4double currentVolume;
|
||||
G4double currentDensity;
|
||||
G4double currentVolume = ((G4VSolid&)solid).GetCubicVolume();
|
||||
G4double currentDensity = fpCurrentMaterial->GetDensity();
|
||||
/* Using G4Polyhedron... (gives slightly different answers on Tubs, e.g.).
|
||||
G4Polyhedron* pPolyhedron = solid.GetPolyhedron();
|
||||
if (pPolyhedron) {
|
||||
G4Material* pMaterial;
|
||||
@@ -93,6 +96,7 @@ void G4PhysicalVolumeMassScene::AccrueMass (const G4VSolid& solid)
|
||||
} else {
|
||||
pMaterial = fpCurrentLV->GetMaterial();
|
||||
}
|
||||
assert(pMaterial == fpCurrentMaterial);
|
||||
currentVolume = pPolyhedron->GetVolume();
|
||||
currentDensity = pMaterial->GetDensity();
|
||||
} else {
|
||||
@@ -106,6 +110,7 @@ void G4PhysicalVolumeMassScene::AccrueMass (const G4VSolid& solid)
|
||||
currentVolume = 0.;
|
||||
currentDensity = 0.;
|
||||
}
|
||||
*/
|
||||
|
||||
if (fCurrentDepth == 0) fVolume = currentVolume;
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeModel.cc,v 1.25 2004/09/22 19:50:32 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4PhysicalVolumeModel.cc,v 1.32 2005/06/07 16:54:33 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
@@ -41,6 +41,8 @@
|
||||
#include "G4BoundingSphereScene.hh"
|
||||
#include "G4PhysicalVolumeSearchScene.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Polyhedron.hh"
|
||||
|
||||
#include <strstream>
|
||||
|
||||
@@ -60,9 +62,11 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
|
||||
fpCurrentPV (0),
|
||||
fpCurrentLV (0),
|
||||
fCurtailDescent (false),
|
||||
fpClippingPolyhedron (0),
|
||||
fpCurrentDepth (0),
|
||||
fppCurrentPV (0),
|
||||
fppCurrentLV (0)
|
||||
fppCurrentLV (0),
|
||||
fppCurrentMaterial (0)
|
||||
{
|
||||
const int len = 8; char a [len];
|
||||
std::ostrstream o (a, len); o.seekp (std::ios::beg);
|
||||
@@ -98,9 +102,18 @@ void G4PhysicalVolumeModel::CalculateExtent () {
|
||||
false); // View digis - not relevant for physical volume model.
|
||||
fpMP = &mParams;
|
||||
DescribeYourselfTo (bsScene);
|
||||
fExtent = bsScene.GetBoundingSphereExtent ();
|
||||
if (!(fExtent.GetXmin() < fExtent.GetXmax())) {
|
||||
G4double radius = bsScene.GetRadius();
|
||||
if (radius < 0.) { // Nothing in the scene.
|
||||
fExtent = fpTopPV -> GetLogicalVolume () -> GetSolid () -> GetExtent ();
|
||||
} else {
|
||||
// Transform back to coordinates relative to the top
|
||||
// transformation, which is in G4VModel::fTransform. This makes
|
||||
// it conform to all models, which are defined by a
|
||||
// transformation and an extent relative to that
|
||||
// transformation...
|
||||
G4Point3D centre = bsScene.GetCentre();
|
||||
centre.transform(fTransform.inverse());
|
||||
fExtent = G4VisExtent(centre, radius);
|
||||
}
|
||||
fpMP = tempMP;
|
||||
fRequestedDepth = tempRequestedDepth;
|
||||
@@ -133,13 +146,14 @@ void G4PhysicalVolumeModel::DescribeYourselfTo
|
||||
if (fpCurrentDepth) *fpCurrentDepth = fCurrentDepth;
|
||||
if (fppCurrentPV) *fppCurrentPV = fpCurrentPV;
|
||||
if (fppCurrentLV) *fppCurrentLV = fpCurrentLV;
|
||||
|
||||
if (fppCurrentMaterial) *fppCurrentMaterial = fpCurrentMaterial;
|
||||
sceneHandler.DecommissionSpecials (*this);
|
||||
|
||||
// Clear pointers to working space.
|
||||
fpCurrentDepth = 0;
|
||||
fppCurrentPV = 0;
|
||||
fppCurrentLV = 0;
|
||||
fppCurrentMaterial = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,10 +176,12 @@ G4String G4PhysicalVolumeModel::GetCurrentDescription () const {
|
||||
void G4PhysicalVolumeModel::DefinePointersToWorkingSpace
|
||||
(G4int* pCurrentDepth,
|
||||
G4VPhysicalVolume** ppCurrentPV,
|
||||
G4LogicalVolume** ppCurrentLV) {
|
||||
G4LogicalVolume** ppCurrentLV,
|
||||
G4Material** ppCurrentMaterial) {
|
||||
fpCurrentDepth = pCurrentDepth;
|
||||
fppCurrentPV = ppCurrentPV;
|
||||
fppCurrentLV = ppCurrentLV;
|
||||
fppCurrentMaterial = ppCurrentMaterial;
|
||||
}
|
||||
|
||||
void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
|
||||
@@ -209,6 +225,7 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
|
||||
pMaterial = pP -> ComputeMaterial (n, pVPV);
|
||||
pP -> ComputeTransformation (n, pVPV);
|
||||
pSol -> ComputeDimensions (pP, n, pVPV);
|
||||
pVPV -> SetCopyNo (n);
|
||||
DescribeAndDescend (pVPV, requestedDepth, pLV, pSol, pMaterial,
|
||||
theAT, sceneHandler);
|
||||
}
|
||||
@@ -268,8 +285,7 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
|
||||
}
|
||||
pVPV -> SetTranslation (translation);
|
||||
pVPV -> SetRotation (pRotation);
|
||||
// pVPV -> SetCopyNo (n); // Has no effect and might even be
|
||||
// dangerous.
|
||||
pVPV -> SetCopyNo (n);
|
||||
pSol = pLV -> GetSolid ();
|
||||
pMaterial = pLV -> GetMaterial ();
|
||||
DescribeAndDescend (pVPV, requestedDepth, pLV, pSol, pMaterial,
|
||||
@@ -289,7 +305,7 @@ void G4PhysicalVolumeModel::DescribeAndDescend
|
||||
G4int requestedDepth,
|
||||
G4LogicalVolume* pLV,
|
||||
G4VSolid* pSol,
|
||||
const G4Material* pMaterial,
|
||||
G4Material* pMaterial,
|
||||
const G4Transform3D& theAT,
|
||||
G4VGraphicsScene& sceneHandler) {
|
||||
|
||||
@@ -298,8 +314,10 @@ void G4PhysicalVolumeModel::DescribeAndDescend
|
||||
if (fpCurrentDepth) *fpCurrentDepth = fCurrentDepth;
|
||||
fpCurrentPV = pVPV;
|
||||
fpCurrentLV = pLV;
|
||||
fpCurrentMaterial = pMaterial;
|
||||
if (fppCurrentPV) *fppCurrentPV = fpCurrentPV;
|
||||
if (fppCurrentLV) *fppCurrentLV = fpCurrentLV;
|
||||
if (fppCurrentMaterial) *fppCurrentMaterial = fpCurrentMaterial;
|
||||
|
||||
const G4RotationMatrix objectRotation = pVPV -> GetObjectRotationValue ();
|
||||
const G4ThreeVector& translation = pVPV -> GetTranslation ();
|
||||
@@ -384,9 +402,40 @@ void G4PhysicalVolumeModel::DescribeSolid
|
||||
G4VSolid* pSol,
|
||||
const G4VisAttributes* pVisAttribs,
|
||||
G4VGraphicsScene& sceneHandler) {
|
||||
sceneHandler.PreAddThis (theAT, *pVisAttribs);
|
||||
pSol -> DescribeYourselfTo (sceneHandler);
|
||||
sceneHandler.PostAddThis ();
|
||||
|
||||
sceneHandler.PreAddSolid (theAT, *pVisAttribs);
|
||||
if (fpClippingPolyhedron) // Clip and force polyhedral representation...
|
||||
{
|
||||
G4Polyhedron clipper(*fpClippingPolyhedron); // Local copy.
|
||||
clipper.Transform(theAT.inverse());
|
||||
|
||||
G4Polyhedron::SetNumberOfRotationSteps (fpMP->GetNoOfSides());
|
||||
G4Polyhedron* pClippee = pSol->GetPolyhedron();
|
||||
G4Polyhedron::ResetNumberOfRotationSteps ();
|
||||
if (pClippee) // Solid can provide.
|
||||
{
|
||||
G4Polyhedron clipped(pClippee->subtract(clipper));
|
||||
if(clipped.IsErrorBooleanProcess())
|
||||
{
|
||||
G4cout <<
|
||||
"WARNING: G4PhysicalVolumeModel::DescribeSolid: polyhedron for solid\n \""
|
||||
<< pSol->GetName() <<
|
||||
"\" skipped due to error during Boolean processing."
|
||||
<< G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
clipped.SetVisAttributes(pVisAttribs);
|
||||
G4VVisManager::GetConcreteInstance()->Draw(clipped,theAT);
|
||||
}
|
||||
}
|
||||
}
|
||||
else // Standard treatment...
|
||||
{
|
||||
pSol -> DescribeYourselfTo (sceneHandler);
|
||||
|
||||
}
|
||||
sceneHandler.PostAddSolid ();
|
||||
}
|
||||
|
||||
G4bool G4PhysicalVolumeModel::IsThisCulled (const G4LogicalVolume* pLV,
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeSearchScene.cc,v 1.7 2003/05/30 13:01:32 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4PhysicalVolumeSearchScene.cc,v 1.8 2005/01/26 17:07:37 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 10th August 1998.
|
||||
@@ -41,6 +41,7 @@ G4PhysicalVolumeSearchScene::G4PhysicalVolumeSearchScene
|
||||
fCurrentDepth (0),
|
||||
fpCurrentPV (0),
|
||||
fpCurrentLV (0),
|
||||
fpCurrentMaterial (0),
|
||||
fpCurrentObjectTransformation (0),
|
||||
fFoundDepth (0),
|
||||
fpFoundPV (0),
|
||||
@@ -54,7 +55,8 @@ void G4PhysicalVolumeSearchScene::EstablishSpecials
|
||||
(G4PhysicalVolumeModel& pvModel) {
|
||||
pvModel.DefinePointersToWorkingSpace (&fCurrentDepth,
|
||||
&fpCurrentPV,
|
||||
&fpCurrentLV);
|
||||
&fpCurrentLV,
|
||||
&fpCurrentMaterial);
|
||||
}
|
||||
|
||||
void G4PhysicalVolumeSearchScene::FindVolume (const G4VSolid&) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ScaleModel.cc,v 1.3 2001/08/14 18:43:31 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 21st July 2001.
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TextModel.cc,v 1.4 2001/08/14 18:43:32 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4TextModel.cc,v 1.6 2005/06/07 16:53:40 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 3rd April 2001
|
||||
@@ -33,15 +33,23 @@
|
||||
#include "G4ModelingParameters.hh"
|
||||
#include "G4VGraphicsScene.hh"
|
||||
|
||||
#include "G4UnitsTable.hh"
|
||||
#include <sstream>
|
||||
|
||||
G4TextModel::~G4TextModel () {}
|
||||
|
||||
G4TextModel::G4TextModel (const G4Text& text): fText(text) {
|
||||
fGlobalTag = "G4TextModel: " + fText.GetText();
|
||||
G4TextModel::G4TextModel (const G4Text& g4Text): fG4Text(g4Text) {
|
||||
std::ostringstream oss;
|
||||
oss << "G4TextModel: \"" << fG4Text.GetText()
|
||||
<< "\" at " << G4BestUnit(g4Text.GetPosition(),"Length")
|
||||
<< "with size " << g4Text.GetScreenSize()
|
||||
<< " with offsets " << g4Text.GetXOffset() << ',' << g4Text.GetYOffset();
|
||||
fGlobalTag = oss.str();
|
||||
fGlobalDescription = fGlobalTag;
|
||||
}
|
||||
|
||||
void G4TextModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler) {
|
||||
sceneHandler.BeginPrimitives ();
|
||||
sceneHandler.AddPrimitive (fText);
|
||||
sceneHandler.AddPrimitive (fG4Text);
|
||||
sceneHandler.EndPrimitives ();
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TrajectoriesModel.cc,v 1.12 2002/11/11 18:39:28 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4TrajectoriesModel.cc,v 1.14 2005/01/27 20:07:05 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 26th August 1998.
|
||||
@@ -48,9 +48,8 @@ void G4TrajectoriesModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler) {
|
||||
if (event) {
|
||||
G4TrajectoryContainer* TC = event -> GetTrajectoryContainer ();
|
||||
if (TC) {
|
||||
G4int nT = TC -> entries ();
|
||||
for (int iT = 0; iT < nT; iT++) {
|
||||
sceneHandler.AddThis (*((*TC) [iT]));
|
||||
for (G4int iT = 0; iT < TC->entries(); iT++) {
|
||||
sceneHandler.AddCompound (*((*TC) [iT]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VModel.cc,v 1.9 2003/06/16 17:14:32 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
|
||||
Reference in New Issue
Block a user