Import Geant4 6.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:56:29 +02:00
parent 1d812b78b1
commit e083ffb441
1415 changed files with 111223 additions and 21207 deletions
@@ -7,8 +7,9 @@
#ifndef HEPREP_HEPREP_H
#define HEPREP_HEPREP_H 1
// Copyright 2000-2003, FreeHEP.
// Copyright 2000-2004, FreeHEP.
#include <set>
#include <string>
#include <vector>
@@ -17,14 +18,15 @@
#include "HEPREP/HepRepAction.h"
#include "HEPREP/HepRepAttDef.h"
#include "HEPREP/HepRepAttribute.h"
#include "HEPREP/HepRepAttributeListener.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepConstants.h"
#include "HEPREP/HepRepDefinition.h"
#include "HEPREP/HepRepFactory.h"
#include "HEPREP/HepRepFrameListener.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepIterator.h"
#include "HEPREP/HepRepIteratorListener.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepTreeID.h"
@@ -37,7 +39,6 @@ namespace HEPREP {
class HepRepAction;
class HepRepInstanceTree;
class HepRepSelectFilter;
class HepRepType;
class HepRepTypeTree;
/**
@@ -61,22 +62,21 @@ public:
*
* @param layer name of layer to be added to the back of the list.
*/
virtual bool addLayer(std::string layer) = 0;
virtual void addLayer(std::string layer) = 0;
/**
* Returns the list of layers.
*
* @return the known layer names, in the order back-to-front.
*/
virtual std::vector<std::string> * getLayerOrder() = 0;
virtual std::vector<std::string> getLayerOrder() = 0;
/**
* Add a typetree to this heprep.
*
* @param typeTree to be added.
* @return false only if the tree is written immediately to some stream.
*/
virtual bool addTypeTree(HepRepTypeTree * typeTree) = 0;
virtual void addTypeTree(HepRepTypeTree * typeTree) = 0;
/**
* Remove a typetree from this heprep.
@@ -90,7 +90,7 @@ public:
*
* @return collection of HepRepTypeTrees.
*/
virtual std::vector<HepRepTypeTree *> * getTypeTrees() = 0;
virtual std::set<HepRepTypeTree *> getTypeTrees() = 0;
/**
* Returns a named and versioned typetree.
@@ -108,15 +108,13 @@ public:
* @param name name of type.
* @return named HepRepType.
*/
virtual HepRepType * getType(std::string name) = 0;
// HepRepType* getType(String name);
/**
* Adds an instancetree to this heprep.
*
* @param instanceTree to be added.
* @return false only if the tree is written immediately to some stream.
*/
virtual bool addInstanceTree(HepRepInstanceTree * instanceTree) = 0;
virtual void addInstanceTree(HepRepInstanceTree * instanceTree) = 0;
/**
* Overlays an instancetree to this heprep, overriding attributes and adding children.
@@ -137,7 +135,7 @@ public:
*
* @return collection of HepRepInstanceTrees.
*/
virtual std::vector<HepRepInstanceTree *> * getInstanceTrees() = 0;
virtual std::set<HepRepInstanceTree *> getInstanceTrees() = 0;
/**
* Returns a named and versioned instancetree.
@@ -9,6 +9,7 @@
// Copyright 2000-2002, FreeHEP.
#include <set>
#include <string>
#include <vector>
@@ -33,9 +34,8 @@ public:
* Adds an attValue.
*
* @param attValue to be added.
* @return false only if the value is immediately written to a stream.
*/
virtual bool addAttValue(HepRepAttValue * attValue) = 0;
virtual void addAttValue(HepRepAttValue * attValue) = 0;
/**
@@ -47,18 +47,16 @@ public:
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
* @return false if an IOException was created.
*/
virtual bool addAttValue(std::string key, char* value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
virtual void addAttValue(std::string key, char* value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
* @return false only if the value is immediately written to a stream.
*/
virtual bool addAttValue(std::string key, std::string value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
virtual void addAttValue(std::string key, std::string value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
@@ -66,9 +64,8 @@ public:
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
* @return false only if the value is immediately written to a stream.
*/
virtual bool addAttValue(std::string key, int value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
virtual void addAttValue(std::string key, int value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
@@ -76,9 +73,8 @@ public:
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
* @return false only if the value is immediately written to a stream.
*/
virtual bool addAttValue(std::string key, double value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
virtual void addAttValue(std::string key, double value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
@@ -86,9 +82,8 @@ public:
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
* @return false only if the value is immediately written to a stream.
*/
virtual bool addAttValue(std::string key, bool value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
virtual void addAttValue(std::string key, bool value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds a Color attValue.
@@ -96,9 +91,8 @@ public:
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
* @return false only if the value is immediately written to a stream.
*/
virtual bool addAttValue(std::string key, std::vector<double> value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
virtual void addAttValue(std::string key, std::vector<double> value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds a Color attValue.
@@ -109,9 +103,8 @@ public:
* @param blue color
* @param alpha value
* @param showLabel show this as label
* @return false only if the value is immediately written to a stream.
*/
virtual bool addAttValue(std::string key, double red, double green, double blue, double alpha = 1.0, int showLabel = HepRepConstants::SHOW_NONE) = 0;
virtual void addAttValue(std::string key, double red, double green, double blue, double alpha = 1.0, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Remove the attvalue named by key.
@@ -135,7 +128,7 @@ public:
*
* @return collection of HepRepAttValues.
*/
virtual std::vector<HepRepAttValue *> * getAttValuesFromNode() = 0;
virtual std::set<HepRepAttValue *> getAttValuesFromNode() = 0;
/**
* Returns a named attribute value from this node.
@@ -4,10 +4,10 @@
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPITERATORLISTENER_H
#define HEPREP_HEPREPITERATORLISTENER_H 1
#ifndef HEPREP_HEPREPATTRIBUTELISTENER_H
#define HEPREP_HEPREPATTRIBUTELISTENER_H 1
// Copyright 2000-2002, FreeHEP.
// Copyright 2000-2004, FreeHEP.
#include <string>
#include <vector>
@@ -15,25 +15,25 @@
namespace HEPREP {
/**
* HepRepIteratorListener interface. The implementor is called back for changes
* HepRepAttributeListener interface. The implementor is called back for changes
* of attributes while using the HepRepIterator to iterate over all the HepRepInstances.
*
* All names are lowercased.
*
* @author Mark Donszelmann
*/
class HepRepIteratorListener {
class HepRepAttributeListener {
public:
/// Destructor.
virtual ~HepRepIteratorListener() { /* nop */; }
virtual ~HepRepAttributeListener() { /* nop */; }
/**
* Called if attribute key changes its value.
*
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param value value of the changed attribute.
* @param lowerCaseValue lower case value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(std::string key, std::string value, std::string lowerCaseValue, int showLabel) = 0;
@@ -91,4 +91,4 @@ public:
virtual void removeAttribute(std::string key) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPITERATORLISTENER_H */
#endif /* ifndef HEPREP_HEPREPATTRIBUTELISTENER_H */
@@ -9,8 +9,8 @@
// Copyright 2000-2002, FreeHEP.
#include <set>
#include <string>
#include <vector>
#include "HEPREP/HepRepAttribute.h"
@@ -37,17 +37,15 @@ public:
* @param desc description of the definition.
* @param category category of the definition.
* @param extra extra info of the definition.
* @return false only if this definition is written immediately to a stream.
*/
virtual bool addAttDef(std::string name, std::string desc, std::string category, std::string extra) = 0;
virtual void addAttDef(std::string name, std::string desc, std::string category, std::string extra) = 0;
/**
* Adds an attdef.
*
* @param attDef to be added.
* @return false only if this definition is written immediately to a stream.
*/
virtual bool addAttDef(HepRepAttDef * attDef) = 0;
virtual void addAttDef(HepRepAttDef * attDef) = 0;
/**
* Return a named attribute definition searched on this node and any parent nodes.
@@ -62,7 +60,7 @@ public:
*
* @return collection of attributes definitions.
*/
virtual std::vector<HepRepAttDef *> * getAttDefsFromNode() = 0;
virtual std::set<HepRepAttDef *> getAttDefsFromNode() = 0;
/**
* Returns a named attribute definition defined on this node.
@@ -113,6 +113,14 @@ public:
*/
virtual HepRepInstanceTree * createHepRepInstanceTree(std::string name, std::string version, HepRepTreeID * typeTree) = 0;
/**
* Creates a HepRepType.
*
* @param parent to add this type to.
* @param name of the type to create.
*/
virtual HepRepType * createHepRepType(HepRepTypeTree * parent, std::string name) = 0;
/**
* Creates a HepRepType.
*
@@ -0,0 +1,34 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPFRAMELISTENER_H
#define HEPREP_HEPREPFRAMELISTENER_H 1
// Copyright 2004, FreeHEP.
namespace HEPREP {
/**
* HepRepFrameListener interface. The implementor is called back for changes in
* drawing in or out of the frame layer.
*
* @author Mark Donszelmann
*/
class HepRepFrameListener {
public:
/// Destructor.
virtual ~HepRepFrameListener() { /* nop */; }
/**
* Called if we switch from a normal layer to a frame layer, and back.
*
* @param inFrame true if in a frame layer
*/
virtual void setFrameLayer(bool inFrame) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPFRAMELISTENER_H */
@@ -7,7 +7,7 @@
#ifndef HEPREP_HEPREPINSTANCE_H
#define HEPREP_HEPREPINSTANCE_H 1
// Copyright 2000-2002, FreeHEP.
// Copyright 2000-2004, FreeHEP.
#include <vector>
@@ -15,11 +15,11 @@
namespace HEPREP {
class HepRep;
class HepRepInstanceTree;
class HepRepPoint;
class HepRepSelectFilter;
class HepRepType;
class HepRepTypeTree;
/**
* HepRepInstance interface.
@@ -45,9 +45,8 @@ public:
* Adds an sub-instance to this instance.
*
* @param instance sub-instance.
* @return false only if written immediately to a stream.
*/
virtual bool addInstance(HepRepInstance * instance) = 0;
virtual void addInstance(HepRepInstance * instance) = 0;
/**
* Removes a sub-instance from this instance.
@@ -61,7 +60,7 @@ public:
*
* @return collection of HepRepInstances.
*/
virtual std::vector<HepRepInstance *> * getInstances() = 0;
virtual std::vector<HepRepInstance *> getInstances() = 0;
/**
* Returns the associated type for this instance.
@@ -74,36 +73,56 @@ public:
* Adds a point to this instance.
*
* @param point to be added.
* @return false only if written immediately to a stream.
*/
virtual bool addPoint(HepRepPoint * point) = 0;
virtual void addPoint(HepRepPoint * point) = 0;
/**
* Returns a collection of all points this instance keeps.
*
* @return collection of HepRepPoints.
*/
virtual std::vector<HepRepPoint *> * getPoints() = 0;
virtual std::vector<HepRepPoint *> getPoints() = 0;
/**
* Fills a double[3][n] array with the coordinates of all points, if
* none of the points have any attributes defined on them.
* The actual number of points filled is returned. In case the number
* of points is larger than n, or if any points have attributes, -1 is returned.
* One could then call getPoint().
*
* @see #getPoints()
*
* @param xyz a double[3][n] array to be filled with points.
* @return number of points filled in xyz, or -1 in case of error or non-implementation.
*
* ONLY in JAVA
*/
/**
* Returns the parent of this instance.
*
* @return parent of instance, or null if top-level.
*/
virtual HepRepInstance * getSuperInstance() = 0;
/**
* Returns a deep copy of this instance.
*
* @param heprep needed to find the associated type.
* @param typeTree needed to find the associated type.
* @param parent to which the copy is added.
* @param filter run on all instances before copying.
* @return copy of this instance.
*/
virtual HepRepInstance * copy(HepRep * heprep, HepRepInstance * parent, HepRepSelectFilter * filter = NULL) = 0;
virtual HepRepInstance * copy(HepRepTypeTree * typeTree, HepRepInstance * parent, HepRepSelectFilter * filter = NULL) = 0;
/**
* Returns a deep copy of this instance.
*
* @param heprep needed to find the associated type.
* @param typeTree needed to find the associated type.
* @param parent to which the copy is added.
* @param filter run on all instances before copying.
* @return copy of this instance.
*/
virtual HepRepInstance * copy(HepRep * heprep, HepRepInstanceTree * parent, HepRepSelectFilter * filter = NULL) = 0;
virtual HepRepInstance * copy(HepRepTypeTree * typeTree, HepRepInstanceTree * parent, HepRepSelectFilter * filter = NULL) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPINSTANCE_H */
@@ -7,18 +7,19 @@
#ifndef HEPREP_HEPREPINSTANCETREE_H
#define HEPREP_HEPREPINSTANCETREE_H 1
// Copyright 2000-2002, FreeHEP.
// Copyright 2000-2004, FreeHEP.
#include <set>
#include <vector>
#include "HEPREP/HepRepTreeID.h"
namespace HEPREP {
class HepRep;
class HepRepInstance;
class HepRepSelectFilter;
class HepRepTreeID;
class HepRepTypeTree;
/**
* HepRepInstanceTree interface.
@@ -42,9 +43,8 @@ public:
* Adds an instance to this instancetree.
*
* @param instance to be added.
* @return false only if written immediately to a stream.
*/
virtual bool addInstance(HepRepInstance * instance) = 0;
virtual void addInstance(HepRepInstance * instance) = 0;
/**
* Removes an instance from this instancetree.
@@ -58,22 +58,21 @@ public:
*
* @return collection of HepRepInstances.
*/
virtual std::vector<HepRepInstance *> * getInstances() = 0;
virtual std::vector<HepRepInstance *> getInstances() = 0;
/**
* Adds a related instance tree to this instancetree.
*
* @param instanceTree related instancetree.
* @return false only if written immediately to a stream.
*/
virtual bool addInstanceTree(HepRepTreeID * instanceTree) = 0;
virtual void addInstanceTree(HepRepTreeID * instanceTree) = 0;
/**
* Returns a collection of associated instance trees.
*
* @return collection of HepRepTreeIDs.
*/
virtual std::vector<HepRepTreeID *> * getInstanceTrees() = 0;
virtual std::set<HepRepTreeID *> getInstanceTrees() = 0;
/**
* Returns the associated typetree.
@@ -85,13 +84,10 @@ public:
/**
* Returns a deep copy of this instancetree.
*
* @param heprep needed to find the associated type.
* @param filter to filter the instances.
* @return copy of this instancetree.
*/
virtual HepRepInstanceTree * copy(HepRep * heprep, HepRepSelectFilter * filter = NULL) = 0;
virtual HepRepTreeID * copy() = 0;
virtual HepRepInstanceTree * copy(HepRepTypeTree * typeTree, HepRepSelectFilter * filter = NULL) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPINSTANCETREE_H */
@@ -7,15 +7,15 @@
#ifndef HEPREP_HEPREPITERATOR_H
#define HEPREP_HEPREPITERATOR_H 1
// Copyright 2000-2002, FreeHEP.
// Copyright 2000-2004, FreeHEP.
#include <string>
namespace HEPREP {
class HepRepAttValue;
class HepRepAttributeListener;
class HepRepFrameListener;
class HepRepInstance;
class HepRepIteratorListener;
/**
* HepRepIterator interface.
@@ -47,22 +47,41 @@ public:
*
* @param listener to be added.
*/
virtual bool addHepRepIteratorListener(HepRepIteratorListener * listener) = 0;
virtual void addHepRepAttributeListener(std::string name, HepRepAttributeListener * listener) = 0;
/**
* Removes a listener.
*
* @param listener to be removed.
*/
virtual void removeHepRepIteratorListener(HepRepIteratorListener * listener) = 0;
virtual void removeHepRepAttributeListener(std::string name, HepRepAttributeListener * listener) = 0;
/**
* Adds a listener to be informed about attribute changes while iterating.
*
* @param listener to be added.
*/
virtual void addHepRepFrameListener(HepRepFrameListener * listener) = 0;
/**
* Removes a listener.
*
* @param listener to be removed.
*/
virtual void removeHepRepFrameListener(HepRepFrameListener * listener) = 0;
/**
* Returns true if the current instance, just delivered by nextInstance(), is to be drawn as a frame.
*/
virtual bool drawAsFrame() = 0;
/**
* Returns the attValue for key at the current point of iteration.
*
* @param key name of tye attribute to be looked up.
* @param key name of the attribute to be looked up.
* @return value associated to name at this point in the iteration.
*/
virtual HepRepAttValue * getAttValue(std::string key) = 0;
// HepRepAttValue* getAttValue(String key);
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPITERATOR_H */
@@ -7,7 +7,7 @@
#ifndef HEPREP_HEPREPTREEID_H
#define HEPREP_HEPREPTREEID_H 1
// Copyright 2000-2002, FreeHEP.
// Copyright 2000-2003, FreeHEP.
#include <string>
@@ -56,8 +56,9 @@ public:
* Returns a deep copy of this treeID.
*
* @return copy of this treeID.
* @throws CloneNotSupportedException if copying is not possible.
*/
virtual HepRepTreeID * copy() = 0;
// HepRepTreeID* copy() throws CloneNotSupportedException;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPTREEID_H */
@@ -7,17 +7,15 @@
#ifndef HEPREP_HEPREPTYPE_H
#define HEPREP_HEPREPTYPE_H 1
// Copyright 2000-2002, FreeHEP.
// Copyright 2000-2003, FreeHEP.
#include <set>
#include <string>
#include <vector>
#include "HEPREP/HepRepDefinition.h"
namespace HEPREP {
class HepRep;
/**
* HepRepType interface.
*
@@ -33,9 +31,8 @@ public:
* Adds a sub-type to this type.
*
* @param type sub-type to be added.
* @return false only if written directly to a stream.
*/
virtual bool addType(HepRepType * type) = 0;
virtual void addType(HepRepType * type) = 0;
/**
* Returns the name of this type.
@@ -65,6 +62,13 @@ public:
*/
virtual std::string getDescription() = 0;
/**
* Sets the description of this type.
*
* @param infoURL
*/
virtual void setDescription(std::string description) = 0;
/**
* Returns the information URL of this type.
*
@@ -72,6 +76,13 @@ public:
*/
virtual std::string getInfoURL() = 0;
/**
* Sets the information URL of this type.
*
* @param infoURL
*/
virtual void setInfoURL(std::string infoURL) = 0;
/**
* Returns the parent of this type.
*
@@ -84,16 +95,15 @@ public:
*
* @return collection of HepRepTypes.
*/
virtual std::vector<HepRepType *> * getTypes() = 0;
virtual std::set<HepRepType *> getTypes() = 0;
/**
* Returns a deep copy of this type.
*
* @param heprep top-level heprep. (Not sure if this is necessary).
* @param parent to which this copy is added.
* @return copy of this type.
*/
virtual HepRepType * copy(HepRep * heprep, HepRepType * parent) = 0;
virtual HepRepType * copy(HepRepType * parent) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPTYPE_H */
@@ -9,14 +9,13 @@
// Copyright 2000-2002, FreeHEP.
#include <vector>
#include <set>
#include <string>
#include "HEPREP/HepRepTreeID.h"
namespace HEPREP {
class HepRep;
class HepRepTreeID;
class HepRepType;
/**
@@ -34,29 +33,34 @@ public:
* Adds a type to this typetree.
*
* @param type to be added.
* @return false only if written immediatelty to a stream.
*/
virtual bool addType(HepRepType * type) = 0;
virtual void addType(HepRepType * type) = 0;
/**
* Returns a collection of all types in this tree.
*
* @return collection of HepRepTypes.
*/
virtual std::vector<HepRepType *> * getTypes() = 0;
virtual std::set<HepRepType *> getTypes() = 0;
/**
* Returns type
*/
virtual HepRepType * getType(std::string fullName) = 0;
/**
* Returns a deep copy of this typetree.
*
* @param heprep top-level heprep. (Not sure if this is necessary).
* @return copy of this typetree.
*/
virtual HepRepTypeTree * copy(HepRep * heprep) = 0;
virtual HepRepTypeTree * copy() = 0;
//
// To be enable in g++ 3.0
// using HepRep::HepRepTreeID::copy;
// To be disabled in g++ 3.0
virtual HepRepTreeID * copy() = 0;
// HepRepTreeID * copy();
//
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPTYPETREE_H */
@@ -38,6 +38,15 @@ public:
/// Destructor.
virtual ~HepRepWriter() { /* nop */; }
/**
* Adds a property, to be written to the HepRep file when closed.
*
* @param key
* @param value
* @return false in case of a stream problem.
*/
virtual bool addProperty(std::string key, std::string value) = 0;
/**
* Closes the writer and its underlying stream.
*
@@ -60,7 +69,7 @@ public:
* @param layerOrder to be written.
* @return false in case of a stream problem.
*/
virtual bool write(std::vector<std::string> * layerOrder) = 0;
virtual bool write(std::vector<std::string> layerOrder) = 0;
/**
* Writes a HepRepTypeTree.