|
Revision 13041, 1.8 kB
(checked in by robert, 14 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | #ifndef __FLTEXP_MATERIAL_PALETTE_MANAGER_H__ |
|---|
| 18 | #define __FLTEXP_MATERIAL_PALETTE_MANAGER_H__ 1 |
|---|
| 19 | |
|---|
| 20 | #include "ExportOptions.h" |
|---|
| 21 | #include <map> |
|---|
| 22 | |
|---|
| 23 | namespace osg { |
|---|
| 24 | class Material; |
|---|
| 25 | } |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | namespace flt |
|---|
| 29 | { |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | class DataOutputStream; |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | class MaterialPaletteManager |
|---|
| 36 | { |
|---|
| 37 | public: |
|---|
| 38 | MaterialPaletteManager( ExportOptions& fltOpt ); |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | int add(osg::Material const* material); |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | void write( DataOutputStream& dos ) const; |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | private: |
|---|
| 48 | int _currIndex; |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | struct MaterialRecord |
|---|
| 52 | { |
|---|
| 53 | MaterialRecord(osg::Material const* m, int i) |
|---|
| 54 | : Material(m) |
|---|
| 55 | , Index(i) { } |
|---|
| 56 | |
|---|
| 57 | osg::Material const* Material; |
|---|
| 58 | int Index; |
|---|
| 59 | |
|---|
| 60 | }; |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | typedef std::map<osg::Material const*, MaterialRecord> MaterialPalette; |
|---|
| 64 | MaterialPalette _materialPalette; |
|---|
| 65 | |
|---|
| 66 | ExportOptions& _fltOpt; |
|---|
| 67 | |
|---|
| 68 | protected: |
|---|
| 69 | |
|---|
| 70 | MaterialPaletteManager& operator = (const MaterialPaletteManager&) { return *this; } |
|---|
| 71 | }; |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | #endif // !FLTEXP_MATERIAL_PALETTE_MANAGER_H |
|---|