76 inPrimitives2D =
false;
77 warnedAbout3DText =
false;
78 warnedAbout2DMarkers =
false;
110#ifdef G4HEPREPFILEDEBUG
111 G4cout <<
"G4HepRepFileSceneHandler::BeginPrimitives2D() " <<
G4endl;
113 inPrimitives2D =
true;
119#ifdef G4HEPREPFILEDEBUG
120 G4cout <<
"G4HepRepFileSceneHandler::EndPrimitives2D() " <<
G4endl;
123 inPrimitives2D =
false;
126#ifdef G4HEPREPFILEDEBUG
127void G4HepRepFileSceneHandler::PrintThings()
137 G4cout <<
"\n current physical volume: " << pCurrentPV->
GetName()
138 <<
"\n current logical volume: " << pCurrentLV->
GetName()
139 <<
"\n current depth of geometry tree: " << currentDepth;
147#ifdef G4HEPREPFILEDEBUG
148 G4cout <<
"G4HepRepFileSceneHandler::AddSolid(const G4Box& box) called for "
160 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
207 G4cout <<
"G4HepRepFileSceneHandler::AddSolid(const G4Cons& cons) called for "
215 G4bool linedUpWithAnAxis =
216 (std::fabs(r.
phiX()) <= .001 || std::fabs(r.
phiY()) <= .001 ||
217 std::fabs(r.
phiZ()) <= .001 || std::fabs(r.
phiX() - pi) <= .001 ||
218 std::fabs(r.
phiY() - pi) <= .001 || std::fabs(r.
phiZ() - pi) <= .001);
241 AddHepRepInstance(
"Cylinder", NULL);
261 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
262 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
270 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
271 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
277#ifdef G4HEPREPFILEDEBUG
278 G4cout <<
"G4HepRepFileSceneHandler::AddSolid(const G4Tubs& tubs) called for "
286 G4bool linedUpWithAnAxis =
287 (std::fabs(r.
phiX()) <= .001 || std::fabs(r.
phiY()) <= .001 ||
288 std::fabs(r.
phiZ()) <= .001 || std::fabs(r.
phiX() - pi) <= .001 ||
289 std::fabs(r.
phiY() - pi) <= .001 || std::fabs(r.
phiZ() - pi) <= .001);
312 AddHepRepInstance(
"Cylinder", NULL);
332 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
333 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
343 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
344 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
351#ifdef G4HEPREPFILEDEBUG
352 G4cout <<
"G4HepRepFileSceneHandler::AddSolid(const G4Trd& trd) called for "
364 AddHepRepInstance(
"Prism", NULL);
400 hepRepXMLWriter->
addPoint(vertex1.
x(), vertex1.
y(), vertex1.
z());
401 hepRepXMLWriter->
addPoint(vertex2.
x(), vertex2.
y(), vertex2.
z());
402 hepRepXMLWriter->
addPoint(vertex3.
x(), vertex3.
y(), vertex3.
z());
403 hepRepXMLWriter->
addPoint(vertex4.
x(), vertex4.
y(), vertex4.
z());
404 hepRepXMLWriter->
addPoint(vertex5.
x(), vertex5.
y(), vertex5.
z());
405 hepRepXMLWriter->
addPoint(vertex6.
x(), vertex6.
y(), vertex6.
z());
406 hepRepXMLWriter->
addPoint(vertex7.
x(), vertex7.
y(), vertex7.
z());
407 hepRepXMLWriter->
addPoint(vertex8.
x(), vertex8.
y(), vertex8.
z());
412#ifdef G4HEPREPFILEDEBUG
413 G4cout <<
"G4HepRepFileSceneHandler::AddSolid(const G4Trap& trap) called for "
422#ifdef G4HEPREPFILEDEBUG
424 <<
"G4HepRepFileSceneHandler::AddSolid(const G4Sphere& sphere) called for "
433#ifdef G4HEPREPFILEDEBUG
434 G4cout <<
"G4HepRepFileSceneHandler::AddSolid(const G4Para& para) called for "
443#ifdef G4HEPREPFILEDEBUG
445 <<
"G4HepRepFileSceneHandler::AddSolid(const G4Torus& torus) called for "
454#ifdef G4HEPREPFILEDEBUG
455 G4cout <<
"G4HepRepFileSceneHandler::AddSolid(const G4Polycone& polycone) "
465#ifdef G4HEPREPFILEDEBUG
466 G4cout <<
"G4HepRepFileSceneHandler::AddSolid(const G4Polyhedra& polyhedra) "
476#ifdef G4HEPREPFILEDEBUG
477 G4cout <<
"G4HepRepFileSceneHandler::AddSolid(const G4Orb& orb) called for "
486#ifdef G4HEPREPFILEDEBUG
487 G4cout <<
"G4HepRepFileSceneHandler::AddSolid(const G4Ellipsoid& ellipsoid) "
497#ifdef G4HEPREPFILEDEBUG
498 G4cout <<
"G4HepRepFileSceneHandler::AddSolid(const G4TessellatedSolid& ) "
508#ifdef G4HEPREPFILEDEBUG
510 <<
"G4HepRepFileSceneHandler::AddSolid(const G4Solid& solid) called for "
519#ifdef G4HEPREPFILEDEBUG
520 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(const G4VTrajectory&) "
526 G4Exception(
"G4HepRepFileSceneHandler::AddCompound(const G4VTrajectory&)",
531 trajAttValues =
new std::vector<G4AttValue>;
532 trajAttDefs =
new std::map<G4String, G4AttDef>;
535 std::vector<G4AttValue>::iterator iAttVal;
536 std::map<G4String, G4AttDef>::const_iterator iAttDef;
544 .
Standard(trajAttValues, trajAttDefs);
548 <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
549 "\nERROR found during conversion to standard trajectory attributes."
552#ifdef G4HEPREPFILEDEBUG
553 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj): standardised "
557 delete rawTrajAttValues;
564 if(strcmp(
"Event Data", hepRepXMLWriter->
prevTypeName[0]) != 0)
566 hepRepXMLWriter->
addType(
"Event Data", 0);
572 hepRepXMLWriter->
addType(
"Trajectories", 1);
576 if(strcmp(
"Trajectories", previousName) != 0)
584 if(trajAttValues && trajAttDefs)
586 for(iAttVal = trajAttValues->begin(); iAttVal != trajAttValues->end();
589 iAttDef = trajAttDefs->find(iAttVal->GetName());
590 if(iAttDef != trajAttDefs->end())
595 G4String category = iAttDef->second.GetCategory();
596 if(strcmp(category,
"Draw") != 0 &&
597 strcmp(category,
"Physics") != 0 &&
598 strcmp(category,
"Association") != 0 &&
599 strcmp(category,
"PickAction") != 0)
600 category =
"Physics";
601 hepRepXMLWriter->
addAttDef(iAttVal->GetName(),
602 iAttDef->second.GetDesc(), category,
603 iAttDef->second.GetExtra());
617 std::vector<G4AttValue>* rawPointAttValues =
619 std::vector<G4AttValue>* pointAttValues =
new std::vector<G4AttValue>;
620 std::map<G4String, G4AttDef>* pointAttDefs =
621 new std::map<G4String, G4AttDef>;
625 if(rawPointAttValues)
629 .
Standard(pointAttValues, pointAttDefs);
632 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
633 "\nERROR found during conversion to standard first point "
639 if(pointAttValues && pointAttDefs)
641 for(iAttVal = pointAttValues->begin();
642 iAttVal != pointAttValues->end(); ++iAttVal)
644 iAttDef = pointAttDefs->find(iAttVal->GetName());
645 if(iAttDef != pointAttDefs->end())
650 G4String category = iAttDef->second.GetCategory();
651 if(strcmp(category,
"Draw") != 0 &&
652 strcmp(category,
"Physics") != 0 &&
653 strcmp(category,
"Association") != 0 &&
654 strcmp(category,
"PickAction") != 0)
655 category =
"Physics";
660 if(strcmp(iAttVal->GetName(),
"Aux-X") != 0 &&
661 strcmp(iAttVal->GetName(),
"Aux-Y") != 0 &&
662 strcmp(iAttVal->GetName(),
"Aux-Z") != 0 &&
663 strcmp(iAttVal->GetName(),
"Pos-X") != 0 &&
664 strcmp(iAttVal->GetName(),
"Pos-Y") != 0 &&
665 strcmp(iAttVal->GetName(),
"Pos-Z") != 0)
666 hepRepXMLWriter->
addAttDef(iAttVal->GetName(),
667 iAttDef->second.GetDesc(), category,
668 iAttDef->second.GetExtra());
672 delete rawPointAttValues;
677 delete pointAttValues;
693 doneInitTraj =
false;
707 hepRepXMLWriter->
addType(
"Trajectory Step Points", 2);
716 redness = colour.
GetRed();
724 if(redness == 0. && greenness == 0. && blueness == 0.)
732 if(strcmp(
"Trajectory Step Points", previousName) != 0)
735 hepRepXMLWriter->
addAttValue(
"MarkColor", redness, greenness, blueness);
736 hepRepXMLWriter->
addAttValue(
"MarkSize", markSize);
738 hepRepXMLWriter->
addAttValue(
"Visibility", visible);
740 hepRepXMLWriter->
addAttValue(
"MarkName",
"square");
754 std::vector<G4AttValue>* rawPointAttValues =
756 std::vector<G4AttValue>* pointAttValues =
new std::vector<G4AttValue>;
757 std::map<G4String, G4AttDef>* pointAttDefs =
758 new std::map<G4String, G4AttDef>;
762 if(rawPointAttValues)
766 .
Standard(pointAttValues, pointAttDefs);
770 <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
771 "\nERROR found during conversion to standard point attributes."
778 for(iAttVal = pointAttValues->begin();
779 iAttVal != pointAttValues->end(); ++iAttVal)
784 if(strcmp(iAttVal->GetName(),
"Aux-X") != 0 &&
785 strcmp(iAttVal->GetName(),
"Aux-Y") != 0 &&
786 strcmp(iAttVal->GetName(),
"Aux-Z") != 0 &&
787 strcmp(iAttVal->GetName(),
"Pos-X") != 0 &&
788 strcmp(iAttVal->GetName(),
"Pos-Y") != 0 &&
789 strcmp(iAttVal->GetName(),
"Pos-Z") != 0)
791 iAttVal->GetValue());
797 delete pointAttValues;
798 delete rawPointAttValues;
803 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
817 hepRepXMLWriter->
addType(
"Trajectory Auxiliary Points", 2);
826 redness = colour.
GetRed();
834 if(redness == 0. && greenness == 0. && blueness == 0.)
842 if(strcmp(
"Trajectory Auxiliary Points", previousName) != 0)
845 hepRepXMLWriter->
addAttValue(
"MarkColor", redness, greenness, blueness);
846 hepRepXMLWriter->
addAttValue(
"MarkSize", markSize);
848 hepRepXMLWriter->
addAttValue(
"Visibility", visible);
850 hepRepXMLWriter->
addAttValue(
"MarkName",
"Square");
864 std::vector<G4AttValue>* rawPointAttValues =
866 std::vector<G4AttValue>* pointAttValues =
new std::vector<G4AttValue>;
867 std::map<G4String, G4AttDef>* pointAttDefs =
868 new std::map<G4String, G4AttDef>;
872 if(rawPointAttValues)
876 .
Standard(pointAttValues, pointAttDefs);
880 <<
"G4HepRepFileSceneHandler::AddCompound(traj):"
881 "\nERROR found during conversion to standard point attributes."
888 for(iAttVal = pointAttValues->begin();
889 iAttVal != pointAttValues->end(); ++iAttVal)
894 if(strcmp(iAttVal->GetName(),
"Aux-X") != 0 &&
895 strcmp(iAttVal->GetName(),
"Aux-Y") != 0 &&
896 strcmp(iAttVal->GetName(),
"Aux-Z") != 0 &&
897 strcmp(iAttVal->GetName(),
"Pos-X") != 0 &&
898 strcmp(iAttVal->GetName(),
"Pos-Y") != 0 &&
899 strcmp(iAttVal->GetName(),
"Pos-Z") != 0)
901 iAttVal->GetValue());
907 delete pointAttValues;
908 delete rawPointAttValues;
914 const std::vector<G4ThreeVector>* auxiliaries =
918 for(
size_t iAux = 0; iAux < auxiliaries->size(); ++iAux)
922 hepRepXMLWriter->
addPoint(auxPos.
x(), auxPos.
y(), auxPos.
z());
931#ifdef G4HEPREPFILEDEBUG
932 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(G4VHit&) " <<
G4endl;
937 hitAttValues =
new std::vector<G4AttValue>;
938 hitAttDefs =
new std::map<G4String, G4AttDef>;
941 std::vector<G4AttValue>::iterator iAttVal;
942 std::map<G4String, G4AttDef>::const_iterator iAttDef;
949 .
Standard(hitAttValues, hitAttDefs);
952 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(hit):"
953 "\nERROR found during conversion to standard hit attributes."
956#ifdef G4HEPREPFILEDEBUG
957 G4cout <<
"G4HepRepFileSceneHandler::AddCompound(hit): standardised "
961 delete rawHitAttValues;
968 if(strcmp(
"Event Data", hepRepXMLWriter->
prevTypeName[0]) != 0)
970 hepRepXMLWriter->
addType(
"Event Data", 0);
979 for(iAttVal = hitAttValues->begin();
980 iAttVal != hitAttValues->end() && !found; ++iAttVal)
982 if(strcmp(iAttVal->GetName(),
"HitType") == 0)
984 hitType = iAttVal->GetValue();
992 hepRepXMLWriter->
addType(hitType, 1);
996 if(strcmp(hitType, previousName) != 0)
1004 if(hitAttValues && hitAttDefs)
1006 for(iAttVal = hitAttValues->begin(); iAttVal != hitAttValues->end();
1009 iAttDef = hitAttDefs->find(iAttVal->GetName());
1010 if(iAttDef != hitAttDefs->end())
1015 G4String category = iAttDef->second.GetCategory();
1016 if(strcmp(category,
"Draw") != 0 &&
1017 strcmp(category,
"Physics") != 0 &&
1018 strcmp(category,
"Association") != 0 &&
1019 strcmp(category,
"PickAction") != 0)
1020 category =
"Physics";
1021 hepRepXMLWriter->
addAttDef(iAttVal->GetName(),
1022 iAttDef->second.GetDesc(), category,
1023 iAttDef->second.GetExtra());
1032 doneInitHit =
false;
1047 std::vector<G4AttValue>::iterator iAttVal;
1048 for(iAttVal = trajAttValues->begin(); iAttVal != trajAttValues->end();
1050 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
1051 delete trajAttValues;
1058 doneInitTraj =
true;
1072 std::vector<G4AttValue>::iterator iAttVal;
1073 for(iAttVal = hitAttValues->begin(); iAttVal != hitAttValues->end();
1075 hepRepXMLWriter->
addAttValue(iAttVal->GetName(), iAttVal->GetValue());
1076 delete hitAttValues;
1089#ifdef G4HEPREPFILEDEBUG
1090 G4cout <<
"G4HepRepFileSceneHandler::AddPrimitive(const G4Polyline& "
1105 if(!warnedAbout2DMarkers)
1107 G4cout <<
"HepRepFile does not currently support 2D lines." <<
G4endl;
1108 warnedAbout2DMarkers =
true;
1120 AddHepRepInstance(
"Line", polyline);
1124 for(
size_t i = 0; i < polyline.size(); i++)
1127 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
1133#ifdef G4HEPREPFILEDEBUG
1135 <<
"G4HepRepFileSceneHandler::AddPrimitive(const G4Polymarker& line) called"
1148 if(!warnedAbout2DMarkers)
1150 G4cout <<
"HepRepFile does not currently support 2D lines." <<
G4endl;
1151 warnedAbout2DMarkers =
true;
1158 if(sizeType ==
world)
1168 AddHepRepInstance(
"Point", line);
1175 for(
size_t i = 0; i < line.size(); i++)
1178 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
1184#ifdef G4HEPREPFILEDEBUG
1185 G4cout <<
"G4HepRepFileSceneHandler::AddPrimitive(const G4Text& text) called:"
1193 if(!warnedAbout3DText)
1195 G4cout <<
"HepRepFile does not currently support 3D text." <<
G4endl;
1197 <<
"HepRep browsers can directly display text attributes on request."
1199 G4cout <<
"See Application Developers Guide for how to attach attributes "
1200 "to viewable objects."
1202 warnedAbout3DText =
true;
1209 if(sizeType ==
world)
1213 AddHepRepInstance(
"Text", text);
1217 hepRepXMLWriter->
addAttValue(
"FontName",
"Arial");
1218 hepRepXMLWriter->
addAttValue(
"FontStyle",
"Plain");
1220 hepRepXMLWriter->
addAttValue(
"FontHasBanner",
"TRUE");
1221 hepRepXMLWriter->
addAttValue(
"FontBannerColor",
"0,0,0");
1224 float redness = colour.
GetRed();
1225 float greenness = colour.
GetGreen();
1226 float blueness = colour.
GetBlue();
1229 if(redness == 0. && greenness == 0. && blueness == 0.)
1235 hepRepXMLWriter->
addAttValue(
"FontColor", redness, greenness, blueness);
1246#ifdef G4HEPREPFILEDEBUG
1248 <<
"G4HepRepFileSceneHandler::AddPrimitive(const G4Circle& circle) called:"
1262 if(!warnedAbout2DMarkers)
1264 G4cout <<
"HepRepFile does not currently support 2D circles." <<
G4endl;
1265 warnedAbout2DMarkers =
true;
1272 if(sizeType ==
world)
1282 AddHepRepInstance(
"Point", circle);
1290 hepRepXMLWriter->
addPoint(center.
x(), center.
y(), center.
z());
1295#ifdef G4HEPREPFILEDEBUG
1297 <<
"G4HepRepFileSceneHandler::AddPrimitive(const G4Square& square) called:"
1311 if(!warnedAbout2DMarkers)
1313 G4cout <<
"HepRepFile does not currently support 2D squares." <<
G4endl;
1314 warnedAbout2DMarkers =
true;
1321 if(sizeType ==
world)
1331 AddHepRepInstance(
"Point", square);
1333 hepRepXMLWriter->
addAttValue(
"MarkName",
"Square");
1339 hepRepXMLWriter->
addPoint(center.
x(), center.
y(), center.
z());
1344#ifdef G4HEPREPFILEDEBUG
1345 G4cout <<
"G4HepRepFileSceneHandler::AddPrimitive(const G4Polyhedron& "
1346 "polyhedron) called."
1367 AddHepRepInstance(
"Polygon", polyhedron);
1384 hepRepXMLWriter->
addPoint(vertex.
x(), vertex.
y(), vertex.
z());
1385 }
while(notLastEdge);
1386 }
while(notLastFace);
1391 return hepRepXMLWriter;
1394void G4HepRepFileSceneHandler::AddHepRepInstance(
const char* primName,
1397#ifdef G4HEPREPFILEDEBUG
1398 G4cout <<
"G4HepRepFileSceneHandler::AddHepRepInstance called." <<
G4endl;
1406 G4int currentDepth = 0;
1416#ifdef G4HEPREPFILEDEBUG
1417 G4cout <<
"pCurrentPV:" << pCurrentPV
1421 if(drawingTraj || drawingHit)
1428 if(strcmp(
"Event Data", hepRepXMLWriter->
prevTypeName[0]) != 0)
1430 hepRepXMLWriter->
addType(
"Event Data", 0);
1449 if(strcmp(
"Text", primName) == 0)
1451 hepRepXMLWriter->
addType(
"EventID", 1);
1455 if(strcmp(
"Line", primName) == 0)
1457 hepRepXMLWriter->
addType(
"TransientPolylines", 1);
1462 if(strcmp(hepRepXMLWriter->
prevTypeName[1],
"TransientPolylines") ==
1464 strcmp(
"Square", primName) == 0)
1466 hepRepXMLWriter->
addType(
"AuxiliaryPoints", 2);
1471 if(strcmp(hepRepXMLWriter->
prevTypeName[1],
"TransientPolylines") ==
1473 strcmp(
"Circle", primName) == 0)
1475 hepRepXMLWriter->
addType(
"StepPoints", 2);
1480 hepRepXMLWriter->
addType(
"Hits", 1);
1492 else if(pCurrentPV == 0)
1494 if(strcmp(
"AxesEtc", hepRepXMLWriter->
prevTypeName[0]) != 0)
1496 hepRepXMLWriter->
addType(
"AxesEtc", 0);
1502 if(strcmp(
"Text", primName) == 0)
1504 hepRepXMLWriter->
addType(
"Text", 1);
1508 if(strcmp(
"Line", primName) == 0)
1510 hepRepXMLWriter->
addType(
"Polylines", 1);
1515 hepRepXMLWriter->
addType(
"Points", 1);
1531 if(strcmp(
"Detector Geometry", hepRepXMLWriter->
prevTypeName[0]) != 0)
1534 hepRepXMLWriter->
addType(
"Detector Geometry", 0);
1540 if(strcmp(hepRepXMLWriter->
prevTypeName[currentDepth + 1],
1545 typedef std::vector<PVNodeID> PVPath;
1547 PVPath::const_reverse_iterator ri = ++drawnPVPath.rbegin();
1548 G4int drawnMotherDepth;
1549 if(ri != drawnPVPath.rend())
1552 drawnMotherDepth = ri->GetNonCulledDepth();
1558 drawnMotherDepth = -1;
1562 while(drawnMotherDepth < (currentDepth - 1))
1564 G4String culledParentName =
"Culled parent of " + pCurrentPV->
GetName();
1567 hepRepXMLWriter->
addType(culledParentName, drawnMotherDepth + 2);
1574 hepRepXMLWriter->
addType(pCurrentPV->
GetName(), currentDepth + 1);
1588 hepRepXMLWriter->
addAttValue(
"Region", regionName);
1595 hepRepXMLWriter->
addAttValue(
"Material", matName);
1597 hepRepXMLWriter->
addAttValue(
"Density", matDensity * m3 / kg);
1601 hepRepXMLWriter->
addAttValue(
"Radlen", matRadlen / m);
1629 redness = colour.
GetRed();
1634 if(redness == 0. && greenness == 0. && blueness == 0.)
1643#ifdef G4HEPREPFILEDEBUG
1645 <<
"G4HepRepFileSceneHandler::AddHepRepInstance using default colour."
1654 if(strcmp(primName,
"Point") == 0)
1655 hepRepXMLWriter->
addAttValue(
"MarkColor", redness, greenness, blueness);
1657 hepRepXMLWriter->
addAttValue(
"LineColor", redness, greenness, blueness);
1659 hepRepXMLWriter->
addAttValue(
"Visibility", isVisible);
1662void G4HepRepFileSceneHandler::CheckFileOpen()
1664#ifdef G4HEPREPFILEDEBUG
1665 G4cout <<
"G4HepRepFileSceneHandler::CheckFileOpen called." <<
G4endl;
1668 if(!hepRepXMLWriter->
isOpen)
1685 G4cout <<
"HepRepFile writing to " << newFileSpec <<
G4endl;
1687 hepRepXMLWriter->
open(newFileSpec);
1692 hepRepXMLWriter->
addAttDef(
"Generator",
"HepRep Data Generator",
"Physics",
1694 G4String versionString = G4Version;
1695 versionString = versionString.substr(1, versionString.size() - 2);
1696 versionString =
" Geant4 version " + versionString +
" " + G4Date;
1697 hepRepXMLWriter->
addAttValue(
"Generator", versionString);
1699 hepRepXMLWriter->
addAttDef(
"LVol",
"Logical Volume",
"Physics",
"");
1700 hepRepXMLWriter->
addAttDef(
"Region",
"Cuts Region",
"Physics",
"");
1701 hepRepXMLWriter->
addAttDef(
"RootRegion",
"Root Region",
"Physics",
"");
1702 hepRepXMLWriter->
addAttDef(
"Solid",
"Solid Name",
"Physics",
"");
1703 hepRepXMLWriter->
addAttDef(
"EType",
"Entity Type",
"Physics",
"");
1704 hepRepXMLWriter->
addAttDef(
"Material",
"Material Name",
"Physics",
"");
1705 hepRepXMLWriter->
addAttDef(
"Density",
"Material Density",
"Physics",
1707 hepRepXMLWriter->
addAttDef(
"State",
"Material State",
"Physics",
"");
1708 hepRepXMLWriter->
addAttDef(
"Radlen",
"Material Radiation Length",
"Physics",
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
virtual void DrawView()=0
virtual void ClearView()=0
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