54void G4HepRepFileXMLWriter::init()
76 if (newTypeDepth > 49)
106 inType[newTypeDepth] =
true;
108 fout <<
"<heprep:type version=\"null\" name=\"" << name <<
"\">"
114#ifdef G4HEPREPFILEDEBUG
115 G4cout <<
"G4HepRepFileXMLWriter:addType No file is currently open." <<
G4endl;
129 fout <<
"<heprep:instance>" <<
G4endl;
131#ifdef G4HEPREPFILEDEBUG
132 G4cout <<
"G4HepRepFileXMLWriter:addInstance No HepRep Type is currently open" <<
G4endl;
136#ifdef G4HEPREPFILEDEBUG
137 G4cout <<
"G4HepRepFileXMLWriter:addInstance No file is currently open" <<
G4endl;
151 fout <<
"<heprep:primitive>" <<
G4endl;
153#ifdef G4HEPREPFILEDEBUG
154 G4cout <<
"G4HepRepFileXMLWriter:addPrimitive No HepRep Instance is currently open" <<
G4endl;
158#ifdef G4HEPREPFILEDEBUG
159 G4cout <<
"G4HepRepFileXMLWriter:addPrimitive No file is currently open" <<
G4endl;
178 G4double xNew = scale * ( x - center.
x());
179 G4double yNew = scale * ( y - center.
y());
180 G4double zNew = scale * ( z - center.
z());
182 fout <<
"<heprep:point x=\"" << xNew <<
"\" y=\"" << yNew <<
"\" z=\"" << zNew <<
"\">" <<
G4endl;
184#ifdef G4HEPREPFILEDEBUG
185 G4cout <<
"G4HepRepFileXMLWriter:addPoint No HepRep Primitive is currently open" <<
G4endl;
189#ifdef G4HEPREPFILEDEBUG
190 G4cout <<
"G4HepRepFileXMLWriter:addPoint No file is currently open" <<
G4endl;
203 fout <<
" <heprep:attdef extra=\"" << extra <<
"\" name=\"" << name <<
"\" type=\"" << type <<
"\"" <<
G4endl;
205 fout <<
" desc=\"" << desc <<
"\"/>" <<
G4endl;
207#ifdef G4HEPREPFILEDEBUG
208 G4cout <<
"G4HepRepFileXMLWriter:addAttDef No file is currently open" <<
G4endl;
220 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\"" <<
G4endl;
222 fout <<
" value=\"" << value <<
"\"/>" <<
G4endl;
224#ifdef G4HEPREPFILEDEBUG
225 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open" <<
G4endl;
236 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\"" <<
G4endl;
238 fout <<
" value=\"" << value <<
"\"/>" <<
G4endl;
240#ifdef G4HEPREPFILEDEBUG
241 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open" <<
G4endl;
252 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\"" <<
G4endl;
254 fout <<
" value=\"" << value <<
"\"/>" <<
G4endl;
256#ifdef G4HEPREPFILEDEBUG
257 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open" <<
G4endl;
268 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\"" <<
G4endl;
271 fout <<
" value=\"True\"/>" <<
G4endl;
273 fout <<
" value=\"False\"/>" <<
G4endl;
275#ifdef G4HEPREPFILEDEBUG
276 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open" <<
G4endl;
288 int redness = int(value1*255.);
289 int greenness = int(value2*255.);
290 int blueness = int(value3*255.);
292 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\"" <<
G4endl;
294 fout <<
" value=\"" << redness <<
"," << greenness <<
"," << blueness <<
"\"/>" <<
G4endl;
296#ifdef G4HEPREPFILEDEBUG
297 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open" <<
G4endl;
310 fout <<
"<?xml version=\"1.0\" ?>" <<
G4endl;
311 fout <<
"<heprep:heprep xmlns:heprep=\"http://www.slac.stanford.edu/~perl/heprep/\"" <<
G4endl;
312 fout <<
" xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\" xsi:schemaLocation=\"HepRep.xsd\">" <<
G4endl;
317 G4cout <<
"G4HepRepFileXMLWriter:open Unable to write to file " << fileSpec <<
G4endl;
327 fout <<
"</heprep:heprep>" <<
G4endl;
331 G4cout <<
"G4HepRepFileXMLWriter:close No file is currently open" <<
G4endl;
342void G4HepRepFileXMLWriter::endType()
346 fout <<
"</heprep:type>" <<
G4endl;
354void G4HepRepFileXMLWriter::endInstance()
360 fout <<
"</heprep:instance>" <<
G4endl;
365void G4HepRepFileXMLWriter::endPrimitive()
371 fout <<
"</heprep:primitive>" <<
G4endl;
376void G4HepRepFileXMLWriter::endPoint()
381 fout <<
"</heprep:point>" <<
G4endl;
386void G4HepRepFileXMLWriter::indent()
391 while (
inType[i] && i<12) {
G4DLLIMPORT std::ostream G4cout
void addAttValue(const char *name, const char *value)
void addPoint(double x, double y, double z)
void addType(const char *name, int newTypeDepth)
void open(const char *filespec)
void addAttDef(const char *name, const char *desc, const char *type, const char *extra)
virtual G4double getScale()
static G4HepRepMessenger * GetInstance()
virtual G4ThreeVector getCenter()