|
Revision 13041, 1.9 kB
(checked in by robert, 15 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | #ifndef LWOSG_CONVERTER_ |
|---|
| 9 | #define LWOSG_CONVERTER_ |
|---|
| 10 | |
|---|
| 11 | #include "Object.h" |
|---|
| 12 | #include "iffparser.h" |
|---|
| 13 | |
|---|
| 14 | #include <osg/ref_ptr> |
|---|
| 15 | #include <osg/Group> |
|---|
| 16 | |
|---|
| 17 | #include <osgDB/ReaderWriter> |
|---|
| 18 | |
|---|
| 19 | #include <string> |
|---|
| 20 | |
|---|
| 21 | namespace lwosg |
|---|
| 22 | { |
|---|
| 23 | |
|---|
| 24 | class Converter { |
|---|
| 25 | public: |
|---|
| 26 | |
|---|
| 27 | struct Options { |
|---|
| 28 | osg::ref_ptr<CoordinateSystemFixer> csf; |
|---|
| 29 | int max_tex_units; |
|---|
| 30 | bool apply_light_model; |
|---|
| 31 | bool use_osgfx; |
|---|
| 32 | bool force_arb_compression; |
|---|
| 33 | bool combine_geodes; |
|---|
| 34 | VertexMap_binding_map texturemap_bindings; |
|---|
| 35 | |
|---|
| 36 | Options() |
|---|
| 37 | : csf(new LwoCoordFixer), |
|---|
| 38 | max_tex_units(0), |
|---|
| 39 | apply_light_model(true), |
|---|
| 40 | use_osgfx(false), |
|---|
| 41 | force_arb_compression(false), |
|---|
| 42 | combine_geodes(false) |
|---|
| 43 | { |
|---|
| 44 | } |
|---|
| 45 | }; |
|---|
| 46 | |
|---|
| 47 | Converter(); |
|---|
| 48 | Converter(const Options &options, const osgDB::ReaderWriter::Options* db_options); |
|---|
| 49 | |
|---|
| 50 | osg::Group *convert(Object &obj); |
|---|
| 51 | osg::Group *convert(const iff::Chunk_list &data); |
|---|
| 52 | osg::Group *convert(const std::string &filename); |
|---|
| 53 | |
|---|
| 54 | inline osg::Group *get_root() { return root_.get(); } |
|---|
| 55 | inline const osg::Group *get_root() const { return root_.get(); } |
|---|
| 56 | |
|---|
| 57 | inline const Options &get_options() const { return options_; } |
|---|
| 58 | inline Options &get_options() { return options_; } |
|---|
| 59 | inline void set_options(const Options &options) { options_ = options; } |
|---|
| 60 | |
|---|
| 61 | protected: |
|---|
| 62 | void build_scene_graph(Object &obj); |
|---|
| 63 | |
|---|
| 64 | private: |
|---|
| 65 | osg::ref_ptr<osg::Group> root_; |
|---|
| 66 | Options options_; |
|---|
| 67 | osg::ref_ptr<const osgDB::ReaderWriter::Options> db_options_; |
|---|
| 68 | }; |
|---|
| 69 | |
|---|
| 70 | } |
|---|
| 71 | |
|---|
| 72 | #endif |
|---|