root/OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/LightSourcePaletteManager.h @ 13041

Revision 13041, 1.8 kB (checked in by robert, 2 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
Line 
1/*
2 * This library is open source and may be redistributed and/or modified under
3 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or (at
4 * your option) any later version. The full license is in the LICENSE file
5 * included with this distribution, and on the openscenegraph.org website.
6 *
7 * This library is distributed in the hope that it will be useful, but
8 * WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * OpenSceneGraph Public License for more details.
11*/
12
13//
14// Copyright(c) 2008 Skew Matrix Software LLC.
15//
16
17#ifndef __FLTEXP_LIGHT_SOURCE_PALETTE_MANAGER_H__
18#define __FLTEXP_LIGHT_SOURCE_PALETTE_MANAGER_H__ 1
19
20#include "ExportOptions.h"
21
22#include <set>
23
24namespace osg {
25    class Light;
26}
27
28
29namespace flt
30{
31
32
33class DataOutputStream;
34
35
36class LightSourcePaletteManager
37{
38  public:
39      LightSourcePaletteManager( ExportOptions& fltOpt );
40
41    // Add a light to the palette and auto-assign it the next available index
42    int add(osg::Light const* light);
43
44    // Write the light palette records out to a DataOutputStream
45    void write( DataOutputStream& dos ) const;
46
47
48  private:
49    int _currIndex;
50
51    // Helper struct to hold light palette records
52    struct LightRecord
53    {
54        LightRecord(osg::Light const* light, int i)
55            : Light(light)
56            , Index(i) { }
57
58        osg::Light const* Light;
59        int Index;
60
61    };
62
63    // Map to allow lookups by Light pointer
64    typedef std::map<osg::Light const*, LightRecord> LightPalette;
65    LightPalette _lightPalette;
66
67
68    ExportOptions& _fltOpt;
69
70protected:
71
72    LightSourcePaletteManager& operator = (const LightSourcePaletteManager&) { return *this; }
73};
74
75
76// End namespace fltexp
77
78#endif  // !__FLTEXP_LIGHT_SOURCE_PALETTE_MANAGER_H__
Note: See TracBrowser for help on using the browser.