Import Geant4 11.4.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2025-06-26 09:17:29 +02:00
parent 20a218bbe1
commit a499fb82e9
1941 changed files with 203285 additions and 95593 deletions
@@ -144,6 +144,49 @@ public: // With description
PVNameCopyNoPath fPVNameCopyNoPath;
};
struct TimeParameters {
G4double fStartTime = -G4VisAttributes::fVeryLongTime; // ) Start and end time of drawn range,
G4double fEndTime = G4VisAttributes::fVeryLongTime; // ) e.g., for trajectory steps.
G4double fFadeFactor = 1.; // 0: no fade; 1: maximum fade with time within range.
G4bool fDisplayHeadTime = false; // Display head time (fEndTime) in 2D text.
G4double fDisplayHeadTimeX = 0.0; // ) 2D screen coords of head time,
G4double fDisplayHeadTimeY = -0.9; // ) bottom-middle of view.
G4double fDisplayHeadTimeSize = 24.; // Screen size (pixels) of the head time writing.
G4double fDisplayHeadTimeRed = 0.; // )
G4double fDisplayHeadTimeGreen = 1.; // ) Default colour of head time writing (cyan)
G4double fDisplayHeadTimeBlue = 1.; // )
G4bool fDisplayLightFront = false; // Display light front at head time originating at...
G4double fDisplayLightFrontX = 0.; // )
G4double fDisplayLightFrontY = 0.; // ) ...default coordinates and time of origin
G4double fDisplayLightFrontZ = 0.; // ) of light front drawing...
G4double fDisplayLightFrontT = 0.; // )
G4double fDisplayLightFrontRed = 0.; // )
G4double fDisplayLightFrontGreen = 1.; // ) ...in this default colour (green)
G4double fDisplayLightFrontBlue = 0.; // )
G4bool operator != (const TimeParameters& rhs) const {
if (fStartTime != rhs.fStartTime ||
fEndTime != rhs.fEndTime ||
fFadeFactor != rhs.fFadeFactor ||
fDisplayHeadTime != rhs.fDisplayHeadTime ||
fDisplayHeadTimeX != rhs.fDisplayHeadTimeX ||
fDisplayHeadTimeY != rhs.fDisplayHeadTimeY ||
fDisplayHeadTimeSize != rhs.fDisplayHeadTimeSize ||
fDisplayHeadTimeRed != rhs.fDisplayHeadTimeRed ||
fDisplayHeadTimeGreen != rhs.fDisplayHeadTimeGreen ||
fDisplayHeadTimeBlue != rhs.fDisplayHeadTimeBlue ||
fDisplayLightFront != rhs.fDisplayLightFront ||
fDisplayLightFrontX != rhs.fDisplayLightFrontX ||
fDisplayLightFrontY != rhs.fDisplayLightFrontY ||
fDisplayLightFrontZ != rhs.fDisplayLightFrontZ ||
fDisplayLightFrontT != rhs.fDisplayLightFrontT ||
fDisplayLightFrontRed != rhs.fDisplayLightFrontRed ||
fDisplayLightFrontGreen != rhs.fDisplayLightFrontGreen ||
fDisplayLightFrontBlue != rhs.fDisplayLightFrontBlue
) return true;
return false;
}
};
G4ModelingParameters ();
G4ModelingParameters (const G4VisAttributes* pDefaultVisAttributes,
@@ -183,8 +226,11 @@ public: // With description
G4DisplacedSolid* GetCutawaySolid () const;
const G4Event* GetEvent () const;
const std::vector<VisAttributesModifier>& GetVisAttributesModifiers() const;
const TimeParameters& GetTimeParameters () const;
G4bool IsSpecialMeshRendering () const;
const std::vector<PVNameCopyNo>& GetSpecialMeshVolumes() const;
const std::vector<PVNameCopyNo>& GetSpecialMeshVolumes () const;
G4double GetTransparencyByDepth () const;
G4int GetTransparencyByDepthOption () const;
// Set functions...
void SetWarning (G4bool);
@@ -206,8 +252,11 @@ public: // With description
void SetCutawaySolid (G4DisplacedSolid* pCutawaySolid);
void SetEvent (const G4Event* pEvent);
void SetVisAttributesModifiers(const std::vector<VisAttributesModifier>&);
void SetTimeParameters (const TimeParameters&);
void SetSpecialMeshRendering (G4bool);
void SetSpecialMeshVolumes (const std::vector<PVNameCopyNo>&);
void SetTransparencyByDepth (G4double);
void SetTransparencyByDepthOption(G4int);
friend std::ostream& operator <<
(std::ostream& os, const G4ModelingParameters&);
@@ -245,8 +294,11 @@ private:
G4DisplacedSolid* fpCutawaySolid; // For generic cutaways.
const G4Event* fpEvent; // Event being processed.
std::vector<VisAttributesModifier> fVisAttributesModifiers;
TimeParameters fTimeParameters; // Time parameters (for time-slicing).
G4bool fSpecialMeshRendering; // Request special rendering of parameterised volumes
std::vector<PVNameCopyNo> fSpecialMeshVolumes; // If empty, all meshes.
G4double fTransparencyByDepth; // Transparency ~= (geometry depth) - fTransparencyByDepth
G4int fTransparencyByDepthOption; // Its option
};
std::ostream& operator <<
@@ -108,6 +108,10 @@ G4ModelingParameters::GetVisAttributesModifiers() const {
return fVisAttributesModifiers;
}
inline const G4ModelingParameters::TimeParameters&
G4ModelingParameters::GetTimeParameters () const
{return fTimeParameters;}
inline G4bool G4ModelingParameters::IsSpecialMeshRendering () const
{return fSpecialMeshRendering;}
@@ -115,6 +119,14 @@ inline const std::vector<G4ModelingParameters::PVNameCopyNo>&
G4ModelingParameters::GetSpecialMeshVolumes() const
{return fSpecialMeshVolumes;}
inline G4double G4ModelingParameters::GetTransparencyByDepth () const {
return fTransparencyByDepth;
}
inline G4int G4ModelingParameters::GetTransparencyByDepthOption () const {
return fTransparencyByDepthOption;
}
inline void G4ModelingParameters::SetWarning (G4bool value) {
fWarning = value;
}
@@ -181,9 +193,22 @@ inline void G4ModelingParameters::SetVisAttributesModifiers
fVisAttributesModifiers = vams;
}
inline void G4ModelingParameters::SetTimeParameters
(const G4ModelingParameters::TimeParameters& timeParameters) {
fTimeParameters = timeParameters;
}
inline void G4ModelingParameters::SetSpecialMeshRendering (G4bool smr)
{fSpecialMeshRendering = smr;}
inline void G4ModelingParameters::SetSpecialMeshVolumes
(const std::vector<G4ModelingParameters::PVNameCopyNo>& smvs)
{fSpecialMeshVolumes = smvs;}
inline void G4ModelingParameters::SetTransparencyByDepth (G4double transparencyByDepth) {
fTransparencyByDepth = transparencyByDepth;
}
inline void G4ModelingParameters::SetTransparencyByDepthOption (G4int option) {
fTransparencyByDepthOption = option;
}
@@ -242,11 +242,20 @@ public: // With description
// G4VTrajectory::ShowTrajectory for an example of the use of
// G4Atts.
const std::map<G4int,G4int>& GetNumberOfTouchables() const {return fNTouchables;}
const std::map<G4int,G4int>& GetMapOfDrawnTouchables() const {return fMapDrawnTouchables;}
// Number of touchables drawn at each depth.
G4int GetTotalTouchables () {return fTotalTouchables;}
// Total numbere of touchables.
G4int GetTotalDrawnTouchables () {return fTotalDrawnTouchables;}
// Total number of touchables drawn.
G4int GetMaxFullDepth () const {return fMaxFullDepth;}
// Including base path, i.e., from the world volume
const std::map<G4int,G4int>& GetMapOfAllTouchables() const {return fMapAllTouchables;}
// Number of all touchables at each depth.
G4int GetTotalAllTouchables () {return fTotalAllTouchables;}
// Total number of touchables.
void SetRequestedDepth (G4int requestedDepth) {
fRequestedDepth = requestedDepth;
@@ -315,8 +324,12 @@ protected:
G4VSolid* fpClippingSolid;
ClippingMode fClippingMode;
G4int fNClippers; // No of clipping/cutting solids - only 0 or 1 allowed
std::map<G4int,G4int> fNTouchables; // No of touchables at each depth
G4int fTotalTouchables;
std::map<G4int,G4int> fMapDrawnTouchables; // No of touchables drawn at each depth
G4int fTotalDrawnTouchables;
std::map<G4int,G4int> fMapAllTouchables; // No of all touchables at each depth
G4int fTotalAllTouchables;
G4int fMaxFullDepth; // Including base path, i.e., from the world volume
private:
@@ -34,6 +34,13 @@
// graphics-system-indepedent description of a Geant4 component.
// The key fuctionality of a model is to know how to describe itself
// to a scene handler. A scene is a collection of models.
//
// The static data member const fpCurrentMP is provided so that it
// can be access statically: G4VModel::GetCurrentModelingParameters().
// Its value is expected to be identical to fpMP set in the scene
// handler, but to avoid linking problems, it must *not* be set on
// the vis side; it must be set in modeling by any model that
// requires it, G4TrajectoriesModel.
#ifndef G4VMODEL_HH
#define G4VMODEL_HH
@@ -58,6 +65,8 @@ public: // With description
// The main task of a model is to describe itself to the graphics scene.
const G4ModelingParameters* GetModelingParameters () const;
static const G4ModelingParameters* GetCurrentModelingParameters ();
// The latter for static access
const G4String& GetType() const;
// The sub-class should set its type, which could be the class
@@ -81,6 +90,7 @@ public: // With description
// Set methods for above...
void SetModelingParameters (const G4ModelingParameters*);
static void SetCurrentModelingParameters (const G4ModelingParameters*);
void SetExtent (const G4VisExtent&);
void SetType (const G4String&);
void SetGlobalDescription (const G4String&);
@@ -103,6 +113,8 @@ private:
// assignment not allowed. Keeps CodeWizard happy.
G4VModel (const G4VModel&);
G4VModel& operator = (const G4VModel&);
static const G4ModelingParameters* fpCurrentMP;
};
#include "G4VModel.icc"