Import Geant4 11.0.0.beta source tree
This commit is contained in:
@@ -53,9 +53,12 @@ public: // With description
|
||||
G4double width, const G4Colour& colour,
|
||||
const G4String& description = "",
|
||||
G4int lineSegmentsPerCircle = 6);
|
||||
|
||||
virtual ~G4ArrowModel ();
|
||||
|
||||
virtual void DescribeYourselfTo (G4VGraphicsScene&);
|
||||
void SetTransformation (const G4Transform3D& transform) override;
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene&) override;
|
||||
// The main task of a model is to describe itself to the graphics scene.
|
||||
|
||||
private:
|
||||
@@ -66,6 +69,9 @@ private:
|
||||
|
||||
G4Polyhedron* fpShaftPolyhedron;
|
||||
G4Polyhedron* fpHeadPolyhedron;
|
||||
|
||||
G4Polyhedron* fpShaftPolyhedronOrig;
|
||||
G4Polyhedron* fpHeadPolyhedronOrig;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -56,7 +56,9 @@ public: // With description
|
||||
|
||||
virtual ~G4AxesModel ();
|
||||
|
||||
virtual void DescribeYourselfTo (G4VGraphicsScene&);
|
||||
void SetTransformation (const G4Transform3D& transform) override;
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene&) override;
|
||||
// The main task of a model is to describe itself to the graphics scene.
|
||||
|
||||
private:
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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 May 2021
|
||||
//
|
||||
// Class Description:
|
||||
// G4Mesh encapsulates and validates a nested parameterisation, which we
|
||||
// call a "mesh". If a valid mesh cannot be created out of this
|
||||
// G4VPhysicalVolume* (which will probably be most common), it will
|
||||
// have a type "invalid". Then, usually, it may simply be destroyed.
|
||||
// The overhead of an invalid attempt is expected to be small.
|
||||
// Class Description - End:
|
||||
|
||||
#ifndef G4MESH_HH
|
||||
#define G4MESH_HH
|
||||
|
||||
#include "G4Transform3D.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
|
||||
class G4Mesh
|
||||
{
|
||||
public: // With description
|
||||
enum MeshType
|
||||
{
|
||||
invalid,
|
||||
rectangle,
|
||||
cylinder,
|
||||
sphere
|
||||
};
|
||||
|
||||
G4Mesh(G4VPhysicalVolume* containerVolume, const G4Transform3D&);
|
||||
virtual ~G4Mesh();
|
||||
|
||||
const std::map<G4int,G4String>& GetEnumMap() const { return fEnumMap; }
|
||||
G4VPhysicalVolume* GetContainerVolume() const { return fpContainerVolume; }
|
||||
MeshType GetMeshType() const { return fMeshType; }
|
||||
G4int GetMeshDepth() const { return fMeshDepth; }
|
||||
const G4Transform3D& GetTransform() const { return fTransform; }
|
||||
|
||||
private:
|
||||
static std::map<G4int,G4String> fEnumMap;
|
||||
G4VPhysicalVolume* fpContainerVolume;
|
||||
MeshType fMeshType;
|
||||
G4int fMeshDepth;
|
||||
G4Transform3D fTransform;
|
||||
};
|
||||
|
||||
std::ostream& operator << (std::ostream& os, const G4Mesh& mesh);
|
||||
|
||||
#endif
|
||||
@@ -177,6 +177,8 @@ public: // With description
|
||||
G4DisplacedSolid* GetCutawaySolid () const;
|
||||
const G4Event* GetEvent () const;
|
||||
const std::vector<VisAttributesModifier>& GetVisAttributesModifiers() const;
|
||||
G4bool IsSpecialMeshRendering () const;
|
||||
const std::vector<PVNameCopyNo>& GetSpecialMeshVolumes() const;
|
||||
|
||||
// Set functions...
|
||||
void SetWarning (G4bool);
|
||||
@@ -197,6 +199,8 @@ public: // With description
|
||||
void SetCutawaySolid (G4DisplacedSolid* pCutawaySolid);
|
||||
void SetEvent (const G4Event* pEvent);
|
||||
void SetVisAttributesModifiers(const std::vector<VisAttributesModifier>&);
|
||||
void SetSpecialMeshRendering (G4bool);
|
||||
void SetSpecialMeshVolumes (const std::vector<PVNameCopyNo>&);
|
||||
|
||||
friend std::ostream& operator <<
|
||||
(std::ostream& os, const G4ModelingParameters&);
|
||||
@@ -233,6 +237,8 @@ private:
|
||||
G4DisplacedSolid* fpCutawaySolid; // For generic cutaways.
|
||||
const G4Event* fpEvent; // Event being processed.
|
||||
std::vector<VisAttributesModifier> fVisAttributesModifiers;
|
||||
G4bool fSpecialMeshRendering; // Request special rendering of parameterised volumes
|
||||
std::vector<PVNameCopyNo> fSpecialMeshVolumes; // If empty, all meshes.
|
||||
};
|
||||
|
||||
std::ostream& operator <<
|
||||
|
||||
@@ -105,6 +105,13 @@ G4ModelingParameters::GetVisAttributesModifiers() const {
|
||||
return fVisAttributesModifiers;
|
||||
}
|
||||
|
||||
inline G4bool G4ModelingParameters::IsSpecialMeshRendering () const
|
||||
{return fSpecialMeshRendering;}
|
||||
|
||||
inline const std::vector<G4ModelingParameters::PVNameCopyNo>&
|
||||
G4ModelingParameters::GetSpecialMeshVolumes() const
|
||||
{return fSpecialMeshVolumes;}
|
||||
|
||||
inline void G4ModelingParameters::SetWarning (G4bool value) {
|
||||
fWarning = value;
|
||||
}
|
||||
@@ -165,3 +172,10 @@ inline void G4ModelingParameters::SetVisAttributesModifiers
|
||||
(const std::vector<G4ModelingParameters::VisAttributesModifier>& vams) {
|
||||
fVisAttributesModifiers = vams;
|
||||
}
|
||||
|
||||
inline void G4ModelingParameters::SetSpecialMeshRendering (G4bool smr)
|
||||
{fSpecialMeshRendering = smr;}
|
||||
|
||||
inline void G4ModelingParameters::SetSpecialMeshVolumes
|
||||
(const std::vector<G4ModelingParameters::PVNameCopyNo>& smvs)
|
||||
{fSpecialMeshVolumes = smvs;}
|
||||
|
||||
@@ -95,7 +95,7 @@ public: // With description
|
||||
G4int iCopyNo = 0,
|
||||
G4int depth = 0,
|
||||
const G4Transform3D& transform = G4Transform3D(),
|
||||
G4bool drawn = false):
|
||||
G4bool drawn = true):
|
||||
fpPV(pPV),
|
||||
fCopyNo(iCopyNo),
|
||||
fNonCulledDepth(depth),
|
||||
|
||||
@@ -49,7 +49,9 @@ public:
|
||||
G4PhysicalVolumesSearchScene
|
||||
(G4PhysicalVolumeModel* pSearchVolumeModel, // usually a world
|
||||
const G4String& requiredPhysicalVolumeName,
|
||||
G4int requiredCopyNo = -1); // -1 means any copy no
|
||||
G4int requiredCopyNo = -1, // -1 means any copy no
|
||||
// Don't continue beyond requiredContinuation once found
|
||||
G4int requiredContinuation = G4PhysicalVolumeModel::UNLIMITED);
|
||||
|
||||
virtual ~G4PhysicalVolumesSearchScene () {}
|
||||
|
||||
@@ -108,6 +110,7 @@ private:
|
||||
const G4PhysicalVolumeModel* fpSearchVolumesModel;
|
||||
Matcher fMatcher;
|
||||
G4int fRequiredCopyNo;
|
||||
G4int fRequiredContinuation;
|
||||
std::vector<Findings> fFindings;
|
||||
};
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ public:
|
||||
void AddCompound (const G4VDigi&) {}
|
||||
void AddCompound (const G4THitsMap<G4double>&) {}
|
||||
void AddCompound (const G4THitsMap<G4StatDouble>&) {}
|
||||
void AddCompound (const G4Mesh&) {}
|
||||
// Primitives
|
||||
void BeginPrimitives (const G4Transform3D&) {}
|
||||
void EndPrimitives () {}
|
||||
@@ -95,7 +96,7 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
virtual void ProcessVolume (const G4VSolid&) = 0;
|
||||
virtual void ProcessVolume (const G4VSolid&);
|
||||
const G4Transform3D* fpCurrentObjectTransformation;
|
||||
};
|
||||
|
||||
|
||||
@@ -50,7 +50,9 @@ public: // With description
|
||||
|
||||
virtual ~G4TextModel ();
|
||||
|
||||
virtual void DescribeYourselfTo (G4VGraphicsScene&);
|
||||
void SetTransformation (const G4Transform3D& transform) override;
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene&) override;
|
||||
// The main task of a model is to describe itself to the graphics scene.
|
||||
|
||||
private:
|
||||
@@ -60,6 +62,7 @@ private:
|
||||
G4TextModel& operator = (const G4TextModel&);
|
||||
|
||||
G4Text fG4Text;
|
||||
G4Text fG4TextOrig;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -91,8 +91,8 @@ private:
|
||||
// If non-empty, use fExtentForField alone for sampling, but only
|
||||
// draw if sampling point is in the specified physical volume(s).
|
||||
|
||||
G4int fNDataPointsPerMaxHalfScene;
|
||||
// No. of data points sampled per maximum half scene.
|
||||
G4int fNDataPointsPerMaxHalfExtent;
|
||||
// No. of data points sampled per maximum half extent.
|
||||
// Note that total number of sampling points can be as high as
|
||||
// (2*n+1)^3, which can get very big. However, fields are usually
|
||||
// confined to only parts of the scene, so this may not be a problem.
|
||||
|
||||
@@ -36,6 +36,15 @@
|
||||
// to a scene handler. A scene is a collection of models.
|
||||
// A special case is made for G4PhysicalVolumeModel - a non-null pointer
|
||||
// is to be returned by G4PhysicalVolumeModel::GetG4PhysicalVolumeModel().
|
||||
//
|
||||
// The model must take care of the required transformation itself - thus the
|
||||
// models components should be transformed before delivering to the scene
|
||||
// handler. The model could receive the transformation in its constructor,
|
||||
// e.g., G4PhysicalVolumeModel, or handle it in the model's SetTransformation,
|
||||
// e.g., in G4AxesModel (relatively simple) or in G4ArrowModel (quite
|
||||
// complicated). This avoids having to transform the components perhaps
|
||||
// multiple times. The reasons for this are mainly to do with how we implement
|
||||
// G4PhysicalVolumeModel
|
||||
|
||||
#ifndef G4VMODEL_HH
|
||||
#define G4VMODEL_HH
|
||||
@@ -100,7 +109,7 @@ public: // With description
|
||||
void SetType (const G4String&);
|
||||
void SetGlobalDescription (const G4String&);
|
||||
void SetGlobalTag (const G4String&);
|
||||
void SetTransformation (const G4Transform3D&);
|
||||
virtual void SetTransformation (const G4Transform3D&);
|
||||
|
||||
virtual G4bool Validate (G4bool warn = true);
|
||||
// Validate, but allow internal changes (hence non-const function).
|
||||
|
||||
@@ -72,7 +72,3 @@ inline void G4VModel::SetType (const G4String& type) {
|
||||
inline void G4VModel::SetGlobalTag (const G4String& tag) {
|
||||
fGlobalTag = tag;
|
||||
}
|
||||
|
||||
inline void G4VModel::SetTransformation (const G4Transform3D& transform) {
|
||||
fTransform = transform;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user