Import Geant4 5.0.0 source tree
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef DEFAULTHEPREPACTION_H
|
||||
#define DEFAULTHEPREPACTION_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "HEPREP/HepRepAction.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
class DefaultHepRepAction : public virtual HEPREP::HepRepAction {
|
||||
|
||||
private:
|
||||
std::string name;
|
||||
std::string expression;
|
||||
|
||||
public:
|
||||
DefaultHepRepAction(std::string name, std::string expression);
|
||||
~DefaultHepRepAction();
|
||||
|
||||
std::string getName();
|
||||
std::string getExpression();
|
||||
HEPREP::HepRepAction* copy();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef DEFAULTHEPREPATTDEF_H
|
||||
#define DEFAULTHEPREPATTDEF_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "HEPREP/HepRepAttDef.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
|
||||
class DefaultHepRepAttDef : public virtual HEPREP::HepRepAttDef {
|
||||
|
||||
private:
|
||||
std::string name, desc, category, extra;
|
||||
|
||||
public:
|
||||
DefaultHepRepAttDef(std::string name, std::string desc, std::string category, std::string extra);
|
||||
~DefaultHepRepAttDef();
|
||||
|
||||
HEPREP::HepRepAttDef* copy();
|
||||
std::string getName();
|
||||
std::string getLowerCaseName();
|
||||
std::string getDescription();
|
||||
std::string getCategory();
|
||||
std::string getExtra();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef DEFAULTHEPREPATTVALUE_H
|
||||
#define DEFAULTHEPREPATTVALUE_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "HEPREP/HepRepAttValue.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
|
||||
class DefaultHepRepAttValue : public virtual HEPREP::HepRepAttValue {
|
||||
|
||||
private:
|
||||
enum { LABELSTRINGS_LEN = 4 };
|
||||
std::string name;
|
||||
int type;
|
||||
|
||||
// values implemented as separate items, so that they do not take up unnecessary space for an Object
|
||||
// only ONE of these is filled
|
||||
std::string stringValue;
|
||||
long longValue;
|
||||
double doubleValue;
|
||||
bool booleanValue;
|
||||
std::vector<double> colorValue;
|
||||
|
||||
int showLabelValue;
|
||||
std::string labelStrings[LABELSTRINGS_LEN];
|
||||
|
||||
void init();
|
||||
|
||||
public:
|
||||
DefaultHepRepAttValue(std::string name, std::string value, int showLabel);
|
||||
DefaultHepRepAttValue(std::string name, long value, int showLabel);
|
||||
DefaultHepRepAttValue(std::string name, int value, int showLabel);
|
||||
DefaultHepRepAttValue(std::string name, double value, int showLabel);
|
||||
DefaultHepRepAttValue(std::string name, bool value, int showLabel);
|
||||
DefaultHepRepAttValue(std::string name, std::vector<double> value, int showLabel);
|
||||
~DefaultHepRepAttValue();
|
||||
|
||||
HEPREP::HepRepAttValue* copy();
|
||||
|
||||
std::string getName();
|
||||
std::string getLowerCaseName();
|
||||
int getType();
|
||||
std::string getTypeName();
|
||||
int showLabel();
|
||||
std::string getString();
|
||||
long getLong();
|
||||
int getInteger();
|
||||
double getDouble();
|
||||
bool getBoolean();
|
||||
std::vector<double> getColor();
|
||||
std::string getAsString();
|
||||
|
||||
std::string toShowLabel();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef DEFAULTHEPREPTREEID_H
|
||||
#define DEFAULTHEPREPTREEID_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "HEPREP/HepRepTreeID.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
|
||||
class DefaultHepRepTreeID : public virtual HEPREP::HepRepTreeID {
|
||||
|
||||
private:
|
||||
std::string name;
|
||||
std::string version;
|
||||
std::string qualifier;
|
||||
|
||||
public:
|
||||
DefaultHepRepTreeID(std::string name, std::string version, std::string qualifier = "top_level");
|
||||
~DefaultHepRepTreeID();
|
||||
|
||||
std::string getQualifier();
|
||||
void setQualifier(std::string qualifier);
|
||||
std::string getName();
|
||||
std::string getVersion();
|
||||
HEPREP::HepRepTreeID* copy();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef FREEHEPTYPES_H
|
||||
#define FREEHEPTYPES_H
|
||||
|
||||
#ifdef WIN32
|
||||
// Disable warning C4786: identifier was truncated to '255' characters in the debug information
|
||||
#pragma warning ( disable : 4786 )
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
|
||||
/**
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
#ifndef G4HEPREP_HH
|
||||
#define G4HEPREP_HH 1
|
||||
|
||||
//G4
|
||||
#include "G4VGraphicsSystem.hh"
|
||||
|
||||
class G4HepRep: public G4VGraphicsSystem {
|
||||
public:
|
||||
G4HepRep ();
|
||||
virtual ~G4HepRep ();
|
||||
G4VSceneHandler* CreateSceneHandler (const G4String& name = "");
|
||||
G4VViewer* CreateViewer (G4VSceneHandler&, const G4String& name = "");
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -21,8 +21,30 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFile.hh,v 1.4 2002/02/02 04:00:12 perl Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFile.hh,v 1.5 2002/12/13 11:17:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 5th April 2001
|
||||
|
||||
@@ -21,10 +21,32 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFileSceneHandler.hh,v 1.7 2002/02/02 04:00:14 perl Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFileSceneHandler.hh,v 1.10 2002/12/13 11:17:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
//
|
||||
// Joseph Perl 27th January 2002
|
||||
// A base class for a scene handler to export geometry and trajectories
|
||||
// to the HepRep xml file format.
|
||||
@@ -73,6 +95,8 @@ public:
|
||||
void AddThis(const G4Polycone&);
|
||||
void AddThis(const G4Polyhedra&);
|
||||
void AddThis(const G4VSolid&);
|
||||
void AddThis (const G4VTrajectory&);
|
||||
void AddThis (const G4VHit&);
|
||||
// void PreAddThis(const G4Transform3D& objectTransformation,
|
||||
// const G4VisAttributes&);
|
||||
// void PostAddThis();
|
||||
@@ -122,8 +146,6 @@ protected:
|
||||
G4int fCurrentDepth; // Current depth of geom. hierarchy.
|
||||
G4VPhysicalVolume* fpCurrentPV; // Current physical volume.
|
||||
G4LogicalVolume* fpCurrentLV; // Current logical volume.
|
||||
const G4ModelingParameters* fpOriginalMP; // Keeps pointer to original.
|
||||
G4ModelingParameters* fpNonCullingMP; // For temporary non-culling.
|
||||
|
||||
private:
|
||||
HepRepXMLWriter *hepRepXMLWriter;
|
||||
|
||||
@@ -21,8 +21,30 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFileViewer.hh,v 1.5 2002/02/02 04:00:16 perl Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFileViewer.hh,v 1.6 2002/12/13 11:17:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 5th April 2001
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
|
||||
/**
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
|
||||
#ifndef G4HEPREPSCENEHANDLER_HH
|
||||
#define G4HEPREPSCENEHANDLER_HH 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "g4std/iostream"
|
||||
|
||||
// HepRep
|
||||
#include "HEPREP/HepRep.h"
|
||||
|
||||
//G4
|
||||
#include "G4VGraphicsSystem.hh"
|
||||
#include "G4VSceneHandler.hh"
|
||||
#include "G4Visible.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PhysicalVolumeModel.hh"
|
||||
|
||||
//class G4HepRep;
|
||||
|
||||
class G4HepRepSceneHandler: public G4VSceneHandler {
|
||||
|
||||
public:
|
||||
G4HepRepSceneHandler (G4VGraphicsSystem& system, const G4String& name = "");
|
||||
virtual ~G4HepRepSceneHandler ();
|
||||
|
||||
void AddThis (const G4Box&);
|
||||
void AddThis (const G4Cons&);
|
||||
void AddThis (const G4Tubs&);
|
||||
void AddThis (const G4Trd&);
|
||||
void AddThis (const G4Trap&);
|
||||
void AddThis (const G4Sphere&);
|
||||
void AddThis (const G4Para&);
|
||||
void AddThis (const G4Torus&);
|
||||
void AddThis (const G4Polycone&);
|
||||
void AddThis (const G4Polyhedra&);
|
||||
void AddThis (const G4VSolid&);
|
||||
void AddThis (const G4VTrajectory&);
|
||||
void AddThis (const G4VHit&);
|
||||
|
||||
void PreAddThis (const G4Transform3D& objectTransformation,
|
||||
const G4VisAttributes& visAttribs);
|
||||
void PostAddThis ();
|
||||
|
||||
void EstablishSpecials(G4PhysicalVolumeModel&);
|
||||
|
||||
void AddPrimitive (const G4Polyline&);
|
||||
void AddPrimitive (const G4Text&);
|
||||
void AddPrimitive (const G4Circle&);
|
||||
void AddPrimitive (const G4Square&);
|
||||
void AddPrimitive (const G4Polyhedron&);
|
||||
void AddPrimitive (const G4NURBS&);
|
||||
|
||||
void AddPrimitive (const G4Polymarker&);
|
||||
void AddPrimitive (const G4Scale& scale) {
|
||||
G4VSceneHandler::AddPrimitive(scale);
|
||||
}
|
||||
|
||||
void BeginPrimitives (const G4Transform3D& objectTransformation);
|
||||
void EndPrimitives ();
|
||||
void BeginModeling ();
|
||||
void EndModeling ();
|
||||
|
||||
static G4int GetSceneCount () { return sceneCount; }
|
||||
|
||||
HEPREP::HepRep *GetHepRep() { return heprep; }
|
||||
HEPREP::HepRepWriter *GetHepRepWriter() { return writer; }
|
||||
HEPREP::HepRepFactory *GetHepRepFactory();
|
||||
void open();
|
||||
void close();
|
||||
|
||||
protected:
|
||||
// void RequestPrimitives (const G4VSolid& solid);
|
||||
|
||||
private:
|
||||
static G4int sceneCount; // No. of extanct scenes.
|
||||
static G4int sceneIdCount; // static counter for scenes.
|
||||
G4int fileNo; // file sequence number
|
||||
G4int currentDepth;
|
||||
G4VPhysicalVolume* currentPV;
|
||||
G4LogicalVolume* currentLV;
|
||||
const G4ModelingParameters* originalMP; // Keeps pointer to original.
|
||||
G4ModelingParameters* nonCullingMP; // For temporary non-culling.
|
||||
|
||||
G4Transform3D transform;
|
||||
|
||||
void SetColour (HEPREP::HepRepAttribute *attribute, const G4Colour& color,const G4String& key = G4String("Color"));
|
||||
void SetLine (HEPREP::HepRepInstance *instance, const G4Visible& visible);
|
||||
void SetMarker (HEPREP::HepRepInstance *instance, const G4VMarker& marker);
|
||||
HEPREP::HepRepInstance* CreateInstance(HEPREP::HepRepInstance* p, HEPREP::HepRepType* altType);
|
||||
bool IsEventData ();
|
||||
|
||||
G4std::ostream* out;
|
||||
HEPREP::HepRepFactory* heprepFactory;
|
||||
HEPREP::HepRepWriter* writer;
|
||||
HEPREP::HepRepInstance *parent;
|
||||
HEPREP::HepRep *heprep;
|
||||
HEPREP::HepRepType *geometryType;
|
||||
HEPREP::HepRepType *eventType;
|
||||
HEPREP::HepRepType *trackType;
|
||||
HEPREP::HepRepType *calHitType;
|
||||
HEPREP::HepRepType *hitType;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
|
||||
/**
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
|
||||
#ifndef G4HEPREPVIEWER_HH
|
||||
#define G4HEPREPVIEWER_HH 1
|
||||
|
||||
// HepRep
|
||||
#include "HEPREP/HepRep.h"
|
||||
|
||||
// Geant4
|
||||
#include "G4VViewer.hh"
|
||||
|
||||
class G4HepRepViewer: public G4VViewer {
|
||||
public:
|
||||
G4HepRepViewer (G4VSceneHandler& scene, const G4String& name = "");
|
||||
virtual ~G4HepRepViewer ();
|
||||
void SetView ();
|
||||
void ClearView ();
|
||||
void DrawView ();
|
||||
void ShowView ();
|
||||
void FinishView ();
|
||||
|
||||
private:
|
||||
bool drawn;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,227 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREP_H
|
||||
#define HEPREP_HEPREP_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// Include all other HepRep header files here for convenience
|
||||
#include "HEPREP/HepRepAction.h"
|
||||
#include "HEPREP/HepRepAttDef.h"
|
||||
#include "HEPREP/HepRepAttribute.h"
|
||||
#include "HEPREP/HepRepAttValue.h"
|
||||
#include "HEPREP/HepRepConstants.h"
|
||||
#include "HEPREP/HepRepDefinition.h"
|
||||
#include "HEPREP/HepRepFactory.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"
|
||||
#include "HEPREP/HepRepType.h"
|
||||
#include "HEPREP/HepRepTypeTree.h"
|
||||
#include "HEPREP/HepRepWriter.h"
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
class HepRepAction;
|
||||
class HepRepInstanceTree;
|
||||
class HepRepSelectFilter;
|
||||
class HepRepType;
|
||||
class HepRepTypeTree;
|
||||
|
||||
/**
|
||||
* The HepRep interface.
|
||||
*
|
||||
* Any of these methods may throw a UnsupportedOperationException in Java.
|
||||
*
|
||||
* This interface is NOT final yet.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRep {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRep() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Add a layer to the list of layers in this heprep.
|
||||
* The layer is added to the back of the list.
|
||||
*
|
||||
* @param layer name of layer to be added to the back of the list.
|
||||
*/
|
||||
virtual bool 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;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Remove a typetree from this heprep.
|
||||
*
|
||||
* @param typeTree to be removed.
|
||||
*/
|
||||
virtual void removeTypeTree(HepRepTypeTree * typeTree) = 0;
|
||||
|
||||
/**
|
||||
* Returns the collection of all typetrees of this heprep.
|
||||
*
|
||||
* @return collection of HepRepTypeTrees.
|
||||
*/
|
||||
virtual std::vector<HepRepTypeTree *> * getTypeTrees() = 0;
|
||||
|
||||
/**
|
||||
* Returns a named and versioned typetree.
|
||||
*
|
||||
* @param name name of the typetree.
|
||||
* @param version version of the typetree.
|
||||
* @return named and versioned HepRepTypeTree.
|
||||
*/
|
||||
virtual HepRepTypeTree * getTypeTree(std::string name, std::string version) = 0;
|
||||
|
||||
/**
|
||||
* Searches for a named type in any of the typetrees.
|
||||
* The first occurrence found is returned.
|
||||
*
|
||||
* @param name name of type.
|
||||
* @return named HepRepType.
|
||||
*/
|
||||
virtual HepRepType * getType(std::string name) = 0;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Remove an instanectree from this heprep.
|
||||
*
|
||||
* @param instanceTree to be removed.
|
||||
*/
|
||||
virtual void removeInstanceTree(HepRepInstanceTree * instanceTree) = 0;
|
||||
|
||||
/**
|
||||
* Returns a collection of instancetrees.
|
||||
*
|
||||
* @return collection of HepRepInstanceTrees.
|
||||
*/
|
||||
virtual std::vector<HepRepInstanceTree *> * getInstanceTrees() = 0;
|
||||
|
||||
/**
|
||||
* Returns a named and versioned instancetree.
|
||||
* FIXME: doc is incorrect here, should only return TOP of the tree. Filling
|
||||
* in should be done by getInstances calls.
|
||||
* <p>
|
||||
* This tree needs to be added to the heprep afterwards.
|
||||
*
|
||||
* @param name name of the instancetree.
|
||||
* @param version version of the instancetree.
|
||||
* @return HepRepIntanceTree
|
||||
*/
|
||||
virtual HepRepInstanceTree * getInstanceTreeTop(std::string name, std::string version) = 0;
|
||||
|
||||
/**
|
||||
* Returns a named and versioned instancetree for a list of typenames.
|
||||
* <p>
|
||||
* This tree needs to be added to the heprep afterwards.
|
||||
*
|
||||
* @param name name of the instancetree.
|
||||
* @param version version of the instancetree.
|
||||
* @param typeNames a list of typenames for which we need instancetrees.
|
||||
* @return HepRepIntanceTree
|
||||
*/
|
||||
virtual HepRepInstanceTree * getInstances(std::string name, std::string version, std::vector<std::string> typeNames) = 0;
|
||||
|
||||
/**
|
||||
* Returns a named and versioned instancetree for a list of typenames
|
||||
* after executing some action and for specific filters.
|
||||
*
|
||||
* This tree needs to be added to the heprep afterwards.
|
||||
* <p>
|
||||
* The inversion effect of invertAtts depends on the values of
|
||||
* GetDrawAtts and GetNonDrawAtts as follows:
|
||||
* <UL>
|
||||
* <LI>GetDrawAtts GetNonDrawAtts effect of InvertAtts
|
||||
* <LI>FALSE FALSE all Attributes specified will be downloaded
|
||||
* <LI>TRUE FALSE Draw Attributes specified will be omitted, NonDraw Attributes specified will be included
|
||||
* <LI>FALSE TRUE Draw Attributes specified will be included, NonDraw Attributes specified will be omitted
|
||||
* <LI>TRUE TRUE all Attributes specified will be omitted
|
||||
* </UL>
|
||||
*
|
||||
* @param name name of the instancetree.
|
||||
* @param version version of the instancetree.
|
||||
* @param typeNames a list of typenames for which we need instancetrees.
|
||||
* @param actions execute this list of actions before returning.
|
||||
* @param getPoints include the HepRepPoints in the instance tree.
|
||||
* @param getDrawAtts include the Draw attributes in the instance tree.
|
||||
* @param getNonDrawAtts include the Non-Draw attributes in the instance tree.
|
||||
* @param invertAtts list of attributes to be included or not depending on getDrawAtts and getNonDrawAtts.
|
||||
* @return HepRepIntanceTree
|
||||
*/
|
||||
virtual HepRepInstanceTree * getInstancesAfterAction(std::string name, std::string version, std::vector<std::string> typeNames, std::vector<HepRepAction *> actions, bool getPoints, bool getDrawAtts, bool getNonDrawAtts, std::vector<std::string> invertAtts) = 0;
|
||||
|
||||
/**
|
||||
* Returns last exception thrown and clears it. Useful for implementations without
|
||||
* exception handling.
|
||||
*
|
||||
* @return last exception and clears it.
|
||||
*/
|
||||
virtual std::string checkForException() = 0;
|
||||
|
||||
/**
|
||||
* Returns a deep copy of the heprep, with all its attached trees, where
|
||||
* instances are filtered using a HepRepSelectFilter.
|
||||
*
|
||||
* @param filter to be used for filtering instances.
|
||||
* @return copy of heprep.
|
||||
*/
|
||||
virtual HepRep * copy(HepRepSelectFilter * filter = NULL) = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREP_H */
|
||||
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPACTION_H
|
||||
#define HEPREP_HEPREPACTION_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
/**
|
||||
* HepRepAction interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepAction {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepAction() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Returns name of this action.
|
||||
*
|
||||
* @return name of this action.
|
||||
*/
|
||||
virtual std::string getName() = 0;
|
||||
|
||||
/**
|
||||
* Returns expression associated with this action.
|
||||
*
|
||||
* @return expression of this action.
|
||||
*/
|
||||
virtual std::string getExpression() = 0;
|
||||
|
||||
/**
|
||||
* Returns a deep copy of this action.
|
||||
*
|
||||
* @return copy of this action.
|
||||
*/
|
||||
virtual HepRepAction * copy() = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPACTION_H */
|
||||
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPATTDEF_H
|
||||
#define HEPREP_HEPREPATTDEF_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
/**
|
||||
* HepRepAttDef interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepAttDef {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepAttDef() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Returns the mixed case name of this attdef.
|
||||
*
|
||||
* @return name.
|
||||
*/
|
||||
virtual std::string getName() = 0;
|
||||
|
||||
/**
|
||||
* Returns the lowercased name of this attdef.
|
||||
*
|
||||
* @return lowercased name.
|
||||
*/
|
||||
virtual std::string getLowerCaseName() = 0;
|
||||
|
||||
/**
|
||||
* Returns a description of this attdef.
|
||||
*
|
||||
* @return description.
|
||||
*/
|
||||
virtual std::string getDescription() = 0;
|
||||
|
||||
/**
|
||||
* Returns category of this attdef.
|
||||
*
|
||||
* @return category.
|
||||
*/
|
||||
virtual std::string getCategory() = 0;
|
||||
|
||||
/**
|
||||
* Returns any extra information of this attdef.
|
||||
*
|
||||
* @return extra info.
|
||||
*/
|
||||
virtual std::string getExtra() = 0;
|
||||
|
||||
/**
|
||||
* Returns a deep copy of this attdef.
|
||||
*
|
||||
* @return copy of this attdef.
|
||||
*/
|
||||
virtual HepRepAttDef * copy() = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPATTDEF_H */
|
||||
@@ -0,0 +1,142 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPATTVALUE_H
|
||||
#define HEPREP_HEPREPATTVALUE_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
/**
|
||||
* HepRepAttValue interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepAttValue {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepAttValue() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Returns name of the attvalue.
|
||||
*
|
||||
* @return Capitalized Name.
|
||||
*/
|
||||
virtual std::string getName() = 0;
|
||||
|
||||
/**
|
||||
* Returns lowercased name of the attvalue.
|
||||
*
|
||||
* @return Lowercased Name.
|
||||
*/
|
||||
virtual std::string getLowerCaseName() = 0;
|
||||
|
||||
/**
|
||||
* Returns type of the attvalue, defined in HepRepConstants with names TYPE_xxx.
|
||||
*
|
||||
* @return type.
|
||||
*/
|
||||
virtual int getType() = 0;
|
||||
|
||||
/**
|
||||
* Returns the Java-like name for the type of this attvalue.
|
||||
*
|
||||
* @return type name.
|
||||
*/
|
||||
virtual std::string getTypeName() = 0;
|
||||
|
||||
/**
|
||||
* Returns the flag bits for showing this attvalue as a label, defined in HepRepConstants with names SHOW_xxx.
|
||||
*
|
||||
* @return flag bits if should be shown as label.
|
||||
*/
|
||||
virtual int showLabel() = 0;
|
||||
|
||||
/**
|
||||
* Returns value as string.
|
||||
*
|
||||
* @return value as string (if type is string).
|
||||
*/
|
||||
virtual std::string getString() = 0;
|
||||
|
||||
/**
|
||||
* Returns value as string.
|
||||
*
|
||||
* @return value (of any type) in string format.
|
||||
*/
|
||||
virtual std::string getAsString() = 0;
|
||||
|
||||
/**
|
||||
* Returns value as Color.
|
||||
*
|
||||
* @return value as Color.
|
||||
*/
|
||||
virtual std::vector<double> getColor() = 0;
|
||||
|
||||
/**
|
||||
* Returns value as long.
|
||||
*
|
||||
* @return value as long.
|
||||
*/
|
||||
virtual long getLong() = 0;
|
||||
|
||||
/**
|
||||
* Returns value as int.
|
||||
*
|
||||
* @return value as integer.
|
||||
*/
|
||||
virtual int getInteger() = 0;
|
||||
|
||||
/**
|
||||
* Returns value as double.
|
||||
*
|
||||
* @return value as double.
|
||||
*/
|
||||
virtual double getDouble() = 0;
|
||||
|
||||
/**
|
||||
* Returns value as boolean.
|
||||
*
|
||||
* @return value as boolean.
|
||||
*/
|
||||
virtual bool getBoolean() = 0;
|
||||
|
||||
/**
|
||||
* Returns a deep copy of this attvalue.
|
||||
*
|
||||
* @return copy of this attvalue.
|
||||
*/
|
||||
virtual HepRepAttValue * copy() = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPATTVALUE_H */
|
||||
@@ -0,0 +1,174 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPATTRIBUTE_H
|
||||
#define HEPREP_HEPREPATTRIBUTE_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRepConstants.h"
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
class HepRepAttValue;
|
||||
|
||||
/**
|
||||
* HepRepAttribute interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepAttribute {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepAttribute() { /* nop */; }
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
|
||||
/**
|
||||
* Adds a char* attValue as a String.
|
||||
* This call is mapped to addAttValue(std::string, std::string, int); and necessary
|
||||
* because C++ converts char* into bool and would thus call addAttValue(std::string, bool, int)
|
||||
* for a call such as addAttValue("drawAs", "Cylinder", 0);
|
||||
*
|
||||
* @param key name of attValue
|
||||
* @param value value of attValue
|
||||
* @param showLabel show this as label
|
||||
* @return false if an IOException was created.
|
||||
*/
|
||||
bool addAttValue(std::string key, char* value, int showLabel = HepRepConstants::SHOW_NONE) {
|
||||
return addAttValue(key, std::string(value), showLabel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 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, int 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, double 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, bool value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
|
||||
|
||||
/**
|
||||
* Adds a Color 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::vector<double> value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
|
||||
|
||||
/**
|
||||
* Adds a Color attValue.
|
||||
*
|
||||
* @param key name of attValue
|
||||
* @param red color
|
||||
* @param green color
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* Remove the attvalue named by key.
|
||||
*
|
||||
* @param key name of the attValue to be removed.
|
||||
* @return removed HepRepAttValue, or null if not removed.
|
||||
*/
|
||||
virtual HepRepAttValue * removeAttValue(std::string key) = 0;
|
||||
|
||||
/**
|
||||
* Returns the attValue specified by name. This attValue is normally searched
|
||||
* on the node itself and then on its type, moving up the typetree.
|
||||
*
|
||||
* @param name of attribute value.
|
||||
* @return attribute value.
|
||||
*/
|
||||
virtual HepRepAttValue * getAttValue(std::string name) = 0;
|
||||
|
||||
/**
|
||||
* Returns a collection of all attribute values from this node.
|
||||
*
|
||||
* @return collection of HepRepAttValues.
|
||||
*/
|
||||
virtual std::vector<HepRepAttValue *> * getAttValuesFromNode() = 0;
|
||||
|
||||
/**
|
||||
* Returns a named attribute value from this node.
|
||||
*
|
||||
* @param lowerCaseName name in all lowercase.
|
||||
* @return corresponding HepRepAttValue.
|
||||
*/
|
||||
virtual HepRepAttValue * getAttValueFromNode(std::string lowerCaseName) = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPATTRIBUTE_H */
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPCONSTANTS_H
|
||||
#define HEPREP_HEPREPCONSTANTS_H 1
|
||||
|
||||
// Copyright 2000, FreeHEP.
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
/**
|
||||
* Constants for HepRep interfaces.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepConstants {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepConstants() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Defines constants for type
|
||||
*/
|
||||
enum { TYPE_UNKNOWN = -1, TYPE_STRING = 1, TYPE_COLOR = 2, TYPE_LONG = 10, TYPE_INT = 11, TYPE_DOUBLE = 20, TYPE_BOOLEAN = 30 };
|
||||
|
||||
/**
|
||||
* Defines constants for showLabel
|
||||
*/
|
||||
enum { SHOW_NONE = 0x0000, SHOW_NAME = 0x0001, SHOW_DESC = 0x0002, SHOW_VALUE = 0x0004, SHOW_EXTRA = 0x0008 };
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPCONSTANTS_H */
|
||||
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPDEFINITION_H
|
||||
#define HEPREP_HEPREPDEFINITION_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRepAttribute.h"
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
class HepRepAttDef;
|
||||
|
||||
/**
|
||||
* HepRepDefinition interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*
|
||||
*/
|
||||
class HepRepDefinition : virtual public HepRepAttribute {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepDefinition() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Adds an attdef.
|
||||
*
|
||||
* @param name name of the definition.
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Return a named attribute definition searched on this node and any parent nodes.
|
||||
*
|
||||
* @param name of attribute definition.
|
||||
* @return attribute definition.
|
||||
*/
|
||||
virtual HepRepAttDef * getAttDef(std::string name) = 0;
|
||||
|
||||
/**
|
||||
* Returns a collection of all attribute definitions defined on this node.
|
||||
*
|
||||
* @return collection of attributes definitions.
|
||||
*/
|
||||
virtual std::vector<HepRepAttDef *> * getAttDefsFromNode() = 0;
|
||||
|
||||
/**
|
||||
* Returns a named attribute definition defined on this node.
|
||||
*
|
||||
* @param lowerCaseName name of the attribute in lower case.
|
||||
* @return attribute definition.
|
||||
*/
|
||||
virtual HepRepAttDef * getAttDefFromNode(std::string lowerCaseName) = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPDEFINITION_H */
|
||||
@@ -0,0 +1,145 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPFACTORY_H
|
||||
#define HEPREP_HEPREPFACTORY_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
class HepRep;
|
||||
class HepRepAction;
|
||||
class HepRepInstance;
|
||||
class HepRepInstanceTree;
|
||||
class HepRepPoint;
|
||||
class HepRepTreeID;
|
||||
class HepRepType;
|
||||
class HepRepTypeTree;
|
||||
class HepRepWriter;
|
||||
|
||||
/**
|
||||
* HepRepFactory interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepFactory {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepFactory() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Creates a HepRepWriter.
|
||||
*
|
||||
* @param out output stream.
|
||||
*/
|
||||
virtual HepRepWriter * createHepRepWriter(std::ostream * out) = 0;
|
||||
|
||||
/**
|
||||
* Creates a HepRepPoint.
|
||||
*
|
||||
* @param instance to add the point to.
|
||||
* @param x x coordinate of point.
|
||||
* @param y y coordinate of point.
|
||||
* @param z z coordinate of point.
|
||||
*/
|
||||
virtual HepRepPoint * createHepRepPoint(HepRepInstance * instance, double x, double y, double z) = 0;
|
||||
|
||||
/**
|
||||
* Creates a HepRepInstance.
|
||||
*
|
||||
* @parent to add the instance to.
|
||||
* @type type the associated type.
|
||||
*/
|
||||
virtual HepRepInstance * createHepRepInstance(HepRepInstance * parent, HepRepType * type) = 0;
|
||||
|
||||
/**
|
||||
* Creates a HepRepInstance.
|
||||
*
|
||||
* @parent to add the instance to.
|
||||
* @type type the associated type.
|
||||
*/
|
||||
virtual HepRepInstance * createHepRepInstance(HepRepInstanceTree * parent, HepRepType * type) = 0;
|
||||
|
||||
/**
|
||||
* Creates a HepRepTreeID.
|
||||
*
|
||||
* @param name of the treeID.
|
||||
* @param version of the treeID.
|
||||
* @param qualifier of the treeID.
|
||||
*/
|
||||
virtual HepRepTreeID * createHepRepTreeID(std::string name, std::string version, std::string qualifier = "top-level") = 0;
|
||||
|
||||
/**
|
||||
* Creates a HepRepAction.
|
||||
*
|
||||
* @param name of the action.
|
||||
* @param expression of the action.
|
||||
*/
|
||||
virtual HepRepAction * createHepRepAction(std::string name, std::string expression) = 0;
|
||||
|
||||
/**
|
||||
* Creates a HepRepInstanceTree.
|
||||
* <p>
|
||||
* The tree needs to be added to the HepRep.
|
||||
*
|
||||
* @param name of the instancetree.
|
||||
* @param version of the instancetree.
|
||||
* @param typeTree associated typetree.
|
||||
*/
|
||||
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(HepRepType * parent, std::string name) = 0;
|
||||
|
||||
/**
|
||||
* Creates a HepRepTypeTree.
|
||||
* <p>
|
||||
* The tree needs to be added to the HepRep.
|
||||
*
|
||||
* @param treeID to name the tree being created.
|
||||
*/
|
||||
virtual HepRepTypeTree * createHepRepTypeTree(HepRepTreeID * treeID) = 0;
|
||||
|
||||
/**
|
||||
* Creates a HepRep.
|
||||
*
|
||||
*/
|
||||
virtual HepRep * createHepRep() = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPFACTORY_H */
|
||||
@@ -0,0 +1,122 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPINSTANCE_H
|
||||
#define HEPREP_HEPREPINSTANCE_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRepAttribute.h"
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
class HepRep;
|
||||
class HepRepInstanceTree;
|
||||
class HepRepPoint;
|
||||
class HepRepSelectFilter;
|
||||
class HepRepType;
|
||||
|
||||
/**
|
||||
* HepRepInstance interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepInstance : virtual public HepRepAttribute {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepInstance() { /* nop */; }
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Removes a sub-instance from this instance.
|
||||
*
|
||||
* @param instance sub-instance.
|
||||
*/
|
||||
virtual void removeInstance(HepRepInstance * instance) = 0;
|
||||
|
||||
/**
|
||||
* Returns a collection of all sub-instances this instance keeps.
|
||||
*
|
||||
* @return collection of HepRepInstances.
|
||||
*/
|
||||
virtual std::vector<HepRepInstance *> * getInstances() = 0;
|
||||
|
||||
/**
|
||||
* Returns the associated type for this instance.
|
||||
*
|
||||
* @return associated HepRepType.
|
||||
*/
|
||||
virtual HepRepType * getType() = 0;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Returns a collection of all points this instance keeps.
|
||||
*
|
||||
* @return collection of HepRepPoints.
|
||||
*/
|
||||
virtual std::vector<HepRepPoint *> * getPoints() = 0;
|
||||
|
||||
/**
|
||||
* Returns a deep copy of this instance.
|
||||
*
|
||||
* @param heprep 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;
|
||||
|
||||
/**
|
||||
* Returns a deep copy of this instance.
|
||||
*
|
||||
* @param heprep 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;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPINSTANCE_H */
|
||||
@@ -0,0 +1,112 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPINSTANCETREE_H
|
||||
#define HEPREP_HEPREPINSTANCETREE_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRepTreeID.h"
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
class HepRep;
|
||||
class HepRepInstance;
|
||||
class HepRepSelectFilter;
|
||||
class HepRepTreeID;
|
||||
|
||||
/**
|
||||
* HepRepInstanceTree interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepInstanceTree : virtual public HepRepTreeID {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepInstanceTree() { /* nop */; }
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Removes an instance from this instancetree.
|
||||
*
|
||||
* @param instance to be removed.
|
||||
*/
|
||||
virtual void removeInstance(HepRepInstance * instance) = 0;
|
||||
|
||||
/**
|
||||
* Returns a collection of instances.
|
||||
*
|
||||
* @return collection of HepRepInstances.
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
* Returns a collection of associated instance trees.
|
||||
*
|
||||
* @return collection of HepRepInstanceTrees.
|
||||
*/
|
||||
virtual std::vector<HepRepInstanceTree *> * getInstanceTrees() = 0;
|
||||
|
||||
/**
|
||||
* Returns the associated typetree.
|
||||
*
|
||||
* @return TreeID of the associated typetree.
|
||||
*/
|
||||
virtual HepRepTreeID * getTypeTree() = 0;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPINSTANCETREE_H */
|
||||
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPITERATOR_H
|
||||
#define HEPREP_HEPREPITERATOR_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
class HepRepAttValue;
|
||||
class HepRepInstance;
|
||||
class HepRepIteratorListener;
|
||||
|
||||
/**
|
||||
* HepRepIterator interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepIterator {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepIterator() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Signals if there is a next instance to iterate to.
|
||||
*
|
||||
* @return true if next() can be called.
|
||||
*/
|
||||
virtual bool hasNext() = 0;
|
||||
|
||||
/**
|
||||
* Returns next instance.
|
||||
*
|
||||
* @return next HepRepInstance.
|
||||
*/
|
||||
virtual HepRepInstance * nextInstance() = 0;
|
||||
|
||||
/**
|
||||
* Adds a listener to be informed about attribute changes while iterating.
|
||||
*
|
||||
* @param listener to be added.
|
||||
*/
|
||||
virtual void addHepRepIteratorListener(HepRepIteratorListener * listener) = 0;
|
||||
|
||||
/**
|
||||
* Removes a listener.
|
||||
*
|
||||
* @param listener to be removed.
|
||||
*/
|
||||
virtual void removeHepRepIteratorListener(HepRepIteratorListener * listener) = 0;
|
||||
|
||||
/**
|
||||
* Returns the attValue for key at the current point of iteration.
|
||||
*
|
||||
* @param key name of tye attribute to be looked up.
|
||||
* @return value associated to name at this point in the iteration.
|
||||
*/
|
||||
virtual HepRepAttValue * getAttValue(std::string key) = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPITERATOR_H */
|
||||
@@ -0,0 +1,113 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPITERATORLISTENER_H
|
||||
#define HEPREP_HEPREPITERATORLISTENER_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
/**
|
||||
* HepRepIteratorListener interface. The implementor is called back for changes
|
||||
* of attributes while using the HepRepIterator to iterate over all the HepRepInstances.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepIteratorListener {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepIteratorListener() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Called if attribute key changes its value.
|
||||
*
|
||||
* @param key name of the changed attribute.
|
||||
* @param value value of the changed attribute.
|
||||
* @param showLabel value of showLabel.
|
||||
*/
|
||||
virtual void setAttribute(std::string key, std::string value, int showLabel) = 0;
|
||||
|
||||
/**
|
||||
* Called if attribute key changes its value.
|
||||
*
|
||||
* @param key name of the changed attribute.
|
||||
* @param value value of the changed attribute.
|
||||
* @param showLabel value of showLabel.
|
||||
*/
|
||||
virtual void setAttribute(std::string key, std::vector<double> value, int showLabel) = 0;
|
||||
|
||||
/**
|
||||
* Called if attribute key changes its value.
|
||||
*
|
||||
* @param key name of the changed attribute.
|
||||
* @param value value of the changed attribute.
|
||||
* @param showLabel value of showLabel.
|
||||
*/
|
||||
virtual void setAttribute(std::string key, long value, int showLabel) = 0;
|
||||
|
||||
/**
|
||||
* Called if attribute key changes its value.
|
||||
*
|
||||
* @param key name of the changed attribute.
|
||||
* @param value value of the changed attribute.
|
||||
* @param showLabel value of showLabel.
|
||||
*/
|
||||
virtual void setAttribute(std::string key, int value, int showLabel) = 0;
|
||||
|
||||
/**
|
||||
* Called if attribute key changes its value.
|
||||
*
|
||||
* @param key name of the changed attribute.
|
||||
* @param value value of the changed attribute.
|
||||
* @param showLabel value of showLabel.
|
||||
*/
|
||||
virtual void setAttribute(std::string key, double value, int showLabel) = 0;
|
||||
|
||||
/**
|
||||
* Called if attribute key changes its value.
|
||||
*
|
||||
* @param key name of the changed attribute.
|
||||
* @param value value of the changed attribute.
|
||||
* @param showLabel value of showLabel.
|
||||
*/
|
||||
virtual void setAttribute(std::string key, bool value, int showLabel) = 0;
|
||||
|
||||
/**
|
||||
* Called if attribute key is removed from the attribute set.
|
||||
*
|
||||
* @param key name of the removed attribute.
|
||||
*/
|
||||
virtual void removeAttribute(std::string key) = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPITERATORLISTENER_H */
|
||||
@@ -0,0 +1,190 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPPOINT_H
|
||||
#define HEPREP_HEPREPPOINT_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRepAttribute.h"
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
class HepRepInstance;
|
||||
|
||||
/**
|
||||
* HepRepPoint interface. The HepRepMath class can be used to deal with the conversions.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepPoint : virtual public HepRepAttribute {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepPoint() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (0, 0, 0).
|
||||
*
|
||||
* @return dx-coordinate
|
||||
*/
|
||||
virtual double getX() = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (0, 0, 0).
|
||||
*
|
||||
* @return dy-coordinate
|
||||
*/
|
||||
virtual double getY() = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (0, 0, 0).
|
||||
*
|
||||
* @return dz-coordinate
|
||||
*/
|
||||
virtual double getZ() = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (0, 0, 0).
|
||||
*
|
||||
* @return rho = sqrt(dx2+dy2);
|
||||
*/
|
||||
virtual double getRho() = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (0, 0, 0).
|
||||
*
|
||||
* @return phi = atan2(dy, dx);
|
||||
*/
|
||||
virtual double getPhi() = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (0, 0, 0).
|
||||
*
|
||||
* @return theta = atan2(rho, dx);
|
||||
*/
|
||||
virtual double getTheta() = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (0, 0, 0).
|
||||
*
|
||||
* @return r = sqrt(dx2+dy2+dz2);
|
||||
*/
|
||||
virtual double getR() = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (0, 0, 0).
|
||||
*
|
||||
* @return eta = -0.5*clog((1.-ct)/(1.+ct)), where ct = .cos(getTheta(dx, dy, dz));
|
||||
*/
|
||||
virtual double getEta() = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
|
||||
*
|
||||
* @return dx-coordinate
|
||||
*/
|
||||
virtual double getX(double xVertex, double yVertex, double zVertex) = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
|
||||
*
|
||||
* @return dy-coordinate
|
||||
*/
|
||||
virtual double getY(double xVertex, double yVertex, double zVertex) = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
|
||||
*
|
||||
* @return dz-coordinate
|
||||
*/
|
||||
virtual double getZ(double xVertex, double yVertex, double zVertex) = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
|
||||
*
|
||||
* @return rho = sqrt(dx2+dy2);
|
||||
*/
|
||||
virtual double getRho(double xVertex, double yVertex, double zVertex) = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
|
||||
*
|
||||
* @return phi = atan2(dy, dx);
|
||||
*/
|
||||
virtual double getPhi(double xVertex, double yVertex, double zVertex) = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
|
||||
*
|
||||
* @return theta = atan2(rho, dx);
|
||||
*/
|
||||
virtual double getTheta(double xVertex, double yVertex, double zVertex) = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
|
||||
*
|
||||
* @return r = sqrt(dx2+dy2+dz2);
|
||||
*/
|
||||
virtual double getR(double xVertex, double yVertex, double zVertex) = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
|
||||
*
|
||||
* @return eta = -0.5*clog((1.-ct)/(1.+ct)), where ct = .cos(getTheta(dx, dy, dz));
|
||||
*/
|
||||
virtual double getEta(double xVertex, double yVertex, double zVertex) = 0;
|
||||
|
||||
/**
|
||||
* Returns coordinate with respect to vertex at (0, 0, 0).
|
||||
*
|
||||
* @param xyz list of three coordinates which are filled and returned.
|
||||
* If null, a new list of three coordinates is allocated.
|
||||
* @return list of 3 coordinates.
|
||||
*/
|
||||
virtual std::vector<double> * getXYZ(std::vector<double> * xyz) = 0;
|
||||
|
||||
/**
|
||||
* Returns associated instance (parent).
|
||||
*
|
||||
* @return HepRepInstance.
|
||||
*/
|
||||
virtual HepRepInstance * getInstance() = 0;
|
||||
|
||||
/**
|
||||
* Returns a deep copy of this point.
|
||||
*
|
||||
* @param parent to add the copy to.
|
||||
* @return copy of this point.
|
||||
*/
|
||||
virtual HepRepPoint * copy(HepRepInstance * parent) = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPPOINT_H */
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPSELECTFILTER_H
|
||||
#define HEPREP_HEPREPSELECTFILTER_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
class HepRepInstance;
|
||||
|
||||
/**
|
||||
* HepRepSelectFilter interface used in copying HepReps.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepSelectFilter {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepSelectFilter() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Selects if the given instance will pass.
|
||||
*
|
||||
* @param instance to be checked.
|
||||
* @return true if instance passes.
|
||||
*/
|
||||
virtual bool select(HepRepInstance * instance) = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPSELECTFILTER_H */
|
||||
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPTREEID_H
|
||||
#define HEPREP_HEPREPTREEID_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
/**
|
||||
* HepRepTreeID interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepTreeID {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepTreeID() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Returns the name of this treeID.
|
||||
*
|
||||
* @return name of treeID.
|
||||
*/
|
||||
virtual std::string getName() = 0;
|
||||
|
||||
/**
|
||||
* Returns the version of this treeID.
|
||||
*
|
||||
* @return version of treeID.
|
||||
*/
|
||||
virtual std::string getVersion() = 0;
|
||||
|
||||
/**
|
||||
* Returns the qualifier that qualifies the relation that this treeID has with what it refers to.
|
||||
*
|
||||
* @return qualifier.
|
||||
*/
|
||||
virtual std::string getQualifier() = 0;
|
||||
|
||||
/**
|
||||
* Sets the qualifier that qualifies the relation that this treeID has with what it refers to.
|
||||
*
|
||||
* @param qualifier to be set.
|
||||
*/
|
||||
virtual void setQualifier(std::string qualifier) = 0;
|
||||
|
||||
/**
|
||||
* Returns a deep copy of this treeID.
|
||||
*
|
||||
* @return copy of this treeID.
|
||||
*/
|
||||
virtual HepRepTreeID * copy() = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPTREEID_H */
|
||||
@@ -0,0 +1,107 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPTYPE_H
|
||||
#define HEPREP_HEPREPTYPE_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRepDefinition.h"
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
class HepRep;
|
||||
|
||||
/**
|
||||
* HepRepType interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepType : virtual public HepRepDefinition {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepType() { /* nop */; }
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Returns the name of this type.
|
||||
*
|
||||
* @return name of type.
|
||||
*/
|
||||
virtual std::string getName() = 0;
|
||||
|
||||
/**
|
||||
* Returns the description of this type.
|
||||
*
|
||||
* @return description of type.
|
||||
*/
|
||||
virtual std::string getDescription() = 0;
|
||||
|
||||
/**
|
||||
* Returns the information URL of this type.
|
||||
*
|
||||
* @return info URL of type.
|
||||
*/
|
||||
virtual std::string getInfoURL() = 0;
|
||||
|
||||
/**
|
||||
* Returns the parent of this type.
|
||||
*
|
||||
* @return parent of type, or null if top-level.
|
||||
*/
|
||||
virtual HepRepType * getSuperType() = 0;
|
||||
|
||||
/**
|
||||
* Returns a collection of all the sub-types of this type.
|
||||
*
|
||||
* @return collection of HepRepTypes.
|
||||
*/
|
||||
virtual std::vector<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;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPTYPE_H */
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPTYPETREE_H
|
||||
#define HEPREP_HEPREPTYPETREE_H 1
|
||||
|
||||
// Copyright 2000-2002, FreeHEP.
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRepTreeID.h"
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
class HepRep;
|
||||
class HepRepTreeID;
|
||||
class HepRepType;
|
||||
|
||||
/**
|
||||
* HepRepTypeTree interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepTypeTree : virtual public HepRepTreeID {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepTypeTree() { /* nop */; }
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Returns a collection of all types in this tree.
|
||||
*
|
||||
* @return collection of HepRepTypes.
|
||||
*/
|
||||
virtual std::vector<HepRepType *> * getTypes() = 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;
|
||||
|
||||
// To be enable in g++ 3.0
|
||||
// using HepRep::HepRepTreeID::copy;
|
||||
// To be disabled in g++ 3.0
|
||||
virtual HepRepTreeID * copy() = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPTYPETREE_H */
|
||||
@@ -0,0 +1,164 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -*- 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_HEPREPWRITER_H
|
||||
#define HEPREP_HEPREPWRITER_H 1
|
||||
|
||||
// Copyright 2002, Freehep.
|
||||
|
||||
namespace HEPREP {
|
||||
|
||||
class HepRep;
|
||||
class HepRepAction;
|
||||
class HepRepAttDef;
|
||||
class HepRepAttValue;
|
||||
class HepRepAttribute;
|
||||
class HepRepDefinition;
|
||||
class HepRepInstance;
|
||||
class HepRepInstanceTree;
|
||||
class HepRepPoint;
|
||||
class HepRepTreeID;
|
||||
class HepRepType;
|
||||
class HepRepTypeTree;
|
||||
|
||||
/**
|
||||
* HepRepWriter interface.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class HepRepWriter {
|
||||
|
||||
public:
|
||||
/// Destructor.
|
||||
virtual ~HepRepWriter() { /* nop */; }
|
||||
|
||||
/**
|
||||
* Closes the writer and its underlying stream.
|
||||
*
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool close() = 0;
|
||||
|
||||
/**
|
||||
* Writes a HepRep.
|
||||
*
|
||||
* @param heprep to be written.
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool write(HepRep * heprep) = 0;
|
||||
|
||||
/**
|
||||
* Writes a HepRepTypeTree.
|
||||
*
|
||||
* @param typeTree to be written.
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool write(HepRepTypeTree * typeTree) = 0;
|
||||
|
||||
/**
|
||||
* Writes a HepRepType.
|
||||
*
|
||||
* @param type to be written.
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool write(HepRepType * type) = 0;
|
||||
|
||||
/**
|
||||
* Writes a HepRepTreeID.
|
||||
*
|
||||
* @param treeID to be written.
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool write(HepRepTreeID * treeID) = 0;
|
||||
|
||||
/**
|
||||
* Writes a HepRepAction.
|
||||
*
|
||||
* @param action to be written.
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool write(HepRepAction * action) = 0;
|
||||
|
||||
/**
|
||||
* Writes a HepRepInstanceTree.
|
||||
*
|
||||
* @param instanceTree to be written.
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool write(HepRepInstanceTree * instanceTree) = 0;
|
||||
|
||||
/**
|
||||
* Writes a HepRepInstance.
|
||||
*
|
||||
* @param instance to be written.
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool write(HepRepInstance * instance) = 0;
|
||||
|
||||
/**
|
||||
* Writes a HepRepPoint.
|
||||
*
|
||||
* @param point to be written.
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool write(HepRepPoint * point) = 0;
|
||||
|
||||
/**
|
||||
* Writes a HepRepAttribute.
|
||||
*
|
||||
* @param attribute to be written.
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool write(HepRepAttribute * attribute) = 0;
|
||||
|
||||
/**
|
||||
* Writes a HepRepDefinition.
|
||||
*
|
||||
* @param definition to be written.
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool write(HepRepDefinition * definition) = 0;
|
||||
|
||||
/**
|
||||
* Writes a HepRepAttValue.
|
||||
*
|
||||
* @param attValue to be written.
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool write(HepRepAttValue * attValue) = 0;
|
||||
|
||||
/**
|
||||
* Writes a HepRepAttDef.
|
||||
*
|
||||
* @param attDef to be written.
|
||||
* @return false in case of a stream problem.
|
||||
*/
|
||||
virtual bool write(HepRepAttDef * attDef) = 0;
|
||||
}; // class
|
||||
}; // namespace HEPREP
|
||||
#endif /* ifndef HEPREP_HEPREPWRITER_H */
|
||||
@@ -20,9 +20,31 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
// File and Version Information:
|
||||
// $Id: HepRepXMLWriter.hh,v 1.8 2002/02/02 04:00:19 perl Exp $
|
||||
// $Id: HepRepXMLWriter.hh,v 1.9 2002/12/13 11:18:00 gunter Exp $
|
||||
//
|
||||
// Description:
|
||||
// Create a HepRep XML File (HepRep version 1).
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef INDENTPRINTWRITER_H
|
||||
#define INDENTPRINTWRITER_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* A PrintWriter that keeps track of an indentation level
|
||||
* and indents the output appropriately.
|
||||
*
|
||||
* <b>Warning:</b> Only print and println methods taking strings have been overriden,
|
||||
* print, println methods taking other arguments may not be indented properly.
|
||||
*
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class IndentPrintWriter {
|
||||
|
||||
public:
|
||||
IndentPrintWriter(std::ostream* out, int level = 0);
|
||||
virtual ~IndentPrintWriter();
|
||||
|
||||
void close();
|
||||
IndentPrintWriter& operator<< (const char *s);
|
||||
IndentPrintWriter& operator<< (std::ostream& (*pf)(std::ostream&));
|
||||
void println(std::string s);
|
||||
void print(std::string s);
|
||||
void println();
|
||||
void indent();
|
||||
void outdent();
|
||||
int getIndent();
|
||||
void setIndent(int level);
|
||||
std::string getIndentString();
|
||||
void setIndentString(std::string indentString);
|
||||
|
||||
private:
|
||||
void doIndent();
|
||||
|
||||
std::ostream* out;
|
||||
int indentLevel;
|
||||
bool indented;
|
||||
std::string indentString;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
Apart from the heprep1 files:
|
||||
|
||||
G4HepRepFile.hh
|
||||
G4HepRepFileSceneHandler.hh
|
||||
G4HepRepFileViewer.hh
|
||||
HepRepXMLWriter.hh
|
||||
|
||||
the other sources (heprep2) are copies from the FreeHEP library
|
||||
(java.freehep.org) and are maintained there.
|
||||
|
||||
The files starting with G4 are geant4 compliant, the others may not be.
|
||||
|
||||
Changes made here may be overwritten.
|
||||
|
||||
12 Nov 2002
|
||||
Mark Donszelmann
|
||||
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef STREAMERHEPREP_H
|
||||
#define STREAMERHEPREP_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRep.h"
|
||||
#include "HEPREP/HepRepSelectFilter.h"
|
||||
#include "HEPREP/HepRepWriter.h"
|
||||
#include "HEPREP/HepRepType.h"
|
||||
#include "HEPREP/HepRepTypeTree.h"
|
||||
#include "HEPREP/HepRepInstanceTree.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
class StreamerHepRep : public virtual HEPREP::HepRep {
|
||||
|
||||
private:
|
||||
std::vector<std::string> layers;
|
||||
|
||||
public:
|
||||
StreamerHepRep(HEPREP::HepRepWriter* streamer);
|
||||
~StreamerHepRep();
|
||||
|
||||
HEPREP::HepRep* copy(HEPREP::HepRepSelectFilter* filter);
|
||||
std::vector<std::string>* getLayerOrder();
|
||||
bool addLayer(std::string layer);
|
||||
bool 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);
|
||||
void removeInstanceTree(HEPREP::HepRepInstanceTree* instanceTree);
|
||||
HEPREP::HepRepInstanceTree* getInstanceTreeTop(std::string name, std::string version);
|
||||
HEPREP::HepRepInstanceTree* getInstances(std::string name, std::string version,
|
||||
std::vector<std::string> typeNames);
|
||||
HEPREP::HepRepInstanceTree* getInstancesAfterAction(
|
||||
std::string name,
|
||||
std::string version,
|
||||
std::vector<std::string> typeNames,
|
||||
std::vector<HEPREP::HepRepAction*> actions,
|
||||
bool getPoints,
|
||||
bool getDrawAtts,
|
||||
bool getNonDrawAtts,
|
||||
std::vector<std::string> invertAtts);
|
||||
std::string checkForException();
|
||||
std::vector<HEPREP::HepRepInstanceTree*>* getInstanceTrees();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef STREAMERHEPREPATTRIBUTE_H
|
||||
#define STREAMERHEPREPATTRIBUTE_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRepAttribute.h"
|
||||
#include "HEPREP/HepRepAttValue.h"
|
||||
#include "HEPREP/HepRepWriter.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
|
||||
class StreamerHepRepAttribute : public virtual HEPREP::HepRepAttribute {
|
||||
|
||||
private:
|
||||
HEPREP::HepRepWriter* streamer;
|
||||
|
||||
public:
|
||||
StreamerHepRepAttribute(HEPREP::HepRepWriter* streamer);
|
||||
~StreamerHepRepAttribute();
|
||||
|
||||
std::vector<HEPREP::HepRepAttValue*>* getAttValuesFromNode();
|
||||
bool addAttValue(HEPREP::HepRepAttValue* hepRepAttValue);
|
||||
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);
|
||||
HEPREP::HepRepAttValue* getAttValueFromNode(std::string lowerCaseName);
|
||||
HEPREP::HepRepAttValue* removeAttValue(std::string key);
|
||||
HEPREP::HepRepAttValue* getAttValue(std::string name);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef STREAMERHEPREPDEFINITION_H
|
||||
#define STREAMERHEPREPDEFINITION_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRepDefinition.h"
|
||||
#include "HEPREP/HepRepWriter.h"
|
||||
|
||||
#include "StreamerHepRepAttribute.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
class StreamerHepRepDefinition : public StreamerHepRepAttribute, public virtual HEPREP::HepRepDefinition {
|
||||
|
||||
private:
|
||||
HEPREP::HepRepWriter* streamer;
|
||||
|
||||
public:
|
||||
StreamerHepRepDefinition(HEPREP::HepRepWriter* streamer);
|
||||
~StreamerHepRepDefinition();
|
||||
|
||||
bool addAttDef(HEPREP::HepRepAttDef* hepRepAttDef);
|
||||
bool addAttDef(std::string name, std::string desc, std::string type, std::string extra);
|
||||
HEPREP::HepRepAttDef* getAttDef(std::string name);
|
||||
std::vector<HEPREP::HepRepAttDef *>* getAttDefsFromNode();
|
||||
HEPREP::HepRepAttDef* getAttDefFromNode(std::string lowerCaseName);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef STREAMERHEPREPINSTANCE_H
|
||||
#define STREAMERHEPREPINSTANCE_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRep.h"
|
||||
#include "HEPREP/HepRepSelectFilter.h"
|
||||
#include "HEPREP/HepRepInstanceTree.h"
|
||||
#include "HEPREP/HepRepInstance.h"
|
||||
#include "HEPREP/HepRepWriter.h"
|
||||
#include "HEPREP/HepRepType.h"
|
||||
#include "HEPREP/HepRepPoint.h"
|
||||
#include "HEPREP/HepRepAttValue.h"
|
||||
|
||||
#include "StreamerHepRepAttribute.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
class StreamerHepRepInstance : public StreamerHepRepAttribute, public virtual HEPREP::HepRepInstance {
|
||||
|
||||
private:
|
||||
void* parent;
|
||||
HEPREP::HepRepType* type;
|
||||
|
||||
public:
|
||||
StreamerHepRepInstance(HEPREP::HepRepWriter* streamer, HEPREP::HepRepInstance* parent, HEPREP::HepRepType* type);
|
||||
StreamerHepRepInstance(HEPREP::HepRepWriter* streamer, HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepType* type);
|
||||
~StreamerHepRepInstance();
|
||||
|
||||
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::HepRepType* getType();
|
||||
bool addPoint(HEPREP::HepRepPoint* point);
|
||||
std::vector<HEPREP::HepRepPoint *>* getPoints();
|
||||
bool addInstance(HEPREP::HepRepInstance* instance);
|
||||
void removeInstance(HEPREP::HepRepInstance* instance);
|
||||
std::vector<HEPREP::HepRepInstance *>* getInstances();
|
||||
HEPREP::HepRepAttValue* getAttValue(std::string name);
|
||||
|
||||
void *getParent() { return parent; }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef STREAMERHEPREPINSTANCETREE_H
|
||||
#define STREAMERHEPREPINSTANCETREE_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRep.h"
|
||||
#include "HEPREP/HepRepSelectFilter.h"
|
||||
#include "HEPREP/HepRepInstanceTree.h"
|
||||
#include "HEPREP/HepRepInstance.h"
|
||||
#include "HEPREP/HepRepWriter.h"
|
||||
#include "HEPREP/HepRepTreeID.h"
|
||||
|
||||
#include "DefaultHepRepTreeID.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
class StreamerHepRepInstanceTree : public DefaultHepRepTreeID, public virtual HEPREP::HepRepInstanceTree {
|
||||
|
||||
private:
|
||||
HEPREP::HepRepWriter* streamer;
|
||||
HEPREP::HepRepTreeID* typeTree;
|
||||
|
||||
public:
|
||||
StreamerHepRepInstanceTree(HEPREP::HepRepWriter* streamer, std::string name, std::string version, HEPREP::HepRepTreeID* typeTree);
|
||||
~StreamerHepRepInstanceTree();
|
||||
|
||||
HEPREP::HepRepInstanceTree* copy(HEPREP::HepRep* heprep, HEPREP::HepRepSelectFilter* filter);
|
||||
HEPREP::HepRepTreeID* copy();
|
||||
bool addInstance(HEPREP::HepRepInstance* instance);
|
||||
void removeInstance(HEPREP::HepRepInstance* instance);
|
||||
std::vector<HEPREP::HepRepInstance*>* getInstances();
|
||||
bool addInstanceTree(HEPREP::HepRepTreeID* treeID);
|
||||
HEPREP::HepRepTreeID* getTypeTree();
|
||||
std::vector<HEPREP::HepRepInstanceTree*>* getInstanceTrees();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef STREAMERHEPREPPOINT_H
|
||||
#define STREAMERHEPREPPOINT_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRepInstance.h"
|
||||
#include "HEPREP/HepRepWriter.h"
|
||||
#include "HEPREP/HepRepAttValue.h"
|
||||
#include "HEPREP/HepRepPoint.h"
|
||||
|
||||
#include "StreamerHepRepAttribute.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
class StreamerHepRepPoint : public StreamerHepRepAttribute, public virtual HEPREP::HepRepPoint {
|
||||
|
||||
private:
|
||||
HEPREP::HepRepInstance* instance;
|
||||
|
||||
protected:
|
||||
double x, y, z;
|
||||
|
||||
public:
|
||||
StreamerHepRepPoint(HEPREP::HepRepWriter* streamer, HEPREP::HepRepInstance* instance, double x, double y, double z);
|
||||
~StreamerHepRepPoint();
|
||||
|
||||
HEPREP::HepRepInstance* getInstance();
|
||||
|
||||
HEPREP::HepRepAttValue* getAttValue(std::string lowerCaseName);
|
||||
|
||||
HEPREP::HepRepPoint* copy(HEPREP::HepRepInstance* parent);
|
||||
double getX();
|
||||
double getY();
|
||||
double getZ();
|
||||
std::vector<double>* getXYZ(std::vector<double>* xyz);
|
||||
double getRho();
|
||||
double getPhi();
|
||||
double getTheta();
|
||||
double getR();
|
||||
double getEta();
|
||||
double getX(double xVertex, double yVertex, double zVertex);
|
||||
double getY(double xVertex, double yVertex, double zVertex);
|
||||
double getZ(double xVertex, double yVertex, double zVertex);
|
||||
double getRho(double xVertex, double yVertex, double zVertex);
|
||||
double getPhi(double xVertex, double yVertex, double zVertex);
|
||||
double getTheta(double xVertex, double yVertex, double zVertex);
|
||||
double getR(double xVertex, double yVertex, double zVertex);
|
||||
double getEta(double xVertex, double yVertex, double zVertex);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef STREAMERHEPREPTYPE_H
|
||||
#define STREAMERHEPREPTYPE_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRep.h"
|
||||
#include "HEPREP/HepRepType.h"
|
||||
#include "HEPREP/HepRepAttDef.h"
|
||||
#include "HEPREP/HepRepAttValue.h"
|
||||
#include "HEPREP/HepRepWriter.h"
|
||||
|
||||
#include "StreamerHepRepDefinition.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
class StreamerHepRepType : public StreamerHepRepDefinition, public virtual HEPREP::HepRepType {
|
||||
|
||||
private:
|
||||
HEPREP::HepRepType* parent;
|
||||
std::string name;
|
||||
std::string description;
|
||||
std::string infoURL;
|
||||
|
||||
public:
|
||||
StreamerHepRepType(HEPREP::HepRepWriter* streamer, HEPREP::HepRepType* parent, std::string name);
|
||||
~StreamerHepRepType();
|
||||
|
||||
HEPREP::HepRepType* getSuperType();
|
||||
HEPREP::HepRepAttDef* getAttDef(std::string name);
|
||||
HEPREP::HepRepAttValue* getAttValue(std::string name);
|
||||
HEPREP::HepRepType* copy(HEPREP::HepRep* heprep, HEPREP::HepRepType* parent);
|
||||
std::string getName();
|
||||
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();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef STREAMERHEPREPTYPETREE_H
|
||||
#define STREAMERHEPREPTYPETREE_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "HEPREP/HepRep.h"
|
||||
#include "HEPREP/HepRepTypeTree.h"
|
||||
#include "HEPREP/HepRepType.h"
|
||||
#include "HEPREP/HepRepWriter.h"
|
||||
#include "HEPREP/HepRepTreeID.h"
|
||||
|
||||
#include "DefaultHepRepTreeID.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
class StreamerHepRepTypeTree : public DefaultHepRepTreeID, public virtual HEPREP::HepRepTypeTree {
|
||||
|
||||
public:
|
||||
StreamerHepRepTypeTree(HEPREP::HepRepWriter* streamer, HEPREP::HepRepTreeID* typeTree);
|
||||
~StreamerHepRepTypeTree();
|
||||
|
||||
HEPREP::HepRepTypeTree* copy(HEPREP::HepRep* heprep);
|
||||
HEPREP::HepRepTreeID* copy();
|
||||
bool addType(HEPREP::HepRepType* type);
|
||||
std::vector<HEPREP::HepRepType* >* getTypes();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef XMLHEPREPSTREAMER_H
|
||||
#define XMLHEPREPSTREAMER_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <stack>
|
||||
|
||||
#include "HEPREP/HepRep.h"
|
||||
#include "HEPREP/HepRepFactory.h"
|
||||
#include "HEPREP/HepRepWriter.h"
|
||||
#include "HEPREP/HepRepPoint.h"
|
||||
#include "HEPREP/HepRepInstance.h"
|
||||
#include "HEPREP/HepRepInstanceTree.h"
|
||||
#include "HEPREP/HepRepTreeID.h"
|
||||
#include "HEPREP/HepRepAction.h"
|
||||
#include "HEPREP/HepRepType.h"
|
||||
#include "HEPREP/HepRepTypeTree.h"
|
||||
#include "HEPREP/HepRepAttDef.h"
|
||||
#include "HEPREP/HepRepAttValue.h"
|
||||
#include "HEPREP/HepRepAttribute.h"
|
||||
|
||||
#include "XMLWriter.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
class XMLHepRepStreamer : public XMLWriter, public virtual HEPREP::HepRepWriter {
|
||||
|
||||
private:
|
||||
std::string nameSpace;
|
||||
bool writtenLayers;
|
||||
std::stack<void *> hepreps;
|
||||
HEPREP::HepRep *heprep;
|
||||
HEPREP::HepRepTypeTree *heprepTypeTree;
|
||||
|
||||
public:
|
||||
XMLHepRepStreamer(std::ostream* out);
|
||||
~XMLHepRepStreamer();
|
||||
|
||||
bool close();
|
||||
bool write(HEPREP::HepRep* heprep);
|
||||
bool write(HEPREP::HepRepTypeTree* typeTree);
|
||||
bool write(HEPREP::HepRepType* type);
|
||||
bool write(HEPREP::HepRepTreeID* treeID);
|
||||
bool write(HEPREP::HepRepAction* action);
|
||||
bool write(HEPREP::HepRepInstanceTree* instanceTree);
|
||||
bool write(HEPREP::HepRepInstance* instance);
|
||||
bool write(HEPREP::HepRepPoint* point);
|
||||
bool write(HEPREP::HepRepAttribute* attribute);
|
||||
bool write(HEPREP::HepRepDefinition* definition);
|
||||
bool write(HEPREP::HepRepAttValue* attValue);
|
||||
bool write(HEPREP::HepRepAttDef* attDef);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef XMLHEPREPSTREAMERFACTORY_H
|
||||
#define XMLHEPREPSTREAMERFACTORY_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
#include "HEPREP/HepRep.h"
|
||||
#include "HEPREP/HepRepFactory.h"
|
||||
#include "HEPREP/HepRepWriter.h"
|
||||
#include "HEPREP/HepRepPoint.h"
|
||||
#include "HEPREP/HepRepInstance.h"
|
||||
#include "HEPREP/HepRepInstanceTree.h"
|
||||
#include "HEPREP/HepRepTreeID.h"
|
||||
#include "HEPREP/HepRepAction.h"
|
||||
#include "HEPREP/HepRepType.h"
|
||||
#include "HEPREP/HepRepTypeTree.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author M.Donszelmann
|
||||
*/
|
||||
class XMLHepRepStreamerFactory : public virtual HEPREP::HepRepFactory {
|
||||
|
||||
private:
|
||||
HEPREP::HepRepWriter* streamer;
|
||||
|
||||
public:
|
||||
XMLHepRepStreamerFactory();
|
||||
~XMLHepRepStreamerFactory();
|
||||
|
||||
// static HEPREP::HepRepFactory* create();
|
||||
HEPREP::HepRepWriter* createHepRepWriter (std::ostream* out);
|
||||
HEPREP::HepRepPoint* createHepRepPoint (HEPREP::HepRepInstance* instance,
|
||||
double x, double y, double z);
|
||||
HEPREP::HepRepInstance* createHepRepInstance (HEPREP::HepRepInstance* parent, HEPREP::HepRepType* type);
|
||||
HEPREP::HepRepInstance* createHepRepInstance (HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepType* type);
|
||||
HEPREP::HepRepTreeID* createHepRepTreeID (std::string name, std::string version, std::string qualifier = "top-level");
|
||||
HEPREP::HepRepAction* createHepRepAction (std::string name, std::string expression);
|
||||
HEPREP::HepRepInstanceTree* createHepRepInstanceTree (std::string name, std::string version,
|
||||
HEPREP::HepRepTreeID* typeTreeID);
|
||||
HEPREP::HepRepType* createHepRepType (HEPREP::HepRepType* parent, std::string name);
|
||||
HEPREP::HepRepTypeTree* createHepRepTypeTree (HEPREP::HepRepTreeID* treeID);
|
||||
HEPREP::HepRep* createHepRep ();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef XMLWRITER_H
|
||||
#define XMLWRITER_H 1
|
||||
|
||||
#include "FreeHepTypes.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <stack>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "IndentPrintWriter.h"
|
||||
|
||||
/**
|
||||
* A class that makes it easy to write XML documents.
|
||||
*
|
||||
* @author Tony Johnson
|
||||
* @author Mark Donszelmann
|
||||
*/
|
||||
class XMLWriter {
|
||||
|
||||
public:
|
||||
XMLWriter(std::ostream* out, std::string indentString = " ", std::string defaultNameSpace = "");
|
||||
virtual ~XMLWriter();
|
||||
void close();
|
||||
void openDoc(std::string version = "1.0", std::string encoding = "", bool standalone = false);
|
||||
void referToDTD(std::string name, std::string pid, std::string ref);
|
||||
void referToDTD(std::string name, std::string system);
|
||||
void closeDoc();
|
||||
void printComment(std::string comment);
|
||||
void print(std::string text);
|
||||
void println(std::string text);
|
||||
void openTag(std::string ns, std::string name);
|
||||
void openTag(std::string name);
|
||||
void closeTag();
|
||||
void printTag(std::string ns, std::string name);
|
||||
void printTag(std::string name);
|
||||
void setAttribute(std::string name, std::string value);
|
||||
void setAttribute(std::string ns, std::string name, std::string value);
|
||||
void setAttribute(std::string name, double value);
|
||||
void setAttribute(std::string ns, std::string name, double value);
|
||||
void printAttributes(int tagLength);
|
||||
std::string normalize(std::string s);
|
||||
std::string normalizeText(std::string s);
|
||||
void checkNameValid(std::string s);
|
||||
|
||||
protected:
|
||||
bool closed;
|
||||
IndentPrintWriter* writer;
|
||||
std::string defaultNameSpace;
|
||||
|
||||
private:
|
||||
std::string* dtdName;
|
||||
std::map<std::string, std::string> attributes;
|
||||
std::stack<std::string> openTags;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user