Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4HepRepFileSceneHandler Class Reference

#include <G4HepRepFileSceneHandler.hh>

Inheritance diagram for G4HepRepFileSceneHandler:
Collaboration diagram for G4HepRepFileSceneHandler:

Public Member Functions

 G4HepRepFileSceneHandler (G4VGraphicsSystem &system, const G4String &name)
 
virtual ~G4HepRepFileSceneHandler ()
 
void AddSolid (const G4Box &)
 
void AddSolid (const G4Cons &)
 
void AddSolid (const G4Tubs &)
 
void AddSolid (const G4Trd &)
 
void AddSolid (const G4Trap &)
 
void AddSolid (const G4Sphere &)
 
void AddSolid (const G4Para &)
 
void AddSolid (const G4Torus &)
 
void AddSolid (const G4Polycone &)
 
void AddSolid (const G4Polyhedra &)
 
void AddSolid (const G4Orb &)
 
void AddSolid (const G4Ellipsoid &)
 
void AddSolid (const G4VSolid &)
 
void AddCompound (const G4VTrajectory &)
 
void InitTrajectory ()
 
void AddCompound (const G4VHit &)
 
void InitHit ()
 
void AddCompound (const G4THitsMap< G4double > &hits)
 
void AddCompound (const G4THitsMap< G4StatDouble > &hits)
 
void AddCompound (const G4VDigi &digi)
 
void AddPrimitive (const G4Polyline &)
 
void AddPrimitive (const G4Text &)
 
void AddPrimitive (const G4Circle &)
 
void AddPrimitive (const G4Square &)
 
void AddPrimitive (const G4Polyhedron &)
 
void AddPrimitive (const G4Polymarker &)
 
void AddPrimitive (const G4Scale &scale)
 
void BeginModeling ()
 
void EndModeling ()
 
void BeginPrimitives2D (const G4Transform3D &objectTransformation)
 
void EndPrimitives2D ()
 
void ClearTransientStore ()
 
G4HepRepFileXMLWriterGetHepRepXMLWriter ()
 
- Public Member Functions inherited from G4VSceneHandler
 G4VSceneHandler (G4VGraphicsSystem &system, G4int id, const G4String &name="")
 
virtual ~G4VSceneHandler ()
 
virtual void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &)
 
virtual void PostAddSolid ()
 
virtual void BeginPrimitives (const G4Transform3D &objectTransformation)
 
virtual void EndPrimitives ()
 
virtual const G4VisExtentGetExtent () const
 
const G4StringGetName () const
 
G4int GetSceneHandlerId () const
 
G4int GetViewCount () const
 
G4VGraphicsSystemGetGraphicsSystem () const
 
G4SceneGetScene () const
 
const G4ViewerListGetViewerList () const
 
G4VModelGetModel () const
 
G4VViewerGetCurrentViewer () const
 
G4bool GetMarkForClearingTransientStore () const
 
G4bool IsReadyForTransients () const
 
G4bool GetTransientsDrawnThisEvent () const
 
G4bool GetTransientsDrawnThisRun () const
 
const G4Transform3DGetObjectTransformation () const
 
void SetName (const G4String &)
 
void SetCurrentViewer (G4VViewer *)
 
virtual void SetScene (G4Scene *)
 
G4ViewerListSetViewerList ()
 
void SetModel (G4VModel *)
 
void SetMarkForClearingTransientStore (G4bool)
 
void SetTransientsDrawnThisEvent (G4bool)
 
void SetTransientsDrawnThisRun (G4bool)
 
void SetObjectTransformation (const G4Transform3D &)
 
const G4ColourGetColour ()
 
const G4ColourGetColor ()
 
const G4ColourGetTextColour (const G4Text &)
 
const G4ColourGetTextColor (const G4Text &)
 
G4double GetLineWidth (const G4VisAttributes *)
 
G4ViewParameters::DrawingStyle GetDrawingStyle (const G4VisAttributes *)
 
G4bool GetAuxEdgeVisible (const G4VisAttributes *)
 
G4int GetNoOfSides (const G4VisAttributes *)
 
G4double GetMarkerSize (const G4VMarker &, MarkerSizeType &)
 
G4double GetMarkerDiameter (const G4VMarker &, MarkerSizeType &)
 
G4double GetMarkerRadius (const G4VMarker &, MarkerSizeType &)
 
G4ModelingParametersCreateModelingParameters ()
 
void DrawEvent (const G4Event *)
 
void DrawEndOfRunModels ()
 
template<class T >
void AddSolidT (const T &solid)
 
template<class T >
void AddSolidWithAuxiliaryEdges (const T &solid)
 
G4int IncrementViewCount ()
 
virtual void ClearStore ()
 
void AddViewerToList (G4VViewer *pView)
 
void RemoveViewerFromList (G4VViewer *pView)
 
- Public Member Functions inherited from G4VGraphicsScene
 G4VGraphicsScene ()
 
virtual ~G4VGraphicsScene ()
 

Static Protected Attributes

static G4int fSceneIdCount = 0
 

Additional Inherited Members

- Public Types inherited from G4VSceneHandler
enum  MarkerSizeType { world, screen }
 
- Protected Member Functions inherited from G4VSceneHandler
virtual void ProcessScene ()
 
virtual void RequestPrimitives (const G4VSolid &solid)
 
virtual G4VSolidCreateSectionSolid ()
 
virtual G4VSolidCreateCutawaySolid ()
 
void LoadAtts (const G4Visible &, G4AttHolder *)
 
- Protected Attributes inherited from G4VSceneHandler
G4VGraphicsSystemfSystem
 
const G4int fSceneHandlerId
 
G4String fName
 
G4int fViewCount
 
G4ViewerList fViewerList
 
G4VViewerfpViewer
 
G4ScenefpScene
 
G4bool fMarkForClearingTransientStore
 
G4bool fReadyForTransients
 
G4bool fTransientsDrawnThisEvent
 
G4bool fTransientsDrawnThisRun
 
G4bool fProcessingSolid
 
G4bool fProcessing2D
 
G4VModelfpModel
 
G4Transform3D fObjectTransformation
 
G4int fNestingDepth
 
const G4VisAttributesfpVisAttribs
 
const G4Transform3D fIdentityTransformation
 

Detailed Description

Definition at line 59 of file G4HepRepFileSceneHandler.hh.

Constructor & Destructor Documentation

G4HepRepFileSceneHandler::G4HepRepFileSceneHandler ( G4VGraphicsSystem system,
const G4String name 
)

Definition at line 70 of file G4HepRepFileSceneHandler.cc.

71  :
72 G4VSceneHandler(system, fSceneIdCount++, name)
73 {
74  hepRepXMLWriter = ((G4HepRepFile*)(&system))->GetHepRepXMLWriter();
75  fileCounter = 0;
76 
77  inPrimitives2D = false;
78  warnedAbout3DText = false;
79  warnedAbout2DMarkers = false;
80  haveVisible = false;
81  drawingTraj = false;
82  doneInitTraj = false;
83  drawingHit = false;
84  doneInitHit = false;
85  trajContext = 0;
86  trajAttValues = 0;
87  trajAttDefs = 0;
88  hitAttValues = 0;
89  hitAttDefs = 0;
90 }
G4VSceneHandler(G4VGraphicsSystem &system, G4int id, const G4String &name="")
G4HepRepFileXMLWriter * GetHepRepXMLWriter()

Here is the call graph for this function:

G4HepRepFileSceneHandler::~G4HepRepFileSceneHandler ( )
virtual

Definition at line 93 of file G4HepRepFileSceneHandler.cc.

93 {}

Member Function Documentation

void G4HepRepFileSceneHandler::AddCompound ( const G4VTrajectory traj)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 517 of file G4HepRepFileSceneHandler.cc.

