Import Geant4 8.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:55:03 +02:00
parent 216a75eeb1
commit fe73f43734
6714 changed files with 118229 additions and 68144 deletions
+2 -2
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4AttCheck.hh,v 1.6 2006/06/29 19:05:10 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4AttCheck.hh,v 1.8 2006/10/17 16:14:08 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
#ifndef G4ATTCHECK_HH
#define G4ATTCHECK_HH
+25 -2
View File
@@ -24,13 +24,15 @@
// ********************************************************************
//
//
// $Id: G4AttDef.hh,v 1.5 2006/06/29 19:05:13 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4AttDef.hh,v 1.7 2006/10/17 16:14:08 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
#ifndef G4ATTDEF_HH
#define G4ATTDEF_HH
#include "globals.hh"
#include "G4TypeKey.hh"
#include <map>
// Class Description:
//
@@ -65,13 +67,27 @@
m_category(category),
m_extra(extra),m_valueType(valueType){};
// G4Typekey based constructor
G4AttDef(const G4String& name,
const G4String& desc,
const G4String& category,
const G4String& extra,
const G4TypeKey& typeKey):
m_name(name),m_desc(desc),
m_category(category),
m_extra(extra),m_valueType("Null"),
m_typeKey(typeKey)
{};
G4AttDef(){};
virtual ~G4AttDef(){};
const G4String& GetName()const{return m_name;};
const G4String& GetDesc()const{return m_desc;};
const G4String& GetCategory()const{return m_category;};
const G4String& GetExtra()const{return m_extra;};
const G4String& GetValueType()const{return m_valueType;};
const G4TypeKey& GetTypeKey()const{return m_typeKey;};
void SetName(const G4String& name){m_name = name;};
void SetDesc(const G4String& desc){m_desc = desc;};
@@ -90,5 +106,12 @@
G4String m_extra;
/// The type of the value of the attribute (int, double, vector, etc.)
G4String m_valueType;
// Type key
G4TypeKey m_typeKey;
};
std::ostream& operator<<
(std::ostream& os, const std::map<G4String,G4AttDef>* definitions);
#endif //G4ATTDEF_H
+14 -8
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4AttDefStore.hh,v 1.7 2006/06/29 19:05:16 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4AttDefStore.hh,v 1.10 2006/11/01 10:08:41 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
#ifndef G4ATTDEFSTORE_HH
#define G4ATTDEFSTORE_HH
@@ -40,11 +40,17 @@ class G4AttDefStore
public:
static std::map<G4String,G4AttDef>*
GetInstance(G4String storeName, G4bool& isNew);
// Returns a pointer to the named store
// and isNew is true if store is new.
// The store keeps the ownership of the returned
// pointer to the map.
GetInstance(G4String storeKey, G4bool& isNew);
// Returns a pointer to the definitions accessed by the given
// key. "isNew" is true if definitions pointer is new and
// therefore the needs filling. The store keeps the ownership
// of the returned pointer. See G4Trajectory::GetAttDefs for an
// example of the use of this class.
static G4bool GetStoreKey
(const std::map<G4String,G4AttDef>* definitions, G4String& key);
// Returns true and assigns key if definitions are amongst those
// maintained in the store.
~G4AttDefStore();
// Destructor.
@@ -58,7 +64,7 @@ class G4AttDefStore
G4AttDefStore(const G4AttDefStore&);
G4AttDefStore& operator=(const G4AttDefStore&);
static std::map<G4String,std::map<G4String,G4AttDef>*> m_stores;
static std::map<G4String,std::map<G4String,G4AttDef>*> m_defsmaps;
static G4AttDefStore* theInstance;
};
+62
View File
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * 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: G4AttDefT.hh,v 1.2 2006/12/13 15:43:57 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Templated G4AttDef. Generates type key for given template parameter.
//
// Jane Tinslay, September 2006
//
#ifndef G4ATTDEFT_HH
#define G4ATTDEFT_HH
#include "globals.hh"
#include "G4AttDef.hh"
#include "G4TypeKeyT.hh"
template <typename T>
class G4AttDefT : public G4AttDef {
public:
typedef T Type;
// Constructor
G4AttDefT(const G4String& name,
const G4String& desc,
const G4String& category,
const G4String& extra="")
:G4AttDef(name, desc, category, extra, G4TypeKeyT<T>())
{}
// Destructor
virtual ~G4AttDefT() {};
private:
};
#endif
@@ -0,0 +1,78 @@
//
// ********************************************************************
// * 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: G4AttHolder.hh,v 1.4 2006/11/01 10:11:44 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
#ifndef G4ATTHOLDER_HH
#define G4ATTHOLDER_HH
// Class Description:
//
// @class G4AttHolder
//
// @brief Holds G4AttValues and their corresponding G4AttDef map.
//
// Intended for inheritance by classes that need to hold them.
//
// For further details, see the HepRep home page at http://heprep.freehep.org
//
// @author J.Allison
// @author J.Perl
// Class Description - End:
#include "globals.hh"
#include <vector>
#include <map>
class G4AttValue;
class G4AttDef;
class G4AttHolder {
public:
G4AttHolder() {}
~G4AttHolder(); // Note: G4AttValues are deleted here.
const std::vector<const std::vector<G4AttValue>*>& GetAttValues() const
{return fValues;}
const std::vector<const std::map<G4String,G4AttDef>*>& GetAttDefs() const
{return fDefs;}
void AddAtts(const std::vector<G4AttValue>* values,
const std::map<G4String,G4AttDef>* defs)
{fValues.push_back(values); fDefs.push_back(defs);}
// Note: G4AttValues are assumed to be expendable - they will be
// deleted in the destructor. G4AttDefs are assumed to have long
// life.
private:
std::vector<const std::vector<G4AttValue>*> fValues;
std::vector<const std::map<G4String,G4AttDef>*> fDefs;
};
#endif //G4ATTHOLDER_HH
@@ -0,0 +1,98 @@
//
// ********************************************************************
// * 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: G4AttUtils.hh,v 1.1 2006/09/11 18:04:58 tinslay Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Jane Tinslay September 2006
//
// Visualisation attribute utility functions.
//
#ifndef G4ATTUTILS_HH
#define G4ATTUTILS_HH
#include "globals.hh"
#include "G4AttDef.hh"
#include "G4AttValue.hh"
#include "G4String.hh"
#include "G4TypeKey.hh"
#include <map>
#include <vector>
namespace G4AttUtils {
namespace {
// Utility class
template <typename T>
class HasName {
public:
HasName(const G4String& name): fName(name) {};
bool operator()(const T& value) const
{return value.GetName() == fName;}
private:
G4String fName;
};
}
// Extract attribute definition with given name
template <typename T>
G4bool ExtractAttDef(const T& object, const G4String& name, G4AttDef& def)
{
const std::map<G4String, G4AttDef>* attDefs = object.GetAttDefs();
std::map<G4String, G4AttDef>::const_iterator iter = attDefs->find(name);
if (iter == attDefs->end()) return false;
def = iter->second;
return true;
}
// Extract attribute value with given name
template <typename T>
G4bool ExtractAttValue(const T& object, const G4String& name, G4AttValue& attVal)
{
std::vector<G4AttValue>* attValues = object.CreateAttValues();
std::vector<G4AttValue>::iterator iter = std::find_if(attValues->begin(), attValues->end(),
HasName<G4AttValue>(name));
if (iter == attValues->end()) return false;
attVal = *iter;
// Clean up
delete attValues;
return true;
}
// Get G4TypeKey information for old style G4AttDef's
G4TypeKey GetKey(const G4AttDef& def);
}
#endif
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4AttValue.hh,v 1.5 2006/06/29 19:05:18 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
#ifndef G4ATTVALUE_HH
#define G4ATTVALUE_HH
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Circle.hh,v 1.9 2006/06/29 19:05:20 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 17/11/96.
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Color.hh,v 1.5 2006/06/29 19:05:23 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 20th October 1996
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Colour.hh,v 1.13 2006/06/29 19:05:26 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 20th October 1996
@@ -0,0 +1,51 @@
//
// ********************************************************************
// * 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: G4ConversionFatalError.hh,v 1.2 2006/12/13 15:44:00 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Fatal G4Exception error
//
// Jane Tinslay, September 2006
//
#ifndef G4CONVERSIONFATALERROR_HH
#define G4CONVERSIONFATALERROR_HH
#include "globals.hh"
#include "G4String.hh"
#include <sstream>
struct G4ConversionFatalError {
void ReportError(const G4String& input, const G4String& message) const {
std::ostringstream o;
o <<input<<": "<<message;
G4Exception
("G4ConversionAbort", "InvalidInput", FatalErrorInArgument, o.str().c_str());
}
};
#endif
@@ -0,0 +1,194 @@
//
// ********************************************************************
// * 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: G4ConversionUtils.hh,v 1.2 2006/09/12 18:29:31 tinslay Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Jane Tinslay September 2006
//
// Conversion utility functions.
//
#ifndef G4CONVERSIONUTILS_HH
#define G4CONVERSIONUTILS_HH
#include "globals.hh"
#include "G4DimensionedDouble.hh"
#include "G4DimensionedThreeVector.hh"
#include <sstream>
namespace G4ConversionUtils
{
// Generic single value istringstream conversion.
// Returns false if conversion failed or if extra characters
// exist in input.
template <typename Value>
G4bool Convert(const G4String& myInput, Value& output)
{
G4String input(myInput);
input = input.strip();
std::istringstream is(input);
char tester;
return ((is >> output) && !is.get(tester));
}
// Conversion specialisations.
template<>
inline G4bool Convert(const G4String& myInput, G4DimensionedDouble& output)
{
G4String input(myInput);
input = input.strip();
G4double value;
G4String unit;
std::istringstream is(input);
char tester;
if (!(is >> value >> unit) || is.get(tester)) return false;
output = G4DimensionedDouble(value, unit);
return true;
}
template<> inline G4bool Convert(const G4String& myInput,
G4DimensionedThreeVector& output)
{
G4String input(myInput);
input = input.strip();
G4double value1, value2, value3;
G4String unit;
std::istringstream is(input);
char tester;
if (!(is >> value1 >> value2 >> value3 >>unit) || is.get(tester)) return false;
output = G4DimensionedThreeVector(G4ThreeVector(value1, value2, value3), unit);
return true;
}
template<> inline G4bool Convert(const G4String& myInput, G4ThreeVector& output)
{
G4String input(myInput);
input = input.strip();
G4double value1, value2, value3;
std::istringstream is(input);
char tester;
if (!(is >> value1 >> value2 >> value3) || is.get(tester)) return false;
output = G4ThreeVector(value1, value2, value3);
return true;
}
// Generic double value istringstream conversion.
// Return false if conversion failed or if extra characters
// exist in input.
template <typename Value> G4bool Convert(const G4String& myInput, Value& value1,
Value& value2)
{
G4String input(myInput);
input = input.strip();
std::istringstream is(input);
char tester;
return ((is >> value1 >> value2) && (!is.get(tester)));
}
// Conversion specialisations.
template<> inline G4bool Convert(const G4String& myInput, G4DimensionedDouble& min,
G4DimensionedDouble& max)
{
G4String input(myInput);
input = input.strip();
G4double valueMin, valueMax;
G4String unitsMin, unitsMax;
std::istringstream is(input);
char tester;
if (!(is >> valueMin >> unitsMin >> valueMax >> unitsMax) || is.get(tester)) return false;;
min = G4DimensionedDouble(valueMin, unitsMin);
max = G4DimensionedDouble(valueMax, unitsMax);
return true;
}
template<> inline G4bool Convert(const G4String& myInput, G4DimensionedThreeVector& min,
G4DimensionedThreeVector& max)
{
G4String input(myInput);
input = input.strip();
G4double valueMinX, valueMinY, valueMinZ;
G4double valueMaxX, valueMaxY, valueMaxZ;
G4String unitMin, unitMax;
std::istringstream is(input);
char tester;
if (!(is >> valueMinX >> valueMinY >> valueMinZ >> unitMin >> valueMaxX >> valueMaxY >> valueMaxZ >> unitMax)
|| is.get(tester)) return false;
min = G4DimensionedThreeVector(G4ThreeVector(valueMinX, valueMinY, valueMinZ), unitMin);
max = G4DimensionedThreeVector(G4ThreeVector(valueMaxX, valueMaxY, valueMaxZ), unitMax);
return true;
}
template<> inline G4bool Convert(const G4String& myInput, G4ThreeVector& min,
G4ThreeVector& max)
{
G4String input(myInput);
input = input.strip();
G4double valueMinX, valueMinY, valueMinZ;
G4double valueMaxX, valueMaxY, valueMaxZ;
std::istringstream is(input);
char tester;
if (!(is >> valueMinX >> valueMinY >> valueMinZ >> valueMaxX >> valueMaxY >> valueMaxZ)
|| is.get(tester)) return false;
min = G4ThreeVector(valueMinX, valueMinY, valueMinZ);
max = G4ThreeVector(valueMaxX, valueMaxY, valueMaxZ);
return true;
}
}
#endif
@@ -0,0 +1,109 @@
//
// ********************************************************************
// * 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: G4CreatorFactoryT.hh,v 1.2 2006/12/13 15:44:03 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Generic identifier-creator based factory. Based on
// factory presented in "Modern C++ Design, Andrei Alexandrescu"
//
// Jane Tinslay, September 2006
//
#ifndef G4CREATORFACTORYT_HH
#define G4CREATORFACTORYT_HH
#include "globals.hh"
#include <map>
#include <sstream>
template <typename T, typename Identifier, typename Creator>
class G4CreatorFactoryT {
public:
// Constructor
G4CreatorFactoryT();
// Destructor
virtual ~G4CreatorFactoryT();
// Register identifier<->creator pairs
G4bool Register(const Identifier& id, Creator creator);
// Create product with given identifier
T* Create(const Identifier& id) const;
private:
typedef std::map<Identifier, Creator> Map;
// Data member
Map fMap;
};
template <typename T, typename Identifier, typename Creator>
G4CreatorFactoryT<T, Identifier, Creator>::G4CreatorFactoryT() {}
template <typename T, typename Identifier, typename Creator>
G4CreatorFactoryT<T, Identifier, Creator>::~G4CreatorFactoryT() {}
template <typename T, typename Identifier, typename Creator>
G4bool
G4CreatorFactoryT<T, Identifier, Creator>::Register(const Identifier& id,
Creator creator)
{
if (fMap.find(id) != fMap.end()) {
std::ostringstream o;
o << "Creator with identifier "<<id<<" already exists.";
G4Exception
("G4CreatorFactoryT::Register(const Identifier& id, Creator creator)",
"CreatorExists", JustWarning, o.str().c_str());
return false;
}
// Insert identifier<->creator pair into map
std::pair<Identifier, Creator> myPair(id, creator);
return fMap.insert(myPair).second;
}
template <typename T, typename Identifier, typename Creator>
T*
G4CreatorFactoryT<T, Identifier, Creator>::Create(const Identifier& id) const
{
typename Map::const_iterator iter = fMap.find(id);
if (iter == fMap.end()) {
std::ostringstream o;
o << "Identifier "<<id<<" does not exist.";
G4Exception("G4CreatorFactoryT::Create(const Identifier& id)",
"NonExistentIdentifier", JustWarning, o.str().c_str());
return 0;
}
return iter->second();
}
#endif
@@ -0,0 +1,40 @@
//
// ********************************************************************
// * 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: G4DimensionedDouble.hh,v 1.2 2006/12/13 15:44:05 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Dimensioned G4double.
//
// Jane Tinslay, September 2006
//
#ifndef G4DIMENSIONEDDOUBLE_HH
#define G4DIMENSIONEDDOUBLE_HH
#include "G4DimensionedType.hh"
typedef G4DimensionedType<G4double> G4DimensionedDouble;
#endif
@@ -0,0 +1,40 @@
//
// ********************************************************************
// * 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: G4DimensionedThreeVector.hh,v 1.2 2006/12/13 15:44:07 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Dimensioned G4Threevector.
//
// Jane Tinslay, September 2006
//
#ifndef G4DIMENSIONEDTHREEVECTOR_HH
#define G4DIMENSIONEDTHREEVECTOR_HH
#include "G4DimensionedType.hh"
typedef G4DimensionedType<G4ThreeVector> G4DimensionedThreeVector;
#endif
@@ -0,0 +1,213 @@
//
// ********************************************************************
// * 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: G4DimensionedType.hh,v 1.3 2006/12/13 15:44:09 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Generic dimensioned type.
//
// Jane Tinslay, September 2006
//
#ifndef G4DIMENSIONEDTYPE_HH
#define G4DIMENSIONEDTYPE_HH
#include "globals.hh"
#include "G4ConversionFatalError.hh"
#include "G4String.hh"
#include "G4UnitsTable.hh"
#include <ostream>
namespace {
// Helper class
class HasName{
public:
HasName(const G4String& name): fName(name) {};
bool operator()(const G4UnitDefinition* value) const
{
return ((value->GetName() == fName) || (value->GetSymbol() == fName));
}
private:
G4String fName;
};
// Get unit value from input string. Return value indicates if
// conversion was successful.
G4bool GetUnitValue(const G4String& unit, G4double& value)
{
// Get units table
G4UnitsTable& unitTable = G4UnitDefinition::GetUnitsTable();
if (unitTable.size() == 0) G4UnitDefinition::BuildUnitsTable();
// Iterate over unit lists, searching for unit match
G4UnitsTable::const_iterator iterTable = unitTable.begin();
HasName myUnit(unit);
G4bool gotUnit(false);
while (!gotUnit && (iterTable != unitTable.end())) {
G4UnitsContainer unitContainer = (*iterTable)->GetUnitsList();
G4UnitsContainer::const_iterator iterUnits =
std::find_if(unitContainer.begin(), unitContainer.end(), myUnit);
if (iterUnits != unitContainer.end()) {
value = (*iterUnits)->GetValue();
gotUnit = true;
}
iterTable++;
}
return gotUnit;
}
}
// Default error handling done through G4ConversionFatalError
template <typename T, typename ConversionErrorPolicy = G4ConversionFatalError>
class G4DimensionedType : public ConversionErrorPolicy {
public:
// Constructors
G4DimensionedType();
G4DimensionedType(const T& value, const G4String& unit);
// Destructor
virtual ~G4DimensionedType();
// Accessors
// Raw, undimensioned value
T RawValue() const;
// Unit string
G4String Unit() const;
// Dimensioned value - rawValue*converted unit
T DimensionedValue() const;
// Operators
T operator()() const;
bool operator == (const G4DimensionedType<T>& rhs) const;
bool operator != (const G4DimensionedType<T>& rhs) const;
bool operator < (const G4DimensionedType<T>& rhs) const;
bool operator > (const G4DimensionedType<T>& rhs) const;
private:
// Data members
T fValue;
G4String fUnit;
T fDimensionedValue;
};
template <typename T, typename ConversionErrorPolicy>
G4DimensionedType<T, ConversionErrorPolicy>::G4DimensionedType()
:fValue(0)
,fUnit("Undefined")
,fDimensionedValue(0)
{}
template <typename T, typename ConversionErrorPolicy>
G4DimensionedType<T, ConversionErrorPolicy>::G4DimensionedType(const T& value, const G4String& unit)
:fValue(value)
,fUnit(unit)
{
G4double unitValue(0);
// Convert unit string to unit value
if (!GetUnitValue(unit, unitValue)) ConversionErrorPolicy::ReportError(unit, "Invalid unit");
fDimensionedValue = value*unitValue;
}
template <typename T, typename ConversionErrorPolicy>
G4DimensionedType<T, ConversionErrorPolicy>::~G4DimensionedType() {}
template <typename T, typename ConversionErrorPolicy>
T
G4DimensionedType<T, ConversionErrorPolicy>::RawValue() const
{
return fValue;
}
template <typename T, typename ConversionErrorPolicy>
G4String
G4DimensionedType<T, ConversionErrorPolicy>::Unit() const
{
return fUnit;
}
template <typename T, typename ConversionErrorPolicy>
T
G4DimensionedType<T, ConversionErrorPolicy>::DimensionedValue() const
{
return fDimensionedValue;
}
template <typename T, typename ConversionErrorPolicy>
T
G4DimensionedType<T, ConversionErrorPolicy>::operator()() const
{
return fDimensionedValue;
}
template <typename T, typename ConversionErrorPolicy>
bool
G4DimensionedType<T, ConversionErrorPolicy>::operator == (const G4DimensionedType<T>& rhs) const
{
return fDimensionedValue == rhs.fDimensionedValue;
}
template <typename T, typename ConversionErrorPolicy>
bool
G4DimensionedType<T, ConversionErrorPolicy>::operator != (const G4DimensionedType<T>& rhs) const
{
return fDimensionedValue != rhs.fDimensionedValue;
}
template <typename T, typename ConversionErrorPolicy>
bool
G4DimensionedType<T, ConversionErrorPolicy>::operator < (const G4DimensionedType<T>& rhs) const
{
return fDimensionedValue < rhs.fDimensionedValue;
}
template <typename T, typename ConversionErrorPolicy>
bool
G4DimensionedType<T, ConversionErrorPolicy>::operator > (const G4DimensionedType<T>& rhs) const
{
return fDimensionedValue > rhs.fDimensionedValue;
}
template <typename M>
std::ostream& operator << (std::ostream& os, const G4DimensionedType<M>& obj) {
os << obj.RawValue()<<" "<<obj.Unit();
return os;
}
#endif
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4NURBS.hh,v 1.10 2006/06/29 19:05:28 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// Olivier Crumeyrolle 12 September 1996
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4NURBSbox.hh,v 1.9 2006/06/29 19:05:30 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -25,7 +25,7 @@
//
//
// $Id: G4NURBScylinder.hh,v 1.9 2006/06/29 19:05:32 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -25,7 +25,7 @@
//
//
// $Id: G4NURBShexahedron.hh,v 1.9 2006/06/29 19:05:34 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// Hexa hedron builder prototype
// OC 17 9 96
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4NURBStube.hh,v 1.9 2006/06/29 19:05:36 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -25,7 +25,7 @@
//
//
// $Id: G4NURBStubesector.hh,v 1.8 2006/06/29 19:05:38 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -25,7 +25,7 @@
//
//
// $Id: G4PlacedPolyhedron.hh,v 1.11 2006/06/29 19:05:40 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
// Class Description:
@@ -25,7 +25,7 @@
//
//
// $Id: G4Point3DList.hh,v 1.12 2006/06/29 19:05:43 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison July 1995
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Polyhedron.hh,v 1.18 2006/06/29 19:05:45 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
#ifndef G4POLYHEDRON_HH
#define G4POLYHEDRON_HH
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Polyline.hh,v 1.13 2006/06/29 19:05:50 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison July 1995
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Polymarker.hh,v 1.11 2006/06/29 19:05:52 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison November 1996
@@ -25,7 +25,7 @@
//
//
// $Id: G4Polymarker.icc,v 1.4 2006/06/29 19:05:54 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison November 1996
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Scale.hh,v 1.7 2006/06/29 19:05:56 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 21st July 2001.
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Scale.icc,v 1.3 2006/06/29 19:05:58 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 21st July 2001.
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4SmartFilter.hh,v 1.2 2006/06/29 19:06:00 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4SmartFilter.hh,v 1.3 2006/08/25 19:39:39 tinslay Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Filter with additional funcionality such as active and inverted states,
// and filtering statistics
@@ -47,7 +47,7 @@ public: // With description
virtual ~G4SmartFilter();
// Evaluate method implemented in subclass
virtual G4bool Evaluate(const T&) = 0;
virtual G4bool Evaluate(const T&) const = 0;
// Print subclass configuration
virtual void Print(std::ostream& ostr) const = 0;
@@ -56,7 +56,7 @@ public: // With description
virtual void Clear() = 0;
// Filter method
G4bool Accept(const T&);
G4bool Accept(const T&) const;
// Print G4SmartFilter configuration
virtual void PrintAll(std::ostream& ostr) const;
@@ -83,8 +83,8 @@ private:
G4bool fActive;
G4bool fInvert;
G4bool fVerbose;
size_t fNPassed;
size_t fNProcessed;
mutable size_t fNPassed;
mutable size_t fNProcessed;
};
@@ -103,7 +103,7 @@ G4SmartFilter<T>::~G4SmartFilter() {}
template <typename T>
G4bool
G4SmartFilter<T>::Accept(const T& object)
G4SmartFilter<T>::Accept(const T& object) const
{
if (fVerbose) {
G4cout<<"Begin verbose printout for filter "<<G4VFilter<T>::Name()<<G4endl;
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Square.hh,v 1.8 2006/06/29 19:06:02 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 17/11/96.
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Square.icc,v 1.4 2006/06/29 19:06:04 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 17/11/96.
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Text.hh,v 1.10 2006/06/29 19:06:06 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 17/11/96.
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Text.icc,v 1.4 2006/06/29 19:06:08 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 17/11/96.
+77
View File
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * 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: G4TypeKey.hh,v 1.2 2006/12/13 15:44:11 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Base type key class
//
// Jane Tinslay, September 2006
//
#ifndef G4TYPEKEY_HH
#define G4TYPEKEY_HH
#include "globals.hh"
#include <ostream>
class G4TypeKey {
public:
typedef unsigned long Key;
// Constructor
G4TypeKey():fMyKey(0) {}
// Destructor
virtual ~G4TypeKey() {}
G4bool IsValid() {
return (0 == fMyKey ? false : true);
}
// Operators
Key operator()() const {return fMyKey;}
bool operator==(const G4TypeKey& rhs) const {return fMyKey == rhs.fMyKey;}
bool operator!=(const G4TypeKey& rhs) const {return !operator==(rhs);}
bool operator<(const G4TypeKey& rhs) const {return fMyKey < rhs.fMyKey;}
bool operator>(const G4TypeKey& rhs) const {return fMyKey > rhs.fMyKey;}
friend std::ostream& operator<<(std::ostream& out, const G4TypeKey& key){
return out<< key.fMyKey;
}
protected:
Key NextKey() const {
static Key nKey = 0;
return ++nKey;
}
Key fMyKey;
};
#endif
@@ -0,0 +1,52 @@
//
// ********************************************************************
// * 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: G4TypeKeyT.hh,v 1.2 2006/12/13 15:44:14 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Type key class
//
// Jane Tinslay, September 2006
//
#ifndef G4TYPEKEYT_HH
#define G4TYPEKEYT_HH
#include "G4TypeKey.hh"
template <typename T>
class G4TypeKeyT : public G4TypeKey {
public:
G4TypeKeyT() {
static Key key = NextKey();
fMyKey = key;
}
virtual ~G4TypeKeyT() {}
};
#endif
+3 -3
View File
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VFilter.hh,v 1.3 2006/06/29 19:06:10 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4VFilter.hh,v 1.4 2006/08/25 19:39:39 tinslay Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Abstract filter class.
//
@@ -50,7 +50,7 @@ public: // With description
virtual ~G4VFilter();
// Filter method
virtual G4bool Accept(const T&) = 0;
virtual G4bool Accept(const T&) const = 0;
// Print configuration
virtual void PrintAll(std::ostream& ostr) const = 0;
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VGraphicsScene.hh,v 1.8 2006/06/29 19:06:12 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4VGraphicsScene.hh,v 1.9 2006/07/10 15:19:29 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// John Allison 19th July 1996
//
// Class Description:
@@ -139,17 +139,6 @@ public: // With description
virtual void AddPrimitive (const G4Polyhedron&) = 0;
virtual void AddPrimitive (const G4NURBS&) = 0;
///////////////////////////////////////////////////////////////////
// Special functions for particular models.
virtual void EstablishSpecials (G4PhysicalVolumeModel&) {}
// Used to establish any special relationships between scene and
// this particular type of model - non-pure, i.e., no requirement to
// implement. See G4PhysicalVolumeModel.hh for details.
virtual void DecommissionSpecials (G4PhysicalVolumeModel&) {}
// Used to reverse the effect of EstablishSpecials, if required.
};
#endif
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4VMarker.hh,v 1.12 2006/06/29 19:06:14 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// G4VMarker - base class for markers - circles, squares, etc.
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4VMarker.icc,v 1.7 2006/06/29 19:06:16 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VVisManager.hh,v 1.12 2006/06/29 19:06:18 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4VVisManager.hh,v 1.13 2006/09/12 18:29:31 tinslay Exp $
// GEANT4 tag $Name: geant4-08-02 $
// John Allison 19/Oct/1996.
//
// Class Description:
@@ -175,6 +175,9 @@ public: // With description
virtual G4bool FilterTrajectory(const G4VTrajectory&) = 0;
// Trajectory filter
virtual G4bool FilterHit(const G4VHit&) = 0;
// Hit filter
protected:
static void SetConcreteInstance (G4VVisManager*);
+30 -15
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VisAttributes.hh,v 1.15 2006/06/29 19:06:20 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4VisAttributes.hh,v 1.18 2006/10/24 05:54:20 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 23rd October 1996
@@ -45,7 +45,7 @@
// - visibility
// - visibility of daughters
// - force wireframe style, force solid style
// - force auxiliary edge visibility
// - force auxiliary edge visibility, force line segments pe circle
// - colour
// Class Description - End:
@@ -86,18 +86,6 @@ public: // With description
G4bool operator != (const G4VisAttributes& a) const;
G4bool operator == (const G4VisAttributes& a) const;
G4bool IsVisible () const;
G4bool IsDaughtersInvisible () const;
const G4Colour& GetColour () const;
const G4Color& GetColor () const;
LineStyle GetLineStyle () const;
G4double GetLineWidth () const;
G4bool IsForceDrawingStyle () const;
ForcedDrawingStyle GetForcedDrawingStyle () const;
G4bool IsForceAuxEdgeVisible () const;
const std::vector<G4AttValue>* GetAttValues() const;
const std::map<G4String,G4AttDef>* GetAttDefs () const;
void SetVisibility (G4bool);
void SetDaughtersInvisible (G4bool);
void SetColour (const G4Colour&);
@@ -111,9 +99,33 @@ public: // With description
void SetForceWireframe (G4bool);
void SetForceSolid (G4bool);
void SetForceAuxEdgeVisible (G4bool);
void SetForceLineSegmentsPerCircle (G4int nSegments);
// Allows choice of circle approximation. A circle of 360 degrees
// will be composed of nSegments line segments. If your solid has
// curves of D degrees that you need to divide into N segments,
// specify nSegments = N * 360 / D.
void SetStartTime (G4double);
void SetEndTime (G4double);
void SetAttValues (const std::vector<G4AttValue>*);
void SetAttDefs (const std::map<G4String,G4AttDef>*);
G4bool IsVisible () const;
G4bool IsDaughtersInvisible () const;
const G4Colour& GetColour () const;
const G4Color& GetColor () const;
LineStyle GetLineStyle () const;
G4double GetLineWidth () const;
G4bool IsForceDrawingStyle () const;
ForcedDrawingStyle GetForcedDrawingStyle () const;
G4bool IsForceAuxEdgeVisible () const;
G4int GetForcedLineSegmentsPerCircle () const;
G4double GetStartTime () const;
G4double GetEndTime () const;
// Returns an expendable copy of the G4AttValues...
const std::vector<G4AttValue>* CreateAttValues () const;
// Returns the orginal long life G4AttDefs...
const std::map<G4String,G4AttDef>* GetAttDefs () const;
private:
G4bool fVisible; // Visibility flag
@@ -125,6 +137,9 @@ private:
G4bool fForceDrawingStyle; // To switch on forced drawing style.
ForcedDrawingStyle fForcedStyle; // Value of forced drawing style.
G4bool fForceAuxEdgeVisible; // Force drawing of auxilary edges.
G4int fForcedLineSegmentsPerCircle; // Forced lines segments per
// circle. <=0 means not forced.
G4double fStartTime, fEndTime; // Time range.
const std::vector<G4AttValue>* fAttValues; // For picking, etc.
const std::map<G4String,G4AttDef>* fAttDefs; // Corresponding definitions.
};
@@ -24,53 +24,12 @@
// ********************************************************************
//
//
// $Id: G4VisAttributes.icc,v 1.9 2006/06/29 19:06:22 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4VisAttributes.icc,v 1.13 2006/12/13 15:44:17 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 18th November 1996
inline G4bool G4VisAttributes::IsVisible () const {return fVisible;}
inline G4bool G4VisAttributes::IsDaughtersInvisible () const {
return fDaughtersInvisible;
}
inline const G4Colour& G4VisAttributes::GetColour () const {return fColour;}
inline const G4Color& G4VisAttributes::GetColor () const {return fColour;}
inline G4VisAttributes::LineStyle G4VisAttributes::GetLineStyle () const {
return fLineStyle;
}
inline G4double G4VisAttributes::GetLineWidth () const {
return fLineWidth;
}
inline G4bool G4VisAttributes::IsForceDrawingStyle () const {
return fForceDrawingStyle;
}
inline G4VisAttributes::ForcedDrawingStyle
G4VisAttributes::GetForcedDrawingStyle () const {
return fForcedStyle;
}
inline G4bool G4VisAttributes::IsForceAuxEdgeVisible () const {
return fForceAuxEdgeVisible;
}
inline const std::vector<G4AttValue>*
G4VisAttributes::GetAttValues () const {
return fAttValues;
}
inline
const std::map<G4String,G4AttDef>* G4VisAttributes::GetAttDefs () const {
return fAttDefs;
}
inline void G4VisAttributes::SetVisibility (G4bool v) {fVisible = v;}
inline void G4VisAttributes::SetDaughtersInvisible (G4bool v) {
@@ -117,6 +76,14 @@ inline void G4VisAttributes::SetForceAuxEdgeVisible (G4bool force) {
fForceAuxEdgeVisible = force;
}
inline void G4VisAttributes::SetStartTime(G4double time) {
fStartTime = time;
}
inline void G4VisAttributes::SetEndTime(G4double time) {
fEndTime = time;
}
inline void G4VisAttributes::SetAttValues
(const std::vector<G4AttValue>* attValues){
fAttValues = attValues;
@@ -126,3 +93,50 @@ inline void G4VisAttributes::SetAttDefs
(const std::map<G4String,G4AttDef>* attDefs) {
fAttDefs = attDefs;
}
inline G4bool G4VisAttributes::IsVisible () const {return fVisible;}
inline G4bool G4VisAttributes::IsDaughtersInvisible () const {
return fDaughtersInvisible;
}
inline const G4Colour& G4VisAttributes::GetColour () const {return fColour;}
inline const G4Color& G4VisAttributes::GetColor () const {return fColour;}
inline G4VisAttributes::LineStyle G4VisAttributes::GetLineStyle () const {
return fLineStyle;
}
inline G4double G4VisAttributes::GetLineWidth () const {
return fLineWidth;
}
inline G4bool G4VisAttributes::IsForceDrawingStyle () const {
return fForceDrawingStyle;
}
inline G4VisAttributes::ForcedDrawingStyle
G4VisAttributes::GetForcedDrawingStyle () const {
return fForcedStyle;
}
inline G4bool G4VisAttributes::IsForceAuxEdgeVisible () const {
return fForceAuxEdgeVisible;
}
inline G4int G4VisAttributes::GetForcedLineSegmentsPerCircle () const {
return fForcedLineSegmentsPerCircle;
}
inline G4double G4VisAttributes::GetStartTime() const {
return fStartTime;
}
inline G4double G4VisAttributes::GetEndTime() const {
return fEndTime;
}
inline
const std::map<G4String,G4AttDef>* G4VisAttributes::GetAttDefs () const {
return fAttDefs;
}
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4VisExtent.hh,v 1.10 2006/06/29 19:06:24 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// A.Walkden 28/11/95
+8 -6
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Visible.hh,v 1.10 2006/06/29 19:06:26 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Visible.hh,v 1.13 2006/11/07 11:53:16 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 30th October 1996
@@ -53,10 +53,15 @@ class G4Visible {
public: // With description
G4Visible ();
G4Visible (const G4Visible&);
G4Visible (const G4VisAttributes* pVA);
virtual ~G4Visible ();
G4Visible& operator= (const G4Visible&);
G4bool operator != (const G4Visible& right) const;
const G4VisAttributes* GetVisAttributes () const;
void SetVisAttributes (const G4VisAttributes* pVA);
@@ -69,13 +74,10 @@ public: // With description
// associated G4VisAttributes object would normally also be created
// on the heap and managed in the same way.
G4bool operator != (const G4Visible& right) const;
// Simple test on non-equality of address of vis attributes.
protected:
const G4VisAttributes* fpVisAttributes;
G4bool fAllocatedVisAttributes;
};
#include "G4Visible.icc"
+2 -6
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Visible.icc,v 1.7 2006/06/29 19:06:29 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Visible.icc,v 1.8 2006/11/07 11:53:16 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// John Allison 30th October 1996
@@ -33,7 +33,3 @@
inline const G4VisAttributes* G4Visible::GetVisAttributes () const {
return fpVisAttributes;
}
inline void G4Visible::SetVisAttributes (const G4VisAttributes* pVA) {
fpVisAttributes = pVA;
}
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: HepPolyhedron.h,v 1.21 2006/06/29 19:06:32 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// Class Description: