root/OpenSceneGraph/trunk/src/osgWrappers/deprecated-dotosg/osg/OccluderNode.cpp @ 13041

Revision 13041, 1.3 kB (checked in by robert, 2 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 "osg/OccluderNode"
2
3#include "osgDB/Registry"
4#include "osgDB/Input"
5#include "osgDB/Output"
6
7using namespace osg;
8using namespace osgDB;
9
10// forward declare functions to use later.
11bool OccluderNode_readLocalData(Object& obj, Input& fr);
12bool OccluderNode_writeLocalData(const Object& obj, Output& fw);
13
14// register the read and write functions with the osgDB::Registry.
15REGISTER_DOTOSGWRAPPER(OccluderNode)
16(
17    new osg::OccluderNode,
18    "OccluderNode",
19    "Object Node OccluderNode Group",
20    &OccluderNode_readLocalData,
21    &OccluderNode_writeLocalData
22);
23
24bool OccluderNode_readLocalData(Object& obj, Input& fr)
25{
26    bool iteratorAdvanced = false;
27
28    OccluderNode& occludernode = static_cast<OccluderNode&>(obj);
29
30    static ref_ptr<ConvexPlanarOccluder> s_occluder = new ConvexPlanarOccluder;
31
32    ConvexPlanarOccluder* tmpOccluder = static_cast<ConvexPlanarOccluder*>(fr.readObjectOfType(*s_occluder));
33
34    if (tmpOccluder)
35    {
36        occludernode.setOccluder(tmpOccluder);
37        iteratorAdvanced = true;
38    }
39
40    return iteratorAdvanced;
41}
42
43
44bool OccluderNode_writeLocalData(const Object& obj, Output& fw)
45{
46    const OccluderNode& occludernode = static_cast<const OccluderNode&>(obj);
47
48    if (occludernode.getOccluder())
49    {
50        fw.writeObject(*occludernode.getOccluder());
51    }
52
53    return true;
54}
Note: See TracBrowser for help on using the browser.