Added test for serializers and fixed serializers

This commit is contained in:
Robert Osfield
2013-08-22 07:49:22 +00:00
parent c678fed113
commit fcde15e136
7 changed files with 29 additions and 7 deletions

View File

@@ -9,7 +9,13 @@
#include <osg/ScriptEngine>
#include <osg/UserDataContainer>
#include <osgPresentation/Presentation>
#include <osgPresentation/Slide>
#include <osgPresentation/Layer>
#include <osgPresentation/Element>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgDB/FileUtils>
#include <osgGA/TrackballManipulator>
@@ -93,6 +99,22 @@ int main(int argc, char** argv)
#endif
viewer.setSceneData( model.get() );
osg::ref_ptr<osgPresentation::Presentation> presentation = new osgPresentation::Presentation;
osg::ref_ptr<osgPresentation::Slide> slide = new osgPresentation::Slide;
osg::ref_ptr<osgPresentation::Layer> layer = new osgPresentation::Layer;
osg::ref_ptr<osgPresentation::Group> group = new osgPresentation::Group;
osg::ref_ptr<osgPresentation::Element> element = new osgPresentation::Element;
presentation->addChild(slide.get());
slide->addChild(layer.get());
//layer->addChild(element.get());
layer->addChild(group.get());
group->addChild(element.get());
element->addChild(model.get());
viewer.setSceneData( presentation.get() );
osgDB::writeNodeFile(*presentation, "pres.osgt");
return viewer.run();
}

View File

@@ -3,7 +3,7 @@
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( Element,
REGISTER_OBJECT_WRAPPER( osgPresentation_Element,
new osgPresentation::Element,
osgPresentation::Element,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Element" )

View File

@@ -3,7 +3,7 @@
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( Group,
REGISTER_OBJECT_WRAPPER( osgPresentation_Group,
new osgPresentation::Group,
osgPresentation::Group,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group" )

View File

@@ -3,7 +3,7 @@
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( Layer,
REGISTER_OBJECT_WRAPPER( osgPresentation_Layer,
new osgPresentation::Layer,
osgPresentation::Layer,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Layer" )

View File

@@ -3,7 +3,7 @@
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( Presentation,
REGISTER_OBJECT_WRAPPER( osgPresentation_Presentation,
new osgPresentation::Presentation,
osgPresentation::Presentation,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Presentation" )

View File

@@ -3,7 +3,7 @@
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( Section,
REGISTER_OBJECT_WRAPPER( osgPresentation_Section,
new osgPresentation::Section,
osgPresentation::Section,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Section" )

View File

@@ -3,7 +3,7 @@
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( Slide,
REGISTER_OBJECT_WRAPPER( osgPresentation_Slide,
new osgPresentation::Slide,
osgPresentation::Slide,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Slide" )