Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4AttFilterUtils Namespace Reference

Typedefs

typedef G4CreatorFactoryT< G4VAttValueFilter, G4TypeKey, G4VAttValueFilter *(*)()> G4AttValueFilterFactory
 

Functions

G4AttValueFilterFactoryGetAttValueFilterFactory ()
 
G4VAttValueFilterGetNewFilter (const G4AttDef &def)
 

Typedef Documentation

◆ G4AttValueFilterFactory

Function Documentation

◆ GetAttValueFilterFactory()

G4AttValueFilterFactory * G4AttFilterUtils::GetAttValueFilterFactory ( )

Definition at line 54 of file G4AttFilterUtils.cc.

54 {
56 static G4bool init(false);
57
58 if (!init) {
59 // Register typekey<->creator pairs
60 factory->Register(G4TypeKeyT<G4String>(), newFilter<G4String>);
61 factory->Register(G4TypeKeyT<G4int>(), newFilter<G4int>);
62 factory->Register(G4TypeKeyT<G4double>(), newFilter<G4double>);
63 factory->Register(G4TypeKeyT<G4ThreeVector>(), newFilter<G4ThreeVector>);
64 factory->Register(G4TypeKeyT<G4bool>(), newFilter<G4bool>);
65 factory->Register(G4TypeKeyT<G4DimensionedDouble>(), newFilter<G4DimensionedDouble>);
66 factory->Register(G4TypeKeyT<G4DimensionedThreeVector>(), newFilter<G4DimensionedThreeVector>);
67 init = true;
68 }
69
70 return factory;
71 }
bool G4bool
Definition G4Types.hh:86
G4bool Register(const Identifier &id, Creator creator)

Referenced by GetNewFilter().

◆ GetNewFilter()

G4VAttValueFilter * G4AttFilterUtils::GetNewFilter ( const G4AttDef & def)

Definition at line 73 of file G4AttFilterUtils.cc.

73 {
74
75 G4TypeKey myKey = def.GetTypeKey();
76
77 // Get correct type key if original G4AttDef's being used
78 if (!myKey.IsValid()) {
79 myKey = G4AttUtils::GetKey(def);
80 }
81
82 // Should be valid now
83 assert(myKey.IsValid());
84
85 G4AttValueFilterFactory* factory = GetAttValueFilterFactory();
86
87 G4VAttValueFilter* filter = factory->Create(myKey);
88 assert (0 != filter);
89
90 return filter;
91 }
const G4TypeKey & GetTypeKey() const
Definition G4AttDef.hh:88
G4bool IsValid()
Definition G4TypeKey.hh:49
G4TypeKey GetKey(const G4AttDef &def)
Definition G4AttUtils.cc:40

Referenced by G4TrajectoryDrawByAttribute::Draw(), and G4AttributeFilterT< T >::Evaluate().