517  {
518 #ifdef G4HEPREPFILEDEBUG
519  G4cout << "G4HepRepFileSceneHandler::AddCompound(const G4VTrajectory&) " << G4endl;
520 #endif
521 
522  G4TrajectoriesModel* pTrModel =
523  dynamic_cast<G4TrajectoriesModel*>(fpModel);
524  if (!pTrModel) G4Exception
525  ("G4HepRepFileSceneHandler::AddCompound(const G4VTrajectory&)",
526  "vis-HepRep0001", FatalException, "Not a G4TrajectoriesModel.");
527 
528  // Pointers to hold trajectory attribute values and definitions.
529  std::vector<G4AttValue>* rawTrajAttValues = traj.CreateAttValues();
530  trajAttValues =
531  new std::vector<G4AttValue>;
532  trajAttDefs =
533  new std::map<G4String,G4AttDef>;
534 
535  // Iterators to use with attribute values and definitions.
536  std::vector<G4AttValue>::iterator iAttVal;
537  std::map<G4String,G4AttDef>::const_iterator iAttDef;
538  G4int i;
539 
540  // Get trajectory attributes and definitions in standard HepRep style
541  // (uniform units, 3Vectors decomposed).
542  if (rawTrajAttValues) {
543  G4bool error = G4AttCheck(rawTrajAttValues,
544  traj.GetAttDefs()).Standard(trajAttValues,trajAttDefs);
545  if (error) {
546  G4cout << "G4HepRepFileSceneHandler::AddCompound(traj):"
547  "\nERROR found during conversion to standard trajectory attributes."
548  << G4endl;
549  }
550 #ifdef G4HEPREPFILEDEBUG
551  G4cout <<
552  "G4HepRepFileSceneHandler::AddCompound(traj): standardised attributes:\n"
553  << G4AttCheck(trajAttValues,trajAttDefs) << G4endl;
554 #endif
555  delete rawTrajAttValues;
556  }
557 
558  // Open the HepRep output file if it is not already open.
559  CheckFileOpen();
560 
561  // Add the Event Data Type if it hasn't already been added.
562  if (strcmp("Event Data",hepRepXMLWriter->prevTypeName[0])!=0) {
563  hepRepXMLWriter->addType("Event Data",0);
564  hepRepXMLWriter->addInstance();
565  }
566 
567  // Add the Trajectories Type.
568  G4String previousName = hepRepXMLWriter->prevTypeName[1];
569  hepRepXMLWriter->addType("Trajectories",1);
570 
571  // If this is the first trajectory of this event,
572  // specify attribute values common to all trajectories.
573  if (strcmp("Trajectories",previousName)!=0) {
574  hepRepXMLWriter->addAttValue("Layer",100);
575 
576  // Take all Trajectory attDefs from first trajectory.
577  // Would rather be able to get these attDefs without needing a reference from any
578  // particular trajectory, but don't know how to do that.
579  // Write out trajectory attribute definitions.
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()) {
585  // Protect against incorrect use of Category. Anything value other than the
586  // standard ones will be considered to be in the physics category.
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());
595  }
596  }
597  }
598 
599  // Take all TrajectoryPoint attDefs from first point of first trajectory.
600  // Would rather be able to get these attDefs without needing a reference from any
601  // particular point, but don't know how to do that.
602  if ((trajContext->GetDrawStepPts() || trajContext->GetDrawAuxPts())
603  && traj.GetPointEntries()>0) {
604  G4VTrajectoryPoint* aTrajectoryPoint = traj.GetPoint(0);
605 
606  // Pointers to hold trajectory point attribute values and definitions.
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>;
612 
613  // Get first trajectory point's attributes and definitions in standard HepRep style
614  // (uniform units, 3Vectors decomposed).
615  if (rawPointAttValues) {
616  G4bool error = G4AttCheck(rawPointAttValues,
617  aTrajectoryPoint->GetAttDefs()).Standard(pointAttValues,pointAttDefs);
618  if (error) {
619  G4cout << "G4HepRepFileSceneHandler::AddCompound(traj):"
620  "\nERROR found during conversion to standard first point attributes." << G4endl;
621  }
622 
623  // Write out point attribute definitions.
624  if (pointAttValues && pointAttDefs) {
625  for (iAttVal = pointAttValues->begin();
626  iAttVal != pointAttValues->end(); ++iAttVal) {
627  iAttDef =
628  pointAttDefs->find(iAttVal->GetName());
629  if (iAttDef != pointAttDefs->end()) {
630  // Protect against incorrect use of Category. Anything value other than the
631  // standard ones will be considered to be in the physics category.
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";
638  // Do not write out the Aux or Pos attribute. Aux does not conform to the HepRep rule
639  // that each object can have only one instance of a given AttValue.
640  // Both of these attributes are redundant to actual position information of the point.
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());
649  }
650  }
651  }
652  delete rawPointAttValues;
653  }
654 
655  // Clean up point attributes.
656  if (pointAttValues)
657  delete pointAttValues;
658  if (pointAttDefs)
659  delete pointAttDefs;
660  }
661  } // end of special treatment for when this is the first trajectory.
662 
663  // Now that we have written out all of the attributes that are based on the
664  // trajectory's particulars, call base class to deconstruct trajectory into polyline and/or points
665  // (or nothing if trajectory is to be filtered out).
666  // If base class calls for drawing points, no points will actually be drawn there since we
667  // instead need to do point drawing from here (in order to obtain the points attributes,
668  // not available from AddPrimitive(...point). Instead, such a call will just serve to set the
669  // flag that tells us that point drawing was requested for this trajectory (depends on several
670  // factors including trajContext and filtering).
671  drawingTraj = true;
672  doneInitTraj = false;
674  drawingTraj = false;
675 
676  // Draw step points.
677  if (trajContext->GetDrawStepPts()) {
678  if (!doneInitTraj)
679  InitTrajectory();
680  // Create Trajectory Points as a subType of Trajectories.
681  // Note that we should create this heprep type even if there are no actual points.
682  // This allows the user to tell that points don't exist (admittedly odd) rather
683  // than that they were omitted by the drawing mode.
684  previousName = hepRepXMLWriter->prevTypeName[2];
685  hepRepXMLWriter->addType("Trajectory Step Points",2);
686 
687  float redness;
688  float greenness;
689  float blueness;
690  G4int markSize;
691  G4bool visible;
692  G4bool square;
693  G4Colour colour = trajContext->GetStepPtsColour();
694  redness = colour.GetRed();
695  greenness = colour.GetGreen();
696  blueness = colour.GetBlue();
697  markSize = (G4int) trajContext->GetStepPtsSize();
698  visible = (G4int) trajContext->GetStepPtsVisible();
699  square = (trajContext->GetStepPtsType()==G4Polymarker::squares);
700 
701  // Avoiding drawing anything black on black.
702  if (redness==0. && greenness==0. && blueness==0.) {
703  redness = 1.;
704  greenness = 1.;
705  blueness = 1.;
706  }
707 
708  // Specify attributes common to all trajectory points.
709  if (strcmp("Trajectory Step Points",previousName)!=0) {
710  hepRepXMLWriter->addAttValue("DrawAs","Point");
711  hepRepXMLWriter->addAttValue("MarkColor", redness, greenness, blueness);
712  hepRepXMLWriter->addAttValue("MarkSize",markSize);
713  hepRepXMLWriter->addAttValue("Layer",110);
714  hepRepXMLWriter->addAttValue("Visibility",visible);
715  if (square)
716  hepRepXMLWriter->addAttValue("MarkName","square");
717  else
718  hepRepXMLWriter->addAttValue("MarkName","dot");
719  }
720 
721  // Loop over all points on this trajectory.
722  for (i = 0; i < traj.GetPointEntries(); i++) {
723  G4VTrajectoryPoint* aTrajectoryPoint = traj.GetPoint(i);
724 
725  // Each point is a separate instance of the type Trajectory Points.
726  hepRepXMLWriter->addInstance();
727 
728  // Pointers to hold trajectory point attribute values and definitions.
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>;
734 
735  // Get trajectory point attributes and definitions in standard HepRep style
736  // (uniform units, 3Vectors decomposed).
737  if (rawPointAttValues) {
738  G4bool error = G4AttCheck(rawPointAttValues,
739  aTrajectoryPoint->GetAttDefs()).Standard(pointAttValues,pointAttDefs);
740  if (error) {
741  G4cout << "G4HepRepFileSceneHandler::AddCompound(traj):"
742  "\nERROR found during conversion to standard point attributes." << G4endl;
743  }
744 
745  // Write out point attribute values.
746  if (pointAttValues) {
747  for (iAttVal = pointAttValues->begin();
748  iAttVal != pointAttValues->end(); ++iAttVal)
749  // Do not write out the Aux or Pos attribute. Aux does not conform to the HepRep rule
750  // that each object can have only one instance of a given AttValue.
751  // Both of these attributes are redundant to actual position information of the point.
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());
759  }
760  }
761 
762  // Clean up point attributes.
763  delete pointAttDefs;
764  delete pointAttValues;
765  delete rawPointAttValues;
766 
767  // Each trajectory point is made of a single primitive, a point.
768  hepRepXMLWriter->addPrimitive();
769  G4Point3D vertex = aTrajectoryPoint->GetPosition();
770  hepRepXMLWriter->addPoint(vertex.x(), vertex.y(), vertex.z());
771  }
772  }
773 
774  // Draw Auxiliary Points
775  if (trajContext->GetDrawAuxPts()) {
776  if (!doneInitTraj)
777  InitTrajectory();
778  // Create Trajectory Points as a subType of Trajectories.
779  // Note that we should create this heprep type even if there are no actual points.
780  // This allows the user to tell that points don't exist (admittedly odd) rather
781  // than that they were omitted by the drawing mode.
782  previousName = hepRepXMLWriter->prevTypeName[2];
783  hepRepXMLWriter->addType("Trajectory Auxiliary Points",2);
784 
785  float redness;
786  float greenness;
787  float blueness;
788  G4int markSize;
789  G4bool visible;
790  G4bool square;
791  G4Colour colour = trajContext->GetAuxPtsColour();
792  redness = colour.GetRed();
793  greenness = colour.GetGreen();
794  blueness = colour.GetBlue();
795  markSize = (G4int) trajContext->GetAuxPtsSize();
796  visible = (G4int) trajContext->GetAuxPtsVisible();
797  square = (trajContext->GetAuxPtsType()==G4Polymarker::squares);
798 
799  // Avoiding drawing anything black on black.
800  if (redness==0. && greenness==0. && blueness==0.) {
801  redness = 1.;
802  greenness = 1.;
803  blueness = 1.;
804  }
805 
806  // Specify attributes common to all trajectory points.
807  if (strcmp("Trajectory Auxiliary Points",previousName)!=0) {
808  hepRepXMLWriter->addAttValue("DrawAs","Point");
809  hepRepXMLWriter->addAttValue("MarkColor", redness, greenness, blueness);
810  hepRepXMLWriter->addAttValue("MarkSize",markSize);
811  hepRepXMLWriter->addAttValue("Layer",110);
812  hepRepXMLWriter->addAttValue("Visibility",visible);
813  if (square)
814  hepRepXMLWriter->addAttValue("MarkName","Square");
815  else
816  hepRepXMLWriter->addAttValue("MarkName","Dot");
817  }
818 
819  // Loop over all points on this trajectory.
820  for (i = 0; i < traj.GetPointEntries(); i++) {
821  G4VTrajectoryPoint* aTrajectoryPoint = traj.GetPoint(i);
822 
823  // Each point is a separate instance of the type Trajectory Points.
824  hepRepXMLWriter->addInstance();
825 
826  // Pointers to hold trajectory point attribute values and definitions.
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>;
832 
833  // Get trajectory point attributes and definitions in standard HepRep style
834  // (uniform units, 3Vectors decomposed).
835  if (rawPointAttValues) {
836  G4bool error = G4AttCheck(rawPointAttValues,
837  aTrajectoryPoint->GetAttDefs()).Standard(pointAttValues,pointAttDefs);
838  if (error) {
839  G4cout << "G4HepRepFileSceneHandler::AddCompound(traj):"
840  "\nERROR found during conversion to standard point attributes." << G4endl;
841  }
842 
843  // Write out point attribute values.
844  if (pointAttValues) {
845  for (iAttVal = pointAttValues->begin();
846  iAttVal != pointAttValues->end(); ++iAttVal)
847  // Do not write out the Aux or Pos attribute. Aux does not conform to the HepRep rule
848  // that each object can have only one instance of a given AttValue.
849  // Both of these attributes are redundant to actual position information of the point.
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());
857  }
858  }
859 
860  // Clean up point attributes.
861  delete pointAttDefs;
862  delete pointAttValues;
863  delete rawPointAttValues;
864 
865  // Each trajectory point is made of a single primitive, a point.
866  G4Point3D vertex = aTrajectoryPoint->GetPosition();
867 
868  // Loop over auxiliary points associated with this Trajectory Point.
869  const std::vector<G4ThreeVector>* auxiliaries = aTrajectoryPoint->GetAuxiliaryPoints();
870  if (0 != auxiliaries) {
871  for (size_t iAux=0; iAux<auxiliaries->size(); ++iAux) {
872  const G4ThreeVector auxPos((*auxiliaries)[iAux]);
873  hepRepXMLWriter->addPrimitive();
874  hepRepXMLWriter->addPoint(auxPos.x(), auxPos.y(), auxPos.z());
875  }
876  }
877  }
878  }
879 }
G4double GetStepPtsSize() const
virtual const std::vector< G4ThreeVector > * GetAuxiliaryPoints() const
G4double GetAuxPtsSize() const
virtual G4VTrajectoryPoint * GetPoint(G4int i) const =0
void addAttValue(const char *name, const char *value)
G4double GetBlue() const
Definition: G4Colour.hh:141
G4Colour GetAuxPtsColour() const
G4Polymarker::MarkerType GetAuxPtsType() const
int G4int
Definition: G4Types.hh:78
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual std::vector< G4AttValue > * CreateAttValues() const
G4bool GetAuxPtsVisible() const
virtual int GetPointEntries() const =0
G4GLOB_DLL std::ostream G4cout
void addPoint(double x, double y, double z)
G4double GetRed() const
Definition: G4Colour.hh:139
void addAttDef(const char *name, const char *desc, const char *type, const char *extra)
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
bool G4bool
Definition: G4Types.hh:79
G4double GetGreen() const
Definition: G4Colour.hh:140
G4bool GetDrawStepPts() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
virtual const G4ThreeVector GetPosition() const =0
G4Colour GetStepPtsColour() const
virtual void AddCompound(const G4VTrajectory &)
virtual std::vector< G4AttValue > * CreateAttValues() const
G4Polymarker::MarkerType GetStepPtsType() const
#define G4endl
Definition: G4ios.hh:61
static PROLOG_HANDLER error
Definition: xmlrole.cc:112
void addType(const char *name, int newTypeDepth)
G4bool GetDrawAuxPts() const
G4bool GetStepPtsVisible() const

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddCompound ( const G4VHit hit)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 882 of file G4HepRepFileSceneHandler.cc.

882  {
883 #ifdef G4HEPREPFILEDEBUG
884  G4cout << "G4HepRepFileSceneHandler::AddCompound(G4VHit&) " << G4endl;
885 #endif
886 
887  // Pointers to hold hit attribute values and definitions.
888  std::vector<G4AttValue>* rawHitAttValues = hit.CreateAttValues();
889  hitAttValues =
890  new std::vector<G4AttValue>;
891  hitAttDefs =
892  new std::map<G4String,G4AttDef>;
893 
894  // Iterators to use with attribute values and definitions.
895  std::vector<G4AttValue>::iterator iAttVal;
896  std::map<G4String,G4AttDef>::const_iterator iAttDef;
897 
898  // Get hit attributes and definitions in standard HepRep style
899  // (uniform units, 3Vectors decomposed).
900  if (rawHitAttValues) {
901  G4bool error = G4AttCheck(rawHitAttValues,
902  hit.GetAttDefs()).Standard(hitAttValues,hitAttDefs);
903  if (error) {
904  G4cout << "G4HepRepFileSceneHandler::AddCompound(hit):"
905  "\nERROR found during conversion to standard hit attributes."
906  << G4endl;
907  }
908 #ifdef G4HEPREPFILEDEBUG
909  G4cout <<
910  "G4HepRepFileSceneHandler::AddCompound(hit): standardised attributes:\n"
911  << G4AttCheck(hitAttValues,hitAttDefs) << G4endl;
912 #endif
913  delete rawHitAttValues;
914  }
915 
916  // Open the HepRep output file if it is not already open.
917  CheckFileOpen();
918 
919  // Add the Event Data Type if it hasn't already been added.
920  if (strcmp("Event Data",hepRepXMLWriter->prevTypeName[0])!=0) {
921  hepRepXMLWriter->addType("Event Data",0);
922  hepRepXMLWriter->addInstance();
923  }
924 
925  // Find out the current HitType.
926  G4String hitType = "Hits";
927  if (hitAttValues) {
928  G4bool found = false;
929  for (iAttVal = hitAttValues->begin();
930  iAttVal != hitAttValues->end() && !found; ++iAttVal) {
931  if (strcmp(iAttVal->GetName(),"HitType")==0) {
932  hitType = iAttVal->GetValue();
933  found = true;
934  }
935  }
936  }
937 
938  // Add the Hits Type.
939  G4String previousName = hepRepXMLWriter->prevTypeName[1];
940  hepRepXMLWriter->addType(hitType,1);
941 
942  // If this is the first hit of this event,
943  // specify attribute values common to all hits.
944  if (strcmp(hitType,previousName)!=0) {
945  hepRepXMLWriter->addAttValue("Layer",130);
946 
947  // Take all Hit attDefs from first hit.
948  // Would rather be able to get these attDefs without needing a reference from any
949  // particular hit, but don't know how to do that.
950  // Write out hit attribute definitions.
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()) {
956  // Protect against incorrect use of Category. Anything value other than the
957  // standard ones will be considered to be in the physics category.
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());
966  }
967  }
968  }
969  } // end of special treatment for when this is the first hit.
970 
971  // Now that we have written out all of the attributes that are based on the
972  // hit's particulars, call base class to deconstruct hit into a primitives.
973  drawingHit = true;
974  doneInitHit = false;
975  G4VSceneHandler::AddCompound(hit); // Invoke default action.
976  drawingHit = false;
977 }
void addAttValue(const char *name, const char *value)
G4GLOB_DLL std::ostream G4cout
void addAttDef(const char *name, const char *desc, const char *type, const char *extra)
bool G4bool
Definition: G4Types.hh:79
virtual void AddCompound(const G4VTrajectory &)
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
Definition: G4VHit.hh:60
virtual std::vector< G4AttValue > * CreateAttValues() const
Definition: G4VHit.hh:67
#define G4endl
Definition: G4ios.hh:61
static PROLOG_HANDLER error
Definition: xmlrole.cc:112
void addType(const char *name, int newTypeDepth)

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddCompound ( const G4THitsMap< G4double > &  hits)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 85 of file G4HepRepFileSceneHandler.hh.

85  {
87  }
virtual void AddCompound(const G4VTrajectory &)

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddCompound ( const G4THitsMap< G4StatDouble > &  hits)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 88 of file G4HepRepFileSceneHandler.hh.

88  {
90  }
virtual void AddCompound(const G4VTrajectory &)

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddCompound ( const G4VDigi digi)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 91 of file G4HepRepFileSceneHandler.hh.

91  {
93  }
virtual void AddCompound(const G4VTrajectory &)

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddPrimitive ( const G4Polyline polyline)
virtual

Implements G4VSceneHandler.

Definition at line 1026 of file G4HepRepFileSceneHandler.cc.

1026  {
1027 #ifdef G4HEPREPFILEDEBUG
1028  G4cout <<
1029  "G4HepRepFileSceneHandler::AddPrimitive(const G4Polyline& polyline) called:"
1030  "\n polyline: " << polyline
1031  << G4endl;
1032  PrintThings();
1033 #endif
1034 
1036 
1037  if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
1038  return;
1039 
1040  if (inPrimitives2D) {
1041  if (!warnedAbout2DMarkers) {
1042  G4cout << "HepRepFile does not currently support 2D lines." << G4endl;
1043  warnedAbout2DMarkers = true;
1044  }
1045  return;
1046  }
1047 
1048  if (drawingTraj)
1049  InitTrajectory();
1050 
1051  if (drawingHit)
1052  InitHit();
1053 
1054  haveVisible = true;
1055  AddHepRepInstance("Line", polyline);
1056 
1057  hepRepXMLWriter->addPrimitive();
1058 
1059  for (size_t i=0; i < polyline.size(); i++) {
1060  G4Point3D vertex = (fObjectTransformation) * polyline[i];
1061  hepRepXMLWriter->addPoint(vertex.x(), vertex.y(), vertex.z());
1062  }
1063 }
G4bool IsVisible() const
G4Transform3D fObjectTransformation
G4GLOB_DLL std::ostream G4cout
void addPoint(double x, double y, double z)
virtual G4bool getCullInvisibles()
static G4HepRepMessenger * GetInstance()
const G4VisAttributes * fpVisAttribs
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddPrimitive ( const G4Text text)
virtual

Implements G4VSceneHandler.

Definition at line 1114 of file G4HepRepFileSceneHandler.cc.

1114  {
1115 #ifdef G4HEPREPFILEDEBUG
1116  G4cout <<
1117  "G4HepRepFileSceneHandler::AddPrimitive(const G4Text& text) called:"
1118  "\n text: " << text.GetText()
1119  << G4endl;
1120  PrintThings();
1121 #endif
1122 
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;
1129  }
1130  return;
1131  }
1132 
1133  MarkerSizeType sizeType;
1134  G4double size = GetMarkerSize (text, sizeType);
1135  if (sizeType==world)
1136  size = 12.;
1137 
1138  haveVisible = true;
1139  AddHepRepInstance("Text", text);
1140 
1141  hepRepXMLWriter->addAttValue("VAlign", "Top");
1142  hepRepXMLWriter->addAttValue("HAlign", "Left");
1143  hepRepXMLWriter->addAttValue("FontName", "Arial");
1144  hepRepXMLWriter->addAttValue("FontStyle", "Plain");
1145  hepRepXMLWriter->addAttValue("FontSize", (G4int) size);
1146  hepRepXMLWriter->addAttValue("FontHasBanner", "TRUE");
1147  hepRepXMLWriter->addAttValue("FontBannerColor", "0,0,0");
1148 
1149  const G4Colour& colour = GetTextColour(text);
1150  float redness = colour.GetRed();
1151  float greenness = colour.GetGreen();
1152  float blueness = colour.GetBlue();
1153 
1154  // Avoiding drawing anything black on black.
1155  if (redness==0. && greenness==0. && blueness==0.) {
1156  redness = 1.;
1157  greenness = 1.;
1158  blueness = 1.;
1159  }
1160  hepRepXMLWriter->addAttValue("FontColor",redness,greenness,blueness);
1161 
1162  hepRepXMLWriter->addPrimitive();
1163 
1164  hepRepXMLWriter->addAttValue("Text", text.GetText());
1165  hepRepXMLWriter->addAttValue("VPos", .99-text.GetYOffset());
1166  hepRepXMLWriter->addAttValue("HPos", text.GetXOffset());
1167 }
void addAttValue(const char *name, const char *value)
G4double GetBlue() const
Definition: G4Colour.hh:141
int G4int
Definition: G4Types.hh:78
G4double GetYOffset() const
G4GLOB_DLL std::ostream G4cout
G4double GetRed() const
Definition: G4Colour.hh:139
G4double GetGreen() const
Definition: G4Colour.hh:140
G4double GetXOffset() const
G4String GetText() const
G4double GetMarkerSize(const G4VMarker &, MarkerSizeType &)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
const G4Colour & GetTextColour(const G4Text &)

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddPrimitive ( const G4Circle circle)
virtual

Implements G4VSceneHandler.

Definition at line 1170 of file G4HepRepFileSceneHandler.cc.

1170  {
1171 #ifdef G4HEPREPFILEDEBUG
1172  G4cout <<
1173  "G4HepRepFileSceneHandler::AddPrimitive(const G4Circle& circle) called:"
1174  "\n radius: " << circle.GetWorldRadius()
1175  << G4endl;
1176  PrintThings();
1177 #endif
1178 
1180 
1181  if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
1182  return;
1183 
1184  if (inPrimitives2D) {
1185  if (!warnedAbout2DMarkers) {
1186  G4cout << "HepRepFile does not currently support 2D circles." << G4endl;
1187  warnedAbout2DMarkers = true;
1188  }
1189  return;
1190  }
1191 
1192  MarkerSizeType sizeType;
1193  G4double size = GetMarkerSize (circle, sizeType);
1194  if (sizeType==world)
1195  size = 4.;
1196 
1197  if (drawingTraj)
1198  return;
1199 
1200  if (drawingHit)
1201  InitHit();
1202 
1203  haveVisible = true;
1204  AddHepRepInstance("Point", circle);
1205 
1206  hepRepXMLWriter->addAttValue("MarkName", "Dot");
1207  hepRepXMLWriter->addAttValue("MarkSize", (G4int) size);
1208 
1209  hepRepXMLWriter->addPrimitive();
1210 
1211  G4Point3D center = (fObjectTransformation) * circle.GetPosition();
1212  hepRepXMLWriter->addPoint(center.x(), center.y(), center.z());
1213 }
G4double GetWorldRadius() const
void addAttValue(const char *name, const char *value)
G4bool IsVisible() const
G4Transform3D fObjectTransformation
G4Point3D GetPosition() const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
void addPoint(double x, double y, double z)
virtual G4bool getCullInvisibles()
static G4HepRepMessenger * GetInstance()
const G4VisAttributes * fpVisAttribs
G4double GetMarkerSize(const G4VMarker &, MarkerSizeType &)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddPrimitive ( const G4Square square)
virtual

Implements G4VSceneHandler.

Definition at line 1216 of file G4HepRepFileSceneHandler.cc.

1216  {
1217 #ifdef G4HEPREPFILEDEBUG
1218  G4cout <<
1219  "G4HepRepFileSceneHandler::AddPrimitive(const G4Square& square) called:"
1220  "\n side: " << square.GetWorldRadius()
1221  << G4endl;
1222  PrintThings();
1223 #endif
1224 
1226 
1227  if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
1228  return;
1229 
1230  if (inPrimitives2D) {
1231  if (!warnedAbout2DMarkers) {
1232  G4cout << "HepRepFile does not currently support 2D squares." << G4endl;
1233  warnedAbout2DMarkers = true;
1234  }
1235  return;
1236  }
1237 
1238  MarkerSizeType sizeType;
1239  G4double size = GetMarkerSize (square, sizeType);
1240  if (sizeType==world)
1241  size = 4.;
1242 
1243  if (drawingTraj)
1244  return;
1245 
1246  if (drawingHit)
1247  InitHit();
1248 
1249  haveVisible = true;
1250  AddHepRepInstance("Point", square);
1251 
1252  hepRepXMLWriter->addAttValue("MarkName", "Square");
1253  hepRepXMLWriter->addAttValue("MarkSize", (G4int) size);
1254 
1255  hepRepXMLWriter->addPrimitive();
1256 
1257  G4Point3D center = (fObjectTransformation) * square.GetPosition();
1258  hepRepXMLWriter->addPoint(center.x(), center.y(), center.z());
1259 }
G4double GetWorldRadius() const
void addAttValue(const char *name, const char *value)
G4bool IsVisible() const
G4Transform3D fObjectTransformation
G4Point3D GetPosition() const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
void addPoint(double x, double y, double z)
virtual G4bool getCullInvisibles()
static G4HepRepMessenger * GetInstance()
const G4VisAttributes * fpVisAttribs
G4double GetMarkerSize(const G4VMarker &, MarkerSizeType &)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddPrimitive ( const G4Polyhedron polyhedron)
virtual

Implements G4VSceneHandler.

Definition at line 1262 of file G4HepRepFileSceneHandler.cc.

1262  {
1263 #ifdef G4HEPREPFILEDEBUG
1264  G4cout <<
1265  "G4HepRepFileSceneHandler::AddPrimitive(const G4Polyhedron& polyhedron) called."
1266  << G4endl;
1267  PrintThings();
1268 #endif
1269 
1271 
1272  if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
1273  return;
1274 
1275  if(polyhedron.GetNoFacets()==0)return;
1276 
1277  if (drawingTraj)
1278  return;
1279 
1280  if (drawingHit)
1281  InitHit();
1282 
1283  haveVisible = true;
1284  AddHepRepInstance("Polygon", polyhedron);
1285 
1286  G4Normal3D surfaceNormal;
1287  G4Point3D vertex;
1288 
1289  G4bool notLastFace;
1290  do {
1291  hepRepXMLWriter->addPrimitive();
1292  notLastFace = polyhedron.GetNextNormal (surfaceNormal);
1293 
1294  G4int edgeFlag = 1;
1295  G4bool notLastEdge;
1296  do {
1297  notLastEdge = polyhedron.GetNextVertex (vertex, edgeFlag);
1298  vertex = (fObjectTransformation) * vertex;
1299  hepRepXMLWriter->addPoint(vertex.x(), vertex.y(), vertex.z());
1300  } while (notLastEdge);
1301  } while (notLastFace);
1302 }
G4bool GetNextNormal(G4Normal3D &normal) const
G4bool IsVisible() const
G4Transform3D fObjectTransformation
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
void addPoint(double x, double y, double z)
bool G4bool
Definition: G4Types.hh:79
virtual G4bool getCullInvisibles()
static G4HepRepMessenger * GetInstance()
const G4VisAttributes * fpVisAttribs
#define G4endl
Definition: G4ios.hh:61
G4bool GetNextVertex(G4Point3D &vertex, G4int &edgeFlag) const
G4int GetNoFacets() const

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddPrimitive ( const G4Polymarker line)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1067 of file G4HepRepFileSceneHandler.cc.

