Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4HepRepFileXMLWriter.hh
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 //--------------------------------------------------------------------------
28 // File and Version Information:
29 // $Id: G4HepRepFileXMLWriter.hh 66373 2012-12-18 09:41:34Z gcosmo $
30 //
31 // Description:
32 // Create a HepRep XML File (HepRep version 1).
33 //
34 // Environment:
35 // Software developed for the general High Energy Physics community.
36 //
37 // Author :
38 // J. Perl Original Author
39 //
40 // Copyright Information:
41 // Copyright (C) 2001 Stanford Linear Accelerator Center
42 //------------------------------------------------------------------------
43 #ifndef G4HepRepFileXMLWriter_hh
44 #define G4HepRepFileXMLWriter_hh
45 
46 //#define G4HEPREPFILEDEBUG // Comment this out to suppress debug code.
47 
48 #include "globals.hh"
49 #include <fstream>
50 
52 {
53 public:
55 
56  void addType(const char* name, int newTypeDepth);
57  void addInstance();
58  void addPrimitive();
59  void addPoint(double x, double y, double z);
60 
61  void addAttDef(const char* name,
62  const char* desc,
63  const char* type,
64  const char* extra);
65 
66  void addAttValue(const char* name,
67  const char* value);
68 
69  void addAttValue(const char* name,
70  double value);
71 
72  void addAttValue(const char* name,
73  int value);
74 
75  void addAttValue(const char* name,
76  bool value);
77 
78  void addAttValue(const char* name,
79  double value1,
80  double value2,
81  double value3);
82 
83  void open(const char* filespec);
84  void close();
85 
86  void endTypes();
87 
88  bool isOpen;
89  int typeDepth;
90  bool inType[50];
91  bool inInstance[50];
92  char* prevTypeName[50];
93 
94 private:
95  std::ofstream fout;
96 
97  void init();
98 
100  bool inPoint;
101 
102  void endType();
103  void endInstance();
104  void endPrimitive();
105  void endPoint();
106 
107  void indent();
108 };
109 #endif
Float_t x
Definition: compare.C:6
const XML_Char * name
Definition: expat.h:151
void addPoint(double x, double y, double z)
Float_t y
Definition: compare.C:6
Double_t z
void addType(const char *name, int newTypeDepth)
const XML_Char int const XML_Char * value
Definition: expat.h:331
void addAttValue(const char *name, const char *value)
void open(const char *filespec)
void addAttDef(const char *name, const char *desc, const char *type, const char *extra)