53void G4HepRepFileXMLWriter::init()
75 if (newTypeDepth > 49)
105 inType[newTypeDepth] =
true;
107 fout <<
"<heprep:type version=\"null\" name=\"" << name <<
"\">"
113#ifdef G4HEPREPFILEDEBUG
114 G4cout <<
"G4HepRepFileXMLWriter:addType No file is currently open." <<
G4endl;
128 fout <<
"<heprep:instance>" <<
G4endl;
130#ifdef G4HEPREPFILEDEBUG
131 G4cout <<
"G4HepRepFileXMLWriter:addInstance No HepRep Type is currently open" <<
G4endl;
135#ifdef G4HEPREPFILEDEBUG
136 G4cout <<
"G4HepRepFileXMLWriter:addInstance No file is currently open" <<
G4endl;
150 fout <<
"<heprep:primitive>" <<
G4endl;
152#ifdef G4HEPREPFILEDEBUG
153 G4cout <<
"G4HepRepFileXMLWriter:addPrimitive No HepRep Instance is currently open" <<
G4endl;
157#ifdef G4HEPREPFILEDEBUG
158 G4cout <<
"G4HepRepFileXMLWriter:addPrimitive No file is currently open" <<
G4endl;
177 G4double xNew = scale * ( x - center.
x());
178 G4double yNew = scale * ( y - center.
y());
179 G4double zNew = scale * ( z - center.
z());
181 fout <<
"<heprep:point x=\"" << xNew <<
"\" y=\"" << yNew <<
"\" z=\"" << zNew <<
"\">" <<
G4endl;
183#ifdef G4HEPREPFILEDEBUG
184 G4cout <<
"G4HepRepFileXMLWriter:addPoint No HepRep Primitive is currently open" <<
G4endl;
188#ifdef G4HEPREPFILEDEBUG
189 G4cout <<
"G4HepRepFileXMLWriter:addPoint No file is currently open" <<
G4endl;
202 fout <<
" <heprep:attdef extra=\"" << extra <<
"\" name=\"" << name <<
"\" type=\"" << type <<
"\"" <<
G4endl;
204 fout <<
" desc=\"" << desc <<
"\"/>" <<
G4endl;
206#ifdef G4HEPREPFILEDEBUG
207 G4cout <<
"G4HepRepFileXMLWriter:addAttDef No file is currently open" <<
G4endl;
219 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\"" <<
G4endl;
221 fout <<
" value=\"" << value <<
"\"/>" <<
G4endl;
223#ifdef G4HEPREPFILEDEBUG
224 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open" <<
G4endl;
235 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\"" <<
G4endl;
237 fout <<
" value=\"" << value <<
"\"/>" <<
G4endl;
239#ifdef G4HEPREPFILEDEBUG
240 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open" <<
G4endl;
251 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\"" <<
G4endl;
253 fout <<
" value=\"" << value <<
"\"/>" <<
G4endl;
255#ifdef G4HEPREPFILEDEBUG
256 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open" <<
G4endl;
267 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\"" <<
G4endl;
270 fout <<
" value=\"True\"/>" <<
G4endl;
272 fout <<
" value=\"False\"/>" <<
G4endl;
274#ifdef G4HEPREPFILEDEBUG
275 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open" <<
G4endl;
287 int redness = int(value1*255.);
288 int greenness = int(value2*255.);
289 int blueness = int(value3*255.);
291 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\"" <<
G4endl;
293 fout <<
" value=\"" << redness <<
"," << greenness <<
"," << blueness <<
"\"/>" <<
G4endl;
295#ifdef G4HEPREPFILEDEBUG
296 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open" <<
G4endl;
309 fout <<
"<?xml version=\"1.0\" ?>" <<
G4endl;
310 fout <<
"<heprep:heprep xmlns:heprep=\"http://www.slac.stanford.edu/~perl/heprep/\"" <<
G4endl;
311 fout <<
" xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\" xsi:schemaLocation=\"HepRep.xsd\">" <<
G4endl;
316 G4cout <<
"G4HepRepFileXMLWriter:open Unable to write to file " << fileSpec <<
G4endl;
326 fout <<
"</heprep:heprep>" <<
G4endl;
330 G4cout <<
"G4HepRepFileXMLWriter:close No file is currently open" <<
G4endl;
341void G4HepRepFileXMLWriter::endType()
345 fout <<
"</heprep:type>" <<
G4endl;
353void G4HepRepFileXMLWriter::endInstance()
359 fout <<
"</heprep:instance>" <<
G4endl;
364void G4HepRepFileXMLWriter::endPrimitive()
370 fout <<
"</heprep:primitive>" <<
G4endl;
375void G4HepRepFileXMLWriter::endPoint()
380 fout <<
"</heprep:point>" <<
G4endl;
385void G4HepRepFileXMLWriter::indent()
390 while (
inType[i] && i<12) {
G4GLOB_DLL 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()