Import Geant4 8.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:44:26 +02:00
parent 8a51e0bc40
commit 216a75eeb1
8717 changed files with 360418 additions and 141343 deletions
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4AxesModel.hh,v 1.4 2001/08/24 20:34:14 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4AxesModel.hh,v 1.5 2006/06/29 21:30:04 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 3rd April 2001
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4AxesModel.icc,v 1.3 2001/08/24 20:34:15 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4AxesModel.icc,v 1.4 2006/06/29 21:30:06 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
inline G4String G4AxesModel::GetCurrentTag () const {
return fGlobalTag;
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4BoundingSphereScene.hh,v 1.15 2005/06/07 16:54:33 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4BoundingSphereScene.hh,v 1.17 2006/06/29 21:30:08 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 7th June 1997
@@ -87,6 +90,8 @@ public:
virtual void BeginPrimitives (const G4Transform3D&) {}
virtual void EndPrimitives () {}
virtual void BeginPrimitives2D () {}
virtual void EndPrimitives2D () {}
virtual void AddPrimitive (const G4Polyline&) {}
virtual void AddPrimitive (const G4Scale&) {}
virtual void AddPrimitive (const G4Text&) {}
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4CallbackModel.hh,v 1.3 2005/03/03 16:22:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4CallbackModel.hh,v 1.5 2006/06/29 21:30:10 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 31st December 1997.
@@ -30,19 +33,21 @@
// 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.
// example, calls to the Draw methods of G4VVisManager or the
// *Primitive* methods of G4VGraphicsScene. 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
// function class must contain:
//
// 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.
// void operator()(G4VGraphicsScene&, const G4Transform3D&)
//
// 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
@@ -55,8 +60,8 @@ template <class F> class G4CallbackModel: public G4VModel {
G4CallbackModel(F* function):
fFunction(function) {}
~G4CallbackModel() {}
void DescribeYourselfTo(G4VGraphicsScene&) {
(*fFunction)(fTransform);
void DescribeYourselfTo(G4VGraphicsScene& sceneHandler) {
(*fFunction)(sceneHandler, fTransform);
}
protected:
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4FlavoredParallelWorldModel.hh,v 1.7 2005/11/22 16:29:40 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4FlavoredParallelWorldModel.hh,v 1.8 2006/06/29 21:30:12 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// P. Mora de Freitas et M.Verderi - 19 June 1998.
//
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4HitsModel.hh,v 1.7 2001/08/24 20:36:13 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4HitsModel.hh,v 1.8 2006/06/29 21:30:14 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 26th August 1998.
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4HitsModel.icc,v 1.6 2001/08/24 20:36:14 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4HitsModel.icc,v 1.7 2006/06/29 21:30:16 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
inline G4String G4HitsModel::GetCurrentTag () const {
return fGlobalTag;
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4LogicalVolumeModel.hh,v 1.7 2005/11/22 16:29:40 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4LogicalVolumeModel.hh,v 1.8 2006/06/29 21:30:18 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 26th July 1999.
@@ -0,0 +1,492 @@
//
// ********************************************************************
// * 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: G4ModelApplyCommandsT.hh,v 1.3 2006/06/29 21:30:20 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Abstract model messenges. Derived classes should implement
// the "Apply" method
//
// Jane Tinslay April 2006
//
#ifndef G4APPLYCOMMANDST_HH
#define G4APPLYCOMMANDST_HH
#include "G4Colour.hh"
#include "G4String.hh"
#include "G4UIcmdWithABool.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcommand.hh"
#include "G4VModelCommand.hh"
#include "globals.hh"
#include <sstream>
///////////////////////////////////////////////////////////////////////////
// ApplyStringColour command
template <typename M>
class G4ModelCmdApplyStringColour : public G4VModelCommand<M> {
public: // With description
G4ModelCmdApplyStringColour(M* model, const G4String& placement, const G4String& cmdName);
virtual ~G4ModelCmdApplyStringColour();
void SetNewValue(G4UIcommand* command, G4String newValue);
protected:
// Implement in derived class
virtual void Apply(const G4String&, const G4Colour&) = 0;
G4UIcommand* StringCommand() {return fpStringCmd;}
G4UIcommand* ComponentCommand() {return fpComponentCmd;}
private:
G4UIcommand* fpStringCmd;
G4UIcommand* fpComponentCmd;
};
template <typename M>
G4ModelCmdApplyStringColour<M>::G4ModelCmdApplyStringColour(M* model, const G4String& placement, const G4String& cmdName)
:G4VModelCommand<M>(model)
{
//Set variable colour through a string
G4String dir = placement+"/"+model->Name()+"/"+cmdName;
G4UIparameter* param(0);
fpStringCmd = new G4UIcommand(dir, this);
fpStringCmd->SetGuidance("Set variable colour through a string");
param = new G4UIparameter("Variable", 's', false);
fpStringCmd->SetParameter(param);
param = new G4UIparameter("Value", 's', false);
fpStringCmd->SetParameter(param);
//Set variable colour through RGBA components
G4String componentDir = dir+"RGBA";
fpComponentCmd = new G4UIcommand(componentDir, this);
fpComponentCmd->SetGuidance("Set variable colour through red, green, blue and alpha components");
param = new G4UIparameter("Variable", 's', false);
fpComponentCmd->SetParameter(param);
param = new G4UIparameter("Red component", 'd', false);
fpComponentCmd->SetParameter(param);
param = new G4UIparameter("Green component", 'd', false);
fpComponentCmd->SetParameter(param);
param = new G4UIparameter("Blue component", 'd', false);
fpComponentCmd->SetParameter(param);
param = new G4UIparameter("Alpha component", 'd', false);
fpComponentCmd->SetParameter(param);
}
template <typename M>
G4ModelCmdApplyStringColour<M>::~G4ModelCmdApplyStringColour()
{
delete fpStringCmd;
delete fpComponentCmd;
}
template <typename M>
void G4ModelCmdApplyStringColour<M>::SetNewValue(G4UIcommand* cmd, G4String newValue)
{
G4Colour myColour;
G4String parameter;
if (cmd == fpStringCmd) {
G4String colour;
std::istringstream is (newValue);
is >> parameter >> colour;
// Colour key should exist
if (!G4Colour::GetColour(colour, myColour)) {
std::ostringstream o;
o << "G4Colour with key "<<colour<<" does not exist ";
G4Exception
("G4ModelCmdApplyStringColour<M>::SetNewValue",
"NonExistentColour", JustWarning, o.str().c_str());
return;
}
}
if (cmd == fpComponentCmd) {
G4double red(0), green(0), blue(0), alpha(0);
std::istringstream is (newValue);
is >> parameter >> red >> green >> blue >> alpha;
G4Colour colour(red, green, blue, alpha);
myColour = colour;
}
Apply(parameter, myColour);
}
///////////////////////////////////////////////////////////////////////////
//ApplyColour command
template <typename M>
class G4ModelCmdApplyColour : public G4VModelCommand<M> {
public: // With description
G4ModelCmdApplyColour(M* model, const G4String& placement, const G4String& cmdName);
virtual ~G4ModelCmdApplyColour();
void SetNewValue(G4UIcommand* command, G4String newValue);
protected:
// Implement in derived class
virtual void Apply(const G4Colour&) = 0;
G4UIcommand* StringCommand() {return fpStringCmd;}
G4UIcommand* ComponentCommand() {return fpComponentCmd;}
private:
G4UIcommand* fpStringCmd;
G4UIcommand* fpComponentCmd;
};
template <typename M>
G4ModelCmdApplyColour<M>::G4ModelCmdApplyColour(M* model, const G4String& placement, const G4String& cmdName)
:G4VModelCommand<M>(model)
{
//Set colour through a string
G4String dir = placement+"/"+model->Name()+"/"+cmdName;
G4UIparameter* param(0);
fpStringCmd = new G4UIcommand(dir, this);
fpStringCmd->SetGuidance("Set colour through a string");
param = new G4UIparameter("Variable", 's', false);
fpStringCmd->SetParameter(param);
//Set colour through RGBA components
G4String componentDir = dir+"RGBA";
fpComponentCmd = new G4UIcommand(componentDir, this);
fpComponentCmd->SetGuidance("Set colour through red, green, blue and alpha components");
fpComponentCmd->SetGuidance("Four inputs are expected.");
param = new G4UIparameter("Red component", 'd', false);
fpComponentCmd->SetParameter(param);
param = new G4UIparameter("Green component", 'd', false);
fpComponentCmd->SetParameter(param);
param = new G4UIparameter("Blue component", 'd', false);
fpComponentCmd->SetParameter(param);
param = new G4UIparameter("Alpha component", 'd', false);
fpComponentCmd->SetParameter(param);
}
template <typename M>
G4ModelCmdApplyColour<M>::~G4ModelCmdApplyColour()
{
delete fpStringCmd;
delete fpComponentCmd;
}
template <typename M>
void G4ModelCmdApplyColour<M>::SetNewValue(G4UIcommand* cmd, G4String newValue)
{
G4Colour myColour;
if (cmd == fpStringCmd) {
G4String colour;
std::istringstream is (newValue);
is >> colour;
// Colour key should exist
if (!G4Colour::GetColour(colour, myColour)) {
std::ostringstream o;
o << "G4Colour with key "<<colour<<" does not exist ";
G4Exception
("G4ModelCmdApplyColour<M>::SetNewValue",
"NonExistentColour", JustWarning, o.str().c_str());
return;
}
}
if (cmd == fpComponentCmd) {
G4double red(0), green(0), blue(0), alpha(0);
std::istringstream is (newValue);
is >> red >> green >> blue >> alpha;
G4Colour colour(red, green, blue, alpha);
myColour = colour;
}
Apply(myColour);
}
///////////////////////////////////////////////////////////////////////////
//ApplyBool command
template <typename M>
class G4ModelCmdApplyBool : public G4VModelCommand<M> {
public: // With description
G4ModelCmdApplyBool(M* model, const G4String& placement, const G4String& cmdName);
virtual ~G4ModelCmdApplyBool();
void SetNewValue(G4UIcommand* command, G4String newValue);
protected:
// Implement in derived class
virtual void Apply(const G4bool&) = 0;
G4UIcmdWithABool* Command() {return fpCmd;}
private:
G4UIcmdWithABool* fpCmd;
};
template <typename M>
G4ModelCmdApplyBool<M>::G4ModelCmdApplyBool(M* model, const G4String& placement, const G4String& cmdName)
:G4VModelCommand<M>(model)
{
G4String dir = placement+"/"+model->Name()+"/"+cmdName;
fpCmd = new G4UIcmdWithABool(dir, this);
fpCmd->SetParameterName("Bool", false);
}
template <typename M>
G4ModelCmdApplyBool<M>::~G4ModelCmdApplyBool()
{
delete fpCmd;
}
template <typename M>
void G4ModelCmdApplyBool<M>::SetNewValue(G4UIcommand*, G4String newValue)
{
Apply(fpCmd->GetNewBoolValue(newValue));
}
///////////////////////////////////////////////////////////////////////////
//ApplyNull command
template <typename M>
class G4ModelCmdApplyNull : public G4VModelCommand<M> {
public: // With description
G4ModelCmdApplyNull(M* model, const G4String& placement, const G4String& cmdName);
virtual ~G4ModelCmdApplyNull();
void SetNewValue(G4UIcommand* command, G4String newValue);
protected:
// Implement in derived class
virtual void Apply() = 0;
G4UIcommand* Command() {return fpCmd;}
private:
G4UIcommand* fpCmd;
};
template <typename M>
G4ModelCmdApplyNull<M>::G4ModelCmdApplyNull(M* model, const G4String& placement, const G4String& cmdName)
:G4VModelCommand<M>(model)
{
G4String dir = placement+"/"+model->Name()+"/"+cmdName;
fpCmd = new G4UIcommand(dir, this);
}
template <typename M>
G4ModelCmdApplyNull<M>::~G4ModelCmdApplyNull()
{
delete fpCmd;
}
template <typename M>
void G4ModelCmdApplyNull<M>::SetNewValue(G4UIcommand*, G4String)
{
Apply();
}
///////////////////////////////////////////////////////////////////////////
//ApplyDouble command
template <typename M>
class G4ModelCmdApplyDouble : public G4VModelCommand<M> {
public: // With description
G4ModelCmdApplyDouble(M* model, const G4String& placement, const G4String& cmdName);
virtual ~G4ModelCmdApplyDouble();
void SetNewValue(G4UIcommand* command, G4String newValue);
protected:
// Implement in derived class
virtual void Apply(const G4double&) = 0;
G4UIcmdWithADouble* Command() {return fpCmd;}
private:
G4UIcmdWithADouble* fpCmd;
};
template <typename M>
G4ModelCmdApplyDouble<M>::G4ModelCmdApplyDouble(M* model, const G4String& placement, const G4String& cmdName)
:G4VModelCommand<M>(model)
{
G4String dir = placement+"/"+model->Name()+"/"+cmdName;
fpCmd = new G4UIcmdWithADouble(dir, this);
fpCmd->SetParameterName("Double", false);
}
template <typename M>
G4ModelCmdApplyDouble<M>::~G4ModelCmdApplyDouble()
{
delete fpCmd;
}
template <typename M>
void G4ModelCmdApplyDouble<M>::SetNewValue(G4UIcommand*, G4String newValue)
{
Apply(fpCmd->GetNewDoubleValue(newValue));
}
///////////////////////////////////////////////////////////////////////////
// ApplyInteger command
template <typename M>
class G4ModelCmdApplyInteger : public G4VModelCommand<M> {
public: // With description
G4ModelCmdApplyInteger(M* model, const G4String& placement, const G4String& cmdName);
virtual ~G4ModelCmdApplyInteger();
void SetNewValue(G4UIcommand* command, G4String newValue);
protected:
// Implement in derived class
virtual void Apply(const G4int&) = 0;
G4UIcmdWithAnInteger* Command() {return fpCmd;}
private:
G4UIcmdWithAnInteger* fpCmd;
};
template <typename M>
G4ModelCmdApplyInteger<M>::G4ModelCmdApplyInteger(M* model, const G4String& placement, const G4String& cmdName)
:G4VModelCommand<M>(model)
{
G4String dir = placement+"/"+model->Name()+"/"+cmdName;
fpCmd = new G4UIcmdWithAnInteger(dir, this);
fpCmd->SetParameterName("Integer", false);
}
template <typename M>
G4ModelCmdApplyInteger<M>::~G4ModelCmdApplyInteger()
{
delete fpCmd;
}
template <typename M>
void G4ModelCmdApplyInteger<M>::SetNewValue(G4UIcommand* cmd, G4String newValue)
{
Apply(fpCmd->GetNewIntValue(newValue));
}
///////////////////////////////////////////////////////////////////////////
// ApplyString command
template <typename M>
class G4ModelCmdApplyString : public G4VModelCommand<M> {
public: // With description
G4ModelCmdApplyString(M* model, const G4String& placement, const G4String& cmdName);
virtual ~G4ModelCmdApplyString();
void SetNewValue(G4UIcommand* command, G4String newValue);
protected:
// Implement in derived class
virtual void Apply(const G4String&) = 0;
G4UIcmdWithAString* Command() {return fpCmd;}
private:
G4UIcmdWithAString* fpCmd;
};
template <typename M>
G4ModelCmdApplyString<M>::G4ModelCmdApplyString(M* model, const G4String& placement, const G4String& cmdName)
:G4VModelCommand<M>(model)
{
G4String dir = placement+"/"+model->Name()+"/"+cmdName;
fpCmd = new G4UIcmdWithAString(dir, this);
}
template <typename M>
G4ModelCmdApplyString<M>::~G4ModelCmdApplyString()
{
delete fpCmd;
}
template <typename M>
void G4ModelCmdApplyString<M>::SetNewValue(G4UIcommand*, G4String newValue)
{
Apply(newValue);
}
#endif
@@ -0,0 +1,129 @@
//
// ********************************************************************
// * 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: G4ModelColourMap.hh,v 1.2 2006/06/29 21:30:22 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Generic variable->G4Colour map, where "variable" is the template
// parameter.
//
// Jane Tinslay March 2006
#ifndef G4MODELCOLOURMAP_HH
#define G4MODELCOLOURMAP_HH
#include "G4Colour.hh"
#include "G4String.hh"
#include <map>
template <typename T>
class G4ModelColourMap {
public: // With description
G4ModelColourMap();
virtual ~G4ModelColourMap();
// Configuration functions
void Set(const T&, const G4Colour&);
void Set(const T&, const G4String&);
G4Colour& operator[](const T& quantity);
// Access functions
bool GetColour(const T&, G4Colour&) const;
void Print(std::ostream& ostr) const;
private:
// Data member
std::map<T, G4Colour> fMap;
};
template <typename T>
G4Colour&
G4ModelColourMap<T>::operator[](const T& quantity) {return fMap[quantity];}
template <typename T>
G4ModelColourMap<T>::G4ModelColourMap() {}
template <typename T>
G4ModelColourMap<T>::~G4ModelColourMap() {}
template <typename T>
void
G4ModelColourMap<T>::Set(const T& quantity, const G4String& colour)
{
G4Colour myColour;
// Will not setup the map if colour key does not exist
if (!G4Colour::GetColour(colour, myColour)) {
std::ostringstream o;
o << "G4Colour with key "<<colour<<" does not exist ";
G4Exception
("G4ColourMap::Set(Charge charge, const G4String& colour)",
"NonExistentColour", JustWarning, o.str().c_str());
return;
}
// Will not modify myColour if colour key does not exist
Set(quantity, myColour);
}
template <typename T>
void
G4ModelColourMap<T>::Set(const T& quantity, const G4Colour& colour)
{
fMap[quantity] = colour;
}
template <typename T>
bool
G4ModelColourMap<T>::GetColour(const T& quantity, G4Colour& colour) const
{
typename std::map<T, G4Colour>::const_iterator iter = fMap.find(quantity);
if (iter != fMap.end()) {
colour = iter->second;
return true;
}
return false;
}
template <typename T>
void
G4ModelColourMap<T>::Print(std::ostream& ostr) const
{
typename std::map<T, G4Colour>::const_iterator iter = fMap.begin();
while (iter != fMap.end()) {
ostr<< iter->first <<" : "<< iter->second <<G4endl;
iter++;
}
}
#endif
@@ -1,74 +0,0 @@
// ********************************************************************
// * 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: G4ModelCommandsDrawByCharge.hh,v 1.2 2005/11/23 05:19:23 tinslay Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
// Class Description
// Trajectory model commands.
// Class Description - End:
#ifndef G4MODELCOMMANDDRAWBYCHARGE_HH
#define G4MODELCOMMANDDRAWBYCHARGE_HH
#include "G4String.hh"
#include "G4VModelCommand.hh"
class G4TrajectoryDrawByCharge;
class G4UIcmdWithAString;
class G4UIcommand;
// Command to set positive/negative/neutral trajectory colouring through a string
class G4ModelCommandDrawByChargeSet : public G4VModelCommand<G4TrajectoryDrawByCharge> {
public: // With description
G4ModelCommandDrawByChargeSet(G4TrajectoryDrawByCharge* model, const G4String& placement);
virtual ~G4ModelCommandDrawByChargeSet();
void SetNewValue(G4UIcommand* command, G4String newValue);
private:
G4UIcmdWithAString* fpCommand;
};
// Command to set positive/negative/neutral trajectory colouring through G4Colour components
class G4ModelCommandDrawByChargeSetRGBA : public G4VModelCommand<G4TrajectoryDrawByCharge> {
public:
G4ModelCommandDrawByChargeSetRGBA(G4TrajectoryDrawByCharge* model, const G4String& placement) ;
virtual ~G4ModelCommandDrawByChargeSetRGBA();
void SetNewValue(G4UIcommand* command, G4String newValue);
private:
G4UIcmdWithAString* fpCommand;
};
#endif
@@ -1,107 +0,0 @@
// ********************************************************************
// * 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: G4ModelCommandsDrawByParticleID.hh,v 1.2 2005/11/23 20:24:15 tinslay Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
// Class Description
// Trajectory model commands.
// Class Description - End:
#ifndef G4MODELCOMMANDDRAWBYPARTICLEID_HH
#define G4MODELCOMMANDDRAWBYPARTICLEID_HH
#include "G4String.hh"
#include "G4VModelCommand.hh"
class G4TrajectoryDrawByParticleID;
class G4UIcmdWithAString;
class G4UIcommand;
// Command to set positive/negative/neutral trajectory colouring through a string
class G4ModelCommandDrawByParticleIDSet : public G4VModelCommand<G4TrajectoryDrawByParticleID> {
public: // With description
G4ModelCommandDrawByParticleIDSet(G4TrajectoryDrawByParticleID* model, const G4String& placement);
virtual ~G4ModelCommandDrawByParticleIDSet();
void SetNewValue(G4UIcommand* command, G4String newValue);
private:
G4UIcmdWithAString* fpCommand;
};
// Command to set default positive/negative/neutral trajectory colouring through G4Colour components
class G4ModelCommandDrawByParticleIDSetRGBA : public G4VModelCommand<G4TrajectoryDrawByParticleID> {
public:
G4ModelCommandDrawByParticleIDSetRGBA(G4TrajectoryDrawByParticleID* model, const G4String& placement) ;
virtual ~G4ModelCommandDrawByParticleIDSetRGBA();
void SetNewValue(G4UIcommand* command, G4String newValue);
private:
G4UIcmdWithAString* fpCommand;
};
// Command to set default positive/negative/neutral trajectory colouring through a string
class G4ModelCommandDrawByParticleIDSetDefault : public G4VModelCommand<G4TrajectoryDrawByParticleID> {
public: // With description
G4ModelCommandDrawByParticleIDSetDefault(G4TrajectoryDrawByParticleID* model, const G4String& placement);
virtual ~G4ModelCommandDrawByParticleIDSetDefault();
void SetNewValue(G4UIcommand* command, G4String newValue);
private:
G4UIcmdWithAString* fpCommand;
};
// Command to set default positive/negative/neutral trajectory colouring through G4Colour components
class G4ModelCommandDrawByParticleIDSetDefaultRGBA : public G4VModelCommand<G4TrajectoryDrawByParticleID> {
public:
G4ModelCommandDrawByParticleIDSetDefaultRGBA(G4TrajectoryDrawByParticleID* model, const G4String& placement) ;
virtual ~G4ModelCommandDrawByParticleIDSetDefaultRGBA();
void SetNewValue(G4UIcommand* command, G4String newValue);
private:
G4UIcmdWithAString* fpCommand;
};
#endif
@@ -0,0 +1,611 @@
//
// ********************************************************************
// * 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: G4ModelCommandsT.hh,v 1.7 2006/06/29 21:30:24 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Generic model messenges.
//
// Jane Tinslay March 2006
//
#ifndef G4MODELCOMMANDST_HH
#define G4MODELCOMMANDST_HH
#include "G4ModelApplyCommandsT.hh"
#include "G4Polymarker.hh"
#include "G4UIdirectory.hh"
#include <sstream>
////////////////////////////////////////////////////////////////////////
// Set parameter colour
template <typename M>
class G4ModelCmdSetStringColour : public G4ModelCmdApplyStringColour<M> {
public: // With description
G4ModelCmdSetStringColour(M* model, const G4String& placement)
:G4ModelCmdApplyStringColour<M>(model, placement, "set") {}
virtual ~G4ModelCmdSetStringColour() {}
protected:
virtual void Apply(const G4String& param, const G4Colour& colour) {
G4VModelCommand<M>::Model()->Set(param, colour);
}
};
////////////////////////////////////////////////////////////////////////
// Set default colour
template <typename M>
class G4ModelCmdSetDefaultColour : public G4ModelCmdApplyColour<M> {
public: // With description
G4ModelCmdSetDefaultColour(M* model, const G4String& placement)
:G4ModelCmdApplyColour<M>(model, placement, "setDefault") {}
virtual ~G4ModelCmdSetDefaultColour() {}
protected:
virtual void Apply(const G4Colour& colour) {
G4VModelCommand<M>::Model()->SetDefault(colour);
}
};
////////////////////////////////////////////////////////////////////////
// Add string command
template <typename M>
class G4ModelCmdAddString : public G4ModelCmdApplyString<M> {
public: // With description
G4ModelCmdAddString(M* model, const G4String& placement)
:G4ModelCmdApplyString<M>(model, placement, "add")
{
G4ModelCmdApplyString<M>::Command()->SetGuidance("Add command");
}
virtual ~G4ModelCmdAddString() {}
protected:
virtual void Apply(const G4String& newValue) {
G4VModelCommand<M>::Model()->Add(newValue);
}
};
////////////////////////////////////////////////////////////////////////
//Add integer command
template <typename M>
class G4ModelCmdAddInt : public G4ModelCmdApplyInteger<M> {
public: // With description
G4ModelCmdAddInt(M* model, const G4String& placement)
:G4ModelCmdApplyInteger<M>(model, placement, "add")
{
G4ModelCmdApplyInteger<M>::Command()->SetGuidance("Add command");
}
virtual ~G4ModelCmdAddInt() {}
protected:
virtual void Apply(const G4int& newValue) {
G4VModelCommand<M>::Model()->Add(newValue);
}
};
////////////////////////////////////////////////////////////////////////
// Invert command
template <typename M>
class G4ModelCmdInvert : public G4ModelCmdApplyBool<M> {
public: // With description
G4ModelCmdInvert(M* model, const G4String& placement)
:G4ModelCmdApplyBool<M>(model, placement, "invert")
{
G4ModelCmdApplyBool<M>::Command()->SetGuidance("Invert command");
}
virtual ~G4ModelCmdInvert() {}
protected:
virtual void Apply(const G4bool& newValue) {
G4VModelCommand<M>::Model()->SetInvert(newValue);
}
};
////////////////////////////////////////////////////////////////////////
// Active command
template <typename M>
class G4ModelCmdActive : public G4ModelCmdApplyBool<M> {
public: // With description
G4ModelCmdActive(M* model, const G4String& placement)
:G4ModelCmdApplyBool<M>(model, placement, "active")
{
G4ModelCmdApplyBool<M>::Command()->SetGuidance("Active command");
}
virtual ~G4ModelCmdActive() {}
protected:
virtual void Apply(const G4bool& newValue) {
G4VModelCommand<M>::Model()->SetActive(newValue);
}
};
////////////////////////////////////////////////////////////////////////
// Verbose command
template <typename M>
class G4ModelCmdVerbose : public G4ModelCmdApplyBool<M> {
public: // With description
G4ModelCmdVerbose(M* model, const G4String& placement)
:G4ModelCmdApplyBool<M>(model, placement, "verbose")
{
G4ModelCmdApplyBool<M>::Command()->SetGuidance("Verbose command");
}
virtual ~G4ModelCmdVerbose() {}
protected:
virtual void Apply(const G4bool& newValue) {
G4VModelCommand<M>::Model()->SetVerbose(newValue);
}
};
////////////////////////////////////////////////////////////////////////
// Reset command
template <typename M>
class G4ModelCmdReset : public G4ModelCmdApplyNull<M> {
public: // With description
G4ModelCmdReset(M* model, const G4String& placement)
:G4ModelCmdApplyNull<M>(model, placement, "reset")
{
G4ModelCmdApplyNull<M>::Command()->SetGuidance("Reset command");
}
virtual ~G4ModelCmdReset() {}
protected:
virtual void Apply() {
G4VModelCommand<M>::Model()->Reset();
}
};
////////////////////////////////////////////////////////////////////////
// Set auxiliary points colour command
template <typename M>
class G4ModelCmdSetAuxPtsColour : public G4ModelCmdApplyColour<M> {
public:
G4ModelCmdSetAuxPtsColour(M* model, const G4String& placement)
:G4ModelCmdApplyColour<M>(model, placement, "setAuxPtsColour") {}
protected:
void Apply(const G4Colour& colour) {
G4VModelCommand<M>::Model()->SetAuxPtsColour(colour);
}
};
////////////////////////////////////////////////////////////////////////
// Set set points colour command
template <typename M>
class G4ModelCmdSetStepPtsColour : public G4ModelCmdApplyColour<M> {
public:
G4ModelCmdSetStepPtsColour(M* model, const G4String& placement)
:G4ModelCmdApplyColour<M>(model, placement, "setStepPtsColour") {}
protected:
void Apply(const G4Colour& colour) {
G4VModelCommand<M>::Model()->SetStepPtsColour(colour);
}
};
////////////////////////////////////////////////////////////////////////
// Set draw line command
template <typename M>
class G4ModelCmdSetDrawLine : public G4ModelCmdApplyBool<M> {
public:
G4ModelCmdSetDrawLine(M* model, const G4String& placement)
:G4ModelCmdApplyBool<M>(model, placement, "setDrawLine")
{
G4ModelCmdApplyBool<M>::Command()->SetGuidance("Set draw line command");
}
protected:
void Apply(const G4bool& myBool) {
G4VModelCommand<M>::Model()->SetDrawLine(myBool);
}
};
////////////////////////////////////////////////////////////////////////
// Set line visibility command
template <typename M>
class G4ModelCmdSetLineVisible : public G4ModelCmdApplyBool<M> {
public:
G4ModelCmdSetLineVisible(M* model, const G4String& placement)
:G4ModelCmdApplyBool<M>(model, placement, "setLineVisible")
{
G4ModelCmdApplyBool<M>::Command()->SetGuidance("Set line visibility command");
}
protected:
void Apply(const G4bool& myBool) {
G4VModelCommand<M>::Model()->SetLineVisible(myBool);
}
};
////////////////////////////////////////////////////////////////////////
// Set draw auxiliary points command
template <typename M>
class G4ModelCmdSetDrawAuxPts : public G4ModelCmdApplyBool<M> {
public:
G4ModelCmdSetDrawAuxPts(M* model, const G4String& placement)
:G4ModelCmdApplyBool<M>(model, placement, "setDrawAuxPts")
{
G4ModelCmdApplyBool<M>::Command()->SetGuidance("Set draw auxiliary points command");
}
protected:
void Apply(const G4bool& myBool) {
G4VModelCommand<M>::Model()->SetDrawAuxPts(myBool);
}
};
////////////////////////////////////////////////////////////////////////
// Set auxiliary points visibility
template <typename M>
class G4ModelCmdSetAuxPtsVisible : public G4ModelCmdApplyBool<M> {
public:
G4ModelCmdSetAuxPtsVisible(M* model, const G4String& placement)
:G4ModelCmdApplyBool<M>(model, placement, "setAuxPtsVisible")
{
G4ModelCmdApplyBool<M>::Command()->SetGuidance("Set auxiliary points visibility command");
}
protected:
void Apply(const G4bool& myBool) {
G4VModelCommand<M>::Model()->SetAuxPtsVisible(myBool);
}
};
////////////////////////////////////////////////////////////////////////
// Set draw step points command
template <typename M>
class G4ModelCmdSetDrawStepPts : public G4ModelCmdApplyBool<M> {
public:
G4ModelCmdSetDrawStepPts(M* model, const G4String& placement)
:G4ModelCmdApplyBool<M>(model, placement, "setDrawStepPts")
{
G4ModelCmdApplyBool<M>::Command()->SetGuidance("Set draw step points command");
}
protected:
void Apply(const G4bool& myBool) {
G4VModelCommand<M>::Model()->SetDrawStepPts(myBool);
}
};
////////////////////////////////////////////////////////////////////////
// Set step points visible command
template <typename M>
class G4ModelCmdSetStepPtsVisible : public G4ModelCmdApplyBool<M> {
public:
G4ModelCmdSetStepPtsVisible(M* model, const G4String& placement)
:G4ModelCmdApplyBool<M>(model, placement, "setStepPtsVisible")
{
G4ModelCmdApplyBool<M>::Command()->SetGuidance("Set step points colour command");
}
protected:
void Apply(const G4bool& myBool) {
G4VModelCommand<M>::Model()->SetStepPtsVisible(myBool);
}
};
////////////////////////////////////////////////////////////////////////
// Set auxiliary points size command
template <typename M>
class G4ModelCmdSetAuxPtsSize : public G4ModelCmdApplyDouble<M> {
public:
G4ModelCmdSetAuxPtsSize(M* model, const G4String& placement)
:G4ModelCmdApplyDouble<M>(model, placement, "setAuxPtsSize")
{
G4ModelCmdApplyDouble<M>::Command()->SetGuidance("Set auxiliary points size command");
}
protected:
void Apply(const G4double& myDouble) {
G4VModelCommand<M>::Model()->SetAuxPtsSize(myDouble);
}
};
////////////////////////////////////////////////////////////////////////
// Set step points size command
template <typename M>
class G4ModelCmdSetStepPtsSize : public G4ModelCmdApplyDouble<M> {
public:
G4ModelCmdSetStepPtsSize(M* model, const G4String& placement)
:G4ModelCmdApplyDouble<M>(model, placement, "setStepPtsSize")
{
G4ModelCmdApplyDouble<M>::Command()->SetGuidance("Set step points colour command");
}
protected:
void Apply(const G4double& myDouble) {
G4VModelCommand<M>::Model()->SetStepPtsSize(myDouble);
}
};
////////////////////////////////////////////////////////////////////////
// Set step points type command
template <typename M>
class G4ModelCmdSetStepPtsType : public G4ModelCmdApplyString<M> {
public:
G4ModelCmdSetStepPtsType(M* model, const G4String& placement)
:G4ModelCmdApplyString<M>(model, placement, "setStepPtsType")
{
G4UIcmdWithAString* cmd = G4ModelCmdApplyString<M>::Command();
cmd->SetGuidance("Set step points type.");
cmd->SetCandidates("dots circles squares");
}
protected:
void Apply(const G4String& type) {
G4Polymarker::MarkerType myType;
if (type == "dots") {myType = G4Polymarker::dots;}
else if (type == "circles") {myType = G4Polymarker::circles;}
else if (type == "squares") {myType = G4Polymarker::squares;}
else {
std::ostringstream o;
o << "Invalid argument. See command guidance for options.";
G4Exception
("G4ModelCmdSetStepPtsType::Apply",
"InvalidArgument", JustWarning, o.str().c_str());
return;
}
G4VModelCommand<M>::Model()->SetStepPtsType(myType);
}
};
////////////////////////////////////////////////////////////////////////
// Set auxiliary points type command
template <typename M>
class G4ModelCmdSetAuxPtsType : public G4ModelCmdApplyString<M> {
public:
G4ModelCmdSetAuxPtsType(M* model, const G4String& placement)
:G4ModelCmdApplyString<M>(model, placement, "setAuxPtsType")
{
G4UIcmdWithAString* cmd = G4ModelCmdApplyString<M>::Command();
cmd->SetGuidance("Set auxiliary points type.");
cmd->SetCandidates("dots circles squares");
}
protected:
void Apply(const G4String& type) {
G4Polymarker::MarkerType myType;
if (type == "dots") {myType = G4Polymarker::dots;}
else if (type == "circles") {myType = G4Polymarker::circles;}
else if (type == "squares") {myType = G4Polymarker::squares;}
else {
std::ostringstream o;
o << "Invalid argument. See command guidance for options.";
G4Exception
("G4ModelCmdSetAuxPtsType::Apply",
"InvalidArgument", JustWarning, o.str().c_str());
return;
}
G4VModelCommand<M>::Model()->SetAuxPtsType(myType);
}
};
////////////////////////////////////////////////////////////////////////
// Set step points fill style command
template <typename M>
class G4ModelCmdSetStepPtsFillStyle : public G4ModelCmdApplyString<M> {
public:
G4ModelCmdSetStepPtsFillStyle(M* model, const G4String& placement)
:G4ModelCmdApplyString<M>(model, placement, "setStepPtsFillStyle")
{
G4UIcmdWithAString* cmd = G4ModelCmdApplyString<M>::Command();
cmd->SetGuidance("Set step fill style type.");
cmd->SetCandidates("noFill hashed filled");
}
protected:
void Apply(const G4String& type) {
G4VMarker::FillStyle myFillStyle;
if (type == "noFill") {myFillStyle = G4VMarker::noFill;}
else if (type == "hashed") {myFillStyle = G4VMarker::hashed;}
else if (type == "filled") {myFillStyle = G4VMarker::filled;}
else {
std::ostringstream o;
o << "Invalid argument. See command guidance for options.";
G4Exception
("G4ModelCmdSetStepPtsFillStyle::Apply",
"InvalidArgument", JustWarning, o.str().c_str());
return;
}
G4VModelCommand<M>::Model()->SetStepPtsFillStyle(myFillStyle);
}
};
////////////////////////////////////////////////////////////////////////
// Set auxiliary points fill style command
template <typename M>
class G4ModelCmdSetAuxPtsFillStyle : public G4ModelCmdApplyString<M> {
public:
G4ModelCmdSetAuxPtsFillStyle(M* model, const G4String& placement)
:G4ModelCmdApplyString<M>(model, placement, "setAuxPtsFillStyle")
{
G4UIcmdWithAString* cmd = G4ModelCmdApplyString<M>::Command();
cmd->SetGuidance("Set auxiliary fill style.");
cmd->SetCandidates("noFill hashed filled");
}
protected:
void Apply(const G4String& type) {
G4VMarker::FillStyle myFillStyle;
if (type == "noFill") {myFillStyle = G4VMarker::noFill;}
else if (type == "hashed") {myFillStyle = G4VMarker::hashed;}
else if (type == "filled") {myFillStyle = G4VMarker::filled;}
else {
std::ostringstream o;
o << "Invalid argument. See command guidance for options.";
G4Exception
("G4ModelCmdSetAuxPtsFillStyle::Apply",
"InvalidArgument", JustWarning, o.str().c_str());
return;
}
G4VModelCommand<M>::Model()->SetAuxPtsFillStyle(myFillStyle);
}
};
////////////////////////////////////////////////////////////////////////
// SetLineColour command
template <typename M>
class G4ModelCmdSetLineColour : public G4ModelCmdApplyColour<M> {
public:
G4ModelCmdSetLineColour(M* model, const G4String& placement)
:G4ModelCmdApplyColour<M>(model, placement, "setLineColour") {}
protected:
void Apply(const G4Colour& colour) {
G4VModelCommand<M>::Model()->SetLineColour(colour);
}
};
////////////////////////////////////////////////////////////////////////
// Create context directory command
template <typename M>
class G4ModelCmdCreateContextDir : public G4UImessenger {
public:
G4ModelCmdCreateContextDir(M* model, const G4String& placement) {
G4String title = placement+"/"+model->Name()+"/";
cmd = new G4UIdirectory(title);
cmd->SetGuidance("Commands for default configuration");
}
virtual ~G4ModelCmdCreateContextDir() {
delete cmd;
}
protected:
G4UIdirectory* cmd;
};
#endif
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4ModelingParameters.hh,v 1.10 2005/03/15 12:56:29 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4ModelingParameters.hh,v 1.12 2006/06/29 21:30:26 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 31st December 1997.
@@ -47,6 +50,14 @@ public: // With description
friend std::ostream& operator << (std::ostream& os, const G4ModelingParameters&);
enum DrawingStyle {
wf, // Draw edges - no hidden line removal (wireframe).
hlr, // Draw edges - hidden lines removed.
hsr, // Draw surfaces - hidden surfaces removed.
hlhsr // Draw surfaces and edges - hidden removed.
};
// Currently requested drawing style.
enum RepStyle {
wireframe, // Use G4Wireframe.
polyhedron, // Use G4Polyhedron.
@@ -57,6 +68,33 @@ public: // With description
G4ModelingParameters ();
G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes,
DrawingStyle drawingStyle,
RepStyle repStyle,
G4bool isCulling,
G4bool isCullingInvisible,
G4bool isDensityCulling,
G4double visibleDensity,
G4bool isCullingCovered,
G4int noOfSides);
// noOfSides is suggested no. of sides per circle in case a
// polygonal representation is produced.
G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes,
DrawingStyle drawingStyle,
RepStyle repStyle,
G4bool isCulling,
G4bool isCullingInvisible,
G4bool isDensityCulling,
G4double visibleDensity,
G4bool isCullingCovered,
G4int noOfSides,
G4bool isViewGeom,
G4bool isViewHits,
G4bool isViewDigis);
// noOfSides is suggested no. of sides per circle in case a
// polygonal representation is produced.
G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes,
RepStyle repStyle,
G4bool isCulling,
@@ -90,6 +128,7 @@ public: // With description
// Get and Is functions...
const G4VisAttributes* GetDefaultVisAttributes () const;
DrawingStyle GetDrawingStyle () const;
RepStyle GetRepStyle () const;
G4bool IsCulling () const;
G4bool IsCullingInvisible () const;
@@ -103,6 +142,7 @@ public: // With description
// Set functions...
void SetDefaultVisAttributes (const G4VisAttributes* pDefaultVisAttributes);
void SetDrawingStyle (DrawingStyle);
void SetRepStyle (RepStyle);
void SetCulling (G4bool);
void SetCullingInvisible (G4bool);
@@ -124,16 +164,17 @@ private:
// Data members...
const G4VisAttributes* fpDefaultVisAttributes;
RepStyle fRepStyle; // Representation style.
G4bool fCulling; // Culling requested.
G4bool fCullInvisible; // Cull (don't Draw) invisible objects.
G4bool fDensityCulling; // Density culling requested. If so...
G4double fVisibleDensity; // ...density lower than this not drawn.
G4bool fCullCovered; // Cull daughters covered by opaque mothers.
G4int fNoOfSides; // ...if polygon approximates circle.
G4bool fViewGeom; // View geometry objects.
G4bool fViewHits; // View hits, if any.
G4bool fViewDigis; // View digis, if any.
DrawingStyle fDrawingStyle; // Drawing style.
RepStyle fRepStyle; // Representation style.
G4bool fCulling; // Culling requested.
G4bool fCullInvisible; // Cull (don't Draw) invisible objects.
G4bool fDensityCulling; // Density culling requested. If so...
G4double fVisibleDensity; // ...density lower than this not drawn.
G4bool fCullCovered; // Cull daughters covered by opaque mothers.
G4int fNoOfSides; // ...if polygon approximates circle.
G4bool fViewGeom; // View geometry objects.
G4bool fViewHits; // View hits, if any.
G4bool fViewDigis; // View digis, if any.
};
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4ModelingParameters.icc,v 1.4 2001/07/11 10:09:21 gunter Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4ModelingParameters.icc,v 1.6 2006/06/29 21:30:28 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 31st December 1997.
@@ -33,6 +36,11 @@ G4ModelingParameters::GetDefaultVisAttributes () const {
return fpDefaultVisAttributes;
}
inline G4ModelingParameters::DrawingStyle
G4ModelingParameters::GetDrawingStyle () const {
return fDrawingStyle;
}
inline G4ModelingParameters::RepStyle
G4ModelingParameters::GetRepStyle () const {
return fRepStyle;
@@ -79,6 +87,12 @@ inline void G4ModelingParameters::SetDefaultVisAttributes
fpDefaultVisAttributes = pDefaultVisAttributes;
}
inline void
G4ModelingParameters::SetDrawingStyle
(G4ModelingParameters::DrawingStyle style) {
fDrawingStyle = style;
}
inline void
G4ModelingParameters::SetRepStyle (G4ModelingParameters::RepStyle style) {
fRepStyle = style;
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4NullModel.hh,v 1.6 2001/08/24 20:36:15 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4NullModel.hh,v 1.7 2006/06/29 21:30:30 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 4th April 1998.
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4PhysicalVolumeMassScene.hh,v 1.4 2005/01/27 20:06:35 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4PhysicalVolumeMassScene.hh,v 1.7 2006/06/29 21:30:32 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 12th September 2004
@@ -38,8 +41,7 @@
// then adding the mass of the daughter, and so on down the heirarchy.
//
// Usage for a given G4PhysicalVolumeModel* pvModel:
// G4PhysicalVolumeMassScene massScene;
// massScene.EstablishSpecials (*pvModel);
// G4PhysicalVolumeMassScene massScene(pvModel);
// pvModel->DescribeYourselfTo (massScene);
// G4double volume = massScene.GetVolume();
// G4double mass = massScene.GetMass();
@@ -71,7 +73,7 @@ class G4Material;
class G4PhysicalVolumeMassScene: public G4VGraphicsScene {
public:
G4PhysicalVolumeMassScene ();
G4PhysicalVolumeMassScene (G4PhysicalVolumeModel*);
virtual ~G4PhysicalVolumeMassScene ();
public: // With description
@@ -103,13 +105,14 @@ public:
void AddSolid (const G4VSolid& s) {AccrueMass (s);}
void AddCompound (const G4VTrajectory&) {}
void AddCompound (const G4VHit&) {}
void EstablishSpecials (G4PhysicalVolumeModel&);
////////////////////////////////////////////////////////////////
// Functions not used but required by the abstract interface.
virtual void BeginPrimitives (const G4Transform3D&) {}
virtual void EndPrimitives () {}
virtual void BeginPrimitives2D () {}
virtual void EndPrimitives2D () {}
virtual void AddPrimitive (const G4Polyline&) {}
virtual void AddPrimitive (const G4Scale&) {}
virtual void AddPrimitive (const G4Text&) {}
@@ -121,6 +124,7 @@ public:
private:
void AccrueMass (const G4VSolid&);
G4PhysicalVolumeModel* fpPVModel;
G4double fVolume;
G4double fMass;
G4VPhysicalVolume* fpLastPV;
@@ -128,10 +132,6 @@ private:
G4int fLastDepth;
G4double fLastDensity;
std::deque<G4double> fDensityStack;
G4int fCurrentDepth; // Current depth of geom. hierarchy.
G4VPhysicalVolume* fpCurrentPV; // Current physical volume.
G4LogicalVolume* fpCurrentLV; // Current logical volume.
G4Material* fpCurrentMaterial; // Current material.
};
#endif
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4PhysicalVolumeModel.hh,v 1.21 2005/11/22 16:29:40 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4PhysicalVolumeModel.hh,v 1.28 2006/06/29 21:30:34 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 31st December 1997.
@@ -36,6 +39,10 @@
// For access to base class information, e.g., modeling parameters,
// use GetModelingParameters() inherited from G4VModel. See Class
// Description of the base class G4VModel.
//
// G4PhysicalVolumeModel assumes the modeling parameters have been set
// up with meaningful information - default vis attributes and culling
// policy in particular.
#ifndef G4PHYSICALVOLUMEMODEL_HH
#define G4PHYSICALVOLUMEMODEL_HH
@@ -43,6 +50,8 @@
#include "G4VModel.hh"
#include "G4Transform3D.hh"
#include <iostream>
#include <vector>
class G4VPhysicalVolume;
class G4LogicalVolume;
@@ -57,6 +66,20 @@ public: // With description
enum {UNLIMITED = -1};
class G4PhysicalVolumeNodeID {
public:
G4PhysicalVolumeNodeID(G4VPhysicalVolume* pPV = 0, G4int iCopyNo = 0):
fpPV(pPV), fCopyNo(iCopyNo) {}
G4VPhysicalVolume* GetPhysicalVolume() const {return fpPV;}
G4int GetCopyNo() const {return fCopyNo;}
G4bool operator< (const G4PhysicalVolumeNodeID& right) const;
G4bool operator== (const G4PhysicalVolumeNodeID& right) const;
private:
G4VPhysicalVolume* fpPV;
G4int fCopyNo;
};
// Nested class for identifying physical volume nodes.
G4PhysicalVolumeModel
(G4VPhysicalVolume*,
G4int requestedDepth = UNLIMITED,
@@ -86,21 +109,43 @@ public: // With description
G4String GetCurrentTag () const;
// A tag which depends on the current state of the model.
const G4PhysicalVolumeModel* GetG4PhysicalVolumeModel () const {
return this;
}
const G4PhysicalVolumeModel* GetG4PhysicalVolumeModel () const
{return this;}
G4PhysicalVolumeModel* GetG4PhysicalVolumeModel () {
return this;
}
G4PhysicalVolumeModel* GetG4PhysicalVolumeModel ()
{return this;}
const G4VPhysicalVolume* GetTopPhysicalVolume () const {return fpTopPV;}
G4VPhysicalVolume* GetTopPhysicalVolume () const {return fpTopPV;}
G4int GetRequestedDepth () const {return fRequestedDepth;}
const G4Polyhedron* GetClippingVolume () const {
return fpClippingPolyhedron;
}
const G4Polyhedron* GetClippingVolume () const
{return fpClippingPolyhedron;}
G4int GetCurrentDepth() const {return fCurrentDepth;}
// Current depth of geom. hierarchy.
G4VPhysicalVolume* GetCurrentPV() const {return fpCurrentPV;}
// Current physical volume.
G4LogicalVolume* GetCurrentLV() const {return fpCurrentLV;}
// Current logical volume.
G4Material* GetCurrentMaterial() const {return fpCurrentMaterial;}
// Current material.
const std::vector<G4PhysicalVolumeNodeID>& GetDrawnPVPath() const
{return fDrawnPVPath;}
// Path of the current drawn (non-culled) volume in terms of drawn
// (non-culled) ancesters. It is a vector of physical volume node
// identifiers corresponding to the geometry hierarchy actually
// selected, i.e., not culled. It is guaranteed that volumes are
// presented to the scene handlers in top-down hierarchy order,
// i.e., ancesters first, mothers before daughters, so the scene
// handler can be assured that, if it is building its own scene
// graph tree, a mother, if any, will have already been encountered
// and there will already be a node in place on which to hang the
// current volume.
void SetRequestedDepth (G4int requestedDepth) {
fRequestedDepth = requestedDepth;
@@ -113,13 +158,16 @@ public: // With description
G4bool Validate (G4bool warn);
// Validate, but allow internal changes (hence non-const function).
void DefinePointersToWorkingSpace (G4int* pCurrentDepth,
G4VPhysicalVolume** ppCurrentPV,
G4LogicalVolume** ppCurrentLV,
G4Material** ppCurrentMaterial);
void DefinePointersToWorkingSpace
(G4int* pCurrentDepth = 0,
G4VPhysicalVolume** ppCurrentPV = 0,
G4LogicalVolume** ppCurrentLV = 0,
G4Material** ppCurrentMaterial = 0,
std::vector<G4PhysicalVolumeNodeID>* pDrawnPVPath = 0);
// For use (optional) by the scene handler if it needs to know about
// the current information maintained through these pointers.
// the current information maintained through these pointers. For
// description of pointers, see below.
void CurtailDescent() {fCurtailDescent = true;}
protected:
@@ -142,11 +190,6 @@ protected:
const G4VisAttributes* pVisAttribs,
G4VGraphicsScene& sceneHandler);
G4bool IsThisCulled (const G4LogicalVolume*,
const G4Material*);
G4bool IsDaughterCulled (const G4LogicalVolume* pMotherLV);
void CalculateExtent ();
/////////////////////////////////////////////////////////
@@ -162,16 +205,18 @@ protected:
G4VPhysicalVolume* fpCurrentPV; // Current physical volume.
G4LogicalVolume* fpCurrentLV; // Current logical volume.
G4Material* fpCurrentMaterial; // Current material.
G4bool fCurtailDescent;// Can be set to curtail descent.
std::vector<G4PhysicalVolumeNodeID> fDrawnPVPath;
G4bool fCurtailDescent; // Can be set to curtail descent.
const G4Polyhedron*fpClippingPolyhedron;
////////////////////////////////////////////////////////////
// Pointers to working space in scene, if required.
// Pointers to working space in scene handler, if required.
G4int* fpCurrentDepth; // Current depth of geom. hierarchy.
G4VPhysicalVolume** fppCurrentPV; // Current physical volume.
G4LogicalVolume** fppCurrentLV; // Current logical volume.
G4Material** fppCurrentMaterial; // Current material.
std::vector<G4PhysicalVolumeNodeID>* fpDrawnPVPath;
private:
@@ -181,4 +226,7 @@ private:
G4PhysicalVolumeModel& operator = (const G4PhysicalVolumeModel&);
};
std::ostream& operator<<
(std::ostream& os, const G4PhysicalVolumeModel::G4PhysicalVolumeNodeID);
#endif
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4PhysicalVolumeSearchScene.hh,v 1.13 2005/01/27 20:06:37 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4PhysicalVolumeSearchScene.hh,v 1.17 2006/06/29 21:30:36 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 10th August 1998.
@@ -50,7 +53,9 @@ class G4PhysicalVolumeSearchScene: public G4VGraphicsScene {
public:
G4PhysicalVolumeSearchScene
(const G4String& requiredPhysicalVolumeName, G4int requiredCopyNo);
(G4PhysicalVolumeModel*,
const G4String& requiredPhysicalVolumeName,
G4int requiredCopyNo);
virtual ~G4PhysicalVolumeSearchScene ();
void PreAddSolid (const G4Transform3D& objectTransformation,
const G4VisAttributes&);
@@ -68,7 +73,6 @@ public:
void AddSolid (const G4VSolid& s) {FindVolume (s);}
void AddCompound (const G4VTrajectory&) {}
void AddCompound (const G4VHit&) {}
void EstablishSpecials (G4PhysicalVolumeModel&);
G4int GetFoundDepth () const;
G4VPhysicalVolume* GetFoundVolume () const;
const G4Transform3D& GetFoundTransformation () const;
@@ -78,6 +82,8 @@ public:
virtual void BeginPrimitives (const G4Transform3D&) {}
virtual void EndPrimitives () {}
virtual void BeginPrimitives2D () {}
virtual void EndPrimitives2D () {}
virtual void AddPrimitive (const G4Polyline&) {}
virtual void AddPrimitive (const G4Scale&) {}
virtual void AddPrimitive (const G4Text&) {}
@@ -89,12 +95,9 @@ public:
private:
void FindVolume (const G4VSolid&);
const G4PhysicalVolumeModel* fpPVModel;
G4String fRequiredPhysicalVolumeName;
G4int fRequiredCopyNo;
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.
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4PhysicalVolumeSearchScene.icc,v 1.5 2005/01/27 20:06:42 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4PhysicalVolumeSearchScene.icc,v 1.6 2006/06/29 21:30:38 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 10th August 1998.
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4ScaleModel.hh,v 1.2 2001/08/24 20:36:18 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4ScaleModel.hh,v 1.3 2006/06/29 21:31:10 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 21st July 2001.
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4ScaleModel.icc,v 1.2 2001/08/24 20:36:19 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4ScaleModel.icc,v 1.3 2006/06/29 21:31:35 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
inline G4String G4ScaleModel::GetCurrentTag () const {
return fGlobalTag;
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4TextModel.hh,v 1.5 2005/05/31 17:01:25 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4TextModel.hh,v 1.6 2006/06/29 21:31:39 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 3rd April 2001
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4TextModel.icc,v 1.3 2001/08/24 20:36:22 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4TextModel.icc,v 1.4 2006/06/29 21:31:41 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
inline G4String G4TextModel::GetCurrentTag () const {
return fGlobalTag;
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4TrajectoriesModel.hh,v 1.8 2002/11/11 18:39:28 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4TrajectoriesModel.hh,v 1.9 2006/06/29 21:31:43 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 26th August 1998.
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4TrajectoriesModel.icc,v 1.6 2001/08/24 20:36:24 johna Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4TrajectoriesModel.icc,v 1.7 2006/06/29 21:31:45 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
inline G4String G4TrajectoriesModel::GetCurrentTag () const {
return fGlobalTag;
@@ -0,0 +1,75 @@
//
// ********************************************************************
// * 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: G4TrajectoryChargeFilter.hh,v 1.2 2006/06/29 21:31:47 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Filter trajectories according to charge. Only registered
// charges will pass the filter.
//
// Jane Tinslay, May 2006
//
#ifndef G4TRAJECTORYCHARGEFILTER_HH
#define G4TRAJECTORYCHARGEFILTER_HH
#include "G4SmartFilter.hh"
#include "G4VTrajectory.hh"
#include <vector>
class G4TrajectoryChargeFilter : public G4SmartFilter<G4VTrajectory> {
public: // With description
// Construct with filter name
G4TrajectoryChargeFilter(const G4String& name = "Unspecified");
virtual ~G4TrajectoryChargeFilter();
// Evaluate this trajectory
virtual bool Evaluate(const G4VTrajectory&);
// Print configuration
virtual void Print(std::ostream& ostr) const;
// Clear filter
virtual void Clear();
// Configuration function
void Add(const G4String& particle);
private:
enum MyCharge {Negative=-1, Neutral=0, Positive=1};
G4bool ConvertToCharge(const G4String&, MyCharge&);
void Add(const MyCharge& chgear);
// Data member
std::vector<MyCharge> fCharges;
};
#endif
@@ -1,38 +1,43 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4TrajectoryDrawByCharge.hh,v 1.3 2005/11/23 05:19:23 tinslay Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4TrajectoryDrawByCharge.hh,v 1.7 2006/06/29 21:31:49 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
// Class Description:
// Trajectory model which colours a trajectory according to
// charge. Guts taken from G4VTrajectory::DrawTrajectory method.
// charge.
// Class Description - End:
#ifndef G4TRAJECTORYDRAWBYCHARGE_HH
#define G4TRAJECTORYDRAWBYCHARGE_HH
#include "G4Colour.hh"
#include "G4ModelColourMap.hh"
#include "G4VTrajectoryModel.hh"
#include <map>
@@ -42,7 +47,7 @@ public: // With description
enum Charge {Negative=-1, Neutral=0, Positive=1};
G4TrajectoryDrawByCharge(const G4String& name = "Unspecified");
G4TrajectoryDrawByCharge(const G4String& name = "Unspecified", G4VisTrajContext* context=0);
G4TrajectoryDrawByCharge(const G4String& name,
const G4Colour& positive,
@@ -51,20 +56,26 @@ public: // With description
virtual ~G4TrajectoryDrawByCharge();
virtual void Draw(const G4VTrajectory& trajectory, G4int i_mode = 0) const;
// Draw the trajectory with optional i_mode parameter
virtual void Draw(const G4VTrajectory& trajectory, const G4int& i_mode = 0,
const G4bool& visible = true) const;
virtual void Print(std::ostream& ostr) const;
// Print configuration
virtual void Print(std::ostream& ostr) const;
void Set(Charge charge, const G4String& colour);
void Set(Charge charge, const G4Colour& colour);
void Set(const Charge& charge, const G4Colour& colour);
void Set(const Charge& charge, const G4String& colour);
void Set(const G4String& charge, const G4Colour& colour);
void Set(const G4String& charge, const G4String& colour);
// Configuration functions
private:
G4bool ConvertToCharge(const G4String&, Charge&);
// Data member
std::map<Charge, G4Colour> fMap;
G4ModelColourMap<Charge> fMap;
};
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * 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: G4TrajectoryDrawByOriginVolume.hh,v 1.4 2006/06/29 21:31:51 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Class Description:
// Trajectory model which colours a trajectory according to
// the origin volume
// Class Description - End:
// Jane Tinslay March 2006
#ifndef G4TRAJECTORYDRAWBYORIGINVOLUME
#define G4TRAJECTORYDRAWBYORIGINVOLUME
#include "G4VTrajectoryModel.hh"
#include "G4Colour.hh"
#include "G4ModelColourMap.hh"
#include "G4String.hh"
#include <map>
class G4TrajectoryDrawByOriginVolume : public G4VTrajectoryModel {
public: // With description
G4TrajectoryDrawByOriginVolume(const G4String& name = "Unspecified", G4VisTrajContext* context=0);
virtual ~G4TrajectoryDrawByOriginVolume();
virtual void Draw(const G4VTrajectory&, const G4int& i_mode = 0,
const G4bool& visible = true) const;
// Draw the trajectory with optional i_mode parameter
virtual void Print(std::ostream& ostr) const;
// Print configuration
void SetDefault(const G4String&);
void SetDefault(const G4Colour&);
void Set(const G4String& particle, const G4String& colour);
void Set(const G4String& particle, const G4Colour& colour);
// Configuration functions
private:
// Data members
G4ModelColourMap<G4String> fMap;
G4Colour fDefault;
};
#endif
@@ -1,26 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4TrajectoryDrawByParticleID.hh,v 1.3 2005/11/23 05:19:23 tinslay Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4TrajectoryDrawByParticleID.hh,v 1.7 2006/06/29 21:31:53 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
@@ -34,6 +38,7 @@
#include "G4VTrajectoryModel.hh"
#include "G4Colour.hh"
#include "G4ModelColourMap.hh"
#include "G4String.hh"
#include <map>
@@ -41,11 +46,12 @@ class G4TrajectoryDrawByParticleID : public G4VTrajectoryModel {
public: // With description
G4TrajectoryDrawByParticleID(const G4String& name = "Unspecified");
G4TrajectoryDrawByParticleID(const G4String& name = "Unspecified", G4VisTrajContext* context=0);
virtual ~G4TrajectoryDrawByParticleID();
virtual void Draw(const G4VTrajectory&, G4int) const;
virtual void Draw(const G4VTrajectory&, const G4int&i_mode = 0,
const G4bool& visible = true) const;
// Draw the trajectory with optional i_mode parameter
virtual void Print(std::ostream& ostr) const;
@@ -61,7 +67,7 @@ public: // With description
private:
// Data members
std::map<G4String, G4Colour> fMap;
G4ModelColourMap<G4String> fMap;
G4Colour fDefault;
};
@@ -1,26 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4TrajectoryDrawerUtils.hh,v 1.2 2005/11/21 05:44:44 tinslay Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4TrajectoryDrawerUtils.hh,v 1.6 2006/06/29 21:31:55 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
@@ -31,15 +35,30 @@
#ifndef G4TRAJECTORYDRAWERUTILS
#define G4TRAJECTORYDRAWERUTILS
#include "globals.hh"
class G4Colour;
class G4Polyline;
class G4Polymarker;
class G4VisTrajContext;
class G4VTrajectory;
namespace G4TrajectoryDrawerUtils {
namespace {
G4bool warnedAboutIMode = false;
}
void GetPoints(const G4VTrajectory& traj, G4Polyline& trajectoryLine,
G4Polymarker& auxiliaryPoints, G4Polymarker& stepPoints);
// Draw trajectory line and points
void DrawLineAndPoints(const G4VTrajectory& traj, const G4int& i_mode,
const G4Colour& cfg, const G4bool& visible);
// Draw trajectory line and points using G4VisTrajContext object information
void DrawLineAndPoints(const G4VTrajectory& traj, const G4VisTrajContext&, const G4int& i_mode=0);
}
#endif
@@ -0,0 +1,92 @@
//
// ********************************************************************
// * 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: G4TrajectoryFilterFactories.hh,v 1.3 2006/06/29 21:31:57 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// Trajectory filter model factories creating filters
// and associated messengers.
//
// Jane Tinslay March 2006
//
#ifndef G4TRAJECTORYFILTERFACTORIES_HH
#define G4TRAJECTORYFILTERFACTORIES_HH
#include "G4VFilter.hh"
#include "G4VModelFactory.hh"
#include "G4VTrajectory.hh"
// Charge filter
class G4TrajectoryChargeFilterFactory : public G4VModelFactory< G4VFilter<G4VTrajectory> > {
public: // With description
typedef std::vector<G4UImessenger*> Messengers;
typedef std::pair< G4VFilter<G4VTrajectory> *, Messengers > ModelAndMessengers;
G4TrajectoryChargeFilterFactory();
virtual ~G4TrajectoryChargeFilterFactory();
ModelAndMessengers Create(const G4String& placement, const G4String& name);
};
// Particle filter
class G4TrajectoryParticleFilterFactory : public G4VModelFactory< G4VFilter<G4VTrajectory> > {
public: // With description
typedef std::vector<G4UImessenger*> Messengers;
typedef std::pair< G4VFilter<G4VTrajectory> *, Messengers > ModelAndMessengers;
G4TrajectoryParticleFilterFactory();
virtual ~G4TrajectoryParticleFilterFactory();
ModelAndMessengers Create(const G4String& placement, const G4String& name);
};
// Origin volume filter
class G4TrajectoryOriginVolumeFilterFactory : public G4VModelFactory< G4VFilter<G4VTrajectory> > {
public: // With description
typedef std::vector<G4UImessenger*> Messengers;
typedef std::pair< G4VFilter<G4VTrajectory> *, Messengers > ModelAndMessengers;
G4TrajectoryOriginVolumeFilterFactory();
virtual ~G4TrajectoryOriginVolumeFilterFactory();
ModelAndMessengers Create(const G4String& placement, const G4String& name);
};
#endif
@@ -0,0 +1,61 @@
//
// ********************************************************************
// * 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: G4TrajectoryGenericDrawer.hh,v 1.2 2006/06/29 21:31:59 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
// Class Description:
// Trajectory model which colours a trajectory according to
// charge. Guts taken from G4VTrajectory::DrawTrajectory method.
// Class Description - End:
#ifndef G4TRAJECTORYGENERICDRAWER_HH
#define G4TRAJECTORYGENERICDRAWER_HH
#include "G4Colour.hh"
#include "G4VTrajectoryModel.hh"
class G4TrajectoryGenericDrawer : public G4VTrajectoryModel {
public: // With description
G4TrajectoryGenericDrawer(const G4String& name = "Unspecified", G4VisTrajContext* context=0);
virtual ~G4TrajectoryGenericDrawer();
virtual void Draw(const G4VTrajectory& trajectory, const G4int& i_mode = 0,
const G4bool& visible = true) const;
// Draw the trajectory with optional i_mode parameter
virtual void Print(std::ostream& ostr) const;
// Print configuration
private:
};
#endif
@@ -1,26 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4TrajectoryModelFactories.hh,v 1.2 2005/11/23 05:19:23 tinslay Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4TrajectoryModelFactories.hh,v 1.5 2006/06/29 21:32:01 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Jane Tinslay, John Allison, Joseph Perl October 2005
//
@@ -52,6 +56,18 @@ public: // With description
};
class G4TrajectoryGenericDrawerFactory : public G4VModelFactory<G4VTrajectoryModel> {
public: // With description
G4TrajectoryGenericDrawerFactory();
virtual ~G4TrajectoryGenericDrawerFactory();
ModelAndMessengers Create(const G4String& placement, const G4String& name);
};
class G4TrajectoryDrawByParticleIDFactory : public G4VModelFactory<G4VTrajectoryModel> {
public: // With description
@@ -64,6 +80,18 @@ public: // With description
};
class G4TrajectoryDrawByOriginVolumeFactory : public G4VModelFactory<G4VTrajectoryModel> {
public: // With description
G4TrajectoryDrawByOriginVolumeFactory();
virtual ~G4TrajectoryDrawByOriginVolumeFactory();
ModelAndMessengers Create(const G4String& placement, const G4String& name);
};
#endif
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * 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: G4TrajectoryOriginVolumeFilter.hh,v 1.2 2006/06/29 21:32:03 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Filter trajectories according to volume name. Only registered
// volumes will pass the filter.
//
// Jane Tinslay, May 2006
//
#ifndef G4TRAJECTORYORIGINVOLUMEFILTER_HH
#define G4TRAJECTORYORIGINVOLUMEFILTER_HH
#include "G4SmartFilter.hh"
#include "G4VTrajectory.hh"
#include <vector>
class G4TrajectoryOriginVolumeFilter : public G4SmartFilter<G4VTrajectory> {
public: // With description
// Construct with filter name
G4TrajectoryOriginVolumeFilter(const G4String& name = "Unspecified");
virtual ~G4TrajectoryOriginVolumeFilter();
// Evaluate this trajectory
virtual bool Evaluate(const G4VTrajectory&);
// Print configuration
virtual void Print(std::ostream& ostr) const;
// Clear filter
virtual void Clear();
// Configuration function
void Add(const G4String& volume);
private:
// Data member
std::vector<G4String> fVolumes;
};
#endif
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * 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: G4TrajectoryParticleFilter.hh,v 1.2 2006/06/29 21:32:05 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Filter trajectories according to particle type. Only registered
// particle types will pass the filter.
//
// Jane Tinslay, March 2006
//
#ifndef G4TRAJECTORYPARTICLEFILTER_HH
#define G4TRAJECTORYPARTICLEFILTER_HH
#include "G4SmartFilter.hh"
#include "G4VTrajectory.hh"
#include <vector>
class G4TrajectoryParticleFilter : public G4SmartFilter<G4VTrajectory> {
public: // With description
// Construct with filter name
G4TrajectoryParticleFilter(const G4String& name = "Unspecified");
virtual ~G4TrajectoryParticleFilter();
// Evaluate this trajectory
virtual bool Evaluate(const G4VTrajectory&);
// Print configuration
virtual void Print(std::ostream& ostr) const;
// Clear filter
virtual void Clear();
// Configuration function
void Add(const G4String& particle);
private:
// Data member
std::vector<G4String> fParticles;
};
#endif
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4VModel.hh,v 1.17 2005/11/22 16:29:40 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4VModel.hh,v 1.18 2006/06/29 21:32:07 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 31st December 1997.
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4VModel.icc,v 1.10 2005/03/03 16:39:15 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4VModel.icc,v 1.11 2006/06/29 21:32:11 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// John Allison 31st December 1997.
@@ -1,26 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4VModelCommand.hh,v 1.2 2005/11/28 20:07:11 tinslay Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4VModelCommand.hh,v 1.3 2006/06/29 21:32:27 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Jane Tinslay, John Allison, Joseph Perl November 2005
//
@@ -1,26 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4VModelFactory.hh,v 1.1 2005/11/21 05:44:44 tinslay Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4VModelFactory.hh,v 1.6 2006/06/29 21:32:30 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Jane Tinslay, John Allison, Joseph Perl October 2005
//
@@ -34,6 +38,7 @@
#define G4VMODELFACTORY
#include "G4String.hh"
#include <iostream>
#include <utility>
#include <vector>
@@ -55,6 +60,8 @@ public: // With description
virtual ModelAndMessengers Create(const G4String& placement, const G4String& modelName) = 0;
void Print(std::ostream& ostr) const;
private:
G4String fName;
@@ -76,5 +83,12 @@ G4VModelFactory<T>::Name()
return fName;
}
template <typename T>
void
G4VModelFactory<T>::Print(std::ostream& ostr) const
{
ostr<<" "<<fName<<std::endl;
}
#endif
@@ -1,66 +1,79 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and 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 *
// * 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. *
// * 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 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. *
// * 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: G4VTrajectoryModel.hh,v 1.3 2005/12/02 19:16:15 perl Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4VTrajectoryModel.hh,v 1.6 2006/06/29 21:32:32 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Jane Tinslay, John Allison, Joseph Perl October 2005
//
// Class Description:
// Abstract base class for trajectory models. Trajectory models are responsible
// for drawing individual trajectories according to a particular style.
// Abstract base class for trajectory drawing models. Trajectory drawing
// models are responsible for drawing individual trajectories according
// to a particular style.
// Class Description - End:
#ifndef G4VTRAJECTORYMODEL_HH
#define G4VTRAJECTORYMODEL_HH
#include "G4String.hh"
#include <iostream>
#include "G4VTrajectory.hh"
class G4VTrajectory;
class G4VisTrajContext;
class G4VTrajectoryModel {
public: // With description
public:
G4VTrajectoryModel(const G4String& name):fName(name) {}
// Construct with context object
G4VTrajectoryModel(const G4String& name, G4VisTrajContext* fpContext=0);
virtual ~G4VTrajectoryModel() {}
virtual void Draw(const G4VTrajectory& trajectory, G4int i_mode = 0) const = 0;
// Draw the trajectory with optional i_mode parameter
virtual void Print(std::ostream& ostr) const = 0;
// Destructor
virtual ~G4VTrajectoryModel();
// Draw method
virtual void Draw(const G4VTrajectory& model, const G4int& i_mode = 0,
const G4bool& visible = true) const = 0;
// Print configuration
virtual void Print(std::ostream& ostr) const = 0;
// Accessors
G4String Name() const ;
const G4VisTrajContext& GetContext() const;
// Set verbosity
void SetVerbose(const G4bool&);
G4bool GetVerbose() const;
protected:
private:
// Data member
G4String fName;
G4bool fVerbose;
G4VisTrajContext* fpContext;
};
inline G4String G4VTrajectoryModel::Name() const {return fName;}
#endif
@@ -0,0 +1,133 @@
//
// ********************************************************************
// * 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: G4VisTrajContext.hh,v 1.2 2006/06/29 21:32:34 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Jane Tinslay May 2006
//
#ifndef G4VISTRAJCONTEXT_HH
#define G4VISTRAJCONTEXT_HH
#include "G4Colour.hh"
#include "G4Polymarker.hh"
class G4VisTrajContext {
public:
// Default configuration
G4VisTrajContext(const G4String& name = "Unspecified");
// Destructor
virtual ~G4VisTrajContext();
G4String Name() const;
void SetVisible(const G4bool& visible);
// Print configuration
void Print(std::ostream& ostr) const;
// Line
void SetLineColour(const G4Colour& colour);
G4Colour GetLineColour() const;
void SetDrawLine(const G4bool& draw);
G4bool GetDrawLine() const;
void SetLineVisible(const G4bool& visible);
G4bool GetLineVisible() const;
// Auxiliary points
void SetDrawAuxPts(const G4bool& draw);
G4bool GetDrawAuxPts() const;
void SetAuxPtsType(const G4Polymarker::MarkerType& marker);
G4Polymarker::MarkerType GetAuxPtsType() const;
void SetAuxPtsSize(const G4double& size);
G4double GetAuxPtsSize() const;
void SetAuxPtsFillStyle(const G4VMarker::FillStyle& style);
G4VMarker::FillStyle GetAuxPtsFillStyle() const;
void SetAuxPtsColour(const G4Colour& colour);
G4Colour GetAuxPtsColour() const;
void SetAuxPtsVisible(const G4bool& visible);
G4bool GetAuxPtsVisible() const;
// Step points
void SetDrawStepPts(const G4bool& draw);
G4bool GetDrawStepPts() const;
void SetStepPtsType(const G4Polymarker::MarkerType& marker);
G4Polymarker::MarkerType GetStepPtsType() const;
void SetStepPtsSize(const G4double& size);
G4double GetStepPtsSize() const;
void SetStepPtsFillStyle(const G4VMarker::FillStyle& style);
G4VMarker::FillStyle GetStepPtsFillStyle() const;
void SetStepPtsColour(const G4Colour& colour);
G4Colour GetStepPtsColour() const;
void SetStepPtsVisible(const G4bool& visible);
G4bool GetStepPtsVisible() const;
private:
// Data members
G4String fName;
// Line data
G4Colour fLineColour;
G4bool fLineVisible;
G4bool fDrawLine;
// Auxiliary point data
G4bool fDrawAuxPts;
G4Polymarker::MarkerType fAuxPtsType;
G4double fAuxPtsSize;
G4VMarker::FillStyle fAuxPtsFillStyle;
G4Colour fAuxPtsColour;
G4bool fAuxPtsVisible;
// Step point data
G4bool fDrawStepPts;
G4Polymarker::MarkerType fStepPtsType;
G4double fStepPtsSize;
G4VMarker::FillStyle fStepPtsFillStyle;
G4Colour fStepPtsColour;
G4bool fStepPtsVisible;
};
#include "G4VisTrajContext.icc"
#endif
@@ -0,0 +1,111 @@
//
// ********************************************************************
// * 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: G4VisTrajContext.icc,v 1.2 2006/06/29 21:32:36 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// Jane Tinslay May 2006
//
#ifndef G4VISTRAJ_CONTEXT_ICC
#define G4VISTRAJ_CONTEXT_ICC
inline G4String G4VisTrajContext::Name() const {return fName;}
inline void G4VisTrajContext::SetVisible(const G4bool& visible)
{
SetLineVisible(visible);
SetAuxPtsVisible(visible);
SetStepPtsVisible(visible);
}
// Line
inline void G4VisTrajContext::SetLineColour(const G4Colour& colour) {fLineColour = colour;}
inline G4Colour G4VisTrajContext::GetLineColour() const {return fLineColour;}
inline void G4VisTrajContext::SetDrawLine(const G4bool& draw) {fDrawLine = draw;}
inline G4bool G4VisTrajContext::GetDrawLine() const {return fDrawLine;}
inline void G4VisTrajContext::SetLineVisible(const G4bool& visible) {fLineVisible = visible;}
inline G4bool G4VisTrajContext::GetLineVisible() const {return fLineVisible;}
// Auxiliary points
inline void G4VisTrajContext::SetDrawAuxPts(const G4bool& draw) {fDrawAuxPts = draw;}
inline G4bool G4VisTrajContext::GetDrawAuxPts() const {return fDrawAuxPts;}
inline void G4VisTrajContext::SetAuxPtsType(const G4Polymarker::MarkerType& marker) {fAuxPtsType = marker;}
inline G4Polymarker::MarkerType G4VisTrajContext::GetAuxPtsType() const {return fAuxPtsType;}
inline void G4VisTrajContext::SetAuxPtsSize(const G4double& size) {fAuxPtsSize = size;}
inline G4double G4VisTrajContext::GetAuxPtsSize() const {return fAuxPtsSize;}
inline void G4VisTrajContext::SetAuxPtsFillStyle(const G4VMarker::FillStyle& style) {fAuxPtsFillStyle = style;}
inline G4VMarker::FillStyle G4VisTrajContext::GetAuxPtsFillStyle() const {return fAuxPtsFillStyle;}
inline void G4VisTrajContext::SetAuxPtsColour(const G4Colour& colour) {fAuxPtsColour = colour;}
inline G4Colour G4VisTrajContext::GetAuxPtsColour() const {return fAuxPtsColour;}
inline void G4VisTrajContext::SetAuxPtsVisible(const G4bool& visible) {fAuxPtsVisible = visible;}
inline G4bool G4VisTrajContext::GetAuxPtsVisible() const {return fAuxPtsVisible;}
// Step points
inline void G4VisTrajContext::SetDrawStepPts(const G4bool& draw) {fDrawStepPts = draw;}
inline G4bool G4VisTrajContext::GetDrawStepPts() const {return fDrawStepPts;}
inline void G4VisTrajContext::SetStepPtsType(const G4Polymarker::MarkerType& marker) {fStepPtsType = marker;}
inline G4Polymarker::MarkerType G4VisTrajContext::GetStepPtsType() const {return fStepPtsType;}
inline void G4VisTrajContext::SetStepPtsSize(const G4double& size) {fStepPtsSize = size;}
inline G4double G4VisTrajContext::GetStepPtsSize() const {return fStepPtsSize;}
inline void G4VisTrajContext::SetStepPtsFillStyle(const G4VMarker::FillStyle& style) {fStepPtsFillStyle = style;}
inline G4VMarker::FillStyle G4VisTrajContext::GetStepPtsFillStyle() const {return fStepPtsFillStyle;}
inline void G4VisTrajContext::SetStepPtsColour(const G4Colour& colour) {fStepPtsColour = colour;}
inline G4Colour G4VisTrajContext::GetStepPtsColour() const {return fStepPtsColour;}
inline void G4VisTrajContext::SetStepPtsVisible(const G4bool& visible) {fStepPtsVisible = visible;}
inline G4bool G4VisTrajContext::GetStepPtsVisible() const {return fStepPtsVisible;}
inline void G4VisTrajContext::Print(std::ostream& ostr) const
{
ostr<<"Name: "<<Name()<<G4endl;
ostr<<"Line colour "<<GetLineColour()<<G4endl;
ostr<<"Draw line ? "<<GetDrawLine()<<G4endl;
ostr<<"Line visibile ? "<<GetLineVisible()<<G4endl;
ostr<<"Draw auxiliary points ? "<<GetDrawAuxPts()<<G4endl;
ostr<<"Auxiliary points type "<<GetAuxPtsType()<<G4endl;
ostr<<"Auxiliary points size "<<GetAuxPtsSize()<<G4endl;
ostr<<"Auxiliary points fill style "<<GetAuxPtsFillStyle()<<G4endl;
ostr<<"Auxiliary points colour "<<GetAuxPtsColour()<<G4endl;
ostr<<"Auxiliary points visible ? "<<GetAuxPtsVisible()<<G4endl;
ostr<<"Draw step points ? "<<GetDrawStepPts()<<G4endl;
ostr<<"Step points type "<<GetStepPtsType()<<G4endl;
ostr<<"Step points size "<<GetStepPtsSize()<<G4endl;
ostr<<"Step points fill style "<<GetStepPtsFillStyle()<<G4endl;
ostr<<"Step points colour "<<GetStepPtsColour()<<G4endl;
ostr<<"Step points visible ? "<<GetStepPtsVisible()<<G4endl;
}
#endif