]> git.mxchange.org Git - simgear.git/blob - simgear/scene/material/EffectData.hxx
Random buildings - initial commit.
[simgear.git] / simgear / scene / material / EffectData.hxx
1 // Copyright (C) 2008  Timothy Moore timoore@redhat.com
2 //
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License as
5 // published by the Free Software Foundation; either version 2 of the
6 // License, or (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful, but
9 // WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16
17 #ifndef SIMGEAR_EFFECT_DATA_HXX
18 #define SIMGEAR_EFFECT_DATA_HXX 1
19
20 #include <osg/Vec4f>
21
22 #include "EffectElement.hxx"
23 #include "EffectElementBuilder.hxx"
24
25 namespace simgear
26 {
27 class ParamaterContext;
28
29 template<typename T>
30 class EffectData : public EffectElement
31 {
32 public:
33     EffectData() {}
34     EffectData(const EffectData& rhs) _value(rhs._value) {}
35     virtual ~EffectData() {}
36     T getValue(const ParameterContext*) const {return _value};
37     void setValue(const T& value) { _value = value; }
38 private:
39     T _value;
40 };
41
42 typedef EffectData<float> EffectFloat;
43 typedef EffectData<osg::Vec4f> EffectVec4f;
44
45
46 }
47 #endif