1 | // $Id: AtmosphereFactory.cc 2676 2006-04-28 15:22:49Z moreggia $ |
---|
2 | // Sylvain Moreggia created Dec, 1 2003 |
---|
3 | |
---|
4 | /***************************************************************************** |
---|
5 | * ESAF: Euso Simulation and Analysis Framework * |
---|
6 | * * |
---|
7 | * Id: AtmosphereFactory * |
---|
8 | * Package: atmosphere * |
---|
9 | * Coordinator: S. Moreggia * |
---|
10 | * * |
---|
11 | *****************************************************************************/ |
---|
12 | |
---|
13 | //_____________________________________________________________________________ |
---|
14 | // |
---|
15 | // AtmosphereFactory |
---|
16 | // |
---|
17 | // <extensive class description> |
---|
18 | // |
---|
19 | // Config file parameters |
---|
20 | // ====================== |
---|
21 | // |
---|
22 | // <parameter name>: <parameter description> |
---|
23 | // -Valid options: <available options> |
---|
24 | // |
---|
25 | |
---|
26 | #include "AtmosphereFactory.hh" |
---|
27 | #include "TestClouds.hh" |
---|
28 | #include "NoClouds.hh" |
---|
29 | #include "LowtranAerosol.hh" |
---|
30 | #include "NoAerosol.hh" |
---|
31 | #include "Config.hh" |
---|
32 | |
---|
33 | AtmosphereFactory *AtmosphereFactory::fMe = NULL; |
---|
34 | |
---|
35 | ClassImp(AtmosphereFactory) |
---|
36 | |
---|
37 | //_________________________________________________________________________________________ |
---|
38 | AtmosphereFactory::AtmosphereFactory() { |
---|
39 | // |
---|
40 | // ctor |
---|
41 | // |
---|
42 | } |
---|
43 | |
---|
44 | //_________________________________________________________________________________________ |
---|
45 | AtmosphereFactory::~AtmosphereFactory() { |
---|
46 | // |
---|
47 | // dtor |
---|
48 | // |
---|
49 | } |
---|
50 | |
---|
51 | //_________________________________________________________________________________________ |
---|
52 | AtmosphereFactory* AtmosphereFactory::Get() { |
---|
53 | // |
---|
54 | // instance |
---|
55 | // |
---|
56 | if ( fMe == NULL ) |
---|
57 | fMe = new AtmosphereFactory(); |
---|
58 | |
---|
59 | return fMe; |
---|
60 | } |
---|
61 | |
---|
62 | //_________________________________________________________________________________________ |
---|
63 | Clouds* AtmosphereFactory::GetClouds() { |
---|
64 | // |
---|
65 | // Build clouds object |
---|
66 | // |
---|
67 | string type = Conf()->GetStr("AtmosphereFactory.Clouds.type"); |
---|
68 | |
---|
69 | if(type == "test") |
---|
70 | return new TestClouds(); |
---|
71 | |
---|
72 | else if(type == "none") |
---|
73 | return new NoClouds(); |
---|
74 | |
---|
75 | else Msg(EsafMsg::Panic)<< " Wrong clouds type"<< MsgDispatch; |
---|
76 | |
---|
77 | return 0; |
---|
78 | |
---|
79 | } |
---|
80 | |
---|
81 | //_________________________________________________________________________________________ |
---|
82 | Aerosol* AtmosphereFactory::GetAerosol() { |
---|
83 | |
---|
84 | // |
---|
85 | // Build aerosol object |
---|
86 | // |
---|
87 | string type = Conf()->GetStr("AtmosphereFactory.Aerosol.name"); |
---|
88 | |
---|
89 | if(type == "lowtran") |
---|
90 | return new LowtranAerosol("lowtran"); |
---|
91 | |
---|
92 | else if(type == "none") |
---|
93 | return new NoAerosol("none"); |
---|
94 | |
---|
95 | else Msg(EsafMsg::Panic)<< " Wrong aerosol type"<< MsgDispatch; |
---|
96 | |
---|
97 | return 0; |
---|
98 | |
---|
99 | } |
---|
100 | |
---|