/* This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
*
* MAUS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MAUS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MAUS. If not, see .
*
*/
// MAUS copyright message inserted to prevent style errors. Original copyright below
//--------------------------------------------------------------------------
// File and Version Information:
// $Id: HepRepXMLWriter.hh,v 1.5 2002/02/05 12:04:25 perl Exp $
//
// Description:
// Utility for the creation of HepRep XML Files (HepRep version 1).
//
// For details, see:
// http://www.slac.stanford.edu/~perl/HepRepXMLWriter.html
//
// Environment:
// Software developed for the general High Energy Physics community.
//
// Author :
// Joseph Perl Original Author
//
// Copyright Information:
// Copyright (C) 2002 Stanford Linear Accelerator Center
//------------------------------------------------------------------------
#ifndef HepRepXMLWriter_hh
#define HepRepXMLWriter_hh
#include
class HepRepXMLWriter {
public:
HepRepXMLWriter();
void addType(const char* name, int newTypeDepth);
void addInstance();
void addPrimitive();
void addPoint(double x, double y, double z);
void addAttDef(const char* name,
const char* desc,
const char* type,
const char* extra);
void addAttValue(const char* name,
const char* value);
void addAttValue(const char* name,
double value);
void addAttValue(const char* name,
int value);
void addAttValue(const char* name,
bool value);
void addAttValue(const char* name,
double value1,
double value2,
double value3);
void open(const char* filespec);
void close();
void endTypes();
bool isOpen;
int typeDepth;
bool inType[50];
bool inInstance[50];
char* prevTypeName[50];
private:
std::ofstream fout;
void init();
bool inPrimitive;
bool inPoint;
void endType();
void endInstance();
void endPrimitive();
void endPoint();
void indent();
};
#endif