Import Geant4 4.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:18:25 +02:00
parent 36c080dca6
commit 921d3b1cda
3990 changed files with 185376 additions and 82884 deletions
@@ -0,0 +1,49 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4HepRepFile.hh,v 1.1 2001/11/06 11:48:04 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 5th April 2001
// A graphics system to dump geometry hierarchy.
#ifndef G4HepRepFile_HH
#define G4HepRepFile_HH
#include "G4VGraphicsSystem.hh"
// HepRep
#include "HepRepXMLWriter.hh"
class G4HepRepFile: public G4VGraphicsSystem {
public:
G4HepRepFile();
virtual ~G4HepRepFile();
G4VSceneHandler* CreateSceneHandler(const G4String& name = "");
G4VViewer* CreateViewer (G4VSceneHandler&, const G4String& name = "");
HepRepXMLWriter *GetHepRepXMLWriter();
};
#endif
@@ -0,0 +1,134 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4HepRepFileSceneHandler.hh,v 1.4 2001/11/21 16:48:58 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 5th April 2001
// A base class for a scene handler to dump geometry hierarchy.
#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 "HepRepXMLWriter.hh"
class G4VPhysicalVolume;
class G4LogicalVolume;
class G4ModelingParameters;
class G4HepRepFileSceneHandler: public G4VSceneHandler {
public:
G4HepRepFileSceneHandler(G4VGraphicsSystem& system,
const G4String& name);
virtual ~G4HepRepFileSceneHandler();
////////////////////////////////////////////////////////////////
// No need to implement these, but if you do...
void AddThis(const G4Box&);
void AddThis(const G4Cons&);
void AddThis(const G4Tubs&);
void AddThis(const G4Trd&);
void AddThis(const G4Trap&);
void AddThis(const G4Sphere&);
void AddThis(const G4Para&);
void AddThis(const G4Torus&);
void AddThis(const G4Polycone&);
void AddThis(const G4Polyhedra&);
void AddThis(const G4VSolid&);
// void PreAddThis(const G4Transform3D& objectTransformation,
// const G4VisAttributes&);
// void PostAddThis();
// Allows G4PhysicalVolumeModel to provide extra information...
void EstablishSpecials(G4PhysicalVolumeModel&);
////////////////////////////////////////////////////////////////
// Required implementation of pure virtual functions...
void AddPrimitive(const G4Polyline&);
void AddPrimitive(const G4Text&);
void AddPrimitive(const G4Circle&);
void AddPrimitive(const G4Square&);
void AddPrimitive(const G4Polyhedron&);
void AddPrimitive(const G4NURBS&);
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
// 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&);
void AddPrimitive(const G4Scale& scale) {
G4VSceneHandler::AddPrimitive (scale);
}
////////////////////////////////////////////////////////////////
// Further optional virtual functions...
// void BeginPrimitives(const G4Transform3D& objectTransformation);
// void EndPrimitives();
// void BeginModeling();
// void EndModeling();
////////////////////////////////////////////////////////////////
// Required...
static G4int GetSceneCount() {return fSceneCount;}
HepRepXMLWriter *GetHepRepXMLWriter();
protected:
static G4int fSceneIdCount; // Counter for HepRep scene handlers.
static G4int fSceneCount; // No. of extanct scene handlers.
G4int fCurrentDepth; // Current depth of geom. hierarchy.
G4VPhysicalVolume* fpCurrentPV; // Current physical volume.
G4LogicalVolume* fpCurrentLV; // Current logical volume.
private:
HepRepXMLWriter *hepRepXMLWriter;
#ifdef G4HEPREPFILEDEBUG
void PrintThings();
#endif
};
#endif
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4HepRepFileViewer.hh,v 1.2 2001/11/19 15:06:52 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// 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 "HepRepXMLWriter.hh"
class G4HepRepFileViewer: public G4VViewer {
public:
G4HepRepFileViewer(G4VSceneHandler&,const G4String& name);
virtual ~G4HepRepFileViewer();
void SetView();
void ClearView();
void DrawView();
void ShowView();
private:
HepRepXMLWriter *hepRepXMLWriter;
};
#endif
@@ -0,0 +1,96 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//--------------------------------------------------------------------------
// File and Version Information:
// $Id: HepRepXMLWriter.hh,v 1.4 2001/12/13 12:04:25 gunter Exp $
//
// Description:
// Create a HepRep XML File (HepRep version 1).
//
// Environment:
// Software developed for the general High Energy Physics community.
//
// Author :
// J. Perl Original Author
//
// Copyright Information:
// Copyright (C) 2001 Stanford Linear Accelerator Center
//------------------------------------------------------------------------
#ifndef HepRepXMLWriter_hh
#define HepRepXMLWriter_hh
#include "globals.hh"
#include "g4std/fstream"
class HepRepXMLWriter
{
public:
HepRepXMLWriter();
void addType(const char* name);
void addInstance();
void addPrimitive();
void addPoint(double x, double y, double z);
void addAttDef(const char* name,
const char* desc,
const char* type,
const char* extra);
// Four methods to fill attValues
void addAttValue(const char* name,
const char* value);
void addAttValue(const char* name,
double value);
void addAttValue(const char* name,
int value);
void addAttValue(const char* name,
bool value);
void addAttValue(const char* name,
double value1,
double value2,
double value3);
void open(const char* filespec);
void close();
private:
G4std::ofstream fout;
bool inType;
bool inInstance;
bool inPrimitive;
bool inPoint;
void endType();
void endInstance();
void endPrimitive();
void endPoint();
void indent();
};
#endif