|
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 | #include <osgTerrain/Layer> |
|---|
| 15 | |
|---|
| 16 | #include <iostream> |
|---|
| 17 | #include <string> |
|---|
| 18 | |
|---|
| 19 | #include <osg/Vec3> |
|---|
| 20 | #include <osg/Vec4> |
|---|
| 21 | #include <osg/io_utils> |
|---|
| 22 | |
|---|
| 23 | #include <osgDB/ReadFile> |
|---|
| 24 | #include <osgDB/Registry> |
|---|
| 25 | #include <osgDB/Input> |
|---|
| 26 | #include <osgDB/Output> |
|---|
| 27 | #include <osgDB/ParameterOutput> |
|---|
| 28 | |
|---|
| 29 | bool SwitchLayer_readLocalData(osg::Object &obj, osgDB::Input &fr); |
|---|
| 30 | bool SwitchLayer_writeLocalData(const osg::Object &obj, osgDB::Output &fw); |
|---|
| 31 | |
|---|
| 32 | REGISTER_DOTOSGWRAPPER(SwitchLayer_Proxy) |
|---|
| 33 | ( |
|---|
| 34 | new osgTerrain::SwitchLayer, |
|---|
| 35 | "SwitchLayer", |
|---|
| 36 | "Object SwitchLayer CompositeLayer Layer", |
|---|
| 37 | SwitchLayer_readLocalData, |
|---|
| 38 | SwitchLayer_writeLocalData |
|---|
| 39 | ); |
|---|
| 40 | |
|---|
| 41 | bool SwitchLayer_readLocalData(osg::Object& obj, osgDB::Input &fr) |
|---|
| 42 | { |
|---|
| 43 | osgTerrain::SwitchLayer& layer = static_cast<osgTerrain::SwitchLayer&>(obj); |
|---|
| 44 | |
|---|
| 45 | bool itrAdvanced = false; |
|---|
| 46 | |
|---|
| 47 | int i; |
|---|
| 48 | if (fr.read("ActiveLayer",i)) |
|---|
| 49 | { |
|---|
| 50 | layer.setActiveLayer(i); |
|---|
| 51 | itrAdvanced = true; |
|---|
| 52 | }; |
|---|
| 53 | |
|---|
| 54 | return itrAdvanced; |
|---|
| 55 | } |
|---|
| 56 | |
|---|
| 57 | bool SwitchLayer_writeLocalData(const osg::Object& obj, osgDB::Output& fw) |
|---|
| 58 | { |
|---|
| 59 | const osgTerrain::SwitchLayer& layer = static_cast<const osgTerrain::SwitchLayer&>(obj); |
|---|
| 60 | |
|---|
| 61 | fw.indent()<<"ActiveLayer "<<layer.getActiveLayer()<<std::endl; |
|---|
| 62 | |
|---|
| 63 | return true; |
|---|
| 64 | } |
|---|