1067  {
1068 #ifdef G4HEPREPFILEDEBUG
1069  G4cout <<
1070  "G4HepRepFileSceneHandler::AddPrimitive(const G4Polymarker& line) called"
1071  << G4endl;
1072  PrintThings();
1073 #endif
1074 
1076 
1077  if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
1078  return;
1079 
1080  if (inPrimitives2D) {
1081  if (!warnedAbout2DMarkers) {
1082  G4cout << "HepRepFile does not currently support 2D lines." << G4endl;
1083  warnedAbout2DMarkers = true;
1084  }
1085  return;
1086  }
1087 
1088  MarkerSizeType sizeType;
1089  G4double size = GetMarkerSize (line, sizeType);
1090  if (sizeType==world)
1091  size = 4.;
1092 
1093  if (drawingTraj)
1094  return;
1095 
1096  if (drawingHit)
1097  InitHit();
1098 
1099  haveVisible = true;
1100  AddHepRepInstance("Point", line);
1101 
1102  hepRepXMLWriter->addAttValue("MarkName", "Dot");
1103  hepRepXMLWriter->addAttValue("MarkSize", (G4int) size);
1104 
1105  hepRepXMLWriter->addPrimitive();
1106 
1107  for (size_t i=0; i < line.size(); i++) {
1108  G4Point3D vertex = (fObjectTransformation) * line[i];
1109  hepRepXMLWriter->addPoint(vertex.x(), vertex.y(), vertex.z());
1110  }
1111 }
void addAttValue(const char *name, const char *value)
G4bool IsVisible() const
G4Transform3D fObjectTransformation
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
void addPoint(double x, double y, double z)
virtual G4bool getCullInvisibles()
static G4HepRepMessenger * GetInstance()
const G4VisAttributes * fpVisAttribs
G4double GetMarkerSize(const G4VMarker &, MarkerSizeType &)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddPrimitive ( const G4Scale scale)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 113 of file G4HepRepFileSceneHandler.hh.

113  {
115  }
virtual void AddPrimitive(const G4Polyline &)=0

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4Box box)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 151 of file G4HepRepFileSceneHandler.cc.

151  {
152 #ifdef G4HEPREPFILEDEBUG
153  G4cout <<
154  "G4HepRepFileSceneHandler::AddSolid(const G4Box& box) called for "
155  << box.GetName()
156  << G4endl;
157  PrintThings();
158 #endif
159 
160  if (drawingTraj)
161  return;
162 
163  if (drawingHit)
164  InitHit();
165 
166  haveVisible = false;
167  AddHepRepInstance("Prism", NULL);
168 
170 
171  // Get and check applicable vis attributes.
173  if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
174  return;
175 
176  hepRepXMLWriter->addPrimitive();
177 
178  G4double dx = box.GetXHalfLength();
179  G4double dy = box.GetYHalfLength();
180  G4double dz = box.GetZHalfLength();
181 
182  G4Point3D vertex1(G4Point3D( dx, dy,-dz));
183  G4Point3D vertex2(G4Point3D( dx,-dy,-dz));
184  G4Point3D vertex3(G4Point3D(-dx,-dy,-dz));
185  G4Point3D vertex4(G4Point3D(-dx, dy,-dz));
186  G4Point3D vertex5(G4Point3D( dx, dy, dz));
187  G4Point3D vertex6(G4Point3D( dx,-dy, dz));
188  G4Point3D vertex7(G4Point3D(-dx,-dy, dz));
189  G4Point3D vertex8(G4Point3D(-dx, dy, dz));
190 
191  vertex1 = (fObjectTransformation) * vertex1;
192  vertex2 = (fObjectTransformation) * vertex2;
193  vertex3 = (fObjectTransformation) * vertex3;
194  vertex4 = (fObjectTransformation) * vertex4;
195  vertex5 = (fObjectTransformation) * vertex5;
196  vertex6 = (fObjectTransformation) * vertex6;
197  vertex7 = (fObjectTransformation) * vertex7;
198  vertex8 = (fObjectTransformation) * vertex8;
199 
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());
208 }
G4String GetName() const
G4double GetXHalfLength() const
G4VViewer * fpViewer
G4bool IsVisible() const
G4Transform3D fObjectTransformation
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
G4double GetZHalfLength() const
G4GLOB_DLL std::ostream G4cout
void addPoint(double x, double y, double z)
virtual G4bool getCullInvisibles()
static G4HepRepMessenger * GetInstance()
G4double GetYHalfLength() const
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const
const G4VisAttributes * fpVisAttribs
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4Cons cons)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 211 of file G4HepRepFileSceneHandler.cc.

211  {
212 #ifdef G4HEPREPFILEDEBUG
213  G4cout <<
214  "G4HepRepFileSceneHandler::AddSolid(const G4Cons& cons) called for "
215  << cons.GetName()
216  << G4endl;
217  PrintThings();
218 #endif
219 
220  // HepRApp does not correctly represent the end faces of cones at
221  // non-standard angles, let the base class convert these solids to polygons.
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);
229  //G4cout << "Angle X:" << r.phiX() << ", Angle Y:" << r.phiY() << ", Angle Z:" << r.phiZ() << G4endl;
230  //G4cout << "linedUpWithAnAxis:" << linedUpWithAnAxis << G4endl;
231 
232  // HepRep does not have a primitive for a cut cone,
233  // so if this cone is cut, let the base class convert this
234  // solid to polygons.
236  if (cons.GetDeltaPhiAngle() < twopi || !linedUpWithAnAxis || messenger->renderCylAsPolygons())
237  {
238  G4VSceneHandler::AddSolid(cons); // Invoke default action.
239  } else {
240 
241  if (drawingTraj)
242  return;
243 
244  if (drawingHit)
245  InitHit();
246 
247  haveVisible = false;
248  AddHepRepInstance("Cylinder", NULL);
249 
250  // Get and check applicable vis attributes.
252  if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
253  return;
254 
255  G4Point3D vertex1(G4Point3D( 0., 0., -cons.GetZHalfLength()));
256  G4Point3D vertex2(G4Point3D( 0., 0., cons.GetZHalfLength()));
257 
258  vertex1 = (fObjectTransformation) * vertex1;
259  vertex2 = (fObjectTransformation) * vertex2;
260 
261  // Outer cylinder.
262  hepRepXMLWriter->addPrimitive();
263  hepRepXMLWriter->addAttValue("Radius1",messenger->getScale() * cons.GetOuterRadiusMinusZ());
264  hepRepXMLWriter->addAttValue("Radius2",messenger->getScale() * cons.GetOuterRadiusPlusZ());
265  hepRepXMLWriter->addPoint(vertex1.x(), vertex1.y(), vertex1.z());
266  hepRepXMLWriter->addPoint(vertex2.x(), vertex2.y(), vertex2.z());
267 
268  // Inner cylinder.
269  hepRepXMLWriter->addPrimitive();
270  hepRepXMLWriter->addAttValue("Radius1",messenger->getScale() * cons.GetInnerRadiusMinusZ());
271  hepRepXMLWriter->addAttValue("Radius2",messenger->getScale() * cons.GetInnerRadiusPlusZ());
272  hepRepXMLWriter->addPoint(vertex1.x(), vertex1.y(), vertex1.z());
273  hepRepXMLWriter->addPoint(vertex2.x(), vertex2.y(), vertex2.z());
274  }
275 }
G4String GetName() const
virtual G4double getScale()
virtual void AddSolid(const G4Box &)
virtual G4bool renderCylAsPolygons()
G4VViewer * fpViewer
void addAttValue(const char *name, const char *value)
G4bool IsVisible() const
G4Transform3D fObjectTransformation
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
G4double GetOuterRadiusMinusZ() const
double phiY() const
Definition: Rotation.cc:133
static constexpr double twopi
Definition: G4SIunits.hh:76
G4GLOB_DLL std::ostream G4cout
void addPoint(double x, double y, double z)
bool G4bool
Definition: G4Types.hh:79
CLHEP::HepRotation getRotation() const
double phiX() const
Definition: Rotation.cc:129
virtual G4bool getCullInvisibles()
static G4HepRepMessenger * GetInstance()
G4double GetInnerRadiusPlusZ() const
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const
const G4VisAttributes * fpVisAttribs
double phiZ() const
Definition: Rotation.cc:137
#define G4endl
Definition: G4ios.hh:61
static constexpr double pi
Definition: G4SIunits.hh:75
G4double GetInnerRadiusMinusZ() const
G4double GetOuterRadiusPlusZ() const
G4double GetZHalfLength() const
G4double GetDeltaPhiAngle() const

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4Tubs tubs)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 278 of file G4HepRepFileSceneHandler.cc.

