Changes to existing files: ReaderWriter.cpp -- to support writeNode() of course. ReaderWriterATTR.cpp -- to support writeObject -- we write .attr files for textures, if they don't already exist. AttrData.cpp/.h -- Minor fixes. CMakeLists.txt -- to include the new files in the build." From Robert Osfield, port to non Windows platforms just required fixing of header capitilization errors that windows lets through the net due to having a case insensitive file system.
75 lines
1.7 KiB
C++
75 lines
1.7 KiB
C++
/*
|
|
* This library is open source and may be redistributed and/or modified under
|
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or (at
|
|
* your option) any later version. The full license is in the LICENSE file
|
|
* included with this distribution, and on the openscenegraph.org website.
|
|
*
|
|
* This library is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* OpenSceneGraph Public License for more details.
|
|
*/
|
|
|
|
//
|
|
// Copyright(c) 2008 Skew Matrix Software LLC.
|
|
//
|
|
|
|
#ifndef __FLTEXP_LIGHT_SOURCE_PALETTE_MANAGER_H__
|
|
#define __FLTEXP_LIGHT_SOURCE_PALETTE_MANAGER_H__ 1
|
|
|
|
#include "ExportOptions.h"
|
|
|
|
#include <set>
|
|
|
|
namespace osg {
|
|
class Light;
|
|
}
|
|
|
|
|
|
namespace flt
|
|
{
|
|
|
|
|
|
class DataOutputStream;
|
|
|
|
|
|
class LightSourcePaletteManager
|
|
{
|
|
public:
|
|
LightSourcePaletteManager( ExportOptions& fltOpt );
|
|
|
|
// Add a light to the palette and auto-assign it the next available index
|
|
int add(osg::Light const* light);
|
|
|
|
// Write the light palette records out to a DataOutputStream
|
|
void write( DataOutputStream& dos ) const;
|
|
|
|
|
|
private:
|
|
int _currIndex;
|
|
|
|
// Helper struct to hold light palette records
|
|
struct LightRecord
|
|
{
|
|
LightRecord(osg::Light const* light, int i)
|
|
: Light(light)
|
|
, Index(i) { }
|
|
|
|
osg::Light const* Light;
|
|
int Index;
|
|
|
|
};
|
|
|
|
// Map to allow lookups by Light pointer
|
|
typedef std::map<osg::Light const*, LightRecord> LightPalette;
|
|
LightPalette _lightPalette;
|
|
|
|
|
|
ExportOptions& _fltOpt;
|
|
};
|
|
|
|
|
|
} // End namespace fltexp
|
|
|
|
#endif // !__FLTEXP_LIGHT_SOURCE_PALETTE_MANAGER_H__
|