46 #include "HEPREP/HepRep.h" 
   75 #include "cheprep/XMLHepRepFactory.h" 
   96           geometryLayer         (
"Geometry"),
 
   98           calHitLayer           (
"CalHit"),
 
   99           trajectoryLayer       (
"Trajectory"),
 
  101           rootVolumeName        (
"Geometry"),
 
  103           eventNumberPrefix     (
""),
 
  104           eventNumberSuffix     (
""),
 
  106           eventNumberWidth      (-1),
 
  111           writeMultipleFiles    (false),
 
  115           _heprepGeometry       (NULL)
 
  119     cout << 
"G4HepRepSceneHandler::G4HepRepSceneHandler: " << system << endl;
 
  127     factory = 
new XMLHepRepFactory();
 
  137     cout << 
"G4HepRepSceneHandler::~G4HepRepSceneHandler() " << endl;
 
  150     if (
writer != NULL) 
return;
 
  152     if (name == 
"stdout") {
 
  154         cout << 
"G4HepRepSceneHandler::Open() stdout" << endl;
 
  168     } 
else if (name == 
"stderr") {
 
  170         cout << 
"G4HepRepSceneHandler::Open() stderr" << endl;
 
  186         cout << 
"G4HepRepSceneHandler::Open() " << name << endl;
 
  191             const unsigned int numberOfExtensions = 8;
 
  192             string ext[numberOfExtensions] = {
".heprep", 
".heprep.xml", 
".heprep.zip", 
".heprep.gz",
 
  193                                               ".bheprep", 
".bheprep.xml", 
".bheprep.zip", 
".bheprep.gz"};
 
  195             while (i < numberOfExtensions) {
 
  196                 int dot = name.size() - ext[i].size();
 
  198                     (name.substr(dot, ext[i].size()) == ext[i])) 
break;
 
  202             if (i != numberOfExtensions) {
 
  206                 writeGZ = (i == 3) || (i == 7);
 
  208                 int dot = name.length() - 
extension.length();
 
  209                 baseName = (dot >= 0) ? name.substr(0, dot) : 
"";
 
  221             int startDigit = -1; 
int endDigit = -1;
 
  228                 endDigit = suffix.length()-1; 
 
  229                 while (endDigit >= 0) {
 
  230                     if (isdigit(suffix.at(endDigit))) 
break;
 
  234                     cerr << 
"/vis/heprep/appendEventNumberSuffix contains no digits" << endl;
 
  237                     startDigit = endDigit;
 
  238                     while (startDigit >= 0) {
 
  239                         if (!isdigit(suffix.at(startDigit))) 
break;
 
  248                 eventNumber = atoi(suffix.substr(startDigit, endDigit).c_str());
 
  267     cout << 
"G4HepRepSceneHandler::OpenHepRep() " << endl;
 
  296     if (
_heprep == NULL) 
return true;
 
  299     cout << 
"G4HepRepSceneHandler::CloseHepRep() start" << endl;
 
  305             cerr << 
"WARNING: you probably used '/vis/viewer/endOfEventAction accumulate' and " 
  306                  << 
"forgot to call /vis/viewer/update before exit. No event written." << endl;
 
  327                     sprintf(name, 
"%s%s%s#%s", 
baseName.c_str(), 
"-geometry", 
extension.c_str(), 
"G4GeometryData");
 
  329                     sprintf(name, 
"%s%s#%s", 
"geometry", (
writeBinary ? 
".bheprep" : 
".heprep"), 
"G4GeometryData");
 
  363             sprintf(name, 
"%s%s", 
"geometry", (
writeBinary ? 
".bheprep" : 
".heprep"));
 
  365                 writer->addProperty(
"RecordLoop.ignore", name);
 
  383             char fileFormat[128];
 
  396         char eventFormat[128];
 
  416     cout << 
"G4HepRepSceneHandler::Close() " << endl;
 
  419     if (
writer == NULL) 
return;
 
  431     out = 
new ofstream(name.c_str(), std::ios::out | std::ios::binary );
 
  445     if (heprep == NULL) 
return;
 
  455     cout << 
"G4HepRepSceneHandler::BeginModeling() " << endl;
 
  463     cout << 
"G4HepRepSceneHandler::EndModeling() " << endl;
 
  470     cout << 
"G4HepRepSceneHandler::AddSolid(const G4Box& box)" << endl;
 
  513     factory->createHepRepPoint(instance, vertex1.x(), vertex1.y(), vertex1.z());
 
  514     factory->createHepRepPoint(instance, vertex2.x(), vertex2.y(), vertex2.z());
 
  515     factory->createHepRepPoint(instance, vertex3.x(), vertex3.y(), vertex3.z());
 
  516     factory->createHepRepPoint(instance, vertex4.x(), vertex4.y(), vertex4.z());
 
  517     factory->createHepRepPoint(instance, vertex5.x(), vertex5.y(), vertex5.z());
 
  518     factory->createHepRepPoint(instance, vertex6.x(), vertex6.y(), vertex6.z());
 
  519     factory->createHepRepPoint(instance, vertex7.x(), vertex7.y(), vertex7.z());
 
  520     factory->createHepRepPoint(instance, vertex8.x(), vertex8.y(), vertex8.z());
 
  526     cout << 
"G4HepRepSceneHandler::AddSolid(const G4Cons& cons)" << endl;
 
  565     HepRepInstance* outer = 
factory->createHepRepInstance(instance, type);
 
  566     outer->addAttValue(
"pickParent",
true);
 
  567     outer->addAttValue(
"showParentAttributes",
true);
 
  569     HepRepPoint* op1 = 
factory->createHepRepPoint(outer, vertex1.x(), vertex1.y(), vertex1.z());
 
  572     HepRepPoint* op2 = 
factory->createHepRepPoint(outer, vertex2.x(), vertex2.y(), vertex2.z());
 
  576     HepRepInstance* inner = 
factory->createHepRepInstance(instance, type);
 
  577     inner->addAttValue(
"pickParent",
true);
 
  578     inner->addAttValue(
"showParentAttributes",
true);
 
  580     HepRepPoint* ip1 = 
factory->createHepRepPoint(inner, vertex1.x(), vertex1.y(), vertex1.z());
 
  583     HepRepPoint* ip2 = 
factory->createHepRepPoint(inner, vertex2.x(), vertex2.y(), vertex2.z());
 
  590     cout << 
"G4HepRepSceneHandler::AddSolid(const G4Tubs& tubs)" << endl;
 
  629     HepRepInstance* outer = 
factory->createHepRepInstance(instance, type);
 
  631     outer->addAttValue(
"pickParent",
true);
 
  632     outer->addAttValue(
"showParentAttributes",
true);
 
  633     factory->createHepRepPoint(outer, vertex1.x(), vertex1.y(), vertex1.z());
 
  634     factory->createHepRepPoint(outer, vertex2.x(), vertex2.y(), vertex2.z());
 
  638         HepRepInstance* inner = 
factory->createHepRepInstance(instance, type);
 
  640         inner->addAttValue(
"pickParent",
true);
 
  641         inner->addAttValue(
"showParentAttributes",
true);
 
  642         factory->createHepRepPoint(inner, vertex1.x(), vertex1.y(), vertex1.z());
 
  643         factory->createHepRepPoint(inner, vertex2.x(), vertex2.y(), vertex2.z());
 
  650     cout << 
"G4HepRepSceneHandler::AddSolid(const G4Trd& trd)" << endl;
 
  695     factory->createHepRepPoint(instance, vertex1.x(), vertex1.y(), vertex1.z());
 
  696     factory->createHepRepPoint(instance, vertex2.x(), vertex2.y(), vertex2.z());
 
  697     factory->createHepRepPoint(instance, vertex3.x(), vertex3.y(), vertex3.z());
 
  698     factory->createHepRepPoint(instance, vertex4.x(), vertex4.y(), vertex4.z());
 
  699     factory->createHepRepPoint(instance, vertex5.x(), vertex5.y(), vertex5.z());
 
  700     factory->createHepRepPoint(instance, vertex6.x(), vertex6.y(), vertex6.z());
 
  701     factory->createHepRepPoint(instance, vertex7.x(), vertex7.y(), vertex7.z());
 
  702     factory->createHepRepPoint(instance, vertex8.x(), vertex8.y(), vertex8.z());
 
  744     cout << 
"G4HepRepSceneHandler::AddPrimitive(G4Polyline&) " << line.size() << endl;
 
  749       static G4bool warned = 
false;
 
  753           (
"G4HepRepSceneHandler::AddPrimitive (const G4Polyline&)",
 
  755            "2D polylines not implemented.  Ignored.");
 
  770     for (
size_t i=0; i < line.size(); i++) {
 
  772         factory->createHepRepPoint(instance, vertex.x(), vertex.y(), vertex.z());
 
  780     cout << 
"G4HepRepSceneHandler::AddPrimitive(G4Polymarker&) " << line.size() << endl;
 
  785       static G4bool warned = 
false;
 
  789           (
"G4HepRepSceneHandler::AddPrimitive (const G4Polymarker&)",
 
  791            "2D polymarkers not implemented.  Ignored.");
 
  810     if (mtype == line.
dots) {
 
  813     } 
else if (mtype == line.
circles) {
 
  821     for (
size_t i=0; i < line.size(); i++) {
 
  823         factory->createHepRepPoint(instance, vertex.x(), vertex.y(), vertex.z());
 
  830     cout << 
"G4HepRepSceneHandler::AddPrimitive(G4Circle&) " << endl;
 
  835       static G4bool warned = 
false;
 
  839           (
"G4HepRepSceneHandler::AddPrimitive (const G4Circle&)",
 
  841            "2D circles not implemented.  Ignored.");
 
  858     factory->createHepRepPoint(instance, center.x(), center.y(), center.z());
 
  865     cout << 
"G4HepRepSceneHandler::AddPrimitive(G4Polyhedron&) " << endl;
 
  870       static G4bool warned = 
false;
 
  874           (
"G4HepRepSceneHandler::AddPrimitive (const G4Polyhedron&)",
 
  876            "2D polyhedra not implemented.  Ignored.");
 
  884     if (polyhedron.GetNoFacets()==0) 
return;
 
  892     G4int currentDepth = 0;
 
  899         HepRepInstance* face;
 
  912         notLastFace = polyhedron.GetNextNormal (surfaceNormal);
 
  917                 notLastEdge = polyhedron.GetNextVertex (vertex, edgeFlag);
 
  919             factory->createHepRepPoint(face, vertex.x(), vertex.y(), vertex.z());
 
  920         } 
while (notLastEdge);
 
  921     } 
while (notLastFace);
 
  927     cout << 
"G4HepRepSceneHandler::AddPrimitive(G4Text&) " << endl;
 
  945     cout << 
"G4HepRepSceneHandler::AddPrimitive G4Text : not yet implemented. " << endl;
 
  951     cout << 
"G4HepRepSceneHandler::AddPrimitive(G4Square&) " << endl;
 
  956       static G4bool warned = 
false;
 
  960           (
"G4HepRepSceneHandler::AddPrimitive (const G4Square&)",
 
  962            "2D squares not implemented.  Ignored.");
 
  979     factory->createHepRepPoint(instance, center.x(), center.y(), center.z());
 
  989     cout << 
"G4HepRepSceneHandler::AddCompound(G4VTrajectory&) " << endl;
 
 1001     cout << 
"G4HepRepSceneHandler::AddCompound(G4VHit&) " << endl;
 
 1017     cout << 
"G4HepRepSceneHandler::PreAddSolid(G4Transform3D&, G4VisAttributes&)" << endl;
 
 1024     cout << 
"G4HepRepSceneHandler::PostAddSolid()" << endl;
 
 1032     cout << 
"G4HepRepSceneHandler::BeginPrimitives(G4Transform3D&)" << endl;
 
 1042     cout << 
"G4HepRepSceneHandler::EndPrimitives" << endl;
 
 1057     cout << 
"G4HepRepSceneHandler::setColor : red : " << color.
GetRed ()   <<
 
 1058                                   " green : " << color.
GetGreen () <<
 
 1059                                   " blue : " << color.
GetBlue ()   << endl;
 
 1129         type->addAttValue(
"LVol", 
G4String(
""));
 
 1130         type->addAttValue(
"HitType", 
G4String(
""));
 
 1131         type->addAttValue(
"ID", -1);
 
 1132         type->addAttValue(
"Column", -1);
 
 1133         type->addAttValue(
"Row", -1);
 
 1134         type->addAttValue(
"Energy", 0.0);
 
 1135         type->addAttValue(
"Pos", 
G4String(
""));
 
 1137         addAttVals(instance, hitAttDefs, hitAttValues);
 
 1139         delete hitAttValues;
 
 1148         type->addAttValue(
"Ch", 0.0);
 
 1149         type->addAttValue(
"Color", 1.0, 1.0, 1.0, 1.0);
 
 1150         type->addAttValue(
"ID", -1);
 
 1151         type->addAttValue(
"IMom", 
G4String(
""));
 
 1152         type->addAttValue(
"IMag", 0.0);
 
 1153         type->addAttValue(
"PDG", -1);
 
 1154         type->addAttValue(
"PN", 
G4String(
""));
 
 1155         type->addAttValue(
"PID", -1);
 
 1157         addAttVals(instance, trajectoryAttDefs, trajectoryAttValues);
 
 1159         delete trajectoryAttValues;
 
 1165     HepRepAttValue* attValue = attribute->getAttValue(name);
 
 1166     if ((attValue == NULL) || (attValue->getString() != value)) {
 
 1167         HepRepPoint* point = 
dynamic_cast<HepRepPoint*
>(attribute);
 
 1168         if (point != NULL) {
 
 1169             if (point->getInstance()->getAttValueFromNode(name) == NULL) {
 
 1170                 attribute = point->getInstance();
 
 1174         HepRepInstance* 
instance = 
dynamic_cast<HepRepInstance*
>(attribute);
 
 1175         if (instance != NULL) {
 
 1177             if (instance->getType()->getAttValueFromNode(name) == NULL) {
 
 1178                 attribute = instance->getType();
 
 1182         attribute->addAttValue(name, value);
 
 1187     HepRepAttValue* attValue = attribute->getAttValue(name);
 
 1188     if ((attValue == NULL) || (attValue->getBoolean() != value)) {
 
 1189         HepRepPoint* point = 
dynamic_cast<HepRepPoint*
>(attribute);
 
 1190         if (point != NULL) {
 
 1191             if (point->getInstance()->getAttValueFromNode(name) == NULL) {
 
 1192                 attribute = point->getInstance();
 
 1196         HepRepInstance* instance = 
dynamic_cast<HepRepInstance*
>(attribute);
 
 1197         if (instance != NULL) {
 
 1199             if (instance->getType()->getAttValueFromNode(name) == NULL) {
 
 1200                 attribute = instance->getType();
 
 1204         attribute->addAttValue(name, value);
 
 1209     HepRepAttValue* attValue = attribute->getAttValue(name);
 
 1210     if ((attValue == NULL) || (attValue->getDouble() != value)) {
 
 1211         HepRepPoint* point = 
dynamic_cast<HepRepPoint*
>(attribute);
 
 1212         if (point != NULL) {
 
 1213             if (point->getInstance()->getAttValueFromNode(name) == NULL) {
 
 1214                 attribute = point->getInstance();
 
 1218         HepRepInstance* instance = 
dynamic_cast<HepRepInstance*
>(attribute);
 
 1219         if (instance != NULL) {
 
 1221             if (instance->getType()->getAttValueFromNode(name) == NULL) {
 
 1222                 attribute = instance->getType();
 
 1226         attribute->addAttValue(name, value);
 
 1231     HepRepAttValue* attValue = attribute->getAttValue(name);
 
 1232     if ((attValue == NULL) || (attValue->getInteger() != value)) {
 
 1233         HepRepPoint* point = 
dynamic_cast<HepRepPoint*
>(attribute);
 
 1234         if (point != NULL) {
 
 1235             if (point->getInstance()->getAttValueFromNode(name) == NULL) {
 
 1236                 attribute = point->getInstance();
 
 1240         HepRepInstance* instance = 
dynamic_cast<HepRepInstance*
>(attribute);
 
 1241         if (instance != NULL) {
 
 1243             if (instance->getType()->getAttValueFromNode(name) == NULL) {
 
 1244                 attribute = instance->getType();
 
 1248         attribute->addAttValue(name, value);
 
 1253     HepRepAttValue* attValue = attribute->getAttValue(name);
 
 1254     vector<double> color;
 
 1255     if (attValue != NULL) color = attValue->getColor();
 
 1256     if ((color.size() == 0) ||
 
 1257         (color[0] != red) ||
 
 1258         (color[1] != green) ||
 
 1259         (color[2] != blue) ||
 
 1260         ((color.size() > 3) && (color[3] != alpha))) {
 
 1262         HepRepPoint* point = 
dynamic_cast<HepRepPoint*
>(attribute);
 
 1263         if (point != NULL) {
 
 1264             if (point->getInstance()->getAttValueFromNode(name) == NULL) {
 
 1265                 attribute = point->getInstance();
 
 1269         HepRepInstance* instance = 
dynamic_cast<HepRepInstance*
>(attribute);
 
 1270         if (instance != NULL) {
 
 1272             if (instance->getType()->getAttValueFromNode(name) == NULL) {
 
 1273                 attribute = instance->getType();
 
 1277         attribute->addAttValue(name, red, green, blue, alpha);
 
 1282     if (attDefs == NULL) 
return;
 
 1285     map<G4String,G4AttDef>::const_iterator attDefIterator = attDefs->begin();
 
 1286     while (attDefIterator != attDefs->end()) {
 
 1287         definition->addAttDef(attDefIterator->first, attDefIterator->second.GetDesc(),
 
 1288                         attDefIterator->second.GetCategory(), attDefIterator->second.GetExtra());
 
 1294     if (attValues == NULL) 
return;
 
 1297     for (vector<G4AttValue>::iterator attValIterator = attValues->begin(); attValIterator != attValues->end(); attValIterator++) {        
 
 1298         G4String name = attValIterator->GetName();
 
 1300         HepRepPoint* point = 
dynamic_cast<HepRepPoint*
>(attribute);
 
 1301         if ((name == 
"Pos") && (point != NULL)) {
 
 1308             for (
unsigned int i=0; i<pos.length(); i++) {
 
 1309                 if (pos[i] == 
' ') {
 
 1312                         double factor = atof(pos.substr(is, i-is).c_str())/point->getX();
 
 1313                         im = (int)(std::log10(factor)+((factor < 1) ? -0.5 : 0.5));
 
 1315                     } 
else if (in == 3) {
 
 1317                         unit = pos.substr(is, i-is);
 
 1320                         } 
else if (unit == 
G4String(
"mm")) {
 
 1322                         } 
else if (unit == 
G4String(
"cm")) {
 
 1324                         } 
else if (unit == 
G4String(
"m")) {
 
 1326                         } 
else if (unit == 
G4String(
"km")) {
 
 1329                             cerr << 
"HepRepSceneHandler: Unrecognized Unit: '" << unit << 
"'" << endl;
 
 1353                     cerr << 
"HepRepSceneHandler: No valid unit found for im: " << im << endl;
 
 1363         if (name == 
"NTP") 
continue;
 
 1366         const map<G4String,G4AttDef>::const_iterator attDefIterator = attDefs->find(name);
 
 1367         G4String type = attDefIterator->second.GetValueType();
 
 1370         if ((type == 
"G4double") || (type == 
"double")) {   
 
 1371             setAttribute(attribute, attValIterator->GetName(), atof(attValIterator->GetValue()));           
 
 1372         } 
else if ((type == 
"G4int") || (type == 
"int")) {  
 
 1373             setAttribute(attribute, attValIterator->GetName(), atoi(attValIterator->GetValue()));           
 
 1375             setAttribute(attribute, attValIterator->GetName(), attValIterator->GetValue());
 
 1390     type->addAttDef(  
"Generator", 
"Generator of the file", 
"General", 
"");
 
 1391     type->addAttValue(
"Generator", 
G4String(
"Geant4"));
 
 1393     type->addAttDef(  
"GeneratorVersion", 
"Version of the Generator", 
"General", 
"");
 
 1395     versionString = versionString.substr(1,versionString.size()-2);
 
 1396     versionString = 
" Geant4 version " + versionString + 
"   " + 
G4Date;
 
 1397     type->addAttValue(
"GeneratorVersion", versionString);
 
 1401     type->addAttDef(  
"ViewTheta", 
"Theta of initial suggested viewpoint", 
"Draw", 
"rad");
 
 1402     type->addAttValue(
"ViewTheta", viewPointDirection.theta());    
 
 1404     type->addAttDef(  
"ViewPhi", 
"Phi of initial suggested viewpoint", 
"Draw", 
"rad");
 
 1405     type->addAttValue(
"ViewPhi", viewPointDirection.phi());    
 
 1407     type->addAttDef(  
"ViewScale", 
"Scale of initial suggested viewpoint", 
"Draw", 
"");
 
 1411     type->addAttDef(  
"ViewTranslateX", 
"Translate in X of initial suggested viewpoint", 
"Draw", 
"");
 
 1412     type->addAttValue(
"ViewTranslateX", 0.0);    
 
 1414     type->addAttDef(  
"ViewTranslateY", 
"Translate in Y of initial suggested viewpoint", 
"Draw", 
"");
 
 1415     type->addAttValue(
"ViewTranslateY", 0.0);    
 
 1417     type->addAttDef(  
"ViewTranslateZ", 
"Translate in Z of initial suggested viewpoint", 
"Draw", 
"");
 
 1418     type->addAttValue(
"ViewTranslateZ", 0.0);    
 
 1420     type->addAttDef(  
"PointUnit", 
"Length", 
"Physics", 
"");
 
 1421     type->addAttValue(
"PointUnit", 
G4String(
"m"));
 
 1425     type->addAttDef(  
"UseSolids", 
"Use HepRep Solids rather than Geant4 Primitives", 
"Draw", 
"");
 
 1426     type->addAttValue(
"UseSolids", messenger->
useSolids());
 
 1428     type->addAttDef(  
"WriteInvisibles", 
"Write Invisible Objects", 
"Draw", 
"");
 
 1525     HepRepInstance* instance = 
factory->createHepRepInstance(parent, type);
 
 1534         HepRepTreeID* geometryTreeID = 
factory->createHepRepTreeID(
"G4GeometryTypes", 
"1.0");
 
 1570         _geometryRootType->addAttDef  (
"Radlen", 
"Material Radiation Length", 
"Physics",
"");
 
 1605         type = 
factory->createHepRepType(parentType, volumeName);
 
 1615         G4String problem = 
"HierarchyProblem";
 
 1621         return "/" + problem + 
"/" + volumeName;
 
 1631     name = name + 
"/" + volumeName;
 
 1660         HepRepTreeID* eventTreeID = 
factory->createHepRepTreeID(
"G4EventTypes", 
"1.0");
 
 1676         _eventType->addAttValue(
"Color", 1.0, 1.0, 1.0, 1.0);
 
 1677         _eventType->addAttValue(
"FillColor", 1.0, 1.0, 1.0, 1.0);
 
 1680         _eventType->addAttValue(
"PickParent", 
false);
 
 1681         _eventType->addAttValue(
"ShowParentAttributes", 
false);
 
 1683         _eventType->addAttValue(
"MarkSizeMultiplier", 4.0);
 
 1684         _eventType->addAttValue(
"LineWidthMultiplier", 1.0);
 
 1716         _hitType->addAttValue(
"MarkSize", 4.0);
 
 1718         _hitType->addAttValue(
"Fill", 
true);
 
std::vector< HEPREP::HepRepInstance * > _geometryInstance
 
const G4Colour & GetColor(const G4Visible &)
 
void setMarker(HEPREP::HepRepAttribute *attribute, const G4VMarker &marker)
 
HEPREP::HepRepType * getTrajectoryType()
 
void removeSceneHandler()
 
G4double GetZoomFactor() const 
 
G4double GetXHalfLength() const 
 
void AddSolid(const G4Box &box)
 
HEPREP::HepRepInstance * getEventInstance()
 
virtual void AddSolid(const G4Box &)
 
G4double GetAlpha() const 
 
HEPREP::HepRepType * _calHitFaceType
 
HEPREP::HepRepTypeTree * _geometryTypeTree
 
void addAttDefs(HEPREP::HepRepDefinition *definition, const std::map< G4String, G4AttDef > *attDefs)
 
MarkerType GetMarkerType() const 
 
HEPREP::HepRepTypeTree * getGeometryTypeTree()
 
virtual G4bool writeInvisibles()
 
HEPREP::HepRepTypeTree * getEventTypeTree()
 
G4double GetYHalfLength1() const 
 
virtual void BeginModeling()
 
virtual void BeginPrimitives(const G4Transform3D &objectTransformation)
 
const G4VHit * currentHit
 
HEPREP::HepRep * getHepRepGeometry()
 
std::map< G4String, HEPREP::HepRepType * > _geometryType
 
void BeginPrimitives(const G4Transform3D &objectTransformation)
 
bool closeHepRep(bool final=false)
Returns true if the HepRep was (already) closed, false if the HepRep is still open. 
 
HEPREP::HepRepType * _hitType
 
G4double GetLineWidth() const 
 
HEPREP::HepRepType * _geometryRootType
 
void openFile(G4String name)
 
void PreAddSolid(const G4Transform3D &objectTransformation, const G4VisAttributes &visAttribs)
 
HEPREP::HepRepType * getEventType()
 
HEPREP::HepRepType * getCalHitType()
 
const G4String & GetName() const 
 
G4VViewer * GetCurrentViewer() const 
 
G4Material * GetCurrentMaterial() const 
 
HEPREP::HepRepType * _calHitType
 
virtual void PostAddSolid()
 
const G4ViewParameters & GetViewParameters() const 
 
G4double GetDensity() const 
 
std::vector< G4String > _geometryTypeName
 
G4String eventNumberSuffix
 
const G4String & GetName() const 
 
HEPREP::HepRepFactory * factory
 
G4String getFullTypeName(G4String volumeName, int depth)
 
HEPREP::HepRepType * _eventType
 
HepGeom::Point3D< G4double > G4Point3D
 
HepGeom::Vector3D< G4double > G4Vector3D
 
G4double GetOuterRadiusMinusZ() const 
 
G4Point3D GetPosition() const 
 
const G4VisAttributes * GetVisAttributes() const 
 
G4Region * GetRegion() const 
 
virtual G4GeometryType GetEntityType() const =0
 
G4double GetZHalfLength() const 
 
G4int GetCurrentDepth() const 
 
virtual void AddPrimitive(const G4Polyline &)=0
 
G4double GetZHalfLength() const 
 
HEPREP::HepRep * _heprepGeometry
 
LineStyle GetLineStyle() const 
 
virtual G4String getEventNumberSuffix()
 
G4double GetXHalfLength2() const 
 
HEPREP::HepRepInstance * getGeometryRootInstance()
 
G4Color getColorFor(const G4Visible &visible)
 
HEPREP::HepRepInstance * _eventInstance
 
const G4Vector3D & GetViewpointDirection() const 
 
HEPREP::HepRepType * getHitType()
 
HEPREP::HepRep * getHepRep()
 
G4String getParentTypeName(int currentDepth)
 
G4double GetDeltaPhiAngle() const 
 
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const 
 
std::map< int, G4String > materialState
 
G4double GetGreen() const 
 
G4bool IsRootRegion() const 
 
static const G4String G4Version
 
void addTopLevelAttributes(HEPREP::HepRepType *type)
 
static const double twopi
 
void addAttributes(HEPREP::HepRepInstance *instance, HEPREP::HepRepType *type)
 
static G4int sceneIdCount
 
G4double GetMarkerRadius(const G4VMarker &, MarkerSizeType &)
 
virtual void EndModeling()
 
static G4HepRepMessenger * GetInstance()
 
G4VGraphicsSystem * GetGraphicsSystem() const 
 
virtual void EndPrimitives()
 
G4double GetYHalfLength() const 
 
HEPREP::HepRepInstanceTree * _eventInstanceTree
 
G4double GetYHalfLength2() const 
 
static const G4String G4Date
 
void setLine(HEPREP::HepRepAttribute *attribute, const G4VSolid &solid)
 
G4double GetInnerRadiusPlusZ() const 
 
G4double GetInnerRadius() const 
 
HEPREP::HepRepInstance * _geometryRootInstance
 
virtual G4bool appendGeometry()
 
G4double GetRadlen() const 
 
virtual ~G4HepRepSceneHandler()
 
void writeLayers(HEPREP::HepRep *heprep)
 
HEPREP::HepRepTypeTree * _eventTypeTree
 
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
 
const G4Color & GetColor() const 
 
HEPREP::HepRepType * getCalHitFaceType()
 
const G4VisAttributes * fpVisAttribs
 
G4Scene * GetScene() const 
 
virtual void AddCompound(const G4VTrajectory &)
 
static const G4double factor
 
virtual std::vector< G4AttValue > * CreateAttValues() const 
 
HEPREP::HepRepWriter * writer
 
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const 
 
void setVisibility(HEPREP::HepRepAttribute *attribute, const G4VSolid &solid)
 
void AddCompound(const G4VTrajectory &)
 
G4HepRepSceneHandler(G4VGraphicsSystem &system, const G4String &name="")
 
G4bool writeMultipleFiles
 
G4double GetZHalfLength() const 
 
HEPREP::HepRepType * getGeometryRootType()
 
virtual void PreAddSolid(const G4Transform3D &objectTransformation, const G4VisAttributes &)
 
void setAttribute(HEPREP::HepRepAttribute *attribute, G4String name, char *value)
 
virtual std::vector< G4AttValue > * CreateAttValues() const 
 
HEPREP::HepRepInstance * getGeometryOrEventInstance(HEPREP::HepRepType *type)
 
FillStyle GetFillStyle() const 
 
G4double GetXHalfLength1() const 
 
void AddPrimitive(const G4Polyline &)
 
static MCTruthManager * instance
 
HEPREP::HepRepInstanceTree * getGeometryInstanceTree()
 
G4bool fReadyForTransients
 
const G4String & GetName() const 
 
G4double GetInnerRadiusMinusZ() const 
 
HEPREP::HepRepInstance * getGeometryInstance(G4LogicalVolume *volume, G4Material *material, int depth)
 
G4LogicalVolume * GetCurrentLV() const 
 
HEPREP::HepRepType * getGeometryType(G4String volumeName, int depth)
 
static const G4double alpha
 
const G4VTrajectory * currentTrack
 
HEPREP::HepRepType * _trajectoryType
 
G4double GetOuterRadiusPlusZ() const 
 
HEPREP::HepRepInstanceTree * getEventInstanceTree()
 
G4String eventNumberPrefix
 
G4double GetZHalfLength() const 
 
virtual G4bool useSolids()
 
static const G4double pos
 
G4VSolid * GetSolid() const 
 
G4double GetOuterRadius() const 
 
HEPREP::HepRepInstanceTree * _geometryInstanceTree
 
void addAttVals(HEPREP::HepRepAttribute *attribute, const std::map< G4String, G4AttDef > *attDefs, std::vector< G4AttValue > *attValues)
 
void setColor(HEPREP::HepRepAttribute *attribute, const G4Color &color, const G4String &key=G4String("Color"))
 
HepGeom::Normal3D< G4double > G4Normal3D
 
virtual void DrawView()=0
 
G4double GetDeltaPhiAngle() const