root/OpenSceneGraph/trunk/src/osgWrappers/deprecated-dotosg/osgShadow/ShadowedScene.cpp @ 13041

Revision 13041, 1.3 kB (checked in by robert, 3 years 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#include <osgShadow/ShadowedScene>
2
3#include <iostream>
4#include <string>
5
6#include <osg/Vec3>
7#include <osg/Vec4>
8#include <osg/io_utils>
9
10#include <osgDB/Registry>
11#include <osgDB/Input>
12#include <osgDB/Output>
13#include <osgDB/ParameterOutput>
14
15bool ShadowedScene_readLocalData(osg::Object &obj, osgDB::Input &fr);
16bool ShadowedScene_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
17
18REGISTER_DOTOSGWRAPPER(ShadowedScene_Proxy)
19(
20    new osgShadow::ShadowedScene,
21    "ShadowedScene",
22    "Object ShadowedScene Group ",
23    ShadowedScene_readLocalData,
24    ShadowedScene_writeLocalData
25);
26
27bool ShadowedScene_readLocalData(osg::Object& obj, osgDB::Input &fr)
28{
29    osgShadow::ShadowedScene& ss = static_cast<osgShadow::ShadowedScene&>(obj);
30    bool iteratorAdvanced = false;
31
32    osg::ref_ptr<osg::Object> object=0;
33    while((object=fr.readObject())!=0)
34    {
35        osgShadow::ShadowTechnique* st = dynamic_cast<osgShadow::ShadowTechnique*>(object.get());
36        if (st) ss.setShadowTechnique(st);
37        iteratorAdvanced = true;
38    }
39
40    return iteratorAdvanced;
41}
42
43bool ShadowedScene_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
44{
45    const osgShadow::ShadowedScene& ss = static_cast<const osgShadow::ShadowedScene &>(obj);
46
47    if (ss.getShadowTechnique())
48    {
49        fw.writeObject(*ss.getShadowTechnique());
50    }
51
52    return true;
53}
Note: See TracBrowser for help on using the browser.