53void G4HepRepFileXMLWriter::init()
104 prevTypeName[newTypeDepth] =
new char[strlen(name) + 1];
107 inType[newTypeDepth] =
true;
109 fout <<
"<heprep:type version=\"null\" name=\"" << name <<
"\">"
117#ifdef G4HEPREPFILEDEBUG
118 G4cout <<
"G4HepRepFileXMLWriter:addType No file is currently open."
133 fout <<
"<heprep:instance>" <<
G4endl;
137#ifdef G4HEPREPFILEDEBUG
139 <<
"G4HepRepFileXMLWriter:addInstance No HepRep Type is currently open"
146#ifdef G4HEPREPFILEDEBUG
147 G4cout <<
"G4HepRepFileXMLWriter:addInstance No file is currently open"
162 fout <<
"<heprep:primitive>" <<
G4endl;
166#ifdef G4HEPREPFILEDEBUG
167 G4cout <<
"G4HepRepFileXMLWriter:addPrimitive No HepRep Instance is "
175#ifdef G4HEPREPFILEDEBUG
176 G4cout <<
"G4HepRepFileXMLWriter:addPrimitive No file is currently open"
196 G4double xNew = scale * (x - center.
x());
197 G4double yNew = scale * (y - center.
y());
198 G4double zNew = scale * (z - center.
z());
200 fout <<
"<heprep:point x=\"" << xNew <<
"\" y=\"" << yNew <<
"\" z=\""
201 << zNew <<
"\">" <<
G4endl;
205#ifdef G4HEPREPFILEDEBUG
206 G4cout <<
"G4HepRepFileXMLWriter:addPoint No HepRep Primitive is "
214#ifdef G4HEPREPFILEDEBUG
215 G4cout <<
"G4HepRepFileXMLWriter:addPoint No file is currently open"
222 const char* type,
const char* extra)
227 fout <<
" <heprep:attdef extra=\"" << extra <<
"\" name=\"" << name
228 <<
"\" type=\"" << type <<
"\"" <<
G4endl;
230 fout <<
" desc=\"" << desc <<
"\"/>" <<
G4endl;
234#ifdef G4HEPREPFILEDEBUG
235 G4cout <<
"G4HepRepFileXMLWriter:addAttDef No file is currently open"
247 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\""
250 fout <<
" value=\"" << value <<
"\"/>" <<
G4endl;
254#ifdef G4HEPREPFILEDEBUG
255 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open"
266 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\""
269 fout <<
" value=\"" << value <<
"\"/>" <<
G4endl;
273#ifdef G4HEPREPFILEDEBUG
274 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open"
285 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\""
288 fout <<
" value=\"" << value <<
"\"/>" <<
G4endl;
292#ifdef G4HEPREPFILEDEBUG
293 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open"
304 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\""
308 fout <<
" value=\"True\"/>" <<
G4endl;
310 fout <<
" value=\"False\"/>" <<
G4endl;
314#ifdef G4HEPREPFILEDEBUG
315 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open"
322 double value2,
double value3)
326 int redness = int(value1 * 255.);
327 int greenness = int(value2 * 255.);
328 int blueness = int(value3 * 255.);
330 fout <<
" <heprep:attvalue showLabel=\"NONE\" name=\"" << name <<
"\""
333 fout <<
" value=\"" << redness <<
"," << greenness <<
"," << blueness
338#ifdef G4HEPREPFILEDEBUG
339 G4cout <<
"G4HepRepFileXMLWriter:addAttValue No file is currently open"
354 fout <<
"<?xml version=\"1.0\" ?>" <<
G4endl;
355 fout <<
"<heprep:heprep "
356 "xmlns:heprep=\"http://www.slac.stanford.edu/~perl/heprep/\""
358 fout <<
" xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\" "
359 "xsi:schemaLocation=\"HepRep.xsd\">"
367 G4cout <<
"G4HepRepFileXMLWriter:open Unable to write to file " << fileSpec
379 fout <<
"</heprep:heprep>" <<
G4endl;
385 G4cout <<
"G4HepRepFileXMLWriter:close No file is currently open" <<
G4endl;
396void G4HepRepFileXMLWriter::endType()
400 fout <<
"</heprep:type>" <<
G4endl;
408void G4HepRepFileXMLWriter::endInstance()
414 fout <<
"</heprep:instance>" <<
G4endl;
419void G4HepRepFileXMLWriter::endPrimitive()
425 fout <<
"</heprep:primitive>" <<
G4endl;
430void G4HepRepFileXMLWriter::endPoint()
435 fout <<
"</heprep:point>" <<
G4endl;
440void G4HepRepFileXMLWriter::indent()
445 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()