Import Geant4 10.6.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2019-06-28 11:59:04 +02:00
parent 28a70706e0
commit d0f911957d
1056 changed files with 95168 additions and 78160 deletions
+20 -1
View File
@@ -19,9 +19,28 @@ committal in the CVS repository !
History file for graphics_reps category
---------------------------------------
31 January 2019 Ivana Hrivnacova (greps-V10-04-09)
12 June 2019 John Allison (greps-V10-05-03)
- G4VisAttributes:
o Add G4VisAttributes::cloud and methods to force:
. SetForceCloud
. SetForceNumberOfCloudPoints
24 February 2019 John Allison (greps-V10-05-02)
- Remove Get/SetDrawOverlapsFlag from G4VVisManager.
19 February 2019 John Allison
- Included in vis-V10-05-12
- G4VisExtent:
o Replaced operator*(const G4Transform3D&) by
Transform(const G4Transform3D&).
(Note: operator* was only ever in a development version of Geant4.)
31 January 2019 Ivana Hrivnacova (greps-V10-05-01)
- Merged GitHub PR #4: all Boolean operators now return G4bool.
02 January 2018 John Allison (greps-V10-05-00)
- G4VisExtent: Add operator*(const G4Transform3D&).
19 October 2018 John Allison (greps-V10-04-08)
- G4VisExtent: Add GetNullExtent.
@@ -228,32 +228,12 @@ public: // With description
#endif
G4bool GetDrawOverlapsFlag() const {return fDrawOverlapsFlag;}
// This is intended to be inspected by methods capable of drawing
// overlaps. See for example, CheckOverlaps in G4PVPlacement and
// G4PVParameterised.
void SetDrawOverlapsFlag(G4bool draw) {fDrawOverlapsFlag = draw;}
// This is for use by specialist models that request drawing of overlaps.
// It must be unset after use (by calling with a false argument). See,
// for example, G4LogicalVolumeModel.
// This must not be set by the user because the coordinate system is only
// valid under certain conditions. It must be unset so that overlaps are
// not drawn when, for example, CheckOverlaps is called during detector
// construction or when the user requests overlap checking with
// /geometry/test/run. (It is only in special cases that the viewer is ready
// to have the overlaps drawn in the logical volume's coordinate system
// and this must be decided by the vis system.)
protected:
static void SetConcreteInstance (G4VVisManager*);
static G4VVisManager* fpConcreteInstance; // Pointer to real G4VisManager.
private:
G4bool fDrawOverlapsFlag;
};
#endif
@@ -42,8 +42,9 @@
// category. The followings are commonly-used attributes:
// - visibility
// - visibility of daughters
// - force wireframe style, force solid style
// - force auxiliary edge visibility, force line segments pe circle
// - force style
// - force auxiliary edge visibility
// - force line segments per circle
// - colour
// Class Description - End:
@@ -72,7 +73,7 @@ class G4VisAttributes {
public: // With description
enum LineStyle {unbroken, dashed, dotted};
enum ForcedDrawingStyle {wireframe, solid};
enum ForcedDrawingStyle {wireframe, solid, cloud};
G4VisAttributes ();
G4VisAttributes (G4bool visibility);
@@ -108,6 +109,8 @@ public: // With description
void SetLineWidth (G4double);
void SetForceWireframe (G4bool = true);
void SetForceSolid (G4bool = true);
void SetForceCloud (G4bool = true);
void SetForceNumberOfCloudPoints (G4int nPoints);
void SetForceAuxEdgeVisible (G4bool = true);
void SetForceLineSegmentsPerCircle (G4int nSegments);
// Allows choice of circle approximation. A circle of 360 degrees
@@ -127,6 +130,7 @@ public: // With description
G4double GetLineWidth () const;
G4bool IsForceDrawingStyle () const;
ForcedDrawingStyle GetForcedDrawingStyle () const;
G4int GetForcedNumberOfCloudPoints () const;
G4bool IsForceAuxEdgeVisible () const;
G4bool IsForcedAuxEdgeVisible () const;
G4bool IsForceLineSegmentsPerCircle () const;
@@ -155,6 +159,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.
G4int fForcedNumberOfCloudPoints; // Number of points used for cloud style.
// <=0 means take viewer default
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
@@ -100,6 +100,10 @@ inline G4bool G4VisAttributes::IsForceDrawingStyle () const {
return fForceDrawingStyle;
}
inline G4int G4VisAttributes::GetForcedNumberOfCloudPoints () const {
return fForcedNumberOfCloudPoints;
}
inline G4bool G4VisAttributes::IsForceAuxEdgeVisible () const {
return fForceAuxEdgeVisible;
}
@@ -49,6 +49,7 @@
#include "globals.hh"
#include "G4Point3D.hh"
#include "G4Transform3D.hh"
class G4VisExtent
{
@@ -62,6 +63,15 @@ public: // With description
static const G4VisExtent& GetNullExtent ();
G4bool operator != (const G4VisExtent& e) const;
G4bool operator == (const G4VisExtent& e) const {return !operator!=(e);}
G4VisExtent& Transform (const G4Transform3D&);
// The above transforms the box defined by the 6 limits fXmin, fXmax,
// etc., and produces a new box that encloses the transformed box. If the
// transform includes a rotation the new box will likely be a good deal larger
// than the old one, but hey-ho, the concept of G4VisExtent requires the
// limits to be along the major axes and thus defines a box whose edges are
// parallel to the major axes. So use the above with care.
G4double GetXmin () const;
G4double GetXmax () const;
G4double GetYmin () const;
@@ -32,7 +32,6 @@
#include "G4VVisManager.hh"
G4VVisManager::G4VVisManager ()
: fDrawOverlapsFlag(false)
{}
G4VVisManager::~G4VVisManager () {}
@@ -41,6 +41,7 @@ fLineStyle (unbroken),
fLineWidth (1.),
fForceDrawingStyle (false),
fForcedStyle (wireframe),
fForcedNumberOfCloudPoints (10000),
fForceAuxEdgeVisible (false),
fForcedAuxEdgeVisible(false),
fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
@@ -58,6 +59,7 @@ fLineStyle (unbroken),
fLineWidth (1.),
fForceDrawingStyle (false),
fForcedStyle (wireframe),
fForcedNumberOfCloudPoints (10000),
fForceAuxEdgeVisible (false),
fForcedAuxEdgeVisible(false),
fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
@@ -75,6 +77,7 @@ fLineStyle (unbroken),
fLineWidth (1.),
fForceDrawingStyle (false),
fForcedStyle (wireframe),
fForcedNumberOfCloudPoints (10000),
fForceAuxEdgeVisible (false),
fForcedAuxEdgeVisible(false),
fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
@@ -93,6 +96,7 @@ fLineStyle (unbroken),
fLineWidth (1.),
fForceDrawingStyle (false),
fForcedStyle (wireframe),
fForcedNumberOfCloudPoints (10000),
fForceAuxEdgeVisible (false),
fForcedAuxEdgeVisible(false),
fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
@@ -110,6 +114,7 @@ fLineStyle (va.fLineStyle),
fLineWidth (va.fLineWidth),
fForceDrawingStyle (va.fForceDrawingStyle),
fForcedStyle (va.fForcedStyle),
fForcedNumberOfCloudPoints (va.fForcedNumberOfCloudPoints),
fForceAuxEdgeVisible (va.fForceAuxEdgeVisible),
fForcedAuxEdgeVisible(va.fForcedAuxEdgeVisible),
fForcedLineSegmentsPerCircle (va.fForcedLineSegmentsPerCircle),
@@ -137,6 +142,7 @@ G4VisAttributes& G4VisAttributes::operator= (const G4VisAttributes& rhs)
fLineWidth = rhs.fLineWidth;
fForceDrawingStyle = rhs.fForceDrawingStyle;
fForcedStyle = rhs.fForcedStyle;
fForcedNumberOfCloudPoints = rhs.fForcedNumberOfCloudPoints;
fForceAuxEdgeVisible = rhs.fForceAuxEdgeVisible;
fForcedAuxEdgeVisible = rhs.fForcedAuxEdgeVisible;
fForcedLineSegmentsPerCircle = rhs.fForcedLineSegmentsPerCircle;
@@ -180,6 +186,26 @@ void G4VisAttributes::SetForceSolid (G4bool force) {
}
}
void G4VisAttributes::SetForceCloud (G4bool force) {
if (force) {
fForceDrawingStyle = true;
fForcedStyle = G4VisAttributes::cloud;
} else {
fForceDrawingStyle = false;
}
}
void G4VisAttributes::SetForceNumberOfCloudPoints (G4int nPoints) {
fForcedNumberOfCloudPoints = nPoints;
if (nPoints <= 0) {
G4cout <<
"G4VisAttributes::SetForceNumberOfCloudPoints: number of cloud points"
"set to " << fForcedNumberOfCloudPoints
<< ". This means the viewer default will be used."
<< G4endl;
}
}
void G4VisAttributes::SetForceAuxEdgeVisible (G4bool visibility) {
fForceAuxEdgeVisible = true;
fForcedAuxEdgeVisible = visibility;
+43 -2
View File
@@ -32,9 +32,9 @@
#include "G4VisExtent.hh"
#include "G4ios.hh"
#include "G4ThreeVector.hh"
G4VisExtent::G4VisExtent (G4double xmin, G4double xmax,
G4VisExtent::G4VisExtent (G4double xmin, G4double xmax,
G4double ymin, G4double ymax,
G4double zmin, G4double zmax):
fXmin(xmin), fXmax(xmax), fYmin(ymin), fYmax(ymax), fZmin(zmin), fZmax(zmax),
@@ -98,3 +98,44 @@ G4bool G4VisExtent::operator != (const G4VisExtent& e) const {
(fZmin != e.fZmin) ||
(fZmax != e.fZmax));
}
G4VisExtent& G4VisExtent::Transform (const G4Transform3D& transform)
{
auto rotation = transform.getRotation();
auto translation = transform.getTranslation();
G4ThreeVector nnn(fXmin,fYmin,fZmin);
G4ThreeVector nnx(fXmin,fYmin,fZmax);
G4ThreeVector nxn(fXmin,fYmax,fZmin);
G4ThreeVector nxx(fXmin,fYmax,fZmax);
G4ThreeVector xnn(fXmax,fYmin,fZmin);
G4ThreeVector xnx(fXmax,fYmin,fZmax);
G4ThreeVector xxn(fXmax,fYmax,fZmin);
G4ThreeVector xxx(fXmax,fYmax,fZmax);
nnn.transform(rotation); nnn += translation;
nnx.transform(rotation); nnx += translation;
nxn.transform(rotation); nxn += translation;
nxx.transform(rotation); nxx += translation;
xnn.transform(rotation); xnn += translation;
xnx.transform(rotation); xnx += translation;
xxn.transform(rotation); xxn += translation;
xxx.transform(rotation); xxx += translation;
fXmin = DBL_MAX;
fYmin = DBL_MAX;
fZmin = DBL_MAX;
fXmax = -DBL_MAX;
fYmax = -DBL_MAX;
fZmax = -DBL_MAX;
for (const auto& corner: {nnn,nnx,nxn,nxx,xnn,xnx,xxn,xxx}) {
if (fXmin > corner.getX()) fXmin = corner.getX();
if (fYmin > corner.getY()) fYmin = corner.getY();
if (fZmin > corner.getZ()) fZmin = corner.getZ();
if (fXmax < corner.getX()) fXmax = corner.getX();
if (fYmax < corner.getY()) fYmax = corner.getY();
if (fZmax < corner.getZ()) fZmax = corner.getZ();
}
return *this;
}