1 // GroundLightManager.hxx - manage StateSets for point lights
2 //
3 // Copyright (C) 2007  Tim Moore timoore@redhat.com
4 // Copyright (C) 2006-2007 Mathias Froehlich
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License as
8 // published by the Free Software Foundation; either version 2 of the
9 // License, or (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19 //
20 
21 #include <osg/ref_ptr>
22 #include <osg/Vec4>
23 #include <osg/Referenced>
24 #include <osg/StateSet>
25 
26 
27 #include <simgear/scene/util/OsgSingleton.hxx>
28 #include <simgear/scene/util/SGUpdateVisitor.hxx>
29 
30 namespace simgear
31 {
32 class GroundLightManager : public ReferencedSingleton<GroundLightManager> {
33 public:
34     GroundLightManager();
getRunwayLightStateSet()35     osg::StateSet* getRunwayLightStateSet() { return runwayLightSS.get(); }
getTaxiLightStateSet()36     osg::StateSet* getTaxiLightStateSet() { return taxiLightSS.get(); }
getGroundLightStateSet()37     osg::StateSet* getGroundLightStateSet() { return groundLightSS.get(); }
38     // The SGUpdateVisitor manages various environmental properties,
39     // so use it.
40     void update (const SGUpdateVisitor* updateVisitor);
41     unsigned getLightNodeMask(const SGUpdateVisitor* updateVisitor);
42 protected:
43     osg::ref_ptr<osg::StateSet> runwayLightSS;
44     osg::ref_ptr<osg::StateSet> taxiLightSS;
45     osg::ref_ptr<osg::StateSet> groundLightSS;
46 };
47 }
48