76 inPrimitives2D =
false;
77 warnedAbout3DText =
false;
78 warnedAbout2DMarkers =
false;
110#ifdef G4HEPREPFILEDEBUG
111 G4cout <<
"G4HepRepFileSceneHandler::BeginPrimitives2D() " <<
G4endl;
113 inPrimitives2D =
true;
118#ifdef G4HEPREPFILEDEBUG
119 G4cout <<
"G4HepRepFileSceneHandler::EndPrimitives2D() " <<
G4endl;
122 inPrimitives2D =
false;
126#ifdef G4HEPREPFILEDEBUG
127void G4HepRepFileSceneHandler::PrintThings() {
129 " with transformation "
138 "\n current physical volume: "
140 "\n current logical volume: "
142 "\n current depth of geometry tree: "
151#ifdef G4HEPREPFILEDEBUG
153 "G4HepRepFileSceneHandler::AddSolid(const G4Box& box) called for "
166 AddHepRepInstance(
"Prism", NULL);
199 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
200 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
201 hepRepXMLWriter->
addPoint(vertex3.
x(), vertex3.
y(), vertex3.
z());
202 hepRepXMLWriter->
addPoint(vertex4.
x(), vertex4.
y(), vertex4.
z());
203 hepRepXMLWriter->
addPoint(vertex5.
x(), vertex5.
y(), vertex5.
z());
204 hepRepXMLWriter->
addPoint(vertex6.
x(), vertex6.
y(), vertex6.
z());
205 hepRepXMLWriter->
addPoint(vertex7.
x(), vertex7.
y(), vertex7.
z());
206 hepRepXMLWriter->
addPoint(vertex8.
x(), vertex8.
y(), vertex8.
z());
211#ifdef G4HEPREPFILEDEBUG
213 "G4HepRepFileSceneHandler::AddSolid(const G4Cons& cons) called for "
222 G4bool linedUpWithAnAxis = (std::fabs(r.
phiX())<=.001 ||
223 std::fabs(r.
phiY())<=.001 ||
224 std::fabs(r.
phiZ())<=.001 ||
225 std::fabs(r.
phiX()-pi)<=.001 ||
226 std::fabs(r.
phiY()-pi)<=.001 ||
227 std::fabs(r.
phiZ()-pi)<=.001);
247 AddHepRepInstance(
"Cylinder", NULL);
264 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
265 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
271 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
272 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
278#ifdef G4HEPREPFILEDEBUG
280 "G4HepRepFileSceneHandler::AddSolid(const G4Tubs& tubs) called for "
289 G4bool linedUpWithAnAxis = (std::fabs(r.
phiX())<=.001 ||
290 std::fabs(r.
phiY())<=.001 ||
291 std::fabs(r.
phiZ())<=.001 ||
292 std::fabs(r.
phiX()-pi)<=.001 ||
293 std::fabs(r.
phiY()-pi)<=.001 ||
294 std::fabs(r.
phiZ()-pi)<=.001);
314 AddHepRepInstance(
"Cylinder", NULL);
331 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
332 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
339 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
340 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
347#ifdef G4HEPREPFILEDEBUG
349 "G4HepRepFileSceneHandler::AddSolid(const G4Trd& trd) called for "
362 AddHepRepInstance(
"Prism", NULL);
397 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
398 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
399 hepRepXMLWriter->
addPoint(vertex3.
x(), vertex3.
y(), vertex3.
z());
400 hepRepXMLWriter->
addPoint(vertex4.
x(), vertex4.
y(), vertex4.
z());
401 hepRepXMLWriter->
addPoint(vertex5.
x(), vertex5.
y(), vertex5.
z());
402 hepRepXMLWriter->
addPoint(vertex6.
x(), vertex6.
y(), vertex6.
z());
403 hepRepXMLWriter->
addPoint(vertex7.
x(), vertex7.
y(), vertex7.
z());
404 hepRepXMLWriter->
addPoint(vertex8.
x(), vertex8.
y(), vertex8.
z());
409#ifdef G4HEPREPFILEDEBUG
411 "G4HepRepFileSceneHandler::AddSolid(const G4Trap& trap) called for "
421#ifdef G4HEPREPFILEDEBUG
423 "G4HepRepFileSceneHandler::AddSolid(const G4Sphere& sphere) called for "
433#ifdef G4HEPREPFILEDEBUG
435 "G4HepRepFileSceneHandler::AddSolid(const G4Para& para) called for "
445#ifdef G4HEPREPFILEDEBUG
447 "G4HepRepFileSceneHandler::AddSolid(const G4Torus& torus) called for "
457#ifdef G4HEPREPFILEDEBUG
459 "G4HepRepFileSceneHandler::AddSolid(const G4Polycone& polycone) called for "
469#ifdef G4HEPREPFILEDEBUG
471 "G4HepRepFileSceneHandler::AddSolid(const G4Polyhedra& polyhedra) called for "
481#ifdef G4HEPREPFILEDEBUG
483 "G4HepRepFileSceneHandler::AddSolid(const G4Orb& orb) called for "
493#ifdef G4HEPREPFILEDEBUG
495 "G4HepRepFileSceneHandler::AddSolid(const G4Ellipsoid& ellipsoid) called for "
505#ifdef G4HEPREPFILEDEBUG
507 "G4HepRepFileSceneHandler::AddSolid(const G4TessellatedSolid& ) called for "
517#ifdef G4HEPREPFILEDEBUG
519 "G4HepRepFileSceneHandler::AddSolid(const G4Solid& solid) called for "
529#ifdef G4HEPREPFILEDEBUG
530 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(const G4VTrajectory&) " <<
G4endl;
536 (
"G4HepRepFileSceneHandler::AddCompound(const G4VTrajectory&)",
542 new std::vector<G4AttValue>;
544 new std::map<G4String,G4AttDef>;
547 std::vector<G4AttValue>::iterator iAttVal;
548 std::map<G4String,G4AttDef>::const_iterator iAttDef;
553 if (rawTrajAttValues) {
557 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
558 "\nERROR found during conversion to standard trajectory attributes."
561#ifdef G4HEPREPFILEDEBUG
563 "G4HepRepFileSceneHandler::AddCompound(traj): standardised attributes:\n"
566 delete rawTrajAttValues;
573 if (strcmp(
"Event Data",hepRepXMLWriter->
prevTypeName[0])!=0) {
574 hepRepXMLWriter->
addType(
"Event Data",0);
580 hepRepXMLWriter->
addType(
"Trajectories",1);
584 if (strcmp(
"Trajectories",previousName)!=0) {
591 if (trajAttValues && trajAttDefs) {
592 for (iAttVal = trajAttValues->begin();
593 iAttVal != trajAttValues->end(); ++iAttVal) {
594 iAttDef = trajAttDefs->find(iAttVal->GetName());
595 if (iAttDef != trajAttDefs->end()) {
598 G4String category = iAttDef->second.GetCategory();
599 if (strcmp(category,
"Draw")!=0 &&
600 strcmp(category,
"Physics")!=0 &&
601 strcmp(category,
"Association")!=0 &&
602 strcmp(category,
"PickAction")!=0)
603 category =
"Physics";
604 hepRepXMLWriter->
addAttDef(iAttVal->GetName(), iAttDef->second.GetDesc(),
605 category, iAttDef->second.GetExtra());
618 std::vector<G4AttValue>* rawPointAttValues = aTrajectoryPoint->
CreateAttValues();
619 std::vector<G4AttValue>* pointAttValues =
620 new std::vector<G4AttValue>;
621 std::map<G4String,G4AttDef>* pointAttDefs =
622 new std::map<G4String,G4AttDef>;
626 if (rawPointAttValues) {
630 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
631 "\nERROR found during conversion to standard first point attributes." <<
G4endl;
635 if (pointAttValues && pointAttDefs) {
636 for (iAttVal = pointAttValues->begin();
637 iAttVal != pointAttValues->end(); ++iAttVal) {
639 pointAttDefs->find(iAttVal->GetName());
640 if (iAttDef != pointAttDefs->end()) {
643 G4String category = iAttDef->second.GetCategory();
644 if (strcmp(category,
"Draw")!=0 &&
645 strcmp(category,
"Physics")!=0 &&
646 strcmp(category,
"Association")!=0 &&
647 strcmp(category,
"PickAction")!=0)
648 category =
"Physics";
652 if (strcmp(iAttVal->GetName(),
"Aux-X")!=0 &&
653 strcmp(iAttVal->GetName(),
"Aux-Y")!=0 &&
654 strcmp(iAttVal->GetName(),
"Aux-Z")!=0 &&
655 strcmp(iAttVal->GetName(),
"Pos-X")!=0 &&
656 strcmp(iAttVal->GetName(),
"Pos-Y")!=0 &&
657 strcmp(iAttVal->GetName(),
"Pos-Z")!=0)
658 hepRepXMLWriter->
addAttDef(iAttVal->GetName(), iAttDef->second.GetDesc(),
659 category, iAttDef->second.GetExtra());
663 delete rawPointAttValues;
668 delete pointAttValues;
683 doneInitTraj =
false;
696 hepRepXMLWriter->
addType(
"Trajectory Step Points",2);
705 redness = colour.
GetRed();
713 if (redness==0. && greenness==0. && blueness==0.) {
720 if (strcmp(
"Trajectory Step Points",previousName)!=0) {
722 hepRepXMLWriter->
addAttValue(
"MarkColor", redness, greenness, blueness);
725 hepRepXMLWriter->
addAttValue(
"Visibility",visible);
740 std::vector<G4AttValue>* rawPointAttValues = aTrajectoryPoint->
CreateAttValues();
741 std::vector<G4AttValue>* pointAttValues =
742 new std::vector<G4AttValue>;
743 std::map<G4String,G4AttDef>* pointAttDefs =
744 new std::map<G4String,G4AttDef>;
748 if (rawPointAttValues) {
752 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
753 "\nERROR found during conversion to standard point attributes." <<
G4endl;
757 if (pointAttValues) {
758 for (iAttVal = pointAttValues->begin();
759 iAttVal != pointAttValues->end(); ++iAttVal)
763 if (strcmp(iAttVal->GetName(),
"Aux-X")!=0 &&
764 strcmp(iAttVal->GetName(),
"Aux-Y")!=0 &&
765 strcmp(iAttVal->GetName(),
"Aux-Z")!=0 &&
766 strcmp(iAttVal->GetName(),
"Pos-X")!=0 &&
767 strcmp(iAttVal->GetName(),
"Pos-Y")!=0 &&
768 strcmp(iAttVal->GetName(),
"Pos-Z")!=0)
769 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
775 delete pointAttValues;
776 delete rawPointAttValues;
781 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
794 hepRepXMLWriter->
addType(
"Trajectory Auxiliary Points",2);
803 redness = colour.
GetRed();
811 if (redness==0. && greenness==0. && blueness==0.) {
818 if (strcmp(
"Trajectory Auxiliary Points",previousName)!=0) {
820 hepRepXMLWriter->
addAttValue(
"MarkColor", redness, greenness, blueness);
823 hepRepXMLWriter->
addAttValue(
"Visibility",visible);
838 std::vector<G4AttValue>* rawPointAttValues = aTrajectoryPoint->
CreateAttValues();
839 std::vector<G4AttValue>* pointAttValues =
840 new std::vector<G4AttValue>;
841 std::map<G4String,G4AttDef>* pointAttDefs =
842 new std::map<G4String,G4AttDef>;
846 if (rawPointAttValues) {
850 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
851 "\nERROR found during conversion to standard point attributes." <<
G4endl;
855 if (pointAttValues) {
856 for (iAttVal = pointAttValues->begin();
857 iAttVal != pointAttValues->end(); ++iAttVal)
861 if (strcmp(iAttVal->GetName(),
"Aux-X")!=0 &&
862 strcmp(iAttVal->GetName(),
"Aux-Y")!=0 &&
863 strcmp(iAttVal->GetName(),
"Aux-Z")!=0 &&
864 strcmp(iAttVal->GetName(),
"Pos-X")!=0 &&
865 strcmp(iAttVal->GetName(),
"Pos-Y")!=0 &&
866 strcmp(iAttVal->GetName(),
"Pos-Z")!=0)
867 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
873 delete pointAttValues;
874 delete rawPointAttValues;
880 const std::vector<G4ThreeVector>* auxiliaries = aTrajectoryPoint->
GetAuxiliaryPoints();
881 if (0 != auxiliaries) {
882 for (
size_t iAux=0; iAux<auxiliaries->size(); ++iAux) {
885 hepRepXMLWriter->
addPoint(auxPos.
x(), auxPos.
y(), auxPos.
z());
894#ifdef G4HEPREPFILEDEBUG
895 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(G4VHit&) " <<
G4endl;
901 new std::vector<G4AttValue>;
903 new std::map<G4String,G4AttDef>;
906 std::vector<G4AttValue>::iterator iAttVal;
907 std::map<G4String,G4AttDef>::const_iterator iAttDef;
911 if (rawHitAttValues) {
915 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(hit):"
916 "\nERROR found during conversion to standard hit attributes."
919#ifdef G4HEPREPFILEDEBUG
921 "G4HepRepFileSceneHandler::AddCompound(hit): standardised attributes:\n"
924 delete rawHitAttValues;
931 if (strcmp(
"Event Data",hepRepXMLWriter->
prevTypeName[0])!=0) {
932 hepRepXMLWriter->
addType(
"Event Data",0);
940 for (iAttVal = hitAttValues->begin();
941 iAttVal != hitAttValues->end() && !found; ++iAttVal) {
942 if (strcmp(iAttVal->GetName(),
"HitType")==0) {
943 hitType = iAttVal->GetValue();
951 hepRepXMLWriter->
addType(hitType,1);
955 if (strcmp(hitType,previousName)!=0) {
962 if (hitAttValues && hitAttDefs) {
963 for (iAttVal = hitAttValues->begin();
964 iAttVal != hitAttValues->end(); ++iAttVal) {
965 iAttDef = hitAttDefs->find(iAttVal->GetName());
966 if (iAttDef != hitAttDefs->end()) {
969 G4String category = iAttDef->second.GetCategory();
970 if (strcmp(category,
"Draw")!=0 &&
971 strcmp(category,
"Physics")!=0 &&
972 strcmp(category,
"Association")!=0 &&
973 strcmp(category,
"PickAction")!=0)
974 category =
"Physics";
975 hepRepXMLWriter->
addAttDef(iAttVal->GetName(), iAttDef->second.GetDesc(),
976 category, iAttDef->second.GetExtra());
998 std::vector<G4AttValue>::iterator iAttVal;
999 for (iAttVal = trajAttValues->begin();
1000 iAttVal != trajAttValues->end(); ++iAttVal)
1001 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
1002 delete trajAttValues;
1009 doneInitTraj =
true;
1021 std::vector<G4AttValue>::iterator iAttVal;
1022 for (iAttVal = hitAttValues->begin();
1023 iAttVal != hitAttValues->end(); ++iAttVal)
1024 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
1025 delete hitAttValues;
1038#ifdef G4HEPREPFILEDEBUG
1040 "G4HepRepFileSceneHandler::AddPrimitive(const G4Polyline& polyline) called:"
1041 "\n polyline: " << polyline
1051 if (inPrimitives2D) {
1052 if (!warnedAbout2DMarkers) {
1053 G4cout <<
"HepRepFile does not currently support 2D lines." <<
G4endl;
1054 warnedAbout2DMarkers =
true;
1066 AddHepRepInstance(
"Line", polyline);
1070 for (
size_t i=0; i < polyline.size(); i++) {
1072 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
1079#ifdef G4HEPREPFILEDEBUG
1081 "G4HepRepFileSceneHandler::AddPrimitive(const G4Polymarker& line) called"
1091 if (inPrimitives2D) {
1092 if (!warnedAbout2DMarkers) {
1093 G4cout <<
"HepRepFile does not currently support 2D lines." <<
G4endl;
1094 warnedAbout2DMarkers =
true;
1101 if (sizeType==
world)
1111 AddHepRepInstance(
"Point", line);
1118 for (
size_t i=0; i < line.size(); i++) {
1120 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
1126#ifdef G4HEPREPFILEDEBUG
1128 "G4HepRepFileSceneHandler::AddPrimitive(const G4Text& text) called:"
1134 if (!inPrimitives2D) {
1135 if (!warnedAbout3DText) {
1136 G4cout <<
"HepRepFile does not currently support 3D text." <<
G4endl;
1137 G4cout <<
"HepRep browsers can directly display text attributes on request." <<
G4endl;
1138 G4cout <<
"See Application Developers Guide for how to attach attributes to viewable objects." <<
G4endl;
1139 warnedAbout3DText =
true;
1146 if (sizeType==
world)
1150 AddHepRepInstance(
"Text", text);
1154 hepRepXMLWriter->
addAttValue(
"FontName",
"Arial");
1155 hepRepXMLWriter->
addAttValue(
"FontStyle",
"Plain");
1157 hepRepXMLWriter->
addAttValue(
"FontHasBanner",
"TRUE");
1158 hepRepXMLWriter->
addAttValue(
"FontBannerColor",
"0,0,0");
1161 float redness = colour.
GetRed();
1162 float greenness = colour.
GetGreen();
1163 float blueness = colour.
GetBlue();
1166 if (redness==0. && greenness==0. && blueness==0.) {
1171 hepRepXMLWriter->
addAttValue(
"FontColor",redness,greenness,blueness);
1182#ifdef G4HEPREPFILEDEBUG
1184 "G4HepRepFileSceneHandler::AddPrimitive(const G4Circle& circle) called:"
1195 if (inPrimitives2D) {
1196 if (!warnedAbout2DMarkers) {
1197 G4cout <<
"HepRepFile does not currently support 2D circles." <<
G4endl;
1198 warnedAbout2DMarkers =
true;
1205 if (sizeType==
world)
1215 AddHepRepInstance(
"Point", circle);
1223 hepRepXMLWriter->
addPoint(center.
x(), center.
y(), center.
z());
1228#ifdef G4HEPREPFILEDEBUG
1230 "G4HepRepFileSceneHandler::AddPrimitive(const G4Square& square) called:"
1241 if (inPrimitives2D) {
1242 if (!warnedAbout2DMarkers) {
1243 G4cout <<
"HepRepFile does not currently support 2D squares." <<
G4endl;
1244 warnedAbout2DMarkers =
true;
1251 if (sizeType==
world)
1261 AddHepRepInstance(
"Point", square);
1263 hepRepXMLWriter->
addAttValue(
"MarkName",
"Square");
1269 hepRepXMLWriter->
addPoint(center.
x(), center.
y(), center.
z());
1274#ifdef G4HEPREPFILEDEBUG
1276 "G4HepRepFileSceneHandler::AddPrimitive(const G4Polyhedron& polyhedron) called."
1295 AddHepRepInstance(
"Polygon", polyhedron);
1310 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
1311 }
while (notLastEdge);
1312 }
while (notLastFace);
1317 return hepRepXMLWriter;
1321void G4HepRepFileSceneHandler::AddHepRepInstance(
const char* primName,
1323#ifdef G4HEPREPFILEDEBUG
1325 "G4HepRepFileSceneHandler::AddHepRepInstance called."
1334 G4int currentDepth = 0;
1342#ifdef G4HEPREPFILEDEBUG
1348 if (drawingTraj || drawingHit) {
1353 if (strcmp(
"Event Data",hepRepXMLWriter->
prevTypeName[0])!=0) {
1354 hepRepXMLWriter->
addType(
"Event Data",0);
1374 if (strcmp(
"Text",primName)==0) {
1375 hepRepXMLWriter->
addType(
"EventID",1);
1377 if (strcmp(
"Line",primName)==0) {
1378 hepRepXMLWriter->
addType(
"TransientPolylines",1);
1381 if (strcmp(hepRepXMLWriter->
prevTypeName[1],
"TransientPolylines")==0 &&
1382 strcmp(
"Square",primName)==0)
1384 hepRepXMLWriter->
addType(
"AuxiliaryPoints",2);
1387 if (strcmp(hepRepXMLWriter->
prevTypeName[1],
"TransientPolylines")==0 &&
1388 strcmp(
"Circle",primName)==0)
1390 hepRepXMLWriter->
addType(
"StepPoints",2);
1393 hepRepXMLWriter->
addType(
"Hits",1);
1404 }
else if (pCurrentPV==0) {
1405 if (strcmp(
"AxesEtc",hepRepXMLWriter->
prevTypeName[0])!=0) {
1406 hepRepXMLWriter->
addType(
"AxesEtc",0);
1412 if (strcmp(
"Text",primName)==0) {
1413 hepRepXMLWriter->
addType(
"Text",1);
1415 if (strcmp(
"Line",primName)==0) {
1416 hepRepXMLWriter->
addType(
"Polylines",1);
1419 hepRepXMLWriter->
addType(
"Points",1);
1433 if (strcmp(
"Detector Geometry",hepRepXMLWriter->
prevTypeName[0])!=0) {
1435 hepRepXMLWriter->
addType(
"Detector Geometry",0);
1444 typedef std::vector<PVNodeID>
PVPath;
1446 PVPath::const_reverse_iterator ri = ++drawnPVPath.rbegin();
1447 G4int drawnMotherDepth;
1448 if (ri != drawnPVPath.rend()) {
1450 drawnMotherDepth = ri->GetNonCulledDepth();
1454 drawnMotherDepth = -1;
1458 while (drawnMotherDepth < (currentDepth-1)) {
1459 G4String culledParentName =
"Culled parent of " + pCurrentPV->
GetName();
1461 hepRepXMLWriter->
addType(culledParentName, drawnMotherDepth+2);
1463 drawnMotherDepth ++;
1481 hepRepXMLWriter->
addAttValue(
"Region", regionName);
1487 hepRepXMLWriter->
addAttValue(
"Material", matName);
1489 hepRepXMLWriter->
addAttValue(
"Density", matDensity*m3/kg);
1493 hepRepXMLWriter->
addAttValue(
"Radlen", matRadlen/m);
1516 redness = colour.
GetRed();
1521 if (redness==0. && greenness==0. && blueness==0.) {
1527#ifdef G4HEPREPFILEDEBUG
1529 "G4HepRepFileSceneHandler::AddHepRepInstance using default colour."
1538 if (strcmp(primName,
"Point")==0)
1539 hepRepXMLWriter->
addAttValue(
"MarkColor",redness,greenness,blueness);
1541 hepRepXMLWriter->
addAttValue(
"LineColor",redness,greenness,blueness);
1543 hepRepXMLWriter->
addAttValue(
"Visibility",isVisible);
1547void G4HepRepFileSceneHandler::CheckFileOpen() {
1548#ifdef G4HEPREPFILEDEBUG
1550 "G4HepRepFileSceneHandler::CheckFileOpen called."
1554 if (!hepRepXMLWriter->
isOpen) {
1565 G4cout <<
"HepRepFile writing to " << newFileSpec <<
G4endl;
1567 hepRepXMLWriter->
open(newFileSpec);
1572 hepRepXMLWriter->
addAttDef(
"Generator",
"HepRep Data Generator",
"Physics",
"");
1573 G4String versionString = G4Version;
1574 versionString = versionString.substr(1,versionString.size()-2);
1575 versionString =
" Geant4 version " + versionString +
" " + G4Date;
1576 hepRepXMLWriter->
addAttValue(
"Generator", versionString);
1578 hepRepXMLWriter->
addAttDef(
"LVol",
"Logical Volume",
"Physics",
"");
1579 hepRepXMLWriter->
addAttDef(
"Region",
"Cuts Region",
"Physics",
"");
1580 hepRepXMLWriter->
addAttDef(
"RootRegion",
"Root Region",
"Physics",
"");
1581 hepRepXMLWriter->
addAttDef(
"Solid",
"Solid Name",
"Physics",
"");
1582 hepRepXMLWriter->
addAttDef(
"EType",
"Entity Type",
"Physics",
"");
1583 hepRepXMLWriter->
addAttDef(
"Material",
"Material Name",
"Physics",
"");
1584 hepRepXMLWriter->
addAttDef(
"Density",
"Material Density",
"Physics",
"kg/m3");
1585 hepRepXMLWriter->
addAttDef(
"State",
"Material State",
"Physics",
"");
1586 hepRepXMLWriter->
addAttDef(
"Radlen",
"Material Radiation Length",
"Physics",
"m");
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
HepGeom::Point3D< G4double > G4Point3D
G4GLOB_DLL std::ostream G4cout
G4bool Standard(std::vector< G4AttValue > *standardValues, std::map< G4String, G4AttDef > *standardDefinitions) const
G4double GetYHalfLength() const
G4double GetZHalfLength() const
G4double GetXHalfLength() const
G4double GetGreen() const
G4double GetOuterRadiusPlusZ() const
G4double GetDeltaPhiAngle() const
G4double GetInnerRadiusMinusZ() const
G4double GetInnerRadiusPlusZ() const
G4double GetOuterRadiusMinusZ() const
G4double GetZHalfLength() const
G4HepRepFileSceneHandler(G4VGraphicsSystem &system, const G4String &name)
void AddSolid(const G4Box &)
void ClearTransientStore()
G4HepRepFileXMLWriter * GetHepRepXMLWriter()
static G4int fSceneIdCount
void AddPrimitive(const G4Polyline &)
void BeginPrimitives2D(const G4Transform3D &objectTransformation)
void AddCompound(const G4VTrajectory &)
virtual ~G4HepRepFileSceneHandler()
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 G4bool renderCylAsPolygons()
virtual G4String getFileName()
virtual G4double getScale()
virtual G4String getFileDir()
virtual G4bool getCullInvisibles()
virtual G4bool getOverwrite()
static G4HepRepMessenger * GetInstance()
G4VSolid * GetSolid() const
G4bool IsRootRegion() const
G4Region * GetRegion() const
const G4String & GetName() const
G4double GetDensity() const
G4double GetRadlen() const
const G4String & GetName() const
const std::vector< G4PhysicalVolumeNodeID > & GetDrawnPVPath() const
G4VPhysicalVolume * GetCurrentPV() const
G4LogicalVolume * GetCurrentLV() const
G4Material * GetCurrentMaterial() const
G4int GetCurrentDepth() const
const G4String & GetName() const
G4double GetYOffset() const
G4double GetXOffset() const
G4double GetXHalfLength2() const
G4double GetYHalfLength2() const
G4double GetXHalfLength1() const
G4double GetYHalfLength1() const
G4double GetZHalfLength() const
G4double GetZHalfLength() const
G4double GetInnerRadius() const
G4double GetOuterRadius() const
G4double GetDeltaPhiAngle() const
static G4String ConvertToString(G4bool boolVal)
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
G4Point3D GetPosition() const
G4double GetWorldRadius() const
const G4String & GetName() const
virtual void BeginModeling()
const G4Colour & GetTextColour(const G4Text &)
G4Transform3D fObjectTransformation
virtual void EndModeling()
G4double GetMarkerSize(const G4VMarker &, MarkerSizeType &)
virtual void EndPrimitives2D()
const G4VisAttributes * fpVisAttribs
virtual void BeginPrimitives2D(const G4Transform3D &objectTransformation=G4Transform3D())
G4bool fReadyForTransients
virtual void AddSolid(const G4Box &)
virtual void AddCompound(const G4VTrajectory &)
virtual G4GeometryType GetEntityType() const =0
const G4VisTrajContext & GetContext() const
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual const std::vector< G4ThreeVector > * GetAuxiliaryPoints() const
virtual const G4ThreeVector GetPosition() const =0
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual G4VTrajectoryPoint * GetPoint(G4int i) const =0
virtual G4int GetPointEntries() const =0
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const
const G4Colour & GetColour() const
const G4VTrajectoryModel * CurrentTrajDrawModel() const
static G4VisManager * GetInstance()
G4bool GetDrawAuxPts() const
G4Colour GetStepPtsColour() const
G4double GetStepPtsSize() const
G4Polymarker::MarkerType GetAuxPtsType() const
G4double GetAuxPtsSize() const
G4Colour GetAuxPtsColour() const
G4bool GetAuxPtsVisible() const
G4bool GetStepPtsVisible() const
G4Polymarker::MarkerType GetStepPtsType() const
G4bool GetDrawStepPts() const
const G4VisAttributes * GetVisAttributes() const
G4bool GetNextNormal(G4Normal3D &normal) const
G4bool GetNextVertex(G4Point3D &vertex, G4int &edgeFlag) const
G4int GetNoFacets() const
G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID
std::vector< PVNodeID > PVPath