MarlinTPC  1.2.0
HepRepXMLWriter.h
1 //--------------------------------------------------------------------------
2 // File and Version Information:
3 // $Id: HepRepXMLWriter.hh,v 1.5 2002/02/05 12:04:25 perl Exp $
4 //
5 // Description:
6 // Utility for the creation of HepRep XML Files (HepRep version 1).
7 //
8 // For details, see:
9 // http://www.slac.stanford.edu/~perl/HepRepXMLWriter.html
10 //
11 // Environment:
12 // Software developed for the general High Energy Physics community.
13 //
14 // Author :
15 // Joseph Perl Original Author
16 //
17 // Copyright Information:
18 // Copyright (C) 2002 Stanford Linear Accelerator Center
19 //------------------------------------------------------------------------
20 #ifndef HepRepXMLWriter_hh
21 #define HepRepXMLWriter_hh
22 
23 #include <fstream>
24 
26 {
27 public:
29 
30  void addType(const char* name, int newTypeDepth);
31  void addInstance();
32  void addPrimitive();
33  void addPoint(double x, double y, double z);
34 
35  void addAttDef(const char* name,
36  const char* desc,
37  const char* type,
38  const char* extra);
39 
40  void addAttValue(const char* name,
41  const char* value);
42 
43  void addAttValue(const char* name,
44  double value);
45 
46  void addAttValue(const char* name,
47  int value);
48 
49  void addAttValue(const char* name,
50  bool value);
51 
52  void addAttValue(const char* name,
53  double value1,
54  double value2,
55  double value3);
56 
57  void open(const char* filespec);
58  void close();
59 
60  void endTypes();
61 
62  bool isOpen;
63  int typeDepth;
64  bool inType[50];
65  bool inInstance[50];
66  char* prevTypeName[50];
67 
68 private:
69  std::ofstream fout;
70 
71  void init();
72 
73  bool inPrimitive;
74  bool inPoint;
75 
76  void endType();
77  void endInstance();
78  void endPrimitive();
79  void endPoint();
80 
81  void indent();
82 };
83 #endif
Definition: HepRepXMLWriter.h:25