278  {
279 #ifdef G4HEPREPFILEDEBUG
280  G4cout <<
281  "G4HepRepFileSceneHandler::AddSolid(const G4Tubs& tubs) called for "
282  << tubs.GetName()
283  << G4endl;
284  PrintThings();
285 #endif
286 
287  // HepRApp does not correctly represent the end faces of cylinders at
288  // non-standard angles, let the base class convert these solids to polygons.
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);
296  //G4cout << "Angle X:" << r.phiX() << ", Angle Y:" << r.phiY() << ", Angle Z:" << r.phiZ() << G4endl;
297  //G4cout << "linedUpWithAnAxis:" << linedUpWithAnAxis << G4endl;
298 
299  // HepRep does not have a primitive for a cut cylinder,
300  // so if this cylinder is cut, let the base class convert this
301  // solid to polygons.
303  if (tubs.GetDeltaPhiAngle() < twopi || !linedUpWithAnAxis || messenger->renderCylAsPolygons())
304  {
305  G4VSceneHandler::AddSolid(tubs); // Invoke default action.
306  } else {
307 
308  if (drawingTraj)
309  return;
310 
311  if (drawingHit)
312  InitHit();
313 
314  haveVisible = false;
315  AddHepRepInstance("Cylinder", NULL);
316 
317  // Get and check applicable vis attributes.
319  if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
320  return;
321 
322  G4Point3D vertex1(G4Point3D( 0., 0., -tubs.GetZHalfLength()));
323  G4Point3D vertex2(G4Point3D( 0., 0., tubs.GetZHalfLength()));
324 
325  vertex1 = (fObjectTransformation) * vertex1;
326  vertex2 = (fObjectTransformation) * vertex2;
327 
328  // Outer cylinder.
329  hepRepXMLWriter->addPrimitive();
330  hepRepXMLWriter->addAttValue("Radius1", messenger->getScale() * tubs.GetOuterRadius());
331  hepRepXMLWriter->addAttValue("Radius2", messenger->getScale() * tubs.GetOuterRadius());
332  hepRepXMLWriter->addPoint(vertex1.x(), vertex1.y(), vertex1.z());
333  hepRepXMLWriter->addPoint(vertex2.x(), vertex2.y(), vertex2.z());
334 
335  // Inner cylinder.
336  if (tubs.GetInnerRadius() != 0.) {
337  hepRepXMLWriter->addPrimitive();
338  hepRepXMLWriter->addAttValue("Radius1", messenger->getScale() * tubs.GetInnerRadius());
339  hepRepXMLWriter->addAttValue("Radius2", messenger->getScale() * tubs.GetInnerRadius());
340  hepRepXMLWriter->addPoint(vertex1.x(), vertex1.y(), vertex1.z());
341  hepRepXMLWriter->addPoint(vertex2.x(), vertex2.y(), vertex2.z());
342  }
343  }
344 }
G4String GetName() const
virtual G4double getScale()
virtual void AddSolid(const G4Box &)
virtual G4bool renderCylAsPolygons()
G4VViewer * fpViewer
void addAttValue(const char *name, const char *value)
G4bool IsVisible() const
G4Transform3D fObjectTransformation
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
double phiY() const
Definition: Rotation.cc:133
static constexpr double twopi
Definition: G4SIunits.hh:76
G4GLOB_DLL std::ostream G4cout
void addPoint(double x, double y, double z)
G4double GetDeltaPhiAngle() const
bool G4bool
Definition: G4Types.hh:79
CLHEP::HepRotation getRotation() const
double phiX() const
Definition: Rotation.cc:129
virtual G4bool getCullInvisibles()
static G4HepRepMessenger * GetInstance()
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const
G4double GetInnerRadius() const
const G4VisAttributes * fpVisAttribs
double phiZ() const
Definition: Rotation.cc:137
G4double GetZHalfLength() const
#define G4endl
Definition: G4ios.hh:61
static constexpr double pi
Definition: G4SIunits.hh:75
G4double GetOuterRadius() const

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4Trd trd)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 347 of file G4HepRepFileSceneHandler.cc.

347  {
348 #ifdef G4HEPREPFILEDEBUG
349  G4cout <<
350  "G4HepRepFileSceneHandler::AddSolid(const G4Trd& trd) called for "
351  << trd.GetName()
352  << G4endl;
353  PrintThings();
354 #endif
355 
356  if (drawingTraj)
357  return;
358 
359  if (drawingHit)
360  InitHit();
361 
362  haveVisible = false;
363  AddHepRepInstance("Prism", NULL);
364 
366 
367  // Get and check applicable vis attributes.
369  if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
370  return;
371 
372  hepRepXMLWriter->addPrimitive();
373 
374  G4double dx1 = trd.GetXHalfLength1();
375  G4double dy1 = trd.GetYHalfLength1();
376  G4double dx2 = trd.GetXHalfLength2();
377  G4double dy2 = trd.GetYHalfLength2();
378  G4double dz = trd.GetZHalfLength();
379 
380  G4Point3D vertex1(G4Point3D( dx1, dy1,-dz));
381  G4Point3D vertex2(G4Point3D( dx1,-dy1,-dz));
382  G4Point3D vertex3(G4Point3D(-dx1,-dy1,-dz));
383  G4Point3D vertex4(G4Point3D(-dx1, dy1,-dz));
384  G4Point3D vertex5(G4Point3D( dx2, dy2, dz));
385  G4Point3D vertex6(G4Point3D( dx2,-dy2, dz));
386  G4Point3D vertex7(G4Point3D(-dx2,-dy2, dz));
387  G4Point3D vertex8(G4Point3D(-dx2, dy2, dz));
388 
389  vertex1 = (fObjectTransformation) * vertex1;
390  vertex2 = (fObjectTransformation) * vertex2;
391  vertex3 = (fObjectTransformation) * vertex3;
392  vertex4 = (fObjectTransformation) * vertex4;
393  vertex5 = (fObjectTransformation) * vertex5;
394  vertex6 = (fObjectTransformation) * vertex6;
395  vertex7 = (fObjectTransformation) * vertex7;
396  vertex8 = (fObjectTransformation) * vertex8;
397 
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());
406 }
G4String GetName() const
G4double GetYHalfLength1() const
G4VViewer * fpViewer
G4bool IsVisible() const
G4Transform3D fObjectTransformation
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
G4double GetZHalfLength() const
G4double GetXHalfLength2() const
G4GLOB_DLL std::ostream G4cout
void addPoint(double x, double y, double z)
virtual G4bool getCullInvisibles()
static G4HepRepMessenger * GetInstance()
G4double GetYHalfLength2() const
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const
const G4VisAttributes * fpVisAttribs
#define G4endl
Definition: G4ios.hh:61
G4double GetXHalfLength1() const
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4Trap trap)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 409 of file G4HepRepFileSceneHandler.cc.

409  {
410 #ifdef G4HEPREPFILEDEBUG
411  G4cout <<
412  "G4HepRepFileSceneHandler::AddSolid(const G4Trap& trap) called for "
413  << trap.GetName()
414  << G4endl;
415  PrintThings();
416 #endif
417  G4VSceneHandler::AddSolid(trap); // Invoke default action.
418 }
G4String GetName() const
virtual void AddSolid(const G4Box &)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4Sphere sphere)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 421 of file G4HepRepFileSceneHandler.cc.

421  {
422 #ifdef G4HEPREPFILEDEBUG
423  G4cout <<
424  "G4HepRepFileSceneHandler::AddSolid(const G4Sphere& sphere) called for "
425  << sphere.GetName()
426  << G4endl;
427  PrintThings();
428 #endif
429  G4VSceneHandler::AddSolid(sphere); // Invoke default action.
430 }
G4String GetName() const
virtual void AddSolid(const G4Box &)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4Para para)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 433 of file G4HepRepFileSceneHandler.cc.

