Import Geant4 9.4.0 source tree
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// $Id: G4DigiFilterFactories.cc,v 1.1 2010/05/30 11:24:30 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04-beta-01 $
|
||||
//
|
||||
//
|
||||
// Digi filter model factories creating filters
|
||||
// and associated messengers.
|
||||
//
|
||||
// Jane Tinslay March 2006
|
||||
//
|
||||
#include "G4ModelCommandsT.hh"
|
||||
#include "G4DigiFilterFactories.hh"
|
||||
#include "G4AttributeFilterT.hh"
|
||||
|
||||
// Attribute filter
|
||||
G4DigiAttributeFilterFactory::G4DigiAttributeFilterFactory()
|
||||
:G4VModelFactory< G4VFilter<G4VDigi> >("attributeFilter")
|
||||
{}
|
||||
|
||||
G4DigiAttributeFilterFactory::~G4DigiAttributeFilterFactory() {}
|
||||
|
||||
G4DigiAttributeFilterFactory::ModelAndMessengers
|
||||
G4DigiAttributeFilterFactory::Create(const G4String& placement, const G4String& name)
|
||||
{
|
||||
typedef G4AttributeFilterT<G4VDigi> G4DigiAttributeFilter;
|
||||
// Create model
|
||||
G4DigiAttributeFilter* model = new G4DigiAttributeFilter(name);
|
||||
|
||||
// Create associated messengers
|
||||
Messengers messengers;
|
||||
|
||||
messengers.push_back(new G4ModelCmdSetString<G4DigiAttributeFilter>(model, placement, "setAttribute"));
|
||||
messengers.push_back(new G4ModelCmdInvert<G4DigiAttributeFilter>(model, placement));
|
||||
messengers.push_back(new G4ModelCmdActive<G4DigiAttributeFilter>(model, placement));
|
||||
messengers.push_back(new G4ModelCmdVerbose<G4DigiAttributeFilter>(model, placement));
|
||||
messengers.push_back(new G4ModelCmdReset<G4DigiAttributeFilter>(model, placement));
|
||||
messengers.push_back(new G4ModelCmdAddInterval<G4DigiAttributeFilter>(model, placement, "addInterval"));
|
||||
messengers.push_back(new G4ModelCmdAddValue<G4DigiAttributeFilter>(model, placement, "addValue"));
|
||||
|
||||
return ModelAndMessengers(model, messengers);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DigiModel.cc,v 1.1 2010/05/30 11:24:30 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04-beta-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 26th August 1998.
|
||||
// Model which knows how to draw GEANT4 digis (digitisations).
|
||||
|
||||
#include "G4DigiModel.hh"
|
||||
|
||||
#include "G4ModelingParameters.hh"
|
||||
#include "G4VGraphicsScene.hh"
|
||||
#include "G4Event.hh"
|
||||
|
||||
G4DigiModel::~G4DigiModel () {}
|
||||
|
||||
G4DigiModel::G4DigiModel ():
|
||||
fpCurrentDigi(0)
|
||||
{
|
||||
fGlobalTag = "G4DigiModel for all digis.";
|
||||
fGlobalDescription = fGlobalTag;
|
||||
}
|
||||
|
||||
void G4DigiModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler)
|
||||
{
|
||||
const G4Event* event = fpMP->GetEvent();
|
||||
if (event) {
|
||||
G4DCofThisEvent* DCE = event -> GetDCofThisEvent ();
|
||||
if (DCE) {
|
||||
G4int nDC = DCE -> GetCapacity ();
|
||||
for (int iDC = 0; iDC < nDC; iDC++) {
|
||||
G4VDigiCollection* DC = DCE -> GetDC (iDC);
|
||||
if (DC) {
|
||||
for(size_t iDigi = 0; iDigi < DC->GetSize(); ++iDigi) {
|
||||
fpCurrentDigi = DC -> GetDigi (iDigi);
|
||||
if (fpCurrentDigi) sceneHandler.AddCompound (*fpCurrentDigi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,11 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// $Id: G4HitFilterFactories.cc,v 1.1 2006/09/12 18:53:03 tinslay Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
/// $Id: G4HitFilterFactories.cc,v 1.2 2010/05/30 11:24:03 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04-beta-01 $
|
||||
//
|
||||
//
|
||||
// Trajectory filter model factories creating filters
|
||||
// Hits filter model factories creating filters
|
||||
// and associated messengers.
|
||||
//
|
||||
// Jane Tinslay March 2006
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ModelingParameters.cc,v 1.15 2006/11/14 14:42:08 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4ModelingParameters.cc,v 1.16 2010/05/11 11:13:35 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04-beta-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "G4ios.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4ExceptionSeverity.hh"
|
||||
#include "G4Polyhedron.hh"
|
||||
#include "G4VSolid.hh"
|
||||
|
||||
G4ModelingParameters::G4ModelingParameters ():
|
||||
fWarning (true),
|
||||
@@ -49,8 +49,8 @@ G4ModelingParameters::G4ModelingParameters ():
|
||||
fCullCovered (false),
|
||||
fExplodeFactor (1.),
|
||||
fNoOfSides (24),
|
||||
fpSectionPolyhedron (0),
|
||||
fpCutawayPolyhedron (0),
|
||||
fpSectionSolid (0),
|
||||
fpCutawaySolid (0),
|
||||
fpEvent (0)
|
||||
{}
|
||||
|
||||
@@ -74,15 +74,15 @@ G4ModelingParameters::G4ModelingParameters
|
||||
fCullCovered (isCullingCovered),
|
||||
fExplodeFactor (1.),
|
||||
fNoOfSides (noOfSides),
|
||||
fpSectionPolyhedron (0),
|
||||
fpCutawayPolyhedron (0),
|
||||
fpEvent (0)
|
||||
fpSectionSolid (0),
|
||||
fpCutawaySolid (0),
|
||||
fpEvent (0)
|
||||
{}
|
||||
|
||||
G4ModelingParameters::~G4ModelingParameters ()
|
||||
{
|
||||
delete fpSectionPolyhedron;
|
||||
delete fpCutawayPolyhedron;
|
||||
delete fpSectionSolid;
|
||||
delete fpCutawaySolid;
|
||||
}
|
||||
|
||||
void G4ModelingParameters::SetVisibleDensity (G4double visibleDensity) {
|
||||
@@ -115,6 +115,18 @@ G4int G4ModelingParameters::SetNoOfSides (G4int nSides) {
|
||||
return fNoOfSides;
|
||||
}
|
||||
|
||||
void G4ModelingParameters::SetSectionSolid
|
||||
(G4VSolid* pSectionSolid) {
|
||||
delete fpSectionSolid;
|
||||
fpSectionSolid = pSectionSolid;
|
||||
}
|
||||
|
||||
void G4ModelingParameters::SetCutawaySolid
|
||||
(G4VSolid* pCutawaySolid) {
|
||||
delete fpCutawaySolid;
|
||||
fpCutawaySolid = pCutawaySolid;
|
||||
}
|
||||
|
||||
std::ostream& operator << (std::ostream& os, const G4ModelingParameters& mp)
|
||||
{
|
||||
os << "Modeling parameters (warning ";
|
||||
@@ -165,12 +177,12 @@ std::ostream& operator << (std::ostream& os, const G4ModelingParameters& mp)
|
||||
os << "\n No. of sides used in circle polygon approximation: "
|
||||
<< mp.fNoOfSides;
|
||||
|
||||
os << "\n Section (DCUT) polyhedron pointer: ";
|
||||
if (!mp.fpSectionPolyhedron) os << "non-";
|
||||
os << "\n Section (DCUT) shape (G4VSolid) pointer: ";
|
||||
if (!mp.fpSectionSolid) os << "non-";
|
||||
os << "null";
|
||||
|
||||
os << "\n Cutaway (DCUT) polyhedron pointer: ";
|
||||
if (!mp.fpCutawayPolyhedron) os << "non-";
|
||||
os << "\n Cutaway (DCUT) shape (G4VSolid) pointer: ";
|
||||
if (!mp.fpCutawaySolid) os << "non-";
|
||||
os << "null";
|
||||
|
||||
os << "\n Event pointer: " << mp.fpEvent;
|
||||
@@ -191,8 +203,8 @@ G4bool G4ModelingParameters::operator !=
|
||||
(fExplodeFactor != mp.fExplodeFactor) ||
|
||||
(fExplodeCentre != mp.fExplodeCentre) ||
|
||||
(fNoOfSides != mp.fNoOfSides) ||
|
||||
(fpSectionPolyhedron != mp.fpSectionPolyhedron) ||
|
||||
(fpCutawayPolyhedron != mp.fpCutawayPolyhedron) ||
|
||||
(fpSectionSolid != mp.fpSectionSolid) ||
|
||||
(fpCutawaySolid != mp.fpCutawaySolid) ||
|
||||
(fpEvent != mp.fpEvent)
|
||||
)
|
||||
return true;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeModel.cc,v 1.66 2009/10/23 08:08:19 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
// $Id: G4PhysicalVolumeModel.cc,v 1.68 2010/11/05 15:19:29 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
@@ -39,6 +39,8 @@
|
||||
#include "G4VPVParameterisation.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4VSolid.hh"
|
||||
#include "G4SubtractionSolid.hh"
|
||||
#include "G4IntersectionSolid.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4BoundingSphereScene.hh"
|
||||
@@ -72,7 +74,7 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
|
||||
fpCurrentMaterial (0),
|
||||
fpCurrentTransform (0),
|
||||
fCurtailDescent (false),
|
||||
fpClippingPolyhedron (0),
|
||||
fpClippingSolid (0),
|
||||
fClippingMode (subtraction)
|
||||
{
|
||||
std::ostringstream o;
|
||||
@@ -85,7 +87,7 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
|
||||
|
||||
G4PhysicalVolumeModel::~G4PhysicalVolumeModel ()
|
||||
{
|
||||
delete fpClippingPolyhedron;
|
||||
delete fpClippingSolid;
|
||||
}
|
||||
|
||||
void G4PhysicalVolumeModel::CalculateExtent ()
|
||||
@@ -472,11 +474,12 @@ void G4PhysicalVolumeModel::DescribeAndDescend
|
||||
|
||||
if (daughtersToBeDrawn) {
|
||||
for (G4int iDaughter = 0; iDaughter < nDaughters; iDaughter++) {
|
||||
G4VPhysicalVolume* pVPV = pLV -> GetDaughter (iDaughter);
|
||||
// Store daughter pVPV in local variable ready for recursion...
|
||||
G4VPhysicalVolume* pDaughterVPV = pLV -> GetDaughter (iDaughter);
|
||||
// Descend the geometry structure recursively...
|
||||
fCurrentDepth++;
|
||||
VisitGeometryAndGetVisReps
|
||||
(pVPV, requestedDepth - 1, theNewAT, sceneHandler);
|
||||
(pDaughterVPV, requestedDepth - 1, theNewAT, sceneHandler);
|
||||
fCurrentDepth--;
|
||||
}
|
||||
}
|
||||
@@ -499,16 +502,16 @@ void G4PhysicalVolumeModel::DescribeSolid
|
||||
{
|
||||
sceneHandler.PreAddSolid (theAT, *pVisAttribs);
|
||||
|
||||
const G4Polyhedron* pSectionPolyhedron = fpMP->GetSectionPolyhedron();
|
||||
const G4Polyhedron* pCutawayPolyhedron = fpMP->GetCutawayPolyhedron();
|
||||
G4VSolid* pSectionSolid = fpMP->GetSectionSolid();
|
||||
G4VSolid* pCutawaySolid = fpMP->GetCutawaySolid();
|
||||
|
||||
if (!fpClippingPolyhedron && !pSectionPolyhedron && !pCutawayPolyhedron) {
|
||||
if (!fpClippingSolid && !pSectionSolid && !pCutawaySolid) {
|
||||
|
||||
pSol -> DescribeYourselfTo (sceneHandler); // Standard treatment.
|
||||
|
||||
} else {
|
||||
|
||||
// Clipping, etc., performed by Boolean operations on polyhedron objects.
|
||||
// Clipping, etc., performed by Boolean operations.
|
||||
|
||||
// First, get polyhedron for current solid...
|
||||
if (pVisAttribs->IsForceLineSegmentsPerCircle())
|
||||
@@ -516,7 +519,7 @@ void G4PhysicalVolumeModel::DescribeSolid
|
||||
(pVisAttribs->GetForcedLineSegmentsPerCircle());
|
||||
else
|
||||
G4Polyhedron::SetNumberOfRotationSteps(fpMP->GetNoOfSides());
|
||||
G4Polyhedron* pOriginal = pSol->GetPolyhedron();
|
||||
const G4Polyhedron* pOriginal = pSol->GetPolyhedron();
|
||||
G4Polyhedron::ResetNumberOfRotationSteps();
|
||||
|
||||
if (!pOriginal) {
|
||||
@@ -531,67 +534,49 @@ void G4PhysicalVolumeModel::DescribeSolid
|
||||
|
||||
} else {
|
||||
|
||||
G4Polyhedron resultant = *pOriginal;
|
||||
G4Polyhedron resultant(*pOriginal);
|
||||
G4VisAttributes resultantVisAttribs(*pVisAttribs);
|
||||
G4VSolid* resultantSolid = 0;
|
||||
|
||||
if (fpClippingPolyhedron) {
|
||||
G4Polyhedron clipper = *fpClippingPolyhedron; // Local copy.
|
||||
clipper.Transform(theAT.inverse());
|
||||
HepPolyhedronProcessor processor;
|
||||
if (fpClippingSolid) {
|
||||
switch (fClippingMode) {
|
||||
default:
|
||||
case subtraction: processor.push_back(HepPolyhedronProcessor::SUBTRACTION, clipper); break;
|
||||
case intersection: processor.push_back(HepPolyhedronProcessor::INTERSECTION, clipper); break;
|
||||
}
|
||||
if (!processor.execute(resultant)) {
|
||||
if (fpMP->IsWarning())
|
||||
G4cout <<
|
||||
"WARNING: G4PhysicalVolumeModel::DescribeSolid: clipped polyhedron for"
|
||||
"\n solid \"" << pSol->GetName() <<
|
||||
"\" not defined due to error during Boolean processing."
|
||||
"\n It will be drawn in red."
|
||||
<< G4endl;
|
||||
// Nevertheless, keep resultant, but draw it in red
|
||||
resultantVisAttribs.SetColour(G4Colour::Red());
|
||||
case subtraction:
|
||||
resultantSolid = new G4SubtractionSolid
|
||||
("resultant_solid", pSol, fpClippingSolid, theAT.inverse());
|
||||
break;
|
||||
case intersection:
|
||||
resultantSolid = new G4IntersectionSolid
|
||||
("resultant_solid", pSol, fpClippingSolid, theAT.inverse());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (pSectionPolyhedron) {
|
||||
G4Polyhedron sectioner = *pSectionPolyhedron; // Local copy.
|
||||
sectioner.Transform(theAT.inverse());
|
||||
HepPolyhedronProcessor processor;
|
||||
processor.push_back(HepPolyhedronProcessor::INTERSECTION, sectioner);
|
||||
if (!processor.execute(resultant)) {
|
||||
if (fpMP->IsWarning())
|
||||
G4cout <<
|
||||
"WARNING: G4PhysicalVolumeModel::DescribeSolid: sectioned polyhedron for"
|
||||
"\n solid \"" << pSol->GetName() <<
|
||||
"\" not defined due to error during Boolean processing."
|
||||
"\n It will be drawn in red."
|
||||
<< G4endl;
|
||||
// Nevertheless, keep resultant, but draw it in red
|
||||
resultantVisAttribs.SetColour(G4Colour::Red());
|
||||
}
|
||||
if (pSectionSolid) {
|
||||
resultantSolid = new G4IntersectionSolid
|
||||
("sectioned_solid", pSol, pSectionSolid, theAT.inverse());
|
||||
}
|
||||
|
||||
if (pCutawayPolyhedron) {
|
||||
G4Polyhedron cutter = *pCutawayPolyhedron; // Local copy.
|
||||
cutter.Transform(theAT.inverse());
|
||||
HepPolyhedronProcessor processor;
|
||||
processor.push_back(HepPolyhedronProcessor::SUBTRACTION, cutter);
|
||||
if (!processor.execute(resultant)) {
|
||||
if (fpMP->IsWarning())
|
||||
G4cout <<
|
||||
"WARNING: G4PhysicalVolumeModel::DescribeSolid: cutaway polyhedron for"
|
||||
"\n solid \"" << pSol->GetName() <<
|
||||
"\" not defined due to error during Boolean processing."
|
||||
"\n It will be drawn in red."
|
||||
<< G4endl;
|
||||
// Nevertheless, keep resultant, but draw it in red
|
||||
resultantVisAttribs.SetColour(G4Colour::Red());
|
||||
}
|
||||
if (pCutawaySolid) {
|
||||
resultantSolid = new G4SubtractionSolid
|
||||
("cutaway_solid", pSol, pCutawaySolid, theAT.inverse());
|
||||
}
|
||||
|
||||
G4Polyhedron* tmpResultant = resultantSolid->GetPolyhedron();
|
||||
if (tmpResultant) resultant = *tmpResultant;
|
||||
else {
|
||||
if (fpMP->IsWarning())
|
||||
G4cout <<
|
||||
"WARNING: G4PhysicalVolumeModel::DescribeSolid: resultant polyhedron for"
|
||||
"\n solid \"" << pSol->GetName() <<
|
||||
"\" not defined due to error during Boolean processing."
|
||||
"\n Original will be drawn in red."
|
||||
<< G4endl;
|
||||
resultantVisAttribs.SetColour(G4Colour::Red());
|
||||
}
|
||||
|
||||
delete resultantSolid;
|
||||
|
||||
// Finally, force polyhedron drawing...
|
||||
resultant.SetVisAttributes(resultantVisAttribs);
|
||||
sceneHandler.BeginPrimitives(theAT);
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TrajectoriesModel.cc,v 1.24 2006/11/14 14:42:08 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4TrajectoriesModel.cc,v 1.25 2010/05/11 11:21:52 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04-beta-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 26th August 1998.
|
||||
@@ -40,8 +40,19 @@
|
||||
#include "G4AttDef.hh"
|
||||
#include "G4AttCheck.hh"
|
||||
|
||||
G4TrajectoriesModel::G4TrajectoriesModel ():
|
||||
fDrawingModeSet(false),
|
||||
fDrawingMode(0),
|
||||
fpCurrentTrajectory(0)
|
||||
{
|
||||
fGlobalTag = "G4TrajectoriesModel for all trajectories.";
|
||||
fGlobalDescription = fGlobalTag;
|
||||
}
|
||||
|
||||
G4TrajectoriesModel::G4TrajectoriesModel (G4int drawingMode):
|
||||
fDrawingMode(drawingMode), fpCurrentTrajectory(0) {
|
||||
fDrawingModeSet(true),
|
||||
fDrawingMode(drawingMode),
|
||||
fpCurrentTrajectory(0) {
|
||||
fGlobalTag = "G4TrajectoriesModel for all trajectories.";
|
||||
fGlobalDescription = fGlobalTag;
|
||||
}
|
||||
@@ -68,6 +79,42 @@ void G4TrajectoriesModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler) {
|
||||
}
|
||||
}
|
||||
|
||||
G4bool G4TrajectoriesModel::IsDrawingModeSet() const
|
||||
{
|
||||
return fDrawingModeSet;
|
||||
}
|
||||
|
||||
G4int G4TrajectoriesModel::GetDrawingMode() const
|
||||
{
|
||||
if (fDrawingModeSet) return fDrawingMode;
|
||||
else {
|
||||
G4Exception
|
||||
("G4TrajectoriesModel::GetDrawingMode",
|
||||
"",
|
||||
FatalException,
|
||||
"Illegal attempt to obtain i_mode."
|
||||
"\n i_mode is an old trajectories parameter that is DEPRECATED"
|
||||
"\n and will be removed at the next major release."
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void G4TrajectoriesModel::SetDrawingMode(G4int drawingMode)
|
||||
{
|
||||
if (fDrawingModeSet) fDrawingMode = drawingMode;
|
||||
else {
|
||||
G4Exception
|
||||
("G4TrajectoriesModel::SetDrawingMode",
|
||||
"",
|
||||
FatalException,
|
||||
"Illegal attempt to set i_mode."
|
||||
"\n i_mode is an old trajectories parameter that is DEPRECATED"
|
||||
"\n and will be removed at the next major release."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Debug material...
|
||||
|
||||
#include "G4VTrajectoryPoint.hh"
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4TrajectoryDrawByAttribute.cc,v 1.3 2006/09/14 15:41:42 tinslay Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4TrajectoryDrawByAttribute.cc,v 1.5 2010/05/28 02:00:59 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04-beta-01 $
|
||||
//
|
||||
// Jane Tinslay August 2006
|
||||
//
|
||||
@@ -61,7 +61,15 @@ G4TrajectoryDrawByAttribute::~G4TrajectoryDrawByAttribute()
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object, const G4int&,
|
||||
G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object,
|
||||
const G4int&,
|
||||
const G4bool& visible) const
|
||||
{
|
||||
Draw(object, visible);
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object,
|
||||
const G4bool& visible) const
|
||||
{
|
||||
// Return if attribute name has not been set. Just print one warning
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4TrajectoryDrawByCharge.cc,v 1.8 2006/06/29 21:33:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4TrajectoryDrawByCharge.cc,v 1.10 2010/05/28 02:00:59 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04-beta-01 $
|
||||
//
|
||||
// Jane Tinslay, John Allison, Joseph Perl November 2005
|
||||
#include "G4TrajectoryDrawByCharge.hh"
|
||||
@@ -56,7 +56,15 @@ G4TrajectoryDrawByCharge::G4TrajectoryDrawByCharge(const G4String& name,
|
||||
G4TrajectoryDrawByCharge::~G4TrajectoryDrawByCharge() {}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& traj, const G4int& i_mode, const G4bool& visible) const
|
||||
G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& object,
|
||||
const G4int&,
|
||||
const G4bool& visible) const
|
||||
{
|
||||
Draw(object, visible);
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& traj, const G4bool& visible) const
|
||||
{
|
||||
G4Colour colour;
|
||||
|
||||
@@ -78,7 +86,7 @@ G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& traj, const G4int& i_mode, c
|
||||
myContext.Print(G4cout);
|
||||
}
|
||||
|
||||
G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext, i_mode);
|
||||
G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4TrajectoryDrawByOriginVolume.cc,v 1.4 2006/06/29 21:33:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4TrajectoryDrawByOriginVolume.cc,v 1.6 2010/05/28 02:00:59 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04-beta-01 $
|
||||
//
|
||||
// Jane Tinslay March 2006
|
||||
|
||||
@@ -44,7 +44,15 @@ G4TrajectoryDrawByOriginVolume::G4TrajectoryDrawByOriginVolume(const G4String& n
|
||||
G4TrajectoryDrawByOriginVolume::~G4TrajectoryDrawByOriginVolume() {}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& traj, const G4int& i_mode, const G4bool& visible) const
|
||||
G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& object,
|
||||
const G4int&,
|
||||
const G4bool& visible) const
|
||||
{
|
||||
Draw(object, visible);
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& traj, const G4bool& visible) const
|
||||
{
|
||||
G4Colour colour(fDefault);
|
||||
|
||||
@@ -78,7 +86,7 @@ G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& traj, const G4int& i_m
|
||||
myContext.Print(G4cout);
|
||||
}
|
||||
|
||||
G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext, i_mode);
|
||||
G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4TrajectoryDrawByParticleID.cc,v 1.8 2006/06/29 21:33:10 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4TrajectoryDrawByParticleID.cc,v 1.11 2010/06/01 21:17:41 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04-beta-01 $
|
||||
//
|
||||
// Jane Tinslay, John Allison, Joseph Perl November 2005
|
||||
|
||||
@@ -37,12 +37,28 @@
|
||||
G4TrajectoryDrawByParticleID::G4TrajectoryDrawByParticleID(const G4String& name, G4VisTrajContext* context)
|
||||
:G4VTrajectoryModel(name, context)
|
||||
,fDefault(G4Colour::Grey())
|
||||
{}
|
||||
{
|
||||
Set("gamma", "green");
|
||||
Set("e-", "red");
|
||||
Set("e+", "blue");
|
||||
Set("pi+", "magenta");
|
||||
Set("pi-", "magenta");
|
||||
Set("proton", "cyan");
|
||||
Set("neutron", "yellow");
|
||||
}
|
||||
|
||||
G4TrajectoryDrawByParticleID::~G4TrajectoryDrawByParticleID() {}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& traj, const G4int& i_mode, const G4bool& visible) const
|
||||
G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& object,
|
||||
const G4int&,
|
||||
const G4bool& visible) const
|
||||
{
|
||||
Draw(object, visible);
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& traj, const G4bool& visible) const
|
||||
{
|
||||
G4Colour colour(fDefault);
|
||||
G4String particle = traj.GetParticleName();
|
||||
@@ -61,7 +77,7 @@ G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& traj, const G4int& i_mod
|
||||
myContext.Print(G4cout);
|
||||
}
|
||||
|
||||
G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext, i_mode);
|
||||
G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4TrajectoryDrawerUtils.cc,v 1.12 2009/02/24 12:00:56 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
// $Id: G4TrajectoryDrawerUtils.cc,v 1.15 2010/11/14 22:13:55 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
//
|
||||
// Jane Tinslay, John Allison, Joseph Perl November 2005
|
||||
//
|
||||
@@ -39,32 +39,52 @@
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4AttValue.hh"
|
||||
#include <sstream>
|
||||
|
||||
namespace G4TrajectoryDrawerUtils {
|
||||
|
||||
|
||||
void GetPoints(const G4VTrajectory& traj, G4Polyline& trajectoryLine,
|
||||
G4Polymarker& auxiliaryPoints, G4Polymarker& stepPoints)
|
||||
void GetPoints(const G4VTrajectory& traj,
|
||||
G4Polyline& trajectoryLine,
|
||||
G4Polymarker& auxiliaryPoints,
|
||||
G4Polymarker& stepPoints)
|
||||
{
|
||||
// Keep positions. Don't store unless first or different.
|
||||
std::vector<G4ThreeVector> positions;
|
||||
|
||||
for (G4int i=0; i<traj.GetPointEntries(); i++) {
|
||||
|
||||
G4VTrajectoryPoint* aTrajectoryPoint = traj.GetPoint(i);
|
||||
|
||||
const std::vector<G4ThreeVector>* auxiliaries
|
||||
= aTrajectoryPoint->GetAuxiliaryPoints();
|
||||
|
||||
if (0 != auxiliaries) {
|
||||
for (size_t iAux=0; iAux<auxiliaries->size(); ++iAux) {
|
||||
const G4ThreeVector pos((*auxiliaries)[iAux]);
|
||||
trajectoryLine.push_back(pos);
|
||||
auxiliaryPoints.push_back(pos);
|
||||
const G4ThreeVector& trajectoryPointPosition =
|
||||
aTrajectoryPoint->GetPosition();
|
||||
|
||||
// Only store if first or if different
|
||||
if (positions.size() == 0 ||
|
||||
trajectoryPointPosition != positions[positions.size()-1]) {
|
||||
|
||||
const std::vector<G4ThreeVector>* auxiliaries
|
||||
= aTrajectoryPoint->GetAuxiliaryPoints();
|
||||
if (0 != auxiliaries) {
|
||||
for (size_t iAux=0; iAux<auxiliaries->size(); ++iAux) {
|
||||
const G4ThreeVector& auxPointPosition = (*auxiliaries)[iAux];
|
||||
if (positions.size() == 0 ||
|
||||
auxPointPosition != positions[positions.size()-1]) {
|
||||
// Only store if first or if different
|
||||
positions.push_back(trajectoryPointPosition);
|
||||
trajectoryLine.push_back(auxPointPosition);
|
||||
auxiliaryPoints.push_back(auxPointPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
positions.push_back(trajectoryPointPosition);
|
||||
trajectoryLine.push_back(trajectoryPointPosition);
|
||||
stepPoints.push_back(trajectoryPointPosition);
|
||||
}
|
||||
const G4ThreeVector pos(aTrajectoryPoint->GetPosition());
|
||||
trajectoryLine.push_back(pos);
|
||||
stepPoints.push_back(pos);
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
void DrawLineAndPoints(const G4VTrajectory& traj, const G4int& i_mode, const G4Colour& colour, const G4bool& visible) {
|
||||
// If i_mode>=0, draws a trajectory as a polyline (default is blue for
|
||||
// positive, red for negative, green for neutral) and, if i_mode!=0,
|
||||
@@ -72,6 +92,19 @@ namespace G4TrajectoryDrawerUtils {
|
||||
// for auxiliary points, if any - whose screen size in pixels is
|
||||
// given by std::abs(i_mode)/1000. E.g: i_mode = 5000 gives easily
|
||||
// visible markers.
|
||||
|
||||
static G4bool warnedAboutIMode = false;
|
||||
std::ostringstream oss;
|
||||
oss << "WARNING: DEPRECATED use of i_mode (i_mode: " << i_mode
|
||||
<< "). Feature will be removed at a future major release.";
|
||||
if (!warnedAboutIMode) {
|
||||
G4Exception
|
||||
("G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, i_mode, colour, visible)",
|
||||
"",
|
||||
JustWarning,
|
||||
oss.str().c_str());
|
||||
warnedAboutIMode = true;
|
||||
}
|
||||
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if (0 == pVVisManager) return;
|
||||
@@ -115,6 +148,7 @@ namespace G4TrajectoryDrawerUtils {
|
||||
}
|
||||
|
||||
}
|
||||
***/
|
||||
|
||||
static void GetTimes(const G4VTrajectory& traj,
|
||||
std::vector<G4double>& trajectoryLineTimes,
|
||||
@@ -126,71 +160,88 @@ namespace G4TrajectoryDrawerUtils {
|
||||
// GetPoints. If not, assume that the time information is
|
||||
// invalid.
|
||||
|
||||
// Memory for last trajectory point position for auxiliary point
|
||||
// algorithm. There are no auxiliary points for the first
|
||||
// trajectory point, so its initial value is immaterial.
|
||||
G4ThreeVector lastTrajectoryPointPosition;
|
||||
|
||||
// Keep positions. Don't store unless first or different.
|
||||
std::vector<G4ThreeVector> positions;
|
||||
|
||||
for (G4int i=0; i<traj.GetPointEntries(); i++) {
|
||||
|
||||
G4VTrajectoryPoint* aTrajectoryPoint = traj.GetPoint(i);
|
||||
|
||||
// Pre- and Post-Point times from the trajectory point...
|
||||
G4double trajectoryPointPreTime = -DBL_MAX;
|
||||
G4double trajectoryPointPostTime = DBL_MAX;
|
||||
std::vector<G4AttValue>* trajectoryPointAttValues =
|
||||
aTrajectoryPoint->CreateAttValues();
|
||||
if (!trajectoryPointAttValues) {
|
||||
G4cout << "G4TrajectoryDrawerUtils::GetTimes: no att values."
|
||||
<< G4endl;
|
||||
return;
|
||||
} else {
|
||||
G4bool foundPreTime = false, foundPostTime = false;
|
||||
for (std::vector<G4AttValue>::iterator i =
|
||||
trajectoryPointAttValues->begin();
|
||||
i != trajectoryPointAttValues->end(); ++i) {
|
||||
if (i->GetName() == "PreT") {
|
||||
trajectoryPointPreTime =
|
||||
G4UIcommand::ConvertToDimensionedDouble(i->GetValue());
|
||||
foundPreTime = true;
|
||||
}
|
||||
if (i->GetName() == "PostT") {
|
||||
trajectoryPointPostTime =
|
||||
G4UIcommand::ConvertToDimensionedDouble(i->GetValue());
|
||||
foundPostTime = true;
|
||||
}
|
||||
}
|
||||
if (!foundPreTime || !foundPostTime) {
|
||||
static G4bool warnedTimesNotFound = false;
|
||||
if (!warnedTimesNotFound) {
|
||||
G4cout <<
|
||||
"WARNING: G4TrajectoryDrawerUtils::GetTimes: times not found."
|
||||
<< G4endl;
|
||||
warnedTimesNotFound = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const G4ThreeVector& trajectoryPointPosition =
|
||||
aTrajectoryPoint->GetPosition();
|
||||
aTrajectoryPoint->GetPosition();
|
||||
|
||||
const std::vector<G4ThreeVector>* auxiliaries
|
||||
= aTrajectoryPoint->GetAuxiliaryPoints();
|
||||
|
||||
if (0 != auxiliaries) {
|
||||
for (size_t iAux=0; iAux<auxiliaries->size(); ++iAux) {
|
||||
// Interpolate time for auxiliary points...
|
||||
const G4ThreeVector pos((*auxiliaries)[iAux]);
|
||||
G4double s1 = (pos - lastTrajectoryPointPosition).mag();
|
||||
G4double s2 = (trajectoryPointPosition - pos).mag();
|
||||
G4double t = trajectoryPointPreTime +
|
||||
(trajectoryPointPostTime - trajectoryPointPreTime) *
|
||||
(s1 / (s1 + s2));
|
||||
trajectoryLineTimes.push_back(t);
|
||||
auxiliaryPointTimes.push_back(t);
|
||||
// Only store if first or if different
|
||||
if (positions.size() == 0 ||
|
||||
trajectoryPointPosition != positions[positions.size()-1]) {
|
||||
|
||||
// Pre- and Post-Point times from the trajectory point...
|
||||
G4double trajectoryPointPreTime = -std::numeric_limits<double>::max();
|
||||
G4double trajectoryPointPostTime = std::numeric_limits<double>::max();
|
||||
std::vector<G4AttValue>* trajectoryPointAttValues =
|
||||
aTrajectoryPoint->CreateAttValues();
|
||||
if (!trajectoryPointAttValues) {
|
||||
G4cout << "G4TrajectoryDrawerUtils::GetTimes: no att values."
|
||||
<< G4endl;
|
||||
return;
|
||||
} else {
|
||||
G4bool foundPreTime = false, foundPostTime = false;
|
||||
for (std::vector<G4AttValue>::iterator i =
|
||||
trajectoryPointAttValues->begin();
|
||||
i != trajectoryPointAttValues->end(); ++i) {
|
||||
if (i->GetName() == "PreT") {
|
||||
trajectoryPointPreTime =
|
||||
G4UIcommand::ConvertToDimensionedDouble(i->GetValue());
|
||||
foundPreTime = true;
|
||||
}
|
||||
if (i->GetName() == "PostT") {
|
||||
trajectoryPointPostTime =
|
||||
G4UIcommand::ConvertToDimensionedDouble(i->GetValue());
|
||||
foundPostTime = true;
|
||||
}
|
||||
}
|
||||
if (!foundPreTime || !foundPostTime) {
|
||||
static G4bool warnedTimesNotFound = false;
|
||||
if (!warnedTimesNotFound) {
|
||||
G4cout <<
|
||||
"WARNING: G4TrajectoryDrawerUtils::GetTimes: times not found."
|
||||
<< G4endl;
|
||||
warnedTimesNotFound = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<G4ThreeVector>* auxiliaries
|
||||
= aTrajectoryPoint->GetAuxiliaryPoints();
|
||||
if (0 != auxiliaries) {
|
||||
for (size_t iAux=0; iAux<auxiliaries->size(); ++iAux) {
|
||||
// Interpolate time for auxiliary points...
|
||||
const G4ThreeVector& auxPointPosition = (*auxiliaries)[iAux];
|
||||
G4double s1 = (auxPointPosition - lastTrajectoryPointPosition).mag();
|
||||
G4double s2 = (trajectoryPointPosition - auxPointPosition).mag();
|
||||
G4double t = trajectoryPointPreTime +
|
||||
(trajectoryPointPostTime - trajectoryPointPreTime) *
|
||||
(s1 / (s1 + s2));
|
||||
// Only store if first or if different
|
||||
if (positions.size() == 0 ||
|
||||
auxPointPosition != positions[positions.size()-1]) {
|
||||
positions.push_back(trajectoryPointPosition);
|
||||
trajectoryLineTimes.push_back(t);
|
||||
auxiliaryPointTimes.push_back(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
positions.push_back(trajectoryPointPosition);
|
||||
trajectoryLineTimes.push_back(trajectoryPointPostTime);
|
||||
stepPointTimes.push_back(trajectoryPointPostTime);
|
||||
|
||||
lastTrajectoryPointPosition = trajectoryPointPosition;
|
||||
}
|
||||
|
||||
trajectoryLineTimes.push_back(trajectoryPointPostTime);
|
||||
stepPointTimes.push_back(trajectoryPointPostTime);
|
||||
|
||||
lastTrajectoryPointPosition = trajectoryPointPosition;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,6 +392,19 @@ namespace G4TrajectoryDrawerUtils {
|
||||
|
||||
void DrawLineAndPoints(const G4VTrajectory& traj, const G4VisTrajContext& context, const G4int& i_mode)
|
||||
{
|
||||
static G4bool warnedAboutIMode = false;
|
||||
std::ostringstream oss;
|
||||
oss << "WARNING: DEPRECATED use of i_mode (i_mode: " << i_mode
|
||||
<< "). Feature will be removed at a future major release.";
|
||||
if (!warnedAboutIMode) {
|
||||
G4Exception
|
||||
("G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, context, i_mode)",
|
||||
"",
|
||||
JustWarning,
|
||||
oss.str().c_str());
|
||||
warnedAboutIMode = true;
|
||||
}
|
||||
|
||||
// Extra copy while i_mode is still around
|
||||
G4VisTrajContext myContext(context);
|
||||
|
||||
@@ -355,13 +419,6 @@ namespace G4TrajectoryDrawerUtils {
|
||||
|
||||
myContext.SetAuxPtsSize(markerSize);
|
||||
myContext.SetStepPtsSize(markerSize);
|
||||
|
||||
static G4bool warnedAboutIMode = false;
|
||||
|
||||
if (!warnedAboutIMode) {
|
||||
G4cout<<"Trajectory drawing configuration will be based on imode value of "<<i_mode<<G4endl;
|
||||
warnedAboutIMode = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Return if don't need to do anything
|
||||
@@ -406,4 +463,49 @@ namespace G4TrajectoryDrawerUtils {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void DrawLineAndPoints(const G4VTrajectory& traj, const G4VisTrajContext& context)
|
||||
{
|
||||
// Return if don't need to do anything
|
||||
if (!context.GetDrawLine() && !context.GetDrawAuxPts() && !context.GetDrawStepPts()) return;
|
||||
|
||||
// Get points to draw
|
||||
G4Polyline trajectoryLine;
|
||||
G4Polymarker stepPoints;
|
||||
G4Polymarker auxiliaryPoints;
|
||||
|
||||
GetPoints(traj, trajectoryLine, auxiliaryPoints, stepPoints);
|
||||
|
||||
if (context.GetTimeSliceInterval()) {
|
||||
|
||||
// Get corresponding track time information, if any
|
||||
std::vector<G4double> trajectoryLineTimes;
|
||||
std::vector<G4double> stepPointTimes;
|
||||
std::vector<G4double> auxiliaryPointTimes;
|
||||
|
||||
GetTimes(traj, trajectoryLineTimes, auxiliaryPointTimes, stepPointTimes);
|
||||
|
||||
// Check validity
|
||||
if (trajectoryLineTimes.size() != trajectoryLine.size() ||
|
||||
stepPointTimes.size() != stepPoints.size() ||
|
||||
auxiliaryPointTimes.size() != auxiliaryPoints.size()) {
|
||||
|
||||
// Revert to drawing without time information...
|
||||
DrawWithoutTime(context, trajectoryLine, auxiliaryPoints, stepPoints);
|
||||
} else {
|
||||
|
||||
SliceLine(context.GetTimeSliceInterval(),
|
||||
trajectoryLine, trajectoryLineTimes);
|
||||
|
||||
DrawWithTime(context,
|
||||
trajectoryLine, auxiliaryPoints, stepPoints,
|
||||
trajectoryLineTimes, auxiliaryPointTimes, stepPointTimes);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
DrawWithoutTime(context, trajectoryLine, auxiliaryPoints, stepPoints);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4TrajectoryGenericDrawer.cc,v 1.2 2006/06/29 21:33:16 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4TrajectoryGenericDrawer.cc,v 1.3 2010/05/11 11:31:31 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04-beta-01 $
|
||||
//
|
||||
// Jane Tinslay May 2006
|
||||
//
|
||||
@@ -55,6 +55,21 @@ G4TrajectoryGenericDrawer::Draw(const G4VTrajectory& traj, const G4int& i_mode,
|
||||
G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext, i_mode);
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryGenericDrawer::Draw(const G4VTrajectory& traj, const G4bool& visible) const
|
||||
{
|
||||
G4VisTrajContext myContext(GetContext());
|
||||
myContext.SetVisible(visible);
|
||||
|
||||
if (GetVerbose()) {
|
||||
G4cout<<"G4TrajectoryGenericDrawer named "<<Name();
|
||||
G4cout<<", drawing trajectory with configuration: "<<G4endl;
|
||||
myContext.Print(G4cout);
|
||||
}
|
||||
|
||||
G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext);
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryGenericDrawer::Print(std::ostream& ostr) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user