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
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4HepRepMessenger.hh,v 1.3 2003/12/11 21:55:54 duns Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4HepRepMessenger.hh,v 1.5 2004/05/27 05:55:19 duns Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
#ifndef G4HepRepMessenger_HH
@@ -45,6 +45,7 @@ class G4HepRepMessenger : public G4UImessenger {
virtual G4String getEventNumberSuffix();
virtual G4bool appendGeometry();
virtual G4bool addPointAttributes();
virtual G4String getCoordinateSystem();
private:
@@ -54,10 +55,13 @@ class G4HepRepMessenger : public G4UImessenger {
G4UIcmdWithAString* setEventNumberSuffixCommand;
G4bool geometry;
// G4UIcmdWithABool* appendGeometryCommand;
G4UIcmdWithABool* appendGeometryCommand;
G4bool pointAttributes;
G4UIcmdWithABool* addPointAttributesCommand;
G4String coordinateSystem;
G4UIcmdWithAString* setCoordinateSystemCommand;
};
#endif
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4HepRepSceneHandler.hh,v 1.30 2003/12/11 21:55:55 duns Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4HepRepSceneHandler.hh,v 1.32 2004/05/27 05:55:20 duns Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
/**
@@ -127,12 +127,16 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
void open(G4String name);
void close();
void writeLayers(HEPREP::HepRep* heprep);
void addAttDefs(HEPREP::HepRepDefinition* definition, const std::map<G4String,G4AttDef>* attDefs);
void addAttVals(HEPREP::HepRepAttribute* attribute, const std::map<G4String,G4AttDef>* attDefs, std::vector<G4AttValue>* attValues);
void addTopLevelAttributes(HEPREP::HepRepType* type);
// Returns the particular instance/type or if not created, creates them and adds them to the HepRep
HEPREP::HepRep* getHepRep();
HEPREP::HepRep* getHepRepGeometry();
HEPREP::HepRepInstanceTree* getGeometryInstanceTree();
HEPREP::HepRepInstance* getGeometryInstance(G4LogicalVolume* volume, int depth);
HEPREP::HepRepInstance* getGeometryInstance(G4String volumeName, int depth);
@@ -172,6 +176,7 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
// DO NOT USE member vars directly, use get methods.
HEPREP::HepRep* _heprep;
HEPREP::HepRep* _heprepGeometry;
HEPREP::HepRepInstanceTree* _geometryInstanceTree;
std::vector<HEPREP::HepRepInstance*> _geometryInstance;
HEPREP::HepRepInstance* _geometryRootInstance;
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4HepRepViewer.hh,v 1.16 2003/12/11 21:55:55 duns Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4HepRepViewer.hh,v 1.17 2004/05/27 05:55:20 duns Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
/**
@@ -37,9 +37,11 @@
// Geant4
#include "G4VViewer.hh"
#include "G4HepRepMessenger.hh"
class G4HepRepViewer: public G4VViewer {
public:
G4HepRepViewer (G4VSceneHandler& scene, const G4String& name = "");
G4HepRepViewer (G4VSceneHandler& scene, G4HepRepMessenger& messenger, const G4String& name = "");
virtual ~G4HepRepViewer ();
void SetView ();
void ClearView ();
@@ -47,8 +49,11 @@ class G4HepRepViewer: public G4VViewer {
void ShowView ();
void FinishView ();
void reset();
private:
bool geometryIncluded;
G4HepRepMessenger& messenger;
};
#endif
@@ -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.
@@ -5,6 +5,7 @@
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepSelectFilter.h"
@@ -21,22 +22,21 @@ class DefaultHepRep : public virtual HEPREP::HepRep {
private:
std::vector<std::string> layers;
std::vector<HEPREP::HepRepTypeTree*> typeTrees;
std::vector<HEPREP::HepRepInstanceTree*> instanceTrees;
std::set<HEPREP::HepRepTypeTree*> typeTrees;
std::set<HEPREP::HepRepInstanceTree*> instanceTrees;
public:
DefaultHepRep();
~DefaultHepRep();
HEPREP::HepRep* copy(HEPREP::HepRepSelectFilter* filter);
std::vector<std::string>* getLayerOrder();
bool addLayer(std::string layer);
bool addTypeTree(HEPREP::HepRepTypeTree* typeTree);
std::vector<std::string> getLayerOrder();
void addLayer(std::string layer);
void addTypeTree(HEPREP::HepRepTypeTree* typeTree);
void removeTypeTree(HEPREP::HepRepTypeTree* typeTree);
HEPREP::HepRepTypeTree* getTypeTree(std::string name, std::string version);
std::vector<HEPREP::HepRepTypeTree*>* getTypeTrees();
HEPREP::HepRepType* getType(std::string name);
bool addInstanceTree(HEPREP::HepRepInstanceTree* instanceTree);
std::set<HEPREP::HepRepTypeTree*> getTypeTrees();
void addInstanceTree(HEPREP::HepRepInstanceTree* instanceTree);
void overlayInstanceTree(HEPREP::HepRepInstanceTree * instanceTree);
void removeInstanceTree(HEPREP::HepRepInstanceTree* instanceTree);
HEPREP::HepRepInstanceTree* getInstanceTreeTop(std::string name, std::string version);
@@ -52,7 +52,7 @@ class DefaultHepRep : public virtual HEPREP::HepRep {
bool getNonDrawAtts,
std::vector<std::string> invertAtts);
std::string checkForException();
std::vector<HEPREP::HepRepInstanceTree*>* getInstanceTrees();
std::set<HEPREP::HepRepInstanceTree*> getInstanceTrees();
};
#endif
@@ -5,6 +5,7 @@
#include <string>
#include <map>
#include <set>
#include <vector>
#include "HEPREP/HepRepAttribute.h"
@@ -20,21 +21,20 @@ class DefaultHepRepAttribute : public virtual HEPREP::HepRepAttribute {
private:
std::map<std::string, HEPREP::HepRepAttValue*> attValues;
std::vector<HEPREP::HepRepAttValue*> attList;
public:
DefaultHepRepAttribute();
~DefaultHepRepAttribute();
std::vector<HEPREP::HepRepAttValue*>* getAttValuesFromNode();
bool addAttValue(HEPREP::HepRepAttValue* hepRepAttValue);
bool addAttValue(std::string key, char *value, int showLabel);
bool addAttValue(std::string key, std::string value, int showLabel);
bool addAttValue(std::string key, int value, int showLabel);
bool addAttValue(std::string key, double value, int showLabel);
bool addAttValue(std::string key, bool value, int showLabel);
bool addAttValue(std::string key, std::vector<double> value, int showLabel);
bool addAttValue(std::string key, double red, double green, double blue, double alpha, int showLabel);
std::set<HEPREP::HepRepAttValue*> getAttValuesFromNode();
void addAttValue(HEPREP::HepRepAttValue* hepRepAttValue);
void addAttValue(std::string key, char *value, int showLabel);
void addAttValue(std::string key, std::string value, int showLabel);
void addAttValue(std::string key, int value, int showLabel);
void addAttValue(std::string key, double value, int showLabel);
void addAttValue(std::string key, bool value, int showLabel);
void addAttValue(std::string key, std::vector<double> value, int showLabel);
void addAttValue(std::string key, double red, double green, double blue, double alpha, int showLabel);
HEPREP::HepRepAttValue* getAttValueFromNode(std::string lowerCaseName);
HEPREP::HepRepAttValue* removeAttValue(std::string key);
@@ -5,6 +5,7 @@
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRepDefinition.h"
#include "HEPREP/HepRepWriter.h"
@@ -19,15 +20,14 @@ class DefaultHepRepDefinition : public DefaultHepRepAttribute, public virtual HE
private:
std::map<std::string, HEPREP::HepRepAttDef*> attDefs;
std::vector<HEPREP::HepRepAttDef*> attList;
public:
DefaultHepRepDefinition();
~DefaultHepRepDefinition();
bool addAttDef(HEPREP::HepRepAttDef* hepRepAttDef);
bool addAttDef(std::string name, std::string desc, std::string type, std::string extra);
std::vector<HEPREP::HepRepAttDef *>* getAttDefsFromNode();
void addAttDef(HEPREP::HepRepAttDef* hepRepAttDef);
void addAttDef(std::string name, std::string desc, std::string type, std::string extra);
std::set<HEPREP::HepRepAttDef *> getAttDefsFromNode();
HEPREP::HepRepAttDef* getAttDefFromNode(std::string lowerCaseName);
HEPREP::HepRepAttDef* getAttDef(std::string name) = 0;
@@ -41,6 +41,7 @@ class DefaultHepRepFactory : public virtual HEPREP::HepRepFactory {
HEPREP::HepRepInstanceTree* createHepRepInstanceTree (std::string name, std::string version,
HEPREP::HepRepTreeID* typeTreeID);
HEPREP::HepRepType* createHepRepType (HEPREP::HepRepType* parent, std::string name);
HEPREP::HepRepType* createHepRepType (HEPREP::HepRepTypeTree* parent, std::string name);
HEPREP::HepRepTypeTree* createHepRepTypeTree (HEPREP::HepRepTreeID* treeID);
HEPREP::HepRep* createHepRep ();
};
@@ -24,7 +24,7 @@
class DefaultHepRepInstance : public DefaultHepRepAttribute, public virtual HEPREP::HepRepInstance {
private:
void* parent;
HEPREP::HepRepInstance* parent;
HEPREP::HepRepType* type;
std::vector<HEPREP::HepRepPoint*> points;
std::vector<HEPREP::HepRepInstance*> instances;
@@ -35,14 +35,15 @@ class DefaultHepRepInstance : public DefaultHepRepAttribute, public virtual HEPR
~DefaultHepRepInstance();
void overlay(HEPREP::HepRepInstance * instance);
HEPREP::HepRepInstance* copy(HEPREP::HepRep* heprep, HEPREP::HepRepInstance* parent, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepInstance* copy(HEPREP::HepRep* heprep, HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepInstance* copy(HEPREP::HepRepTypeTree* typeTree, HEPREP::HepRepInstance* parent, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepInstance* copy(HEPREP::HepRepTypeTree* typeTree, HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepType* getType();
bool addPoint(HEPREP::HepRepPoint* point);
std::vector<HEPREP::HepRepPoint *>* getPoints();
bool addInstance(HEPREP::HepRepInstance* instance);
void addPoint(HEPREP::HepRepPoint* point);
std::vector<HEPREP::HepRepPoint *> getPoints();
HEPREP::HepRepInstance* getSuperInstance();
void addInstance(HEPREP::HepRepInstance* instance);
void removeInstance(HEPREP::HepRepInstance* instance);
std::vector<HEPREP::HepRepInstance *>* getInstances();
std::vector<HEPREP::HepRepInstance *> getInstances();
HEPREP::HepRepAttValue* getAttValue(std::string name);
@@ -5,6 +5,7 @@
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepSelectFilter.h"
@@ -24,21 +25,20 @@ class DefaultHepRepInstanceTree : public DefaultHepRepTreeID, public virtual HEP
private:
HEPREP::HepRepTreeID* typeTree;
std::vector<HEPREP::HepRepInstance*> instances;
std::vector<HEPREP::HepRepTreeID*> instanceTrees;
std::set<HEPREP::HepRepTreeID*> instanceTrees;
public:
DefaultHepRepInstanceTree(std::string name, std::string version, HEPREP::HepRepTreeID* typeTree);
~DefaultHepRepInstanceTree();
void overlay(HEPREP::HepRepInstanceTree * instanceTree);
HEPREP::HepRepInstanceTree* copy(HEPREP::HepRep* heprep, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepTreeID* copy();
bool addInstance(HEPREP::HepRepInstance* instance);
HEPREP::HepRepInstanceTree* copy(HEPREP::HepRepTypeTree* typeTree, HEPREP::HepRepSelectFilter* filter);
void addInstance(HEPREP::HepRepInstance* instance);
void removeInstance(HEPREP::HepRepInstance* instance);
std::vector<HEPREP::HepRepInstance*>* getInstances();
bool addInstanceTree(HEPREP::HepRepTreeID* treeID);
std::vector<HEPREP::HepRepInstance*> getInstances();
void addInstanceTree(HEPREP::HepRepTreeID* treeID);
HEPREP::HepRepTreeID* getTypeTree();
std::vector<HEPREP::HepRepTreeID*>* getInstanceTrees();
std::set<HEPREP::HepRepTreeID*> getInstanceTrees();
};
#endif
@@ -27,7 +27,6 @@ class DefaultHepRepTreeID : public virtual HEPREP::HepRepTreeID {
void setQualifier(std::string qualifier);
std::string getName();
std::string getVersion();
HEPREP::HepRepTreeID* copy();
};
#endif
@@ -5,6 +5,7 @@
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepType.h"
@@ -22,27 +23,28 @@ class DefaultHepRepType : public DefaultHepRepDefinition, public virtual HEPREP:
private:
HEPREP::HepRepType* parent;
std::vector<HEPREP::HepRepType*> types;
std::set<HEPREP::HepRepType*> types;
std::string name;
std::string description;
std::string infoURL;
public:
DefaultHepRepType(HEPREP::HepRepType* parent, std::string name);
DefaultHepRepType(HEPREP::HepRepTypeTree* parent, std::string name);
~DefaultHepRepType();
HEPREP::HepRepType* getSuperType();
HEPREP::HepRepAttDef* getAttDef(std::string name);
HEPREP::HepRepAttValue* getAttValue(std::string name);
HEPREP::HepRepType* copy(HEPREP::HepRep* heprep, HEPREP::HepRepType* parent);
HEPREP::HepRepType* copy(HEPREP::HepRepType* parent);
std::string getName();
std::string getFullName();
std::string getDescription();
void setDescription(std::string description);
std::string getInfoURL();
void setInfoURL(std::string infoURL);
bool addType(HEPREP::HepRepType* type);
std::vector<HEPREP::HepRepType*>* getTypes();
void addType(HEPREP::HepRepType* type);
std::set<HEPREP::HepRepType*> getTypes();
};
#endif
@@ -5,6 +5,7 @@
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepTypeTree.h"
@@ -21,16 +22,16 @@
class DefaultHepRepTypeTree : public DefaultHepRepTreeID, public virtual HEPREP::HepRepTypeTree {
private:
std::vector<HEPREP::HepRepType*> types;
std::set<HEPREP::HepRepType*> types;
public:
DefaultHepRepTypeTree(HEPREP::HepRepTreeID* typeTree);
~DefaultHepRepTypeTree();
HEPREP::HepRepTypeTree* copy(HEPREP::HepRep* heprep);
HEPREP::HepRepTreeID* copy();
bool addType(HEPREP::HepRepType* type);
std::vector<HEPREP::HepRepType* >* getTypes();
HEPREP::HepRepTypeTree* copy();
void addType(HEPREP::HepRepType* type);
std::set<HEPREP::HepRepType* > getTypes();
HEPREP::HepRepType* getType(std::string name);
};
#endif
@@ -4,11 +4,23 @@
#ifdef WIN32
#ifndef GNU_GCC
// Disable warning C4786: identifier was truncated to '255' characters in the debug information
#pragma warning ( disable : 4786 )
#pragma warning ( disable : 4786 )
// Disable warning C4250: inherits via dominance
#pragma warning ( disable : 4250 )
#endif
#endif
#pragma warning ( disable : 4250 )
#ifdef VC6
// FIX for KB 168440 - VC6
// Stream Operator << Cannot Handle __int64 Type
#include<iostream>
#endif
inline std::ostream& operator<<(std::ostream& os, __int64 i ) {
char buf[20];
sprintf(buf,"%I64d", i );
os << buf;
return os;
}
#endif // VC6
#endif // GNU_GCC
#endif // WIN32
#endif // FREEHEPTYPES_H
@@ -6,7 +6,9 @@
#include <iostream>
#include <string>
#include <stack>
#include <set>
#include <vector>
#include <map>
#include "zipios++/zipoutputstream.h"
#include "zipios++/gzipoutputstream.h"
@@ -38,14 +40,16 @@ class XMLHepRepWriter : public virtual HEPREP::HepRepWriter {
XMLWriter *xml;
zipios::ZipOutputStream *zip;
zipios::GZIPOutputStream *gz;
std::map<std::string, std::string> properties;
public:
XMLHepRepWriter(std::ostream* out, bool randomAccess, bool compress);
~XMLHepRepWriter();
bool addProperty(std::string key, std::string value);
bool close();
bool write(HEPREP::HepRep* heprep, std::string name);
bool write(std::vector<std::string> *layers);
bool write(std::vector<std::string> layers);
bool write(HEPREP::HepRepTypeTree* typeTree);
bool write(HEPREP::HepRepType* type);
bool write(HEPREP::HepRepTreeID* treeID);
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in HepRep-zlib.h
*/
/* @(#) $Id: HepRep-zconf.h,v 1.1 2004/02/03 19:34:43 duns Exp $ */
/* @(#) $Id: HepRep-zconf.h,v 1.2 2004/06/16 21:05:27 duns Exp $ */
#ifndef _HEPREP_ZCONF_H
#define _HEPREP_ZCONF_H
@@ -16,39 +16,43 @@
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
*/
#ifdef Z_PREFIX
# define deflateInit_ z_deflateInit_
# define deflate z_deflate
# define deflateEnd z_deflateEnd
# define inflateInit_ z_inflateInit_
# define inflate z_inflate
# define inflateEnd z_inflateEnd
# define deflateInit2_ z_deflateInit2_
# define deflateSetDictionary z_deflateSetDictionary
# define deflateCopy z_deflateCopy
# define deflateReset z_deflateReset
# define deflateParams z_deflateParams
# define inflateInit2_ z_inflateInit2_
# define inflateSetDictionary z_inflateSetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateReset z_inflateReset
# define compress z_compress
# define compress2 z_compress2
# define uncompress z_uncompress
# define adler32 z_adler32
# define crc32 z_crc32
# define get_crc_table z_get_crc_table
/* MD: changes z_ into heprep_z_ */
# define deflateInit_ heprep_z_deflateInit_
# define deflate heprep_z_deflate
# define deflateEnd heprep_z_deflateEnd
# define inflateInit_ heprep_z_inflateInit_
# define inflate heprep_z_inflate
# define inflateEnd heprep_z_inflateEnd
# define deflateInit2_ heprep_z_deflateInit2_
# define deflateSetDictionary heprep_z_deflateSetDictionary
# define deflateCopy heprep_z_deflateCopy
# define deflateReset heprep_z_deflateReset
# define deflateParams heprep_z_deflateParams
# define inflateInit2_ heprep_z_inflateInit2_
# define inflateSetDictionary heprep_z_inflateSetDictionary
# define inflateSync heprep_z_inflateSync
# define inflateSyncPoint heprep_z_inflateSyncPoint
# define inflateReset heprep_z_inflateReset
# define compress heprep_z_compress
# define compress2 heprep_z_compress2
# define uncompress heprep_z_uncompress
# define adler32 heprep_z_adler32
# define crc32 heprep_z_crc32
# define get_crc_table heprep_z_get_crc_table
# define Byte z_Byte
# define uInt z_uInt
# define uLong z_uLong
# define Bytef z_Bytef
# define charf z_charf
# define intf z_intf
# define uIntf z_uIntf
# define uLongf z_uLongf
# define voidpf z_voidpf
# define voidp z_voidp
# define Byte heprep_z_Byte
# define uInt heprep_z_uInt
# define uLong heprep_z_uLong
# define Bytef heprep_z_Bytef
# define charf heprep_z_charf
# define intf heprep_z_intf
# define uIntf heprep_z_uIntf
# define uLongf heprep_z_uLongf
# define voidpf heprep_z_voidpf
# define voidp heprep_z_voidp
/* MD: added define for lonely symbol not renamed... */
# define z_errmsg heprep_z_errmsg
#endif
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)