Import Geant4 11.2.0.beta source tree
This commit is contained in:
@@ -0,0 +1,160 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// Joseph Perl 27th January 2002
|
||||
// A base class for a scene handler to export geometry and trajectories
|
||||
// to the HepRep xml file format.
|
||||
|
||||
#ifndef G4HepRepFileSCENEHANDLER_HH
|
||||
#define G4HepRepFileSCENEHANDLER_HH
|
||||
|
||||
//#define G4HEPREPFILEDEBUG // Comment this out to suppress debug code.
|
||||
|
||||
#include "G4VSceneHandler.hh"
|
||||
#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"
|
||||
|
||||
// HepRep
|
||||
#include "G4HepRepFileXMLWriter.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4LogicalVolume;
|
||||
class G4ModelingParameters;
|
||||
class G4VisTrajContext;
|
||||
|
||||
class G4HepRepFileSceneHandler : public G4VSceneHandler
|
||||
{
|
||||
public:
|
||||
G4HepRepFileSceneHandler(G4VGraphicsSystem& system, const G4String& name);
|
||||
virtual ~G4HepRepFileSceneHandler();
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// No need to implement these, but if you do...
|
||||
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 G4TessellatedSolid&);
|
||||
void AddSolid(const G4VSolid&);
|
||||
|
||||
using G4VSceneHandler::AddCompound;
|
||||
void AddCompound(const G4VTrajectory&);
|
||||
void InitTrajectory();
|
||||
void AddCompound(const G4VHit&);
|
||||
void InitHit();
|
||||
|
||||
// void PreAddSolid(const G4Transform3D& objectTransformation,
|
||||
// const G4VisAttributes&);
|
||||
// void PostAddSolid();
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Required implementation of pure virtual functions...
|
||||
|
||||
using G4VSceneHandler::AddPrimitive;
|
||||
void AddPrimitive(const G4Polyline&);
|
||||
void AddPrimitive(const G4Text&);
|
||||
void AddPrimitive(const G4Circle&);
|
||||
void AddPrimitive(const G4Square&);
|
||||
void AddPrimitive(const G4Polyhedron&);
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Further optional AddPrimtive methods. Explicitly invoke base
|
||||
// class methods if not otherwise defined to avoid warnings about
|
||||
// hiding of base class methods.
|
||||
void AddPrimitive(const G4Polymarker&);
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Further optional virtual functions...
|
||||
|
||||
// void BeginPrimitives(const G4Transform3D& objectTransformation);
|
||||
// void EndPrimitives();
|
||||
|
||||
void BeginModeling();
|
||||
void EndModeling();
|
||||
|
||||
void BeginPrimitives2D(const G4Transform3D& objectTransformation);
|
||||
void EndPrimitives2D();
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Administration functions.
|
||||
|
||||
// void ClearStore ();
|
||||
void ClearTransientStore();
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Required...
|
||||
|
||||
G4HepRepFileXMLWriter* GetHepRepXMLWriter();
|
||||
|
||||
protected:
|
||||
static G4int fSceneIdCount; // Counter for HepRep scene handlers.
|
||||
|
||||
private:
|
||||
G4HepRepFileXMLWriter* hepRepXMLWriter;
|
||||
void AddHepRepInstance(const char* primName, const G4Visible visible);
|
||||
void CheckFileOpen();
|
||||
int fileCounter;
|
||||
G4bool haveVisible;
|
||||
G4bool inPrimitives2D;
|
||||
G4bool warnedAbout3DText;
|
||||
G4bool warnedAbout2DMarkers;
|
||||
G4bool drawingTraj;
|
||||
G4bool doneInitTraj;
|
||||
G4bool drawingHit;
|
||||
G4bool doneInitHit;
|
||||
|
||||
const G4VisTrajContext* trajContext;
|
||||
|
||||
std::vector<G4AttValue>* trajAttValues;
|
||||
std::map<G4String, G4AttDef>* trajAttDefs;
|
||||
std::vector<G4AttValue>* hitAttValues;
|
||||
std::map<G4String, G4AttDef>* hitAttDefs;
|
||||
|
||||
#ifdef G4HEPREPFILEDEBUG
|
||||
void PrintThings();
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// John Allison 5th April 2001
|
||||
// A base class for a dummy viewer to dump geometry hierarchy.
|
||||
|
||||
#ifndef G4HepRepFileVIEWER_HH
|
||||
#define G4HepRepFileVIEWER_HH
|
||||
|
||||
// #define G4HEPREPFILEDEBUG // Comment this out to suppress debug code.
|
||||
|
||||
#include "G4VViewer.hh"
|
||||
|
||||
#include "G4HepRepFileXMLWriter.hh"
|
||||
#include "G4HepRepFileSceneHandler.hh"
|
||||
|
||||
class G4HepRepFileViewer : public G4VViewer
|
||||
{
|
||||
public:
|
||||
G4HepRepFileViewer(G4VSceneHandler&, const G4String& name);
|
||||
virtual ~G4HepRepFileViewer();
|
||||
void SetView();
|
||||
void ClearView();
|
||||
void DrawView();
|
||||
void ShowView();
|
||||
|
||||
private:
|
||||
G4HepRepFileXMLWriter* hepRepXMLWriter;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,107 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
#ifndef G4HepRepMessenger_HH
|
||||
#define G4HepRepMessenger_HH 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithABool.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithADouble.hh"
|
||||
#include "G4UIcmdWith3VectorAndUnit.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class G4HepRepMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
static G4HepRepMessenger* GetInstance(); // Singleton constructor.
|
||||
virtual ~G4HepRepMessenger();
|
||||
|
||||
virtual G4String GetCurrentValue(G4UIcommand* command);
|
||||
virtual void SetNewValue(G4UIcommand* command, G4String newValue);
|
||||
|
||||
// Used by HepRepFile
|
||||
virtual G4String getFileDir();
|
||||
virtual G4String getFileName();
|
||||
virtual G4bool getOverwrite();
|
||||
virtual G4bool getCullInvisibles();
|
||||
virtual G4bool renderCylAsPolygons();
|
||||
virtual G4double getScale();
|
||||
virtual G4ThreeVector getCenter();
|
||||
|
||||
// Used by HepRepXML
|
||||
virtual G4String getEventNumberSuffix();
|
||||
virtual G4bool appendGeometry();
|
||||
virtual G4bool addPointAttributes();
|
||||
virtual G4bool useSolids();
|
||||
virtual G4bool writeInvisibles();
|
||||
|
||||
private:
|
||||
G4HepRepMessenger(); // Private constructor.
|
||||
static G4HepRepMessenger* fpInstance;
|
||||
|
||||
G4UIdirectory* heprepDirectory;
|
||||
|
||||
G4String fileDir;
|
||||
G4UIcmdWithAString* setFileDirCommand;
|
||||
|
||||
G4String fileName;
|
||||
G4UIcmdWithAString* setFileNameCommand;
|
||||
|
||||
G4bool overwrite;
|
||||
G4UIcmdWithABool* setOverwriteCommand;
|
||||
|
||||
G4bool cullInvisibles;
|
||||
G4UIcmdWithABool* setCullInvisiblesCommand;
|
||||
|
||||
G4bool cylAsPolygons;
|
||||
G4UIcmdWithABool* renderCylAsPolygonsCommand;
|
||||
|
||||
G4double scale;
|
||||
G4UIcmdWithADouble* setScaleCommand;
|
||||
|
||||
G4ThreeVector center;
|
||||
G4UIcmdWith3VectorAndUnit* setCenterCommand;
|
||||
|
||||
G4String suffix;
|
||||
G4UIcmdWithAString* setEventNumberSuffixCommand;
|
||||
|
||||
G4bool geometry;
|
||||
G4UIcmdWithABool* appendGeometryCommand;
|
||||
|
||||
G4bool pointAttributes;
|
||||
G4UIcmdWithABool* addPointAttributesCommand;
|
||||
|
||||
G4bool solids;
|
||||
G4UIcmdWithABool* useSolidsCommand;
|
||||
|
||||
G4bool invisibles;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user