10#define NAMESPACE "heprep"
34#ifndef CHEPREP_NO_ZLIB
38 cerr <<
"WARNING: the .gz output stream you are creating will be a plain file," << endl;
39 cerr <<
"since compression support (ZLIB) was not compiled into the library." << endl;
40 cerr <<
"To add ZLIB support, you need to undefine CHEPREP_NO_ZLIB." << endl;
55 properties[key] = value;
63 map<string, string>::iterator i = properties.begin();
64 while (i != properties.end()) {
65 *zip << (*i).first <<
"=" << (*i).second << endl;
83 if (name.rfind(
".bheprep") == name.length()-8) {
91 xml->
setAttribute(
"xmlns", (
string)
"http://java.freehep.org/schemas/heprep/2.0");
92 xml->
setAttribute(
"xmlns",
"xsi",
"http://www.w3.org/2001/XMLSchema-instance");
93 xml->
setAttribute(
"xsi",
"schemaLocation",
"http://java.freehep.org/schemas/heprep/2.0 http://java.freehep.org/schemas/heprep/2.0/HepRep.xsd");
94 xml->
openTag(nameSpace,
"heprep");
97 for (vector<HepRepTypeTree*>::iterator i1=typeTreeSet.begin(); i1 != typeTreeSet.end(); i1++) {
101 for (vector<HepRepInstanceTree*>::iterator i2=instanceTreeSet.begin(); i2 != instanceTreeSet.end(); i2++) {
117 string layerOrder =
"";
119 for (vector<string>::iterator i=layers.begin(); i != layers.end(); i++) {
121 layerOrder.append(
", ");
123 layerOrder.append(*i);
134 xml->
openTag(nameSpace,
"typetree");
136 vector<HepRepType*> types = typeTree->
getTypeList();
137 for (vector<HepRepType*>::iterator i=types.begin(); i != types.end(); i++) {
147 xml->
openTag(nameSpace,
"type");
152 for (vector<HepRepType*>::iterator i=types.begin(); i != types.end(); i++) {
179 xml->
openTag(nameSpace,
"instancetree");
182 for (vector<HepRepTreeID*>::iterator i1=instanceTreeSet.begin(); i1 != instanceTreeSet.end(); i1++) {
187 vector<HepRepInstance*> instanceList = instanceTree->
getInstances();
188 for (vector<HepRepInstance*>::iterator i2=instanceList.begin(); i2 != instanceList.end(); i2++) {
198 xml->
openTag(nameSpace,
"instance");
201 vector<HepRepPoint*> pointList = instance->
getPoints();
202 for (vector<HepRepPoint*>::iterator i1=pointList.begin(); i1 != pointList.end(); i1++) {
206 vector<HepRepInstance*> instanceList = instance->
getInstances();
207 for (vector<HepRepInstance*>::iterator i2=instanceList.begin(); i2 != instanceList.end(); i2++) {
219 xml->
openTag(nameSpace,
"point");
232 if (layerAtt != NULL)
write(layerAtt);
235 for (set<HepRepAttValue*>::iterator i=attSet.begin(); i != attSet.end(); i++) {
243 for (set<HepRepAttDef*>::iterator i=list.begin(); i != list.end(); i++) {
250 string name = attValue->
getName();
274 xml->
printTag(nameSpace,
"attvalue");
virtual std::string getExpression()=0
virtual std::string getName()=0
virtual std::string getExtra()=0
virtual std::string getName()=0
virtual std::string getDescription()=0
virtual std::string getCategory()=0
virtual std::string getName()=0
virtual std::vector< double > getColor()=0
virtual bool getBoolean()=0
virtual std::string getString()=0
virtual int showLabel()=0
virtual int64 getLong()=0
virtual double getDouble()=0
virtual int getInteger()=0
virtual std::string getAsString()=0
virtual HepRepAttValue * getAttValueFromNode(std::string lowerCaseName)=0
virtual std::set< HepRepAttValue * > getAttValuesFromNode()=0
virtual std::set< HepRepAttDef * > getAttDefsFromNode()=0
virtual HepRepTreeID * getTypeTree()=0
virtual std::vector< HepRepInstance * > getInstances()=0
virtual std::vector< HepRepTreeID * > getInstanceTreeList()=0
virtual HepRepType * getType()=0
virtual std::vector< HepRepPoint * > getPoints()=0
virtual std::vector< HepRepInstance * > getInstances()=0
virtual std::string getQualifier()=0
virtual std::string getName()=0
virtual std::string getVersion()=0
virtual std::vector< HepRepType * > getTypeList()=0
virtual std::string getName()=0
virtual std::string getFullName()=0
virtual std::vector< HepRepType * > getTypeList()=0
virtual std::vector< HepRepInstanceTree * > getInstanceTreeList()=0
virtual std::vector< HepRepTypeTree * > getTypeTreeList()=0
virtual std::vector< std::string > getLayerOrder()=0
virtual void printTag(std::string ns, std::string name)=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
virtual void openTag(std::string ns, std::string name)=0
virtual void closeTag()=0
virtual void openDoc(std::string version="1.0", std::string encoding="", bool standalone=false)=0
virtual void closeDoc(bool force=false)=0
bool write(HEPREP::HepRep *heprep, std::string name)
XMLHepRepWriter(std::ostream *out, bool randomAccess, bool compress)
bool addProperty(std::string key, std::string value)
void putNextEntry(const std::string &name, bool compress)
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)