Typedefs | |
typedef G4CreatorFactoryT< G4VAttValueFilter, G4TypeKey, G4VAttValueFilter *(*)()> | G4AttValueFilterFactory |
Functions | |
G4AttValueFilterFactory * | GetAttValueFilterFactory () |
G4VAttValueFilter * | GetNewFilter (const G4AttDef &def) |
typedef G4CreatorFactoryT<G4VAttValueFilter, G4TypeKey, G4VAttValueFilter*(*)()> G4AttFilterUtils::G4AttValueFilterFactory |
Definition at line 42 of file G4AttFilterUtils.hh.
G4AttValueFilterFactory * G4AttFilterUtils::GetAttValueFilterFactory | ( | ) |
Definition at line 55 of file G4AttFilterUtils.cc.
References G4CreatorFactoryT< T, Identifier, Creator >::Register().
Referenced by GetNewFilter().
00055 { 00056 static G4AttValueFilterFactory* factory = new G4AttValueFilterFactory; 00057 static G4bool init(false); 00058 00059 if (!init) { 00060 // Register typekey<->creator pairs 00061 factory->Register(G4TypeKeyT<G4String>(), newFilter<G4String>); 00062 factory->Register(G4TypeKeyT<G4int>(), newFilter<G4int>); 00063 factory->Register(G4TypeKeyT<G4double>(), newFilter<G4double>); 00064 factory->Register(G4TypeKeyT<G4ThreeVector>(), newFilter<G4ThreeVector>); 00065 factory->Register(G4TypeKeyT<G4bool>(), newFilter<G4bool>); 00066 factory->Register(G4TypeKeyT<G4DimensionedDouble>(), newFilter<G4DimensionedDouble>); 00067 factory->Register(G4TypeKeyT<G4DimensionedThreeVector>(), newFilter<G4DimensionedThreeVector>); 00068 init = true; 00069 } 00070 00071 return factory; 00072 }
G4VAttValueFilter * G4AttFilterUtils::GetNewFilter | ( | const G4AttDef & | def | ) |
Definition at line 74 of file G4AttFilterUtils.cc.
References GetAttValueFilterFactory(), G4AttUtils::GetKey(), G4AttDef::GetTypeKey(), and G4TypeKey::IsValid().
Referenced by G4TrajectoryDrawByAttribute::Draw(), and G4AttributeFilterT< T >::Evaluate().
00074 { 00075 00076 G4TypeKey myKey = def.GetTypeKey(); 00077 00078 // Get correct type key if original G4AttDef's being used 00079 if (!myKey.IsValid()) { 00080 myKey = G4AttUtils::GetKey(def); 00081 } 00082 00083 // Should be valid now 00084 assert(myKey.IsValid()); 00085 00086 G4AttValueFilterFactory* factory = GetAttValueFilterFactory(); 00087 00088 G4VAttValueFilter* filter = factory->Create(myKey); 00089 assert (0 != filter); 00090 00091 return filter; 00092 }