77 inPrimitives2D =
false;
78 warnedAbout3DText =
false;
79 warnedAbout2DMarkers =
false;
111 #ifdef G4HEPREPFILEDEBUG
112 G4cout <<
"G4HepRepFileSceneHandler::BeginPrimitives2D() " <<
G4endl;
114 inPrimitives2D =
true;
119 #ifdef G4HEPREPFILEDEBUG
120 G4cout <<
"G4HepRepFileSceneHandler::EndPrimitives2D() " <<
G4endl;
123 inPrimitives2D =
false;
127 #ifdef G4HEPREPFILEDEBUG
128 void G4HepRepFileSceneHandler::PrintThings() {
130 " with transformation "
139 "\n current physical volume: "
141 "\n current logical volume: "
143 "\n current depth of geometry tree: "
152 #ifdef G4HEPREPFILEDEBUG
154 "G4HepRepFileSceneHandler::AddSolid(const G4Box& box) called for "
167 AddHepRepInstance(
"Prism", NULL);
200 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
201 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
202 hepRepXMLWriter->
addPoint(vertex3.
x(), vertex3.
y(), vertex3.
z());
203 hepRepXMLWriter->
addPoint(vertex4.
x(), vertex4.
y(), vertex4.
z());
204 hepRepXMLWriter->
addPoint(vertex5.
x(), vertex5.
y(), vertex5.
z());
205 hepRepXMLWriter->
addPoint(vertex6.
x(), vertex6.
y(), vertex6.
z());
206 hepRepXMLWriter->
addPoint(vertex7.
x(), vertex7.
y(), vertex7.
z());
207 hepRepXMLWriter->
addPoint(vertex8.
x(), vertex8.
y(), vertex8.
z());
212 #ifdef G4HEPREPFILEDEBUG
214 "G4HepRepFileSceneHandler::AddSolid(const G4Cons& cons) called for "
223 G4bool linedUpWithAnAxis = (std::fabs(r.
phiX())<=.001 ||
224 std::fabs(r.
phiY())<=.001 ||
225 std::fabs(r.
phiZ())<=.001 ||
226 std::fabs(r.
phiX()-
pi)<=.001 ||
227 std::fabs(r.
phiY()-
pi)<=.001 ||
228 std::fabs(r.
phiZ()-
pi)<=.001);
248 AddHepRepInstance(
"Cylinder", NULL);
265 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
266 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
272 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
273 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
279 #ifdef G4HEPREPFILEDEBUG
281 "G4HepRepFileSceneHandler::AddSolid(const G4Tubs& tubs) called for "
290 G4bool linedUpWithAnAxis = (std::fabs(r.
phiX())<=.001 ||
291 std::fabs(r.
phiY())<=.001 ||
292 std::fabs(r.
phiZ())<=.001 ||
293 std::fabs(r.
phiX()-
pi)<=.001 ||
294 std::fabs(r.
phiY()-
pi)<=.001 ||
295 std::fabs(r.
phiZ()-
pi)<=.001);
315 AddHepRepInstance(
"Cylinder", NULL);
332 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
333 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
340 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
341 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
348 #ifdef G4HEPREPFILEDEBUG
350 "G4HepRepFileSceneHandler::AddSolid(const G4Trd& trd) called for "
363 AddHepRepInstance(
"Prism", NULL);
398 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
399 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
400 hepRepXMLWriter->
addPoint(vertex3.
x(), vertex3.
y(), vertex3.
z());
401 hepRepXMLWriter->
addPoint(vertex4.
x(), vertex4.
y(), vertex4.
z());
402 hepRepXMLWriter->
addPoint(vertex5.
x(), vertex5.
y(), vertex5.
z());
403 hepRepXMLWriter->
addPoint(vertex6.
x(), vertex6.
y(), vertex6.
z());
404 hepRepXMLWriter->
addPoint(vertex7.
x(), vertex7.
y(), vertex7.
z());
405 hepRepXMLWriter->
addPoint(vertex8.
x(), vertex8.
y(), vertex8.
z());
410 #ifdef G4HEPREPFILEDEBUG
412 "G4HepRepFileSceneHandler::AddSolid(const G4Trap& trap) called for "
422 #ifdef G4HEPREPFILEDEBUG
424 "G4HepRepFileSceneHandler::AddSolid(const G4Sphere& sphere) called for "
434 #ifdef G4HEPREPFILEDEBUG
436 "G4HepRepFileSceneHandler::AddSolid(const G4Para& para) called for "
446 #ifdef G4HEPREPFILEDEBUG
448 "G4HepRepFileSceneHandler::AddSolid(const G4Torus& torus) called for "
458 #ifdef G4HEPREPFILEDEBUG
460 "G4HepRepFileSceneHandler::AddSolid(const G4Polycone& polycone) called for "
470 #ifdef G4HEPREPFILEDEBUG
472 "G4HepRepFileSceneHandler::AddSolid(const G4Polyhedra& polyhedra) called for "
482 #ifdef G4HEPREPFILEDEBUG
484 "G4HepRepFileSceneHandler::AddSolid(const G4Orb& orb) called for "
494 #ifdef G4HEPREPFILEDEBUG
496 "G4HepRepFileSceneHandler::AddSolid(const G4Ellipsoid& ellipsoid) called for "
506 #ifdef G4HEPREPFILEDEBUG
508 "G4HepRepFileSceneHandler::AddSolid(const G4Solid& solid) called for "
518 #ifdef G4HEPREPFILEDEBUG
519 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(const G4VTrajectory&) " <<
G4endl;
525 (
"G4HepRepFileSceneHandler::AddCompound(const G4VTrajectory&)",
531 new std::vector<G4AttValue>;
533 new std::map<G4String,G4AttDef>;
536 std::vector<G4AttValue>::iterator iAttVal;
537 std::map<G4String,G4AttDef>::const_iterator iAttDef;
542 if (rawTrajAttValues) {
544 traj.
GetAttDefs()).Standard(trajAttValues,trajAttDefs);
546 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
547 "\nERROR found during conversion to standard trajectory attributes."
550 #ifdef G4HEPREPFILEDEBUG
552 "G4HepRepFileSceneHandler::AddCompound(traj): standardised attributes:\n"
555 delete rawTrajAttValues;
562 if (strcmp(
"Event Data",hepRepXMLWriter->
prevTypeName[0])!=0) {
563 hepRepXMLWriter->
addType(
"Event Data",0);
569 hepRepXMLWriter->
addType(
"Trajectories",1);
573 if (strcmp(
"Trajectories",previousName)!=0) {
580 if (trajAttValues && trajAttDefs) {
581 for (iAttVal = trajAttValues->begin();
582 iAttVal != trajAttValues->end(); ++iAttVal) {
583 iAttDef = trajAttDefs->find(iAttVal->GetName());
584 if (iAttDef != trajAttDefs->end()) {
587 G4String category = iAttDef->second.GetCategory();
588 if (strcmp(category,
"Draw")!=0 &&
589 strcmp(category,
"Physics")!=0 &&
590 strcmp(category,
"Association")!=0 &&
591 strcmp(category,
"PickAction")!=0)
592 category =
"Physics";
593 hepRepXMLWriter->
addAttDef(iAttVal->GetName(), iAttDef->second.GetDesc(),
594 category, iAttDef->second.GetExtra());
607 std::vector<G4AttValue>* rawPointAttValues = aTrajectoryPoint->
CreateAttValues();
608 std::vector<G4AttValue>* pointAttValues =
609 new std::vector<G4AttValue>;
610 std::map<G4String,G4AttDef>* pointAttDefs =
611 new std::map<G4String,G4AttDef>;
615 if (rawPointAttValues) {
617 aTrajectoryPoint->
GetAttDefs()).Standard(pointAttValues,pointAttDefs);
619 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
620 "\nERROR found during conversion to standard first point attributes." <<
G4endl;
624 if (pointAttValues && pointAttDefs) {
625 for (iAttVal = pointAttValues->begin();
626 iAttVal != pointAttValues->end(); ++iAttVal) {
628 pointAttDefs->find(iAttVal->GetName());
629 if (iAttDef != pointAttDefs->end()) {
632 G4String category = iAttDef->second.GetCategory();
633 if (strcmp(category,
"Draw")!=0 &&
634 strcmp(category,
"Physics")!=0 &&
635 strcmp(category,
"Association")!=0 &&
636 strcmp(category,
"PickAction")!=0)
637 category =
"Physics";
641 if (strcmp(iAttVal->GetName(),
"Aux-X")!=0 &&
642 strcmp(iAttVal->GetName(),
"Aux-Y")!=0 &&
643 strcmp(iAttVal->GetName(),
"Aux-Z")!=0 &&
644 strcmp(iAttVal->GetName(),
"Pos-X")!=0 &&
645 strcmp(iAttVal->GetName(),
"Pos-Y")!=0 &&
646 strcmp(iAttVal->GetName(),
"Pos-Z")!=0)
647 hepRepXMLWriter->
addAttDef(iAttVal->GetName(), iAttDef->second.GetDesc(),
648 category, iAttDef->second.GetExtra());
652 delete rawPointAttValues;
657 delete pointAttValues;
672 doneInitTraj =
false;
685 hepRepXMLWriter->
addType(
"Trajectory Step Points",2);
694 redness = colour.
GetRed();
702 if (redness==0. && greenness==0. && blueness==0.) {
709 if (strcmp(
"Trajectory Step Points",previousName)!=0) {
711 hepRepXMLWriter->
addAttValue(
"MarkColor", redness, greenness, blueness);
714 hepRepXMLWriter->
addAttValue(
"Visibility",visible);
729 std::vector<G4AttValue>* rawPointAttValues = aTrajectoryPoint->
CreateAttValues();
730 std::vector<G4AttValue>* pointAttValues =
731 new std::vector<G4AttValue>;
732 std::map<G4String,G4AttDef>* pointAttDefs =
733 new std::map<G4String,G4AttDef>;
737 if (rawPointAttValues) {
739 aTrajectoryPoint->
GetAttDefs()).Standard(pointAttValues,pointAttDefs);
741 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
742 "\nERROR found during conversion to standard point attributes." <<
G4endl;
746 if (pointAttValues) {
747 for (iAttVal = pointAttValues->begin();
748 iAttVal != pointAttValues->end(); ++iAttVal)
752 if (strcmp(iAttVal->GetName(),
"Aux-X")!=0 &&
753 strcmp(iAttVal->GetName(),
"Aux-Y")!=0 &&
754 strcmp(iAttVal->GetName(),
"Aux-Z")!=0 &&
755 strcmp(iAttVal->GetName(),
"Pos-X")!=0 &&
756 strcmp(iAttVal->GetName(),
"Pos-Y")!=0 &&
757 strcmp(iAttVal->GetName(),
"Pos-Z")!=0)
758 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
764 delete pointAttValues;
765 delete rawPointAttValues;
770 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
783 hepRepXMLWriter->
addType(
"Trajectory Auxiliary Points",2);
792 redness = colour.
GetRed();
800 if (redness==0. && greenness==0. && blueness==0.) {
807 if (strcmp(
"Trajectory Auxiliary Points",previousName)!=0) {
809 hepRepXMLWriter->
addAttValue(
"MarkColor", redness, greenness, blueness);
812 hepRepXMLWriter->
addAttValue(
"Visibility",visible);
827 std::vector<G4AttValue>* rawPointAttValues = aTrajectoryPoint->
CreateAttValues();
828 std::vector<G4AttValue>* pointAttValues =
829 new std::vector<G4AttValue>;
830 std::map<G4String,G4AttDef>* pointAttDefs =
831 new std::map<G4String,G4AttDef>;
835 if (rawPointAttValues) {
837 aTrajectoryPoint->
GetAttDefs()).Standard(pointAttValues,pointAttDefs);
839 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
840 "\nERROR found during conversion to standard point attributes." <<
G4endl;
844 if (pointAttValues) {
845 for (iAttVal = pointAttValues->begin();
846 iAttVal != pointAttValues->end(); ++iAttVal)
850 if (strcmp(iAttVal->GetName(),
"Aux-X")!=0 &&
851 strcmp(iAttVal->GetName(),
"Aux-Y")!=0 &&
852 strcmp(iAttVal->GetName(),
"Aux-Z")!=0 &&
853 strcmp(iAttVal->GetName(),
"Pos-X")!=0 &&
854 strcmp(iAttVal->GetName(),
"Pos-Y")!=0 &&
855 strcmp(iAttVal->GetName(),
"Pos-Z")!=0)
856 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
862 delete pointAttValues;
863 delete rawPointAttValues;
869 const std::vector<G4ThreeVector>* auxiliaries = aTrajectoryPoint->
GetAuxiliaryPoints();
870 if (0 != auxiliaries) {
871 for (
size_t iAux=0; iAux<auxiliaries->size(); ++iAux) {
874 hepRepXMLWriter->
addPoint(auxPos.
x(), auxPos.
y(), auxPos.
z());
883 #ifdef G4HEPREPFILEDEBUG
884 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(G4VHit&) " <<
G4endl;
890 new std::vector<G4AttValue>;
892 new std::map<G4String,G4AttDef>;
895 std::vector<G4AttValue>::iterator iAttVal;
896 std::map<G4String,G4AttDef>::const_iterator iAttDef;
900 if (rawHitAttValues) {
902 hit.
GetAttDefs()).Standard(hitAttValues,hitAttDefs);
904 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(hit):"
905 "\nERROR found during conversion to standard hit attributes."
908 #ifdef G4HEPREPFILEDEBUG
910 "G4HepRepFileSceneHandler::AddCompound(hit): standardised attributes:\n"
913 delete rawHitAttValues;
920 if (strcmp(
"Event Data",hepRepXMLWriter->
prevTypeName[0])!=0) {
921 hepRepXMLWriter->
addType(
"Event Data",0);
929 for (iAttVal = hitAttValues->begin();
930 iAttVal != hitAttValues->end() && !found; ++iAttVal) {
931 if (strcmp(iAttVal->GetName(),
"HitType")==0) {
932 hitType = iAttVal->GetValue();
940 hepRepXMLWriter->
addType(hitType,1);
944 if (strcmp(hitType,previousName)!=0) {
951 if (hitAttValues && hitAttDefs) {
952 for (iAttVal = hitAttValues->begin();
953 iAttVal != hitAttValues->end(); ++iAttVal) {
954 iAttDef = hitAttDefs->find(iAttVal->GetName());
955 if (iAttDef != hitAttDefs->end()) {
958 G4String category = iAttDef->second.GetCategory();
959 if (strcmp(category,
"Draw")!=0 &&
960 strcmp(category,
"Physics")!=0 &&
961 strcmp(category,
"Association")!=0 &&
962 strcmp(category,
"PickAction")!=0)
963 category =
"Physics";
964 hepRepXMLWriter->
addAttDef(iAttVal->GetName(), iAttDef->second.GetDesc(),
965 category, iAttDef->second.GetExtra());
987 std::vector<G4AttValue>::iterator iAttVal;
988 for (iAttVal = trajAttValues->begin();
989 iAttVal != trajAttValues->end(); ++iAttVal)
990 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
991 delete trajAttValues;
1010 std::vector<G4AttValue>::iterator iAttVal;
1011 for (iAttVal = hitAttValues->begin();
1012 iAttVal != hitAttValues->end(); ++iAttVal)
1013 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
1014 delete hitAttValues;
1027 #ifdef G4HEPREPFILEDEBUG
1029 "G4HepRepFileSceneHandler::AddPrimitive(const G4Polyline& polyline) called:"
1030 "\n polyline: " << polyline
1040 if (inPrimitives2D) {
1041 if (!warnedAbout2DMarkers) {
1042 G4cout <<
"HepRepFile does not currently support 2D lines." <<
G4endl;
1043 warnedAbout2DMarkers =
true;
1055 AddHepRepInstance(
"Line", polyline);
1059 for (
size_t i=0; i < polyline.size(); i++) {
1061 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
1068 #ifdef G4HEPREPFILEDEBUG
1070 "G4HepRepFileSceneHandler::AddPrimitive(const G4Polymarker& line) called"
1080 if (inPrimitives2D) {
1081 if (!warnedAbout2DMarkers) {
1082 G4cout <<
"HepRepFile does not currently support 2D lines." <<
G4endl;
1083 warnedAbout2DMarkers =
true;
1090 if (sizeType==
world)
1100 AddHepRepInstance(
"Point", line);
1107 for (
size_t i=0; i < line.size(); i++) {
1109 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
1115 #ifdef G4HEPREPFILEDEBUG
1117 "G4HepRepFileSceneHandler::AddPrimitive(const G4Text& text) called:"
1123 if (!inPrimitives2D) {
1124 if (!warnedAbout3DText) {
1125 G4cout <<
"HepRepFile does not currently support 3D text." <<
G4endl;
1126 G4cout <<
"HepRep browsers can directly display text attributes on request." <<
G4endl;
1127 G4cout <<
"See Application Developers Guide for how to attach attributes to viewable objects." <<
G4endl;
1128 warnedAbout3DText =
true;
1135 if (sizeType==
world)
1139 AddHepRepInstance(
"Text", text);
1143 hepRepXMLWriter->
addAttValue(
"FontName",
"Arial");
1144 hepRepXMLWriter->
addAttValue(
"FontStyle",
"Plain");
1146 hepRepXMLWriter->
addAttValue(
"FontHasBanner",
"TRUE");
1147 hepRepXMLWriter->
addAttValue(
"FontBannerColor",
"0,0,0");
1150 float redness = colour.
GetRed();
1151 float greenness = colour.
GetGreen();
1152 float blueness = colour.
GetBlue();
1155 if (redness==0. && greenness==0. && blueness==0.) {
1160 hepRepXMLWriter->
addAttValue(
"FontColor",redness,greenness,blueness);
1171 #ifdef G4HEPREPFILEDEBUG
1173 "G4HepRepFileSceneHandler::AddPrimitive(const G4Circle& circle) called:"
1184 if (inPrimitives2D) {
1185 if (!warnedAbout2DMarkers) {
1186 G4cout <<
"HepRepFile does not currently support 2D circles." <<
G4endl;
1187 warnedAbout2DMarkers =
true;
1194 if (sizeType==
world)
1204 AddHepRepInstance(
"Point", circle);
1212 hepRepXMLWriter->
addPoint(center.
x(), center.
y(), center.
z());
1217 #ifdef G4HEPREPFILEDEBUG
1219 "G4HepRepFileSceneHandler::AddPrimitive(const G4Square& square) called:"
1230 if (inPrimitives2D) {
1231 if (!warnedAbout2DMarkers) {
1232 G4cout <<
"HepRepFile does not currently support 2D squares." <<
G4endl;
1233 warnedAbout2DMarkers =
true;
1240 if (sizeType==
world)
1250 AddHepRepInstance(
"Point", square);
1252 hepRepXMLWriter->
addAttValue(
"MarkName",
"Square");
1258 hepRepXMLWriter->
addPoint(center.
x(), center.
y(), center.
z());
1263 #ifdef G4HEPREPFILEDEBUG
1265 "G4HepRepFileSceneHandler::AddPrimitive(const G4Polyhedron& polyhedron) called."
1284 AddHepRepInstance(
"Polygon", polyhedron);
1299 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
1300 }
while (notLastEdge);
1301 }
while (notLastFace);
1306 return hepRepXMLWriter;
1310 void G4HepRepFileSceneHandler::AddHepRepInstance(
const char* primName,
1312 #ifdef G4HEPREPFILEDEBUG
1314 "G4HepRepFileSceneHandler::AddHepRepInstance called."
1323 G4int currentDepth = 0;
1331 #ifdef G4HEPREPFILEDEBUG
1337 if (drawingTraj || drawingHit) {
1342 if (strcmp(
"Event Data",hepRepXMLWriter->
prevTypeName[0])!=0) {
1343 hepRepXMLWriter->
addType(
"Event Data",0);
1363 if (strcmp(
"Text",primName)==0) {
1364 hepRepXMLWriter->
addType(
"EventID",1);
1366 if (strcmp(
"Line",primName)==0) {
1367 hepRepXMLWriter->
addType(
"TransientPolylines",1);
1370 if (strcmp(hepRepXMLWriter->
prevTypeName[1],
"TransientPolylines")==0 &&
1371 strcmp(
"Square",primName)==0)
1373 hepRepXMLWriter->
addType(
"AuxiliaryPoints",2);
1376 if (strcmp(hepRepXMLWriter->
prevTypeName[1],
"TransientPolylines")==0 &&
1377 strcmp(
"Circle",primName)==0)
1379 hepRepXMLWriter->
addType(
"StepPoints",2);
1382 hepRepXMLWriter->
addType(
"Hits",1);
1393 }
else if (pCurrentPV==0) {
1394 if (strcmp(
"AxesEtc",hepRepXMLWriter->
prevTypeName[0])!=0) {
1395 hepRepXMLWriter->
addType(
"AxesEtc",0);
1401 if (strcmp(
"Text",primName)==0) {
1402 hepRepXMLWriter->
addType(
"Text",1);
1404 if (strcmp(
"Line",primName)==0) {
1405 hepRepXMLWriter->
addType(
"Polylines",1);
1408 hepRepXMLWriter->
addType(
"Points",1);
1422 if (strcmp(
"Detector Geometry",hepRepXMLWriter->
prevTypeName[0])!=0) {
1424 hepRepXMLWriter->
addType(
"Detector Geometry",0);
1433 typedef std::vector<PVNodeID>
PVPath;
1435 PVPath::const_reverse_iterator ri = ++drawnPVPath.rbegin();
1436 G4int drawnMotherDepth;
1437 if (ri != drawnPVPath.rend()) {
1439 drawnMotherDepth = ri->GetNonCulledDepth();
1443 drawnMotherDepth = -1;
1447 while (drawnMotherDepth < (currentDepth-1)) {
1448 G4String culledParentName =
"Culled parent of " + pCurrentPV->
GetName();
1450 hepRepXMLWriter->
addType(culledParentName, drawnMotherDepth+2);
1452 drawnMotherDepth ++;
1470 hepRepXMLWriter->
addAttValue(
"Region", regionName);
1476 hepRepXMLWriter->
addAttValue(
"Material", matName);
1505 redness = colour.
GetRed();
1510 if (redness==0. && greenness==0. && blueness==0.) {
1516 #ifdef G4HEPREPFILEDEBUG
1518 "G4HepRepFileSceneHandler::AddHepRepInstance using default colour."
1527 if (strcmp(primName,
"Point")==0)
1528 hepRepXMLWriter->
addAttValue(
"MarkColor",redness,greenness,blueness);
1530 hepRepXMLWriter->
addAttValue(
"LineColor",redness,greenness,blueness);
1532 hepRepXMLWriter->
addAttValue(
"Visibility",isVisible);
1536 void G4HepRepFileSceneHandler::CheckFileOpen() {
1537 #ifdef G4HEPREPFILEDEBUG
1539 "G4HepRepFileSceneHandler::CheckFileOpen called."
1543 if (!hepRepXMLWriter->
isOpen) {
1554 G4cout <<
"HepRepFile writing to " << newFileSpec <<
G4endl;
1556 hepRepXMLWriter->
open(newFileSpec);
1561 hepRepXMLWriter->
addAttDef(
"Generator",
"HepRep Data Generator",
"Physics",
"");
1563 versionString = versionString.substr(1,versionString.size()-2);
1564 versionString =
" Geant4 version " + versionString +
" " +
G4Date;
1565 hepRepXMLWriter->
addAttValue(
"Generator", versionString);
1567 hepRepXMLWriter->
addAttDef(
"LVol",
"Logical Volume",
"Physics",
"");
1568 hepRepXMLWriter->
addAttDef(
"Region",
"Cuts Region",
"Physics",
"");
1569 hepRepXMLWriter->
addAttDef(
"RootRegion",
"Root Region",
"Physics",
"");
1570 hepRepXMLWriter->
addAttDef(
"Solid",
"Solid Name",
"Physics",
"");
1571 hepRepXMLWriter->
addAttDef(
"EType",
"Entity Type",
"Physics",
"");
1572 hepRepXMLWriter->
addAttDef(
"Material",
"Material Name",
"Physics",
"");
1573 hepRepXMLWriter->
addAttDef(
"Density",
"Material Density",
"Physics",
"kg/m3");
1574 hepRepXMLWriter->
addAttDef(
"State",
"Material State",
"Physics",
"");
1575 hepRepXMLWriter->
addAttDef(
"Radlen",
"Material Radiation Length",
"Physics",
"m");
G4double GetWorldRadius() const
virtual G4double getScale()
G4double GetXHalfLength() const
virtual void AddSolid(const G4Box &)
virtual G4String getFileName()
const G4String & GetName() const
void AddCompound(const G4VTrajectory &)
G4double GetYHalfLength1() const
G4HepRepFileSceneHandler(G4VGraphicsSystem &system, const G4String &name)
G4double GetStepPtsSize() const
virtual void BeginModeling()
virtual G4bool renderCylAsPolygons()
virtual const std::vector< G4ThreeVector > * GetAuxiliaryPoints() const
G4bool GetNextNormal(G4Normal3D &normal) const
const G4String & GetName() const
G4double GetAuxPtsSize() const
virtual G4VTrajectoryPoint * GetPoint(G4int i) const =0
G4Material * GetCurrentMaterial() const
void AddPrimitive(const G4Polyline &)
void addAttValue(const char *name, const char *value)
G4double GetDensity() const
void AddSolid(const G4Box &)
const G4Colour & GetColour() const
G4VSolid * GetSolid() const
static G4String ConvertToString(G4bool boolVal)
G4Transform3D fObjectTransformation
HepGeom::Point3D< G4double > G4Point3D
G4double GetOuterRadiusMinusZ() const
G4Point3D GetPosition() const
const G4VisAttributes * GetVisAttributes() const
G4Region * GetRegion() const
static constexpr double m3
G4Colour GetAuxPtsColour() const
G4Polymarker::MarkerType GetAuxPtsType() const
virtual G4GeometryType GetEntityType() const =0
const std::vector< G4PhysicalVolumeNodeID > & GetDrawnPVPath() const
G4double GetZHalfLength() const
G4int GetCurrentDepth() const
G4double GetZHalfLength() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
const G4VTrajectoryModel * CurrentTrajDrawModel() const
static constexpr double twopi
virtual std::vector< G4AttValue > * CreateAttValues() const
const G4VisTrajContext & GetContext() const
G4double GetXHalfLength2() const
G4bool GetAuxPtsVisible() const
virtual G4bool getOverwrite()
virtual G4String getFileDir()
virtual int GetPointEntries() const =0
G4double GetYOffset() const
G4GLOB_DLL std::ostream G4cout
void addPoint(double x, double y, double z)
static constexpr double m
void addAttDef(const char *name, const char *desc, const char *type, const char *extra)
G4double GetDeltaPhiAngle() const
const G4String & GetName() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
G4double GetGreen() const
G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID
G4bool IsRootRegion() const
static const G4String G4Version
virtual G4bool getCullInvisibles()
static G4VisManager * GetInstance()
virtual void EndModeling()
static G4HepRepMessenger * GetInstance()
G4double GetYHalfLength() const
virtual ~G4HepRepFileSceneHandler()
std::vector< PVNodeID > PVPath
G4double GetYHalfLength2() const
static const G4String G4Date
G4double GetInnerRadiusPlusZ() const
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const
G4bool GetDrawStepPts() const
static constexpr double kg
G4double GetInnerRadius() const
G4double GetRadlen() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual void BeginPrimitives2D(const G4Transform3D &objectTransformation)
virtual const G4ThreeVector GetPosition() const =0
G4double GetXOffset() const
const G4VisAttributes * fpVisAttribs
G4Colour GetStepPtsColour() const
virtual void AddCompound(const G4VTrajectory &)
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
static G4int fSceneIdCount
void BeginPrimitives2D(const G4Transform3D &objectTransformation)
G4double GetMarkerSize(const G4VMarker &, MarkerSizeType &)
G4double GetZHalfLength() const
virtual std::vector< G4AttValue > * CreateAttValues() const
G4Polymarker::MarkerType GetStepPtsType() const
G4double GetXHalfLength1() const
static constexpr double pi
static PROLOG_HANDLER error
G4bool fReadyForTransients
void addType(const char *name, int newTypeDepth)
const G4String & GetName() const
G4bool GetDrawAuxPts() const
G4bool GetStepPtsVisible() const
G4double GetInnerRadiusMinusZ() const
G4bool GetNextVertex(G4Point3D &vertex, G4int &edgeFlag) const
G4LogicalVolume * GetCurrentLV() const
void open(const char *filespec)
G4VPhysicalVolume * GetCurrentPV() const
G4int GetNoFacets() const
G4HepRepFileXMLWriter * GetHepRepXMLWriter()
const XML_Char XML_Content * model
G4double GetOuterRadiusPlusZ() const
G4double GetZHalfLength() const
G4double GetOuterRadius() const
virtual void EndPrimitives2D()
void ClearTransientStore()
const G4Colour & GetTextColour(const G4Text &)
G4double GetDeltaPhiAngle() const