78 inPrimitives2D =
false;
79 warnedAbout3DText =
false;
80 warnedAbout2DMarkers =
false;
107 #ifdef G4HEPREPFILEDEBUG
108 G4cout <<
"G4HepRepFileSceneHandler::BeginPrimitives2D() " <<
G4endl;
110 inPrimitives2D =
true;
115 #ifdef G4HEPREPFILEDEBUG
116 G4cout <<
"G4HepRepFileSceneHandler::EndPrimitives2D() " <<
G4endl;
119 inPrimitives2D =
false;
123 #ifdef G4HEPREPFILEDEBUG
124 void G4HepRepFileSceneHandler::PrintThings() {
126 " with transformation "
135 "\n current physical volume: "
137 "\n current logical volume: "
139 "\n current depth of geometry tree: "
148 #ifdef G4HEPREPFILEDEBUG
150 "G4HepRepFileSceneHandler::AddSolid(const G4Box& box) called for "
163 AddHepRepInstance(
"Prism", NULL);
194 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
195 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
196 hepRepXMLWriter->
addPoint(vertex3.
x(), vertex3.
y(), vertex3.
z());
197 hepRepXMLWriter->
addPoint(vertex4.
x(), vertex4.
y(), vertex4.
z());
198 hepRepXMLWriter->
addPoint(vertex5.
x(), vertex5.
y(), vertex5.
z());
199 hepRepXMLWriter->
addPoint(vertex6.
x(), vertex6.
y(), vertex6.
z());
200 hepRepXMLWriter->
addPoint(vertex7.
x(), vertex7.
y(), vertex7.
z());
201 hepRepXMLWriter->
addPoint(vertex8.
x(), vertex8.
y(), vertex8.
z());
206 #ifdef G4HEPREPFILEDEBUG
208 "G4HepRepFileSceneHandler::AddSolid(const G4Cons& cons) called for "
217 G4bool linedUpWithAnAxis = (std::fabs(r.
phiX())<=.001 ||
218 std::fabs(r.
phiY())<=.001 ||
219 std::fabs(r.
phiZ())<=.001 ||
220 std::fabs(r.
phiX()-
pi)<=.001 ||
221 std::fabs(r.
phiY()-
pi)<=.001 ||
222 std::fabs(r.
phiZ()-
pi)<=.001);
242 AddHepRepInstance(
"Cylinder", NULL);
257 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
258 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
264 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
265 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
271 #ifdef G4HEPREPFILEDEBUG
273 "G4HepRepFileSceneHandler::AddSolid(const G4Tubs& tubs) called for "
282 G4bool linedUpWithAnAxis = (std::fabs(r.
phiX())<=.001 ||
283 std::fabs(r.
phiY())<=.001 ||
284 std::fabs(r.
phiZ())<=.001 ||
285 std::fabs(r.
phiX()-
pi)<=.001 ||
286 std::fabs(r.
phiY()-
pi)<=.001 ||
287 std::fabs(r.
phiZ()-
pi)<=.001);
307 AddHepRepInstance(
"Cylinder", NULL);
322 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
323 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
330 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
331 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
338 #ifdef G4HEPREPFILEDEBUG
340 "G4HepRepFileSceneHandler::AddSolid(const G4Trd& trd) called for "
353 AddHepRepInstance(
"Prism", NULL);
386 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
387 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
388 hepRepXMLWriter->
addPoint(vertex3.
x(), vertex3.
y(), vertex3.
z());
389 hepRepXMLWriter->
addPoint(vertex4.
x(), vertex4.
y(), vertex4.
z());
390 hepRepXMLWriter->
addPoint(vertex5.
x(), vertex5.
y(), vertex5.
z());
391 hepRepXMLWriter->
addPoint(vertex6.
x(), vertex6.
y(), vertex6.
z());
392 hepRepXMLWriter->
addPoint(vertex7.
x(), vertex7.
y(), vertex7.
z());
393 hepRepXMLWriter->
addPoint(vertex8.
x(), vertex8.
y(), vertex8.
z());
398 #ifdef G4HEPREPFILEDEBUG
400 "G4HepRepFileSceneHandler::AddSolid(const G4Trap& trap) called for "
410 #ifdef G4HEPREPFILEDEBUG
412 "G4HepRepFileSceneHandler::AddSolid(const G4Sphere& sphere) called for "
422 #ifdef G4HEPREPFILEDEBUG
424 "G4HepRepFileSceneHandler::AddSolid(const G4Para& para) called for "
434 #ifdef G4HEPREPFILEDEBUG
436 "G4HepRepFileSceneHandler::AddSolid(const G4Torus& torus) called for "
446 #ifdef G4HEPREPFILEDEBUG
448 "G4HepRepFileSceneHandler::AddSolid(const G4Polycone& polycone) called for "
458 #ifdef G4HEPREPFILEDEBUG
460 "G4HepRepFileSceneHandler::AddSolid(const G4Polyhedra& polyhedra) called for "
470 #ifdef G4HEPREPFILEDEBUG
472 "G4HepRepFileSceneHandler::AddSolid(const G4Solid& solid) called for "
482 #ifdef G4HEPREPFILEDEBUG
483 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(const G4VTrajectory&) " <<
G4endl;
489 (
"G4HepRepFileSceneHandler::AddCompound(const G4VTrajectory&)",
495 new std::vector<G4AttValue>;
497 new std::map<G4String,G4AttDef>;
500 std::vector<G4AttValue>::iterator iAttVal;
501 std::map<G4String,G4AttDef>::const_iterator iAttDef;
506 if (rawTrajAttValues) {
508 traj.
GetAttDefs()).Standard(trajAttValues,trajAttDefs);
510 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
511 "\nERROR found during conversion to standard trajectory attributes."
514 #ifdef G4HEPREPFILEDEBUG
516 "G4HepRepFileSceneHandler::AddCompound(traj): standardised attributes:\n"
519 delete rawTrajAttValues;
526 if (strcmp(
"Event Data",hepRepXMLWriter->
prevTypeName[0])!=0) {
527 hepRepXMLWriter->
addType(
"Event Data",0);
533 hepRepXMLWriter->
addType(
"Trajectories",1);
537 if (strcmp(
"Trajectories",previousName)!=0) {
544 if (trajAttValues && trajAttDefs) {
545 for (iAttVal = trajAttValues->begin();
546 iAttVal != trajAttValues->end(); ++iAttVal) {
547 iAttDef = trajAttDefs->find(iAttVal->GetName());
548 if (iAttDef != trajAttDefs->end()) {
551 G4String category = iAttDef->second.GetCategory();
552 if (strcmp(category,
"Draw")!=0 &&
553 strcmp(category,
"Physics")!=0 &&
554 strcmp(category,
"Association")!=0 &&
555 strcmp(category,
"PickAction")!=0)
556 category =
"Physics";
557 hepRepXMLWriter->
addAttDef(iAttVal->GetName(), iAttDef->second.GetDesc(),
558 category, iAttDef->second.GetExtra());
571 std::vector<G4AttValue>* rawPointAttValues = aTrajectoryPoint->
CreateAttValues();
572 std::vector<G4AttValue>* pointAttValues =
573 new std::vector<G4AttValue>;
574 std::map<G4String,G4AttDef>* pointAttDefs =
575 new std::map<G4String,G4AttDef>;
579 if (rawPointAttValues) {
581 aTrajectoryPoint->
GetAttDefs()).Standard(pointAttValues,pointAttDefs);
583 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
584 "\nERROR found during conversion to standard first point attributes." <<
G4endl;
588 if (pointAttValues && pointAttDefs) {
589 for (iAttVal = pointAttValues->begin();
590 iAttVal != pointAttValues->end(); ++iAttVal) {
592 pointAttDefs->find(iAttVal->GetName());
593 if (iAttDef != pointAttDefs->end()) {
596 G4String category = iAttDef->second.GetCategory();
597 if (strcmp(category,
"Draw")!=0 &&
598 strcmp(category,
"Physics")!=0 &&
599 strcmp(category,
"Association")!=0 &&
600 strcmp(category,
"PickAction")!=0)
601 category =
"Physics";
605 if (strcmp(iAttVal->GetName(),
"Aux-X")!=0 &&
606 strcmp(iAttVal->GetName(),
"Aux-Y")!=0 &&
607 strcmp(iAttVal->GetName(),
"Aux-Z")!=0 &&
608 strcmp(iAttVal->GetName(),
"Pos-X")!=0 &&
609 strcmp(iAttVal->GetName(),
"Pos-Y")!=0 &&
610 strcmp(iAttVal->GetName(),
"Pos-Z")!=0)
611 hepRepXMLWriter->
addAttDef(iAttVal->GetName(), iAttDef->second.GetDesc(),
612 category, iAttDef->second.GetExtra());
616 delete rawPointAttValues;
621 delete pointAttValues;
636 doneInitTraj =
false;
649 hepRepXMLWriter->
addType(
"Trajectory Step Points",2);
658 redness = colour.
GetRed();
666 if (redness==0. && greenness==0. && blueness==0.) {
673 if (strcmp(
"Trajectory Step Points",previousName)!=0) {
675 hepRepXMLWriter->
addAttValue(
"MarkColor", redness, greenness, blueness);
678 hepRepXMLWriter->
addAttValue(
"Visibility",visible);
693 std::vector<G4AttValue>* rawPointAttValues = aTrajectoryPoint->
CreateAttValues();
694 std::vector<G4AttValue>* pointAttValues =
695 new std::vector<G4AttValue>;
696 std::map<G4String,G4AttDef>* pointAttDefs =
697 new std::map<G4String,G4AttDef>;
701 if (rawPointAttValues) {
703 aTrajectoryPoint->
GetAttDefs()).Standard(pointAttValues,pointAttDefs);
705 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
706 "\nERROR found during conversion to standard point attributes." <<
G4endl;
710 if (pointAttValues) {
711 for (iAttVal = pointAttValues->begin();
712 iAttVal != pointAttValues->end(); ++iAttVal)
716 if (strcmp(iAttVal->GetName(),
"Aux-X")!=0 &&
717 strcmp(iAttVal->GetName(),
"Aux-Y")!=0 &&
718 strcmp(iAttVal->GetName(),
"Aux-Z")!=0 &&
719 strcmp(iAttVal->GetName(),
"Pos-X")!=0 &&
720 strcmp(iAttVal->GetName(),
"Pos-Y")!=0 &&
721 strcmp(iAttVal->GetName(),
"Pos-Z")!=0)
722 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
723 delete pointAttValues;
725 delete rawPointAttValues;
735 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
748 hepRepXMLWriter->
addType(
"Trajectory Auxiliary Points",2);
757 redness = colour.
GetRed();
765 if (redness==0. && greenness==0. && blueness==0.) {
772 if (strcmp(
"Trajectory Auxiliary Points",previousName)!=0) {
774 hepRepXMLWriter->
addAttValue(
"MarkColor", redness, greenness, blueness);
777 hepRepXMLWriter->
addAttValue(
"Visibility",visible);
792 std::vector<G4AttValue>* rawPointAttValues = aTrajectoryPoint->
CreateAttValues();
793 std::vector<G4AttValue>* pointAttValues =
794 new std::vector<G4AttValue>;
795 std::map<G4String,G4AttDef>* pointAttDefs =
796 new std::map<G4String,G4AttDef>;
800 if (rawPointAttValues) {
802 aTrajectoryPoint->
GetAttDefs()).Standard(pointAttValues,pointAttDefs);
804 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
805 "\nERROR found during conversion to standard point attributes." <<
G4endl;
809 if (pointAttValues) {
810 for (iAttVal = pointAttValues->begin();
811 iAttVal != pointAttValues->end(); ++iAttVal)
815 if (strcmp(iAttVal->GetName(),
"Aux-X")!=0 &&
816 strcmp(iAttVal->GetName(),
"Aux-Y")!=0 &&
817 strcmp(iAttVal->GetName(),
"Aux-Z")!=0 &&
818 strcmp(iAttVal->GetName(),
"Pos-X")!=0 &&
819 strcmp(iAttVal->GetName(),
"Pos-Y")!=0 &&
820 strcmp(iAttVal->GetName(),
"Pos-Z")!=0)
821 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
822 delete pointAttValues;
824 delete rawPointAttValues;
835 const std::vector<G4ThreeVector>* auxiliaries = aTrajectoryPoint->
GetAuxiliaryPoints();
836 if (0 != auxiliaries) {
837 for (
size_t iAux=0; iAux<auxiliaries->size(); ++iAux) {
840 hepRepXMLWriter->
addPoint(auxPos.
x(), auxPos.
y(), auxPos.
z());
849 #ifdef G4HEPREPFILEDEBUG
850 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(G4VHit&) " <<
G4endl;
856 new std::vector<G4AttValue>;
858 new std::map<G4String,G4AttDef>;
861 std::vector<G4AttValue>::iterator iAttVal;
862 std::map<G4String,G4AttDef>::const_iterator iAttDef;
866 if (rawHitAttValues) {
868 hit.
GetAttDefs()).Standard(hitAttValues,hitAttDefs);
870 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(hit):"
871 "\nERROR found during conversion to standard hit attributes."
874 #ifdef G4HEPREPFILEDEBUG
876 "G4HepRepFileSceneHandler::AddCompound(hit): standardised attributes:\n"
879 delete rawHitAttValues;
886 if (strcmp(
"Event Data",hepRepXMLWriter->
prevTypeName[0])!=0) {
887 hepRepXMLWriter->
addType(
"Event Data",0);
895 for (iAttVal = hitAttValues->begin();
896 iAttVal != hitAttValues->end() && !found; ++iAttVal) {
897 if (strcmp(iAttVal->GetName(),
"HitType")==0) {
898 hitType = iAttVal->GetValue();
906 hepRepXMLWriter->
addType(hitType,1);
910 if (strcmp(hitType,previousName)!=0) {
917 if (hitAttValues && hitAttDefs) {
918 for (iAttVal = hitAttValues->begin();
919 iAttVal != hitAttValues->end(); ++iAttVal) {
920 iAttDef = hitAttDefs->find(iAttVal->GetName());
921 if (iAttDef != hitAttDefs->end()) {
924 G4String category = iAttDef->second.GetCategory();
925 if (strcmp(category,
"Draw")!=0 &&
926 strcmp(category,
"Physics")!=0 &&
927 strcmp(category,
"Association")!=0 &&
928 strcmp(category,
"PickAction")!=0)
929 category =
"Physics";
930 hepRepXMLWriter->
addAttDef(iAttVal->GetName(), iAttDef->second.GetDesc(),
931 category, iAttDef->second.GetExtra());
953 std::vector<G4AttValue>::iterator iAttVal;
954 for (iAttVal = trajAttValues->begin();
955 iAttVal != trajAttValues->end(); ++iAttVal)
956 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
957 delete trajAttValues;
976 std::vector<G4AttValue>::iterator iAttVal;
977 for (iAttVal = hitAttValues->begin();
978 iAttVal != hitAttValues->end(); ++iAttVal)
979 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
993 #ifdef G4HEPREPFILEDEBUG
995 "G4HepRepFileSceneHandler::AddPrimitive(const G4Polyline& polyline) called:"
996 "\n polyline: " << polyline
1006 if (inPrimitives2D) {
1007 if (!warnedAbout2DMarkers) {
1008 G4cout <<
"HepRepFile does not currently support 2D lines." <<
G4endl;
1009 warnedAbout2DMarkers =
true;
1021 AddHepRepInstance(
"Line", polyline);
1025 for (
size_t i=0; i < polyline.size(); i++) {
1027 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
1034 #ifdef G4HEPREPFILEDEBUG
1036 "G4HepRepFileSceneHandler::AddPrimitive(const G4Polymarker& line) called"
1046 if (inPrimitives2D) {
1047 if (!warnedAbout2DMarkers) {
1048 G4cout <<
"HepRepFile does not currently support 2D lines." <<
G4endl;
1049 warnedAbout2DMarkers =
true;
1056 if (sizeType==
world)
1066 AddHepRepInstance(
"Point", line);
1073 for (
size_t i=0; i < line.size(); i++) {
1075 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
1081 #ifdef G4HEPREPFILEDEBUG
1083 "G4HepRepFileSceneHandler::AddPrimitive(const G4Text& text) called:"
1089 if (!inPrimitives2D) {
1090 if (!warnedAbout3DText) {
1091 G4cout <<
"HepRepFile does not currently support 3D text." <<
G4endl;
1092 G4cout <<
"HepRep browsers can directly display text attributes on request." <<
G4endl;
1093 G4cout <<
"See Application Developers Guide for how to attach attributes to viewable objects." <<
G4endl;
1094 warnedAbout3DText =
true;
1101 if (sizeType==
world)
1105 AddHepRepInstance(
"Text", text);
1109 hepRepXMLWriter->
addAttValue(
"FontName",
"Arial");
1110 hepRepXMLWriter->
addAttValue(
"FontStyle",
"Plain");
1112 hepRepXMLWriter->
addAttValue(
"FontHasBanner",
"TRUE");
1113 hepRepXMLWriter->
addAttValue(
"FontBannerColor",
"0,0,0");
1116 float redness = colour.
GetRed();
1117 float greenness = colour.
GetGreen();
1118 float blueness = colour.
GetBlue();
1121 if (redness==0. && greenness==0. && blueness==0.) {
1126 hepRepXMLWriter->
addAttValue(
"FontColor",redness,greenness,blueness);
1137 #ifdef G4HEPREPFILEDEBUG
1139 "G4HepRepFileSceneHandler::AddPrimitive(const G4Circle& circle) called:"
1150 if (inPrimitives2D) {
1151 if (!warnedAbout2DMarkers) {
1152 G4cout <<
"HepRepFile does not currently support 2D circles." <<
G4endl;
1153 warnedAbout2DMarkers =
true;
1160 if (sizeType==
world)
1170 AddHepRepInstance(
"Point", circle);
1178 hepRepXMLWriter->
addPoint(center.
x(), center.
y(), center.
z());
1183 #ifdef G4HEPREPFILEDEBUG
1185 "G4HepRepFileSceneHandler::AddPrimitive(const G4Square& square) called:"
1196 if (inPrimitives2D) {
1197 if (!warnedAbout2DMarkers) {
1198 G4cout <<
"HepRepFile does not currently support 2D squares." <<
G4endl;
1199 warnedAbout2DMarkers =
true;
1206 if (sizeType==
world)
1216 AddHepRepInstance(
"Point", square);
1218 hepRepXMLWriter->
addAttValue(
"MarkName",
"Square");
1224 hepRepXMLWriter->
addPoint(center.
x(), center.
y(), center.
z());
1229 #ifdef G4HEPREPFILEDEBUG
1231 "G4HepRepFileSceneHandler::AddPrimitive(const G4Polyhedron& polyhedron) called."
1250 AddHepRepInstance(
"Polygon", polyhedron);
1265 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
1266 }
while (notLastEdge);
1267 }
while (notLastFace);
1272 #ifdef G4HEPREPFILEDEBUG
1274 "G4HepRepFileSceneHandler::AddPrimitive(const G4NURBS& nurbs) called."
1278 G4cout <<
"G4HepRepFileSceneHandler::AddPrimitive G4NURBS : not implemented. " <<
G4endl;
1283 return hepRepXMLWriter;
1287 void G4HepRepFileSceneHandler::AddHepRepInstance(
const char* primName,
1289 #ifdef G4HEPREPFILEDEBUG
1291 "G4HepRepFileSceneHandler::AddHepRepInstance called."
1300 G4int currentDepth = 0;
1308 #ifdef G4HEPREPFILEDEBUG
1314 if (drawingTraj || drawingHit) {
1319 if (strcmp(
"Event Data",hepRepXMLWriter->
prevTypeName[0])!=0) {
1320 hepRepXMLWriter->
addType(
"Event Data",0);
1340 if (strcmp(
"Text",primName)==0) {
1341 hepRepXMLWriter->
addType(
"EventID",1);
1343 if (strcmp(
"Line",primName)==0) {
1344 hepRepXMLWriter->
addType(
"TransientPolylines",1);
1347 if (strcmp(hepRepXMLWriter->
prevTypeName[1],
"TransientPolylines")==0 &&
1348 strcmp(
"Square",primName)==0)
1350 hepRepXMLWriter->
addType(
"AuxiliaryPoints",2);
1353 if (strcmp(hepRepXMLWriter->
prevTypeName[1],
"TransientPolylines")==0 &&
1354 strcmp(
"Circle",primName)==0)
1356 hepRepXMLWriter->
addType(
"StepPoints",2);
1359 hepRepXMLWriter->
addType(
"Hits",1);
1370 }
else if (pCurrentPV==0) {
1371 if (strcmp(
"AxesEtc",hepRepXMLWriter->
prevTypeName[0])!=0) {
1372 hepRepXMLWriter->
addType(
"AxesEtc",0);
1378 if (strcmp(
"Text",primName)==0) {
1379 hepRepXMLWriter->
addType(
"Text",1);
1381 if (strcmp(
"Line",primName)==0) {
1382 hepRepXMLWriter->
addType(
"Polylines",1);
1385 hepRepXMLWriter->
addType(
"Points",1);
1399 if (strcmp(
"Detector Geometry",hepRepXMLWriter->
prevTypeName[0])!=0) {
1401 hepRepXMLWriter->
addType(
"Detector Geometry",0);
1410 typedef std::vector<PVNodeID>
PVPath;
1412 PVPath::const_reverse_iterator ri = ++drawnPVPath.rbegin();
1413 G4int drawnMotherDepth;
1414 if (ri != drawnPVPath.rend()) {
1416 drawnMotherDepth = ri->GetNonCulledDepth();
1420 drawnMotherDepth = -1;
1424 while (drawnMotherDepth < (currentDepth-1)) {
1425 G4String culledParentName =
"Culled parent of " + pCurrentPV->
GetName();
1427 hepRepXMLWriter->
addType(culledParentName, drawnMotherDepth+2);
1429 drawnMotherDepth ++;
1447 hepRepXMLWriter->
addAttValue(
"Region", regionName);
1453 hepRepXMLWriter->
addAttValue(
"Material", matName);
1482 redness = colour.
GetRed();
1487 if (redness==0. && greenness==0. && blueness==0.) {
1493 #ifdef G4HEPREPFILEDEBUG
1495 "G4HepRepFileSceneHandler::AddHepRepInstance using default colour."
1504 if (strcmp(primName,
"Point")==0)
1505 hepRepXMLWriter->
addAttValue(
"MarkColor",redness,greenness,blueness);
1507 hepRepXMLWriter->
addAttValue(
"LineColor",redness,greenness,blueness);
1509 hepRepXMLWriter->
addAttValue(
"Visibility",isVisible);
1513 void G4HepRepFileSceneHandler::CheckFileOpen() {
1514 #ifdef G4HEPREPFILEDEBUG
1516 "G4HepRepFileSceneHandler::CheckFileOpen called."
1520 if (!hepRepXMLWriter->
isOpen) {
1531 G4cout <<
"HepRepFile writing to " << newFileSpec <<
G4endl;
1533 hepRepXMLWriter->
open(newFileSpec);
1538 hepRepXMLWriter->
addAttDef(
"Generator",
"HepRep Data Generator",
"Physics",
"");
1539 G4String versionString = G4Version;
1540 versionString = versionString.substr(1,versionString.size()-2);
1541 versionString =
" Geant4 version " + versionString +
" " + G4Date;
1542 hepRepXMLWriter->
addAttValue(
"Generator", versionString);
1544 hepRepXMLWriter->
addAttDef(
"LVol",
"Logical Volume",
"Physics",
"");
1545 hepRepXMLWriter->
addAttDef(
"Region",
"Cuts Region",
"Physics",
"");
1546 hepRepXMLWriter->
addAttDef(
"RootRegion",
"Root Region",
"Physics",
"");
1547 hepRepXMLWriter->
addAttDef(
"Solid",
"Solid Name",
"Physics",
"");
1548 hepRepXMLWriter->
addAttDef(
"EType",
"Entity Type",
"Physics",
"");
1549 hepRepXMLWriter->
addAttDef(
"Material",
"Material Name",
"Physics",
"");
1550 hepRepXMLWriter->
addAttDef(
"Density",
"Material Density",
"Physics",
"kg/m3");
1551 hepRepXMLWriter->
addAttDef(
"State",
"Material State",
"Physics",
"");
1552 hepRepXMLWriter->
addAttDef(
"Radlen",
"Material Radiation Length",
"Physics",
"m");