|
Revision 13041, 1.3 kB
(checked in by robert, 14 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 | #include "osg/OccluderNode" |
|---|
| 2 | |
|---|
| 3 | #include "osgDB/Registry" |
|---|
| 4 | #include "osgDB/Input" |
|---|
| 5 | #include "osgDB/Output" |
|---|
| 6 | |
|---|
| 7 | using namespace osg; |
|---|
| 8 | using namespace osgDB; |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | bool OccluderNode_readLocalData(Object& obj, Input& fr); |
|---|
| 12 | bool OccluderNode_writeLocalData(const Object& obj, Output& fw); |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | REGISTER_DOTOSGWRAPPER(OccluderNode) |
|---|
| 16 | ( |
|---|
| 17 | new osg::OccluderNode, |
|---|
| 18 | "OccluderNode", |
|---|
| 19 | "Object Node OccluderNode Group", |
|---|
| 20 | &OccluderNode_readLocalData, |
|---|
| 21 | &OccluderNode_writeLocalData |
|---|
| 22 | ); |
|---|
| 23 | |
|---|
| 24 | bool 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 | |
|---|
| 44 | bool 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 | } |
|---|