433  {
434 #ifdef G4HEPREPFILEDEBUG
435  G4cout <<
436  "G4HepRepFileSceneHandler::AddSolid(const G4Para& para) called for "
437  << para.GetName()
438  << G4endl;
439  PrintThings();
440 #endif
441  G4VSceneHandler::AddSolid(para); // Invoke default action.
442 }
G4String GetName() const
virtual void AddSolid(const G4Box &)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4Torus torus)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 445 of file G4HepRepFileSceneHandler.cc.

445  {
446 #ifdef G4HEPREPFILEDEBUG
447  G4cout <<
448  "G4HepRepFileSceneHandler::AddSolid(const G4Torus& torus) called for "
449  << torus.GetName()
450  << G4endl;
451  PrintThings();
452 #endif
453  G4VSceneHandler::AddSolid(torus); // Invoke default action.
454 }
G4String GetName() const
virtual void AddSolid(const G4Box &)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4Polycone polycone)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 457 of file G4HepRepFileSceneHandler.cc.

457  {
458 #ifdef G4HEPREPFILEDEBUG
459  G4cout <<
460  "G4HepRepFileSceneHandler::AddSolid(const G4Polycone& polycone) called for "
461  << polycone.GetName()
462  << G4endl;
463  PrintThings();
464 #endif
465  G4VSceneHandler::AddSolid(polycone); // Invoke default action.
466 }
G4String GetName() const
virtual void AddSolid(const G4Box &)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4Polyhedra polyhedra)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 469 of file G4HepRepFileSceneHandler.cc.

469  {
470 #ifdef G4HEPREPFILEDEBUG
471  G4cout <<
472  "G4HepRepFileSceneHandler::AddSolid(const G4Polyhedra& polyhedra) called for "
473  << polyhedra.GetName()
474  << G4endl;
475  PrintThings();
476 #endif
477  G4VSceneHandler::AddSolid(polyhedra); // Invoke default action.
478 }
G4String GetName() const
virtual void AddSolid(const G4Box &)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4Orb orb)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 481 of file G4HepRepFileSceneHandler.cc.

481  {
482 #ifdef G4HEPREPFILEDEBUG
483  G4cout <<
484  "G4HepRepFileSceneHandler::AddSolid(const G4Orb& orb) called for "
485  << orb.GetName()
486  << G4endl;
487  PrintThings();
488 #endif
489  G4VSceneHandler::AddSolid(orb); // Invoke default action.
490 }
G4String GetName() const
virtual void AddSolid(const G4Box &)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4Ellipsoid ellipsoid)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 493 of file G4HepRepFileSceneHandler.cc.

493  {
494 #ifdef G4HEPREPFILEDEBUG
495  G4cout <<
496  "G4HepRepFileSceneHandler::AddSolid(const G4Ellipsoid& ellipsoid) called for "
497  << ellipsoid.GetName()
498  << G4endl;
499  PrintThings();
500 #endif
501  G4VSceneHandler::AddSolid(ellipsoid); // Invoke default action.
502 }
G4String GetName() const
virtual void AddSolid(const G4Box &)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4HepRepFileSceneHandler::AddSolid ( const G4VSolid solid)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 505 of file G4HepRepFileSceneHandler.cc.

505  {
506 #ifdef G4HEPREPFILEDEBUG
507  G4cout <<
508  "G4HepRepFileSceneHandler::AddSolid(const G4Solid& solid) called for "
509  << solid.GetName()
510  << G4endl;
511  PrintThings();
512 #endif
513  G4VSceneHandler::AddSolid(solid); // Invoke default action.
514 }
G4String GetName() const
virtual void AddSolid(const G4Box &)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4HepRepFileSceneHandler::BeginModeling ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 96 of file G4HepRepFileSceneHandler.cc.

96  {
98  const G4VTrajectoryModel* model = visManager->CurrentTrajDrawModel();
99  trajContext = & model->GetContext();
100 
101  G4VSceneHandler::BeginModeling(); // Required: see G4VSceneHandler.hh.
102 }
virtual void BeginModeling()
const G4VTrajectoryModel * CurrentTrajDrawModel() const
const G4VisTrajContext & GetContext() const
static G4VisManager * GetInstance()
const XML_Char XML_Content * model
Definition: expat.h:151

Here is the call graph for this function:

void G4HepRepFileSceneHandler::BeginPrimitives2D ( const G4Transform3D objectTransformation)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 110 of file G4HepRepFileSceneHandler.cc.

110  {
111 #ifdef G4HEPREPFILEDEBUG
112  G4cout << "G4HepRepFileSceneHandler::BeginPrimitives2D() " << G4endl;
113 #endif
114  inPrimitives2D = true;
115  G4VSceneHandler::BeginPrimitives2D(objectTransformation);
116 }
G4GLOB_DLL std::ostream G4cout
virtual void BeginPrimitives2D(const G4Transform3D &objectTransformation)
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4HepRepFileSceneHandler::ClearTransientStore ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1580 of file G4HepRepFileSceneHandler.cc.

1580  {
1581  // This is typically called after an update and before drawing hits
1582  // of the next event. To simulate the clearing of "transients"
1583  // (hits, etc.) the detector is redrawn...
1584  if (fpViewer) {
1585  fpViewer -> SetView();
1586  fpViewer -> ClearView();
1587  fpViewer -> DrawView();
1588  }
1589 }
G4VViewer * fpViewer
void G4HepRepFileSceneHandler::EndModeling ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 105 of file G4HepRepFileSceneHandler.cc.

105  {
106  G4VSceneHandler::EndModeling(); // Required: see G4VSceneHandler.hh.
107 }
virtual void EndModeling()

Here is the call graph for this function:

void G4HepRepFileSceneHandler::EndPrimitives2D ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 118 of file G4HepRepFileSceneHandler.cc.

118  {
119 #ifdef G4HEPREPFILEDEBUG
120  G4cout << "G4HepRepFileSceneHandler::EndPrimitives2D() " << G4endl;
121 #endif
123  inPrimitives2D = false;
124 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
virtual void EndPrimitives2D()

Here is the call graph for this function:

G4HepRepFileXMLWriter * G4HepRepFileSceneHandler::GetHepRepXMLWriter ( )

Definition at line 1305 of file G4HepRepFileSceneHandler.cc.

1305  {
1306  return hepRepXMLWriter;
1307 }

Here is the caller graph for this function:

void G4HepRepFileSceneHandler::InitHit ( )

Definition at line 1003 of file G4HepRepFileSceneHandler.cc.

1003  {
1004  if (!doneInitHit) {
1005  // For every hit, add an instance of Type Hit.
1006  hepRepXMLWriter->addInstance();
1007 
1008  // Write out the hit's attribute values.
1009  if (hitAttValues) {
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;
1015  }
1016 
1017  // Clean up hit attributes.
1018  if (hitAttDefs)
1019  delete hitAttDefs;
1020 
1021  doneInitHit = true;
1022  }
1023 }
void addAttValue(const char *name, const char *value)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4HepRepFileSceneHandler::InitTrajectory ( )

Definition at line 980 of file G4HepRepFileSceneHandler.cc.

980  {
981  if (!doneInitTraj) {
982  // For every trajectory, add an instance of Type Trajectory.
983  hepRepXMLWriter->addInstance();
984 
985  // Write out the trajectory's attribute values.
986  if (trajAttValues) {
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;
992  }
993 
994  // Clean up trajectory attributes.
995  if (trajAttDefs)
996  delete trajAttDefs;
997 
998  doneInitTraj = true;
999  }
1000 }
void addAttValue(const char *name, const char *value)

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

G4int G4HepRepFileSceneHandler::fSceneIdCount = 0
staticprotected

Definition at line 141 of file G4HepRepFileSceneHandler.hh.


The documentation for this class was generated from the following files: