Import Geant4 10.3.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
.$Id: History 94590 2015-11-25 11:12:46Z gcosmo $
|
||||
.$Id: History 101714 2016-11-22 08:53:13Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -20,6 +20,26 @@ committal in the CVS repository !
|
||||
History file for visualization/HepRep sub-category
|
||||
--------------------------------------------------
|
||||
|
||||
18th November 2016 John Allison (vis-HepRep-V10-02-04)
|
||||
- Fixed the GetColour() problem.
|
||||
|
||||
17th November 2016 Joseph Perl (vis-HepRep-V10-02-03)
|
||||
- G4HepRepFileSceneHandler.cc: restore color to trajectories.
|
||||
|
||||
7th November 2016 John Allison (vis-HepRep-V10-02-02)
|
||||
- G4HepRepFileSceneHandler.cc:1504: Fixed Coverity warning.
|
||||
|
||||
11th September 2016 John Allison (vis-HepRep-V10-02-01)
|
||||
- GetColour/GetColor no longer takes an argument.
|
||||
- Make sure applicable vis attributes are obtained.
|
||||
// Get and check applicable vis attributes.
|
||||
// fpVisAttribs = fpViewer->GetApplicableVisAttributes(fpVisAttribs);
|
||||
// Note: the vis attributes may have been modified by the viewer. See
|
||||
// code in G4VViewer::GetApplicableVisAttributes.
|
||||
|
||||
31st August 2016 John Allison (vis-HepRep-V10-02-00)
|
||||
- Fix G4Orb and G4Ellipsoid hiding warnings.
|
||||
|
||||
25th November 2015 Laurent Garnier (vis-HepRep-V10-01-02)
|
||||
- Fix a warning on int64 on VC15
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFileSceneHandler.hh 66870 2013-01-14 23:38:59Z adotti $
|
||||
// $Id: G4HepRepFileSceneHandler.hh 99152 2016-09-07 08:04:30Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Joseph Perl 27th January 2002
|
||||
@@ -75,6 +75,8 @@ public:
|
||||
void AddSolid(const G4Torus&);
|
||||
void AddSolid(const G4Polycone&);
|
||||
void AddSolid(const G4Polyhedra&);
|
||||
void AddSolid(const G4Orb&);
|
||||
void AddSolid(const G4Ellipsoid&);
|
||||
void AddSolid(const G4VSolid&);
|
||||
void AddCompound (const G4VTrajectory&);
|
||||
void InitTrajectory();
|
||||
@@ -83,6 +85,9 @@ public:
|
||||
void AddCompound (const G4THitsMap<G4double>& hits) {
|
||||
G4VSceneHandler::AddCompound(hits);
|
||||
}
|
||||
void AddCompound (const G4THitsMap<G4StatDouble>& hits) {
|
||||
G4VSceneHandler::AddCompound(hits);
|
||||
}
|
||||
void AddCompound (const G4VDigi& digi) {
|
||||
G4VSceneHandler::AddCompound(digi);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepSceneHandler.hh 68043 2013-03-13 14:27:49Z gcosmo $
|
||||
// $Id: G4HepRepSceneHandler.hh 99152 2016-09-07 08:04:30Z gcosmo $
|
||||
//
|
||||
|
||||
/**
|
||||
@@ -75,9 +75,11 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
|
||||
void AddSolid (const G4Sphere& sphere);
|
||||
void AddSolid (const G4Para& para);
|
||||
void AddSolid (const G4Torus& torus);
|
||||
void AddSolid (const G4Polycone& polycone);
|
||||
void AddSolid (const G4Polycone& polycone);
|
||||
void AddSolid (const G4Polyhedra& polyhedra);
|
||||
void AddSolid (const G4VSolid& solid);
|
||||
void AddSolid (const G4Orb& orb);
|
||||
void AddSolid (const G4Ellipsoid& ellipsoid);
|
||||
void AddSolid (const G4VSolid& solid);
|
||||
|
||||
void AddCompound (const G4VTrajectory&);
|
||||
void AddCompound (const G4VHit& hit);
|
||||
@@ -87,6 +89,9 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
|
||||
void AddCompound (const G4THitsMap<G4double>& hits) {
|
||||
G4VSceneHandler::AddCompound(hits);
|
||||
}
|
||||
void AddCompound (const G4THitsMap<G4StatDouble>& hits) {
|
||||
G4VSceneHandler::AddCompound(hits);
|
||||
}
|
||||
|
||||
void PreAddSolid (const G4Transform3D& objectTransformation, const G4VisAttributes& visAttribs);
|
||||
void PostAddSolid ();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepFileSceneHandler.cc 68043 2013-03-13 14:27:49Z gcosmo $
|
||||
// $Id: G4HepRepFileSceneHandler.cc 101714 2016-11-22 08:53:13Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Joseph Perl 27th January 2002
|
||||
@@ -168,6 +168,8 @@ void G4HepRepFileSceneHandler::AddSolid(const G4Box& box) {
|
||||
|
||||
G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
|
||||
|
||||
// Get and check applicable vis attributes.
|
||||
fpVisAttribs = fpViewer->GetApplicableVisAttributes(fpVisAttribs);
|
||||
if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
|
||||
return;
|
||||
|
||||
@@ -245,6 +247,8 @@ void G4HepRepFileSceneHandler::AddSolid(const G4Cons& cons) {
|
||||
haveVisible = false;
|
||||
AddHepRepInstance("Cylinder", NULL);
|
||||
|
||||
// Get and check applicable vis attributes.
|
||||
fpVisAttribs = fpViewer->GetApplicableVisAttributes(fpVisAttribs);
|
||||
if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
|
||||
return;
|
||||
|
||||
@@ -310,6 +314,8 @@ void G4HepRepFileSceneHandler::AddSolid(const G4Tubs& tubs) {
|
||||
haveVisible = false;
|
||||
AddHepRepInstance("Cylinder", NULL);
|
||||
|
||||
// Get and check applicable vis attributes.
|
||||
fpVisAttribs = fpViewer->GetApplicableVisAttributes(fpVisAttribs);
|
||||
if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
|
||||
return;
|
||||
|
||||
@@ -358,6 +364,8 @@ void G4HepRepFileSceneHandler::AddSolid(const G4Trd& trd) {
|
||||
|
||||
G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
|
||||
|
||||
// Get and check applicable vis attributes.
|
||||
fpVisAttribs = fpViewer->GetApplicableVisAttributes(fpVisAttribs);
|
||||
if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
|
||||
return;
|
||||
|
||||
@@ -448,25 +456,49 @@ void G4HepRepFileSceneHandler::AddSolid(const G4Torus& torus) {
|
||||
|
||||
void G4HepRepFileSceneHandler::AddSolid(const G4Polycone& polycone) {
|
||||
#ifdef G4HEPREPFILEDEBUG
|
||||
G4cout <<
|
||||
"G4HepRepFileSceneHandler::AddSolid(const G4Polycone& polycone) called for "
|
||||
<< polycone.GetName()
|
||||
<< G4endl;
|
||||
PrintThings();
|
||||
G4cout <<
|
||||
"G4HepRepFileSceneHandler::AddSolid(const G4Polycone& polycone) called for "
|
||||
<< polycone.GetName()
|
||||
<< G4endl;
|
||||
PrintThings();
|
||||
#endif
|
||||
G4VSceneHandler::AddSolid(polycone); // Invoke default action.
|
||||
G4VSceneHandler::AddSolid(polycone); // Invoke default action.
|
||||
}
|
||||
|
||||
|
||||
void G4HepRepFileSceneHandler::AddSolid(const G4Polyhedra& polyhedra) {
|
||||
#ifdef G4HEPREPFILEDEBUG
|
||||
G4cout <<
|
||||
"G4HepRepFileSceneHandler::AddSolid(const G4Polyhedra& polyhedra) called for "
|
||||
<< polyhedra.GetName()
|
||||
<< G4endl;
|
||||
PrintThings();
|
||||
G4cout <<
|
||||
"G4HepRepFileSceneHandler::AddSolid(const G4Polyhedra& polyhedra) called for "
|
||||
<< polyhedra.GetName()
|
||||
<< G4endl;
|
||||
PrintThings();
|
||||
#endif
|
||||
G4VSceneHandler::AddSolid(polyhedra); // Invoke default action.
|
||||
G4VSceneHandler::AddSolid(polyhedra); // Invoke default action.
|
||||
}
|
||||
|
||||
|
||||
void G4HepRepFileSceneHandler::AddSolid(const G4Orb& orb) {
|
||||
#ifdef G4HEPREPFILEDEBUG
|
||||
G4cout <<
|
||||
"G4HepRepFileSceneHandler::AddSolid(const G4Orb& orb) called for "
|
||||
<< orb.GetName()
|
||||
<< G4endl;
|
||||
PrintThings();
|
||||
#endif
|
||||
G4VSceneHandler::AddSolid(orb); // Invoke default action.
|
||||
}
|
||||
|
||||
|
||||
void G4HepRepFileSceneHandler::AddSolid(const G4Ellipsoid& ellipsoid) {
|
||||
#ifdef G4HEPREPFILEDEBUG
|
||||
G4cout <<
|
||||
"G4HepRepFileSceneHandler::AddSolid(const G4Ellipsoid& ellipsoid) called for "
|
||||
<< ellipsoid.GetName()
|
||||
<< G4endl;
|
||||
PrintThings();
|
||||
#endif
|
||||
G4VSceneHandler::AddSolid(ellipsoid); // Invoke default action.
|
||||
}
|
||||
|
||||
|
||||
@@ -1276,7 +1308,7 @@ G4HepRepFileXMLWriter *G4HepRepFileSceneHandler::GetHepRepXMLWriter() {
|
||||
|
||||
|
||||
void G4HepRepFileSceneHandler::AddHepRepInstance(const char* primName,
|
||||
const G4Visible visible) {
|
||||
const G4Visible visible) {
|
||||
#ifdef G4HEPREPFILEDEBUG
|
||||
G4cout <<
|
||||
"G4HepRepFileSceneHandler::AddHepRepInstance called."
|
||||
@@ -1465,11 +1497,11 @@ void G4HepRepFileSceneHandler::AddHepRepInstance(const char* primName,
|
||||
colour = fpVisAttribs->GetColour();
|
||||
isVisible = fpVisAttribs->IsVisible();
|
||||
} else {
|
||||
colour = GetColour(visible);
|
||||
colour = visible.GetVisAttributes()->GetColour();
|
||||
isVisible = fpViewer->
|
||||
GetApplicableVisAttributes(visible.GetVisAttributes())->IsVisible();
|
||||
GetApplicableVisAttributes(visible.GetVisAttributes())->IsVisible();
|
||||
}
|
||||
|
||||
|
||||
redness = colour.GetRed();
|
||||
greenness = colour.GetGreen();
|
||||
blueness = colour.GetBlue();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepSceneHandler.cc 71534 2013-06-17 16:07:53Z gcosmo $
|
||||
// $Id: G4HepRepSceneHandler.cc 101714 2016-11-22 08:53:13Z gcosmo $
|
||||
//
|
||||
|
||||
/**
|
||||
@@ -722,17 +722,27 @@ void G4HepRepSceneHandler::AddSolid (const G4Torus& torus) {
|
||||
G4VSceneHandler::AddSolid (torus);
|
||||
}
|
||||
|
||||
void G4HepRepSceneHandler::AddSolid (const G4Polycone& polycone) {
|
||||
if (dontWrite()) return;
|
||||
G4VSceneHandler::AddSolid (polycone);
|
||||
void G4HepRepSceneHandler::AddSolid (const G4Polycone& polycone) {
|
||||
if (dontWrite()) return;
|
||||
G4VSceneHandler::AddSolid (polycone);
|
||||
}
|
||||
|
||||
void G4HepRepSceneHandler::AddSolid (const G4Polyhedra& polyhedra) {
|
||||
if (dontWrite()) return;
|
||||
G4VSceneHandler::AddSolid (polyhedra);
|
||||
void G4HepRepSceneHandler::AddSolid (const G4Polyhedra& polyhedra) {
|
||||
if (dontWrite()) return;
|
||||
G4VSceneHandler::AddSolid (polyhedra);
|
||||
}
|
||||
|
||||
void G4HepRepSceneHandler::AddSolid (const G4VSolid& solid) {
|
||||
void G4HepRepSceneHandler::AddSolid (const G4Orb& orb) {
|
||||
if (dontWrite()) return;
|
||||
G4VSceneHandler::AddSolid (orb);
|
||||
}
|
||||
|
||||
void G4HepRepSceneHandler::AddSolid (const G4Ellipsoid& ellipsoid) {
|
||||
if (dontWrite()) return;
|
||||
G4VSceneHandler::AddSolid (ellipsoid);
|
||||
}
|
||||
|
||||
void G4HepRepSceneHandler::AddSolid (const G4VSolid& solid) {
|
||||
if (dontWrite()) return;
|
||||
G4VSceneHandler::AddSolid(solid);
|
||||
}
|
||||
@@ -761,7 +771,8 @@ void G4HepRepSceneHandler::AddPrimitive (const G4Polyline& line) {
|
||||
|
||||
addAttributes(instance, getTrajectoryType());
|
||||
|
||||
setColor(instance, GetColor(line));
|
||||
fpVisAttribs = line.GetVisAttributes();
|
||||
setColor(instance, GetColor());
|
||||
|
||||
setVisibility(instance, line);
|
||||
|
||||
@@ -797,7 +808,8 @@ void G4HepRepSceneHandler::AddPrimitive (const G4Polymarker& line) {
|
||||
|
||||
addAttributes(instance, getHitType());
|
||||
|
||||
setColor(instance, GetColor(line));
|
||||
fpVisAttribs = line.GetVisAttributes();
|
||||
setColor(instance, GetColor());
|
||||
|
||||
setVisibility(instance, line);
|
||||
|
||||
@@ -809,7 +821,7 @@ void G4HepRepSceneHandler::AddPrimitive (const G4Polymarker& line) {
|
||||
// Cannot be case statement since line.xxx is not a constant
|
||||
if (mtype == line.dots) {
|
||||
setAttribute(instance, "Fill", true);
|
||||
setColor(instance, GetColor(line), G4String("FillColor"));
|
||||
setColor(instance, GetColor(), G4String("FillColor"));
|
||||
} else if (mtype == line.circles) {
|
||||
} else if (line.squares) {
|
||||
setAttribute(instance, "MarkName", G4String("Box"));
|
||||
@@ -849,7 +861,8 @@ void G4HepRepSceneHandler::AddPrimitive (const G4Circle& circle) {
|
||||
|
||||
G4Point3D center = transform * circle.GetPosition();
|
||||
|
||||
setColor (instance, GetColor(circle));
|
||||
fpVisAttribs = circle.GetVisAttributes();
|
||||
setColor (instance, GetColor());
|
||||
|
||||
setVisibility(instance, circle);
|
||||
|
||||
@@ -906,8 +919,9 @@ void G4HepRepSceneHandler::AddPrimitive (const G4Polyhedron& polyhedron) {
|
||||
}
|
||||
|
||||
setLine(face, polyhedron);
|
||||
setColor(face, GetColor(polyhedron));
|
||||
if (isEventData()) setColor(face, GetColor(polyhedron), G4String("FillColor"));
|
||||
fpVisAttribs = polyhedron.GetVisAttributes();
|
||||
setColor(face, GetColor());
|
||||
if (isEventData()) setColor(face, GetColor(), G4String("FillColor"));
|
||||
|
||||
notLastFace = polyhedron.GetNextNormal (surfaceNormal);
|
||||
|
||||
@@ -1063,11 +1077,13 @@ void G4HepRepSceneHandler::setColor (HepRepAttribute *attribute,
|
||||
}
|
||||
|
||||
G4Color G4HepRepSceneHandler::getColorFor (const G4VSolid& /* solid */) {
|
||||
return fpVisAttribs ? fpVisAttribs->GetColor() : GetColor(NULL);
|
||||
// fpVisAttribs has been set for solids.
|
||||
return GetColor();
|
||||
}
|
||||
|
||||
G4Color G4HepRepSceneHandler::getColorFor (const G4Visible& visible) {
|
||||
return GetColor(visible);
|
||||
fpVisAttribs = visible.GetVisAttributes();
|
||||
return GetColor();
|
||||
}
|
||||
|
||||
void G4HepRepSceneHandler::setVisibility (HepRepAttribute *attribute, const G4VSolid& /* solid */) {
|
||||
@@ -1114,7 +1130,8 @@ void G4HepRepSceneHandler::setMarker (HepRepAttribute *attribute, const G4VMarke
|
||||
if (marker.GetFillStyle() == G4VMarker::noFill) {
|
||||
setAttribute(attribute, "Fill", false);
|
||||
} else {
|
||||
setColor(attribute, GetColor(marker), G4String("FillColor"));
|
||||
fpVisAttribs = marker.GetVisAttributes();
|
||||
setColor(attribute, GetColor(), G4String("FillColor"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
// Copyright FreeHEP, 2005.
|
||||
|
||||
#include "cheprep/GZIPOutputStreamBuffer.h"
|
||||
#include "cheprep/GZIPOutputStream.h"
|
||||
|
||||
/**
|
||||
* @author Mark Donszelmann
|
||||
* @version $Id: GZIPOutputStream.cc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
*/
|
||||
namespace cheprep {
|
||||
|
||||
using namespace std;
|
||||
|
||||
GZIPOutputStream::GZIPOutputStream(ostream &os)
|
||||
: std::ostream(NULL) {
|
||||
|
||||
buffer = new GZIPOutputStreamBuffer(os.rdbuf());
|
||||
init(buffer);
|
||||
}
|
||||
|
||||
|
||||
void GZIPOutputStream::setFilename(const string &filename) {
|
||||
buffer->setFilename(filename);
|
||||
}
|
||||
|
||||
void GZIPOutputStream::setComment(const string &comment) {
|
||||
buffer->setComment(comment);
|
||||
}
|
||||
|
||||
void GZIPOutputStream::close() {
|
||||
buffer->close();
|
||||
}
|
||||
|
||||
|
||||
GZIPOutputStream::~GZIPOutputStream() {
|
||||
delete buffer;
|
||||
}
|
||||
|
||||
} // cheprep
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
// Copyright FreeHEP, 2005.
|
||||
|
||||
#include <iostream>
|
||||
#include <ctime>
|
||||
#include <vector>
|
||||
|
||||
#include "cheprep/ZipOutputStreamBuffer.h"
|
||||
#include "cheprep/ZipOutputStream.h"
|
||||
|
||||
/**
|
||||
* @author Mark Donszelmann
|
||||
* @version $Id: ZipOutputStream.cc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
*/
|
||||
namespace cheprep {
|
||||
|
||||
ZipOutputStream::ZipOutputStream(std::ostream& os) : std::ostream(0) {
|
||||
buffer = new ZipOutputStreamBuffer(os.rdbuf());
|
||||
|
||||
init(buffer);
|
||||
}
|
||||
|
||||
void ZipOutputStream::closeEntry() {
|
||||
buffer->closeEntry();
|
||||
}
|
||||
|
||||
|
||||
void ZipOutputStream::close() {
|
||||
buffer->close();
|
||||
}
|
||||
|
||||
void ZipOutputStream::putNextEntry(const std::string& name, bool compress) {
|
||||
buffer->putNextEntry(name, compress);
|
||||
}
|
||||
|
||||
void ZipOutputStream::setComment(const std::string& comment ) {
|
||||
buffer->setComment(comment);
|
||||
}
|
||||
|
||||
ZipOutputStream::~ZipOutputStream() {
|
||||
close();
|
||||
delete buffer;
|
||||
}
|
||||
|
||||
} // cheprep
|
||||
Reference in New Issue
Block a user