Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
+54 -1
View File
@@ -1,4 +1,4 @@
$Id: History 95881 2016-03-01 08:46:20Z gcosmo $
$Id: History 101022 2016-11-04 08:25:50Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -20,6 +20,59 @@ committal in the CVS repository !
History file for graphics_reps category
---------------------------------------
3rd November 2016 John Allison (greps-V10-02-10)
- Fix typo in previous tag.
3rd November 2016 John Allison (greps-V10-02-09)
- BooleanProcessor.src: Fix warnings on -O3 on Linux.
3rd November 2016 John Allison (greps-V10-02-08)
- HepPolyhedron.h: Changed default number of line segments per circle:
#define DEFAULT_NUMBER_OF_STEPS 72
6th September 2016 Makoto Asai (greps-V10-02-07)
- Co-works with digits_hits-V10-02-06, vis-V10-02-12
- include/G4VGraphicsScene.hh
It accepts both G4TMitsMap<G4StatDouble> and G4THitsMap<G4double>.
2nd September 2016 Makoto Asai (greps-V10-02-06)
- Co-works with digits_hits-V10-02-05, vis-V10-02-10
- include/G4VGraphicsScene.hh
Build-in scorer now uses G4TMitsMap<G4StatDouble> instead of
G4THitsMap<G4double>.
31st August 2016 John Allison (greps-V10-02-05)
- Co-works vis-V10-02-09.
- G4VGraphicsScene.hh:
o Added
virtual void AddSolid (const G4Orb&) = 0;
virtual void AddSolid (const G4Ellipsoid&) = 0;
o Tidied.
7th August 2016 John Allison (greps-V10-02-03)
- G4VisAttributes.icc: Removed extraneous semi-colon.
7th August 2016 John Allison (greps-V10-02-02)
- G4VisAttributes:
o Added flag for force auxiliary edge visibility, i.e., to record
if the user has asked for forcing, while the value forced - visible
or invisible - is recorded in another flag.
o Introduced default argument - "true" - for:
SetVisibility, SetDaughtersInvisible, SetForceWireframe,
SetForceSolid, SetForceAuxEdgeVisible.
o Improved logic for setting force drawing style and auxiliary edge
visibility.
o Moved above methods from .icc to .cc.
o Moved static inline method GetMinLineSegmentsPerCircle to .icc.
14th July 2016 John Allison (greps-V10-02-01)
- G4VisAttributes::GetInvisible():
o Changed to use a static instance instead of G4VisAttributes::Invisible.
o Moved implementation to .cc file. Now it is non-inline.
- G4VisAttributes::Invisible:
o Deprecated. It is a static instance and does not always instantiate
properly on Windows.
1st March 2016 Gabriele Cosmo (greps-V10-02-00)
- Use "" instead of <> for internal header inclusion in
HepPolyhedronProcessor.h.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VGraphicsScene.hh 78955 2014-02-05 09:45:46Z gcosmo $
// $Id: G4VGraphicsScene.hh 99153 2016-09-07 08:05:30Z gcosmo $
// John Allison 19th July 1996
//
// Class Description:
@@ -43,16 +43,19 @@ class G4VisAttributes;
class G4VSolid;
class G4Box;
class G4Cons;
class G4Tubs;
class G4Trd;
class G4Trap;
class G4Sphere;
class G4Ellipsoid;
class G4Orb;
class G4Para;
class G4Torus;
class G4PhysicalVolumeModel;
class G4Trap;
class G4Trd;
class G4Tubs;
class G4Sphere;
class G4Ellipsoid;
class G4Polycone;
class G4Polyhedra;
class G4PhysicalVolumeModel;
class G4VTrajectory;
class G4VHit;
class G4VDigi;
@@ -65,6 +68,7 @@ class G4Square;
class G4Polymarker;
class G4Polyhedron;
class G4VisExtent;
class G4StatDouble;
class G4VGraphicsScene {
@@ -90,17 +94,24 @@ public: // With description
virtual void PostAddSolid () = 0;
// From geometry/solids/CSG
virtual void AddSolid (const G4Box&) = 0;
virtual void AddSolid (const G4Cons&) = 0;
virtual void AddSolid (const G4Tubs&) = 0;
virtual void AddSolid (const G4Trd&) = 0;
virtual void AddSolid (const G4Trap&) = 0;
virtual void AddSolid (const G4Sphere&) = 0;
virtual void AddSolid (const G4Orb&) = 0;
virtual void AddSolid (const G4Para&) = 0;
virtual void AddSolid (const G4Sphere&) = 0;
virtual void AddSolid (const G4Torus&) = 0;
virtual void AddSolid (const G4Trap&) = 0;
virtual void AddSolid (const G4Trd&) = 0;
virtual void AddSolid (const G4Tubs&) = 0;
// From geometry/solids/specific
virtual void AddSolid (const G4Ellipsoid&) = 0;
virtual void AddSolid (const G4Polycone&) = 0;
virtual void AddSolid (const G4Polyhedra&) = 0;
virtual void AddSolid (const G4VSolid&) = 0; // For solids not above.
// For solids not above.
virtual void AddSolid (const G4VSolid&) = 0;
///////////////////////////////////////////////////////////////////
// Methods for adding "compound" GEANT4 objects to the scene
@@ -117,6 +128,7 @@ public: // With description
virtual void AddCompound (const G4VHit&) = 0;
virtual void AddCompound (const G4VDigi&) = 0;
virtual void AddCompound (const G4THitsMap<G4double>&) = 0;
virtual void AddCompound (const G4THitsMap<G4StatDouble>&) = 0;
///////////////////////////////////////////////////////////////////
// Methods for adding graphics primitives to the scene handler. A
+16 -11
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VisAttributes.hh 85261 2014-10-27 08:54:57Z gcosmo $
// $Id: G4VisAttributes.hh 98730 2016-08-09 10:47:54Z gcosmo $
//
//
// John Allison 23rd October 1996
@@ -73,13 +73,18 @@ public: // With description
enum {fMinLineSegmentsPerCircle = 3}; // number of sides per circle
G4VisAttributes ();
G4VisAttributes (const G4VisAttributes&);
G4VisAttributes (G4bool visibility);
G4VisAttributes (const G4Colour& colour);
G4VisAttributes (G4bool visibility, const G4Colour& colour);
G4VisAttributes (const G4VisAttributes&);
~G4VisAttributes ();
G4VisAttributes& operator= (const G4VisAttributes&);
// Deprecated 14 July 2016 JA
// Use GetInvisible() instead. E.g.:
// logical_volume->SetVisAttributes(G4VisAttributes::GetInvisible());
// or use one of the above constructors or SetVisibility and
// logical_volume->SetVisAttributes(my_vis_attributes);
static const G4VisAttributes Invisible;
static const G4VisAttributes& GetInvisible();
@@ -87,8 +92,8 @@ public: // With description
G4bool operator != (const G4VisAttributes& a) const;
G4bool operator == (const G4VisAttributes& a) const;
void SetVisibility (G4bool);
void SetDaughtersInvisible (G4bool);
void SetVisibility (G4bool = true);
void SetDaughtersInvisible (G4bool = true);
void SetColour (const G4Colour&);
void SetColor (const G4Color&);
void SetColour (G4double red, G4double green, G4double blue,
@@ -97,9 +102,9 @@ public: // With description
G4double alpha = 1.);
void SetLineStyle (LineStyle);
void SetLineWidth (G4double);
void SetForceWireframe (G4bool);
void SetForceSolid (G4bool);
void SetForceAuxEdgeVisible (G4bool);
void SetForceWireframe (G4bool = true);
void SetForceSolid (G4bool = true);
void SetForceAuxEdgeVisible (G4bool = true);
void SetForceLineSegmentsPerCircle (G4int nSegments);
// Allows choice of circle approximation. A circle of 360 degrees
// will be composed of nSegments line segments. If your solid has
@@ -119,13 +124,12 @@ public: // With description
G4bool IsForceDrawingStyle () const;
ForcedDrawingStyle GetForcedDrawingStyle () const;
G4bool IsForceAuxEdgeVisible () const;
G4bool IsForcedAuxEdgeVisible () const;
G4bool IsForceLineSegmentsPerCircle () const;
G4int GetForcedLineSegmentsPerCircle () const;
G4double GetStartTime () const;
G4double GetEndTime () const;
static G4int GetMinLineSegmentsPerCircle () {
return fMinLineSegmentsPerCircle;
};
static G4int GetMinLineSegmentsPerCircle ();
// Returns an expendable copy of the G4AttValues...
const std::vector<G4AttValue>* CreateAttValues () const;
// Returns the orginal long life G4AttDefs...
@@ -141,7 +145,8 @@ private:
// pixels for screen, 0.1 mm for paper.
G4bool fForceDrawingStyle; // To switch on forced drawing style.
ForcedDrawingStyle fForcedStyle; // Value of forced drawing style.
G4bool fForceAuxEdgeVisible; // Force drawing of auxilary edges.
G4bool fForceAuxEdgeVisible; // To switch on a forced auxiliary edge mode.
G4bool fForcedAuxEdgeVisible; // Whether aux edges are visible or not.
G4int fForcedLineSegmentsPerCircle; // Forced lines segments per
// circle. <=0 means not forced.
G4double fStartTime, fEndTime; // Time range.
@@ -24,15 +24,11 @@
// ********************************************************************
//
//
// $Id: G4VisAttributes.icc 85261 2014-10-27 08:54:57Z gcosmo $
// $Id: G4VisAttributes.icc 98730 2016-08-09 10:47:54Z gcosmo $
//
//
// John Allison 18th November 1996
inline const G4VisAttributes& G4VisAttributes::GetInvisible() {
return Invisible;
}
inline void G4VisAttributes::SetVisibility (G4bool v) {fVisible = v;}
inline void G4VisAttributes::SetDaughtersInvisible (G4bool v) {
@@ -65,20 +61,6 @@ inline void G4VisAttributes::SetLineWidth (G4double w) {
fLineWidth = w;
}
inline void G4VisAttributes::SetForceWireframe (G4bool force) {
fForceDrawingStyle = force;
fForcedStyle = G4VisAttributes::wireframe;
}
inline void G4VisAttributes::SetForceSolid (G4bool force) {
fForceDrawingStyle = force;
fForcedStyle = G4VisAttributes::solid;
}
inline void G4VisAttributes::SetForceAuxEdgeVisible (G4bool force) {
fForceAuxEdgeVisible = force;
}
inline void G4VisAttributes::SetStartTime(G4double time) {
fStartTime = time;
}
@@ -119,11 +101,6 @@ inline G4bool G4VisAttributes::IsForceDrawingStyle () const {
return fForceDrawingStyle;
}
inline G4VisAttributes::ForcedDrawingStyle
G4VisAttributes::GetForcedDrawingStyle () const {
return fForcedStyle;
}
inline G4bool G4VisAttributes::IsForceAuxEdgeVisible () const {
return fForceAuxEdgeVisible;
}
@@ -148,3 +125,8 @@ inline
const std::map<G4String,G4AttDef>* G4VisAttributes::GetAttDefs () const {
return fAttDefs;
}
inline
G4int G4VisAttributes::GetMinLineSegmentsPerCircle () {
return fMinLineSegmentsPerCircle;
}
+2 -2
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: HepPolyhedron.h 88771 2015-03-09 12:38:01Z gcosmo $
// $Id: HepPolyhedron.h 101022 2016-11-04 08:25:50Z gcosmo $
//
//
// Class Description:
@@ -174,7 +174,7 @@
#include "G4Transform3D.hh"
#ifndef DEFAULT_NUMBER_OF_STEPS
#define DEFAULT_NUMBER_OF_STEPS 24
#define DEFAULT_NUMBER_OF_STEPS 72
#endif
class G4Facet {
@@ -422,7 +422,8 @@ void BooleanProcessor::takePolyhedron(const HepPolyhedron & p,
* *
***********************************************************************/
{
int i, k, nnode, iNodes[5], iVis[4], iFaces[4];
int i = 0, k = 0, nnode = 0, iNodes[5] = {0,0,0,0,0}, iVis[4] = {0,0,0,0},
iFaces[4] = {0,0,0,0};
int dnode = nodes.size() - 1;
int dface = faces.size() - 1;
@@ -1939,7 +1940,7 @@ HepPolyhedron BooleanProcessor::createPolyhedron()
// S E T F A C E S
int k, v[4], f[4];
int k = 0, v[4] = {0,0,0,0}, f[4] = {0,0,0,0};
for (i=1; i<(int)faces.size(); i++) {
if (faces[i].inew == 0) continue;
v[3] = f[3] = k = 0;
+91 -37
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VisAttributes.cc 88083 2015-01-28 08:31:34Z gcosmo $
// $Id: G4VisAttributes.cc 98730 2016-08-09 10:47:54Z gcosmo $
//
//
// John Allison 23rd October 1996
@@ -34,27 +34,6 @@
#include "G4AttValue.hh"
#include "G4AttDef.hh"
G4VisAttributes::G4VisAttributes (const G4VisAttributes& va):
fVisible (va.fVisible),
fDaughtersInvisible (va.fDaughtersInvisible),
fColour (va.fColour),
fLineStyle (va.fLineStyle),
fLineWidth (va.fLineWidth),
fForceDrawingStyle (va.fForceDrawingStyle),
fForcedStyle (va.fForcedStyle),
fForceAuxEdgeVisible (va.fForceAuxEdgeVisible),
fForcedLineSegmentsPerCircle (va.fForcedLineSegmentsPerCircle),
fStartTime (va.fStartTime),
fEndTime (va.fEndTime),
// AttValues are created afresh for each object (using the
// CreateAttValues message), but deletion is the responsibility of
// the creator. So just copy pointer.
fAttValues (va.fAttValues),
// AttDefs, if any, belong to the object from which they were obtained
// (with a GetAttDefs message), so just copy pointer.
fAttDefs (va.fAttDefs)
{}
G4VisAttributes::G4VisAttributes ():
fVisible (true),
fDaughtersInvisible (false),
@@ -64,6 +43,7 @@ fLineWidth (1.),
fForceDrawingStyle (false),
fForcedStyle (wireframe),
fForceAuxEdgeVisible (false),
fForcedAuxEdgeVisible(false),
fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
fStartTime (-DBL_MAX),
fEndTime (DBL_MAX),
@@ -80,6 +60,7 @@ fLineWidth (1.),
fForceDrawingStyle (false),
fForcedStyle (wireframe),
fForceAuxEdgeVisible (false),
fForcedAuxEdgeVisible(false),
fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
fStartTime (-DBL_MAX),
fEndTime (DBL_MAX),
@@ -96,6 +77,7 @@ fLineWidth (1.),
fForceDrawingStyle (false),
fForcedStyle (wireframe),
fForceAuxEdgeVisible (false),
fForcedAuxEdgeVisible(false),
fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
fStartTime (-DBL_MAX),
fEndTime (DBL_MAX),
@@ -113,6 +95,7 @@ fLineWidth (1.),
fForceDrawingStyle (false),
fForcedStyle (wireframe),
fForceAuxEdgeVisible (false),
fForcedAuxEdgeVisible(false),
fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
fStartTime (-DBL_MAX),
fEndTime (DBL_MAX),
@@ -120,21 +103,43 @@ fAttValues (0),
fAttDefs (0)
{}
G4VisAttributes::G4VisAttributes (const G4VisAttributes& va):
fVisible (va.fVisible),
fDaughtersInvisible (va.fDaughtersInvisible),
fColour (va.fColour),
fLineStyle (va.fLineStyle),
fLineWidth (va.fLineWidth),
fForceDrawingStyle (va.fForceDrawingStyle),
fForcedStyle (va.fForcedStyle),
fForceAuxEdgeVisible (va.fForceAuxEdgeVisible),
fForcedAuxEdgeVisible(va.fForcedAuxEdgeVisible),
fForcedLineSegmentsPerCircle (va.fForcedLineSegmentsPerCircle),
fStartTime (va.fStartTime),
fEndTime (va.fEndTime),
// AttValues are created afresh for each object (using the
// CreateAttValues message), but deletion is the responsibility of
// the creator. So just copy pointer.
fAttValues (va.fAttValues),
// AttDefs, if any, belong to the object from which they were obtained
// (with a GetAttDefs message), so just copy pointer.
fAttDefs (va.fAttDefs)
{}
G4VisAttributes::~G4VisAttributes()
{
}
{}
G4VisAttributes& G4VisAttributes::operator= (const G4VisAttributes& rhs)
{
if (&rhs == this) return *this;
fVisible = rhs.fVisible;
fDaughtersInvisible = rhs.fDaughtersInvisible;
fColour = rhs.fColour;
fLineStyle = rhs.fLineStyle;
fLineWidth = rhs.fLineWidth;
fForceDrawingStyle = rhs.fForceDrawingStyle;
fForcedStyle = rhs.fForcedStyle;
fForceAuxEdgeVisible = rhs.fForceAuxEdgeVisible;
fVisible = rhs.fVisible;
fDaughtersInvisible = rhs.fDaughtersInvisible;
fColour = rhs.fColour;
fLineStyle = rhs.fLineStyle;
fLineWidth = rhs.fLineWidth;
fForceDrawingStyle = rhs.fForceDrawingStyle;
fForcedStyle = rhs.fForcedStyle;
fForceAuxEdgeVisible = rhs.fForceAuxEdgeVisible;
fForcedAuxEdgeVisible = rhs.fForcedAuxEdgeVisible;
fForcedLineSegmentsPerCircle = rhs.fForcedLineSegmentsPerCircle;
fStartTime = rhs.fStartTime;
fEndTime = rhs.fEndTime;
@@ -148,8 +153,48 @@ G4VisAttributes& G4VisAttributes::operator= (const G4VisAttributes& rhs)
return *this;
}
// Deprecated 14 July 2016 JA
const G4VisAttributes G4VisAttributes::Invisible = G4VisAttributes (false);
const G4VisAttributes& G4VisAttributes::GetInvisible() {
static const G4VisAttributes invisible = G4VisAttributes(false);
return invisible;
}
void G4VisAttributes::SetForceWireframe (G4bool force) {
if (force) {
fForceDrawingStyle = true;
fForcedStyle = G4VisAttributes::wireframe;
} else {
fForceDrawingStyle = false;
}
}
void G4VisAttributes::SetForceSolid (G4bool force) {
if (force) {
fForceDrawingStyle = true;
fForcedStyle = G4VisAttributes::solid;
} else {
fForceDrawingStyle = false;
}
}
void G4VisAttributes::SetForceAuxEdgeVisible (G4bool visibility) {
fForceAuxEdgeVisible = true;
fForcedAuxEdgeVisible = visibility;
}
G4VisAttributes::ForcedDrawingStyle
G4VisAttributes::GetForcedDrawingStyle () const {
if (fForceDrawingStyle) return fForcedStyle;
else return G4VisAttributes::wireframe;
}
G4bool G4VisAttributes::IsForcedAuxEdgeVisible () const {
if (fForceAuxEdgeVisible) return fForcedAuxEdgeVisible;
else return false;
}
const std::vector<G4AttValue>* G4VisAttributes::CreateAttValues () const {
// Create an expendable copy on the heap...
return new std::vector<G4AttValue>(*fAttValues);
@@ -187,7 +232,7 @@ std::ostream& operator << (std::ostream& os, const G4VisAttributes& a)
os << ", min line segments per circle: " << a.GetMinLineSegmentsPerCircle();
os << "\n drawing style: ";
if (a.fForceDrawingStyle) {
os << "forced to: ";
os << "forced to ";
switch (a.fForcedStyle) {
case G4VisAttributes::wireframe:
os << "wireframe"; break;
@@ -200,10 +245,15 @@ std::ostream& operator << (std::ostream& os, const G4VisAttributes& a)
os << "not forced";
}
os << ", auxiliary edge visibility: ";
if (!a.fForceAuxEdgeVisible) {
os << "not ";
if (a.fForceAuxEdgeVisible) {
os << "forced to ";
if (!a.fForcedAuxEdgeVisible) {
os << "not ";
}
os << "visible";
} else {
os << "not forced";
}
os << "forced";
os << "\n line segments per circle: ";
if (a.fForcedLineSegmentsPerCircle > 0) {
os << "forced to " << a.fForcedLineSegmentsPerCircle;
@@ -233,7 +283,7 @@ G4bool G4VisAttributes::operator != (const G4VisAttributes& a) const {
(fLineStyle != a.fLineStyle) ||
(fLineWidth != a.fLineWidth) ||
(fForceDrawingStyle != a.fForceDrawingStyle) ||
(fForceAuxEdgeVisible!= a.fForceAuxEdgeVisible)||
(fForceAuxEdgeVisible!= a.fForceAuxEdgeVisible) ||
(fForcedLineSegmentsPerCircle != a.fForcedLineSegmentsPerCircle) ||
(fStartTime != a.fStartTime) ||
(fEndTime != a.fEndTime) ||
@@ -246,6 +296,10 @@ G4bool G4VisAttributes::operator != (const G4VisAttributes& a) const {
if (fForcedStyle != a.fForcedStyle) return true;
}
if (fForceAuxEdgeVisible) {
if (fForcedAuxEdgeVisible != a.fForcedAuxEdgeVisible) return true;
}
return false;
}