Geant4 9.6.0
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 55 of file G4AttFilterUtils.cc.

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

Referenced by GetNewFilter().

◆ GetNewFilter()

G4VAttValueFilter * G4AttFilterUtils::GetNewFilter ( const G4AttDef def)

Definition at line 74 of file G4AttFilterUtils.cc.

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

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