Import Geant4 7.1.0 source tree
This commit is contained in:
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepSceneHandler.hh,v 1.33 2004/11/11 16:01:51 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4HepRepSceneHandler.hh,v 1.40 2005/06/02 23:40:49 duns Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
|
||||
/**
|
||||
@@ -41,6 +41,17 @@
|
||||
#include "HEPREP/HepRep.h"
|
||||
|
||||
//G4
|
||||
#include "G4Box.hh"
|
||||
#include "G4Cons.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4Trd.hh"
|
||||
#include "G4Trap.hh"
|
||||
#include "G4Sphere.hh"
|
||||
#include "G4Para.hh"
|
||||
#include "G4Torus.hh"
|
||||
#include "G4Polycone.hh"
|
||||
#include "G4Polyhedra.hh"
|
||||
|
||||
#include "G4VGraphicsSystem.hh"
|
||||
#include "G4VSceneHandler.hh"
|
||||
#include "G4Visible.hh"
|
||||
@@ -56,22 +67,23 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
|
||||
G4HepRepSceneHandler (G4VGraphicsSystem& system, G4HepRepMessenger& messenger, const G4String& name = "");
|
||||
virtual ~G4HepRepSceneHandler ();
|
||||
|
||||
void AddThis (const G4Box& box) { G4VSceneHandler::AddThis (box); }
|
||||
void AddThis (const G4Cons& cons) { G4VSceneHandler::AddThis (cons); }
|
||||
void AddThis (const G4Tubs& tubs) { G4VSceneHandler::AddThis (tubs); }
|
||||
void AddThis (const G4Trd& trd) { G4VSceneHandler::AddThis (trd); }
|
||||
void AddThis (const G4Trap& trap) { G4VSceneHandler::AddThis (trap); }
|
||||
void AddThis (const G4Sphere& sphere) { G4VSceneHandler::AddThis (sphere); }
|
||||
void AddThis (const G4Para& para) { G4VSceneHandler::AddThis (para); }
|
||||
void AddThis (const G4Torus& torus) { G4VSceneHandler::AddThis (torus); }
|
||||
void AddThis (const G4Polycone& polycone) { G4VSceneHandler::AddThis (polycone); }
|
||||
void AddThis (const G4Polyhedra& polyhedra) { G4VSceneHandler::AddThis (polyhedra); }
|
||||
void AddThis (const G4VSolid& solid) { G4VSceneHandler::AddThis(solid); }
|
||||
void AddThis (const G4VTrajectory&);
|
||||
void AddThis (const G4VHit& hit) { G4VSceneHandler::AddThis(hit); }
|
||||
void AddSolid (const G4Box& box);
|
||||
void AddSolid (const G4Cons& cons);
|
||||
void AddSolid (const G4Tubs& tubs);
|
||||
void AddSolid (const G4Trd& trd);
|
||||
void AddSolid (const G4Trap& trap);
|
||||
void AddSolid (const G4Sphere& sphere);
|
||||
void AddSolid (const G4Para& para);
|
||||
void AddSolid (const G4Torus& torus);
|
||||
void AddSolid (const G4Polycone& polycone);
|
||||
void AddSolid (const G4Polyhedra& polyhedra);
|
||||
void AddSolid (const G4VSolid& solid);
|
||||
|
||||
void AddCompound (const G4VTrajectory&);
|
||||
void AddCompound (const G4VHit& hit);
|
||||
|
||||
void PreAddThis (const G4Transform3D& objectTransformation, const G4VisAttributes& visAttribs);
|
||||
void PostAddThis ();
|
||||
void PreAddSolid (const G4Transform3D& objectTransformation, const G4VisAttributes& visAttribs);
|
||||
void PostAddSolid ();
|
||||
|
||||
void AddPrimitive (const G4Polyline&);
|
||||
void AddPrimitive (const G4Text&);
|
||||
@@ -81,22 +93,20 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
|
||||
void AddPrimitive (const G4NURBS&);
|
||||
|
||||
void AddPrimitive (const G4Polymarker&);
|
||||
void AddPrimitive (const G4Scale& scale) { G4VSceneHandler::AddPrimitive(scale); }
|
||||
void AddPrimitive (const G4Scale& scale);
|
||||
|
||||
void BeginPrimitives (const G4Transform3D& objectTransformation);
|
||||
void EndPrimitives ();
|
||||
void BeginModeling ();
|
||||
void EndModeling ();
|
||||
|
||||
static G4int getSceneCount () { return sceneCount; }
|
||||
|
||||
void openHepRep();
|
||||
bool closeHepRep(bool final = false);
|
||||
void openFile(G4String name);
|
||||
void closeFile();
|
||||
|
||||
private:
|
||||
static G4int sceneCount;
|
||||
static G4int sceneIdCount;
|
||||
const G4ModelingParameters* originalMP; // Keeps pointer to original.
|
||||
G4ModelingParameters* nonCullingMP; // For temporary non-culling.
|
||||
|
||||
@@ -107,31 +117,46 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
|
||||
HEPREP::HepRepWriter* writer;
|
||||
|
||||
// Methods
|
||||
G4bool dontWrite();
|
||||
|
||||
void setColor (HEPREP::HepRepAttribute *attribute, const G4Color& color,
|
||||
const G4String& key = G4String("Color"));
|
||||
G4Color getColor (G4double charge);
|
||||
G4Color getColorFor (const G4Visible& visible);
|
||||
G4Color getColorFor (const G4VSolid& solid);
|
||||
|
||||
void setVisibility (HEPREP::HepRepAttribute *attribute, const G4VSolid& solid);
|
||||
void setLine (HEPREP::HepRepAttribute *attribute, const G4VSolid& solid);
|
||||
|
||||
void setVisibility (HEPREP::HepRepAttribute *attribute, const G4Visible& visible);
|
||||
void setLine (HEPREP::HepRepAttribute *attribute, const G4Visible& visible);
|
||||
|
||||
void setMarker (HEPREP::HepRepAttribute *attribute, const G4VMarker& marker);
|
||||
|
||||
inline void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, char* value) {
|
||||
setAttribute(attribute, name, G4String(value));
|
||||
}
|
||||
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, G4String value);
|
||||
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, bool value);
|
||||
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, double value);
|
||||
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, int value);
|
||||
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, double red, double green, double blue, double alpha);
|
||||
|
||||
bool isEventData ();
|
||||
bool isEventData();
|
||||
|
||||
void open(G4String name);
|
||||
void close();
|
||||
|
||||
void writeLayers(HEPREP::HepRep* heprep);
|
||||
|
||||
void addAttributes(HEPREP::HepRepInstance* instance, HEPREP::HepRepType* type);
|
||||
|
||||
void addAttDefs(HEPREP::HepRepDefinition* definition, const std::map<G4String,G4AttDef>* attDefs);
|
||||
void addAttVals(HEPREP::HepRepAttribute* attribute, const std::map<G4String,G4AttDef>* attDefs, std::vector<G4AttValue>* attValues);
|
||||
|
||||
void addTopLevelAttributes(HEPREP::HepRepType* type);
|
||||
|
||||
HEPREP::HepRepInstance* getGeometryOrEventInstance(HEPREP::HepRepType* type);
|
||||
|
||||
// Returns the particular instance/type or if not created, creates them and adds them to the HepRep
|
||||
HEPREP::HepRep* getHepRep();
|
||||
HEPREP::HepRep* getHepRepGeometry();
|
||||
@@ -166,7 +191,12 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
|
||||
G4int eventNumber;
|
||||
G4int eventNumberWidth;
|
||||
G4String extension;
|
||||
G4bool writeBinary;
|
||||
G4bool writeZip;
|
||||
G4bool writeGZ;
|
||||
G4bool writeMultipleFiles;
|
||||
const G4VHit* currentHit;
|
||||
const G4VTrajectory* currentTrack;
|
||||
|
||||
// DO NOT USE member vars directly, use get methods.
|
||||
HEPREP::HepRep* _heprep;
|
||||
|
||||
Reference in New Issue
Block a user