root/OpenSceneGraph/trunk/src/osgWrappers/deprecated-dotosg/osgTerrain/SwitchLayer.cpp @ 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/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
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
29bool SwitchLayer_readLocalData(osg::Object &obj, osgDB::Input &fr);
30bool SwitchLayer_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
31
32REGISTER_DOTOSGWRAPPER(SwitchLayer_Proxy)
33(
34    new osgTerrain::SwitchLayer,
35    "SwitchLayer",
36    "Object SwitchLayer CompositeLayer Layer",
37    SwitchLayer_readLocalData,
38    SwitchLayer_writeLocalData
39);
40
41bool 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
57bool 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}
Note: See TracBrowser for help on using the browser.