Added initial Widget wrapper
This commit is contained in:
@@ -29,7 +29,7 @@ class OSGUI_EXPORT Widget : public osg::Group
|
||||
public:
|
||||
Widget();
|
||||
Widget(const Widget& tfw, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
|
||||
META_Node(osgUI, Widget);
|
||||
META_Node(osgGA, Widget);
|
||||
|
||||
virtual void traverse(osg::NodeVisitor& nv);
|
||||
virtual void traverseImplementation(osg::NodeVisitor& nv);
|
||||
|
||||
@@ -51,7 +51,6 @@ struct GroupGetChild : public osgDB::MethodObject
|
||||
if (inputParameters.empty()) return false;
|
||||
|
||||
osg::Object* indexObject = inputParameters[0].get();
|
||||
OSG_NOTICE<<"GroupGetChild "<<indexObject->className()<<std::endl;
|
||||
|
||||
unsigned int index = 0;
|
||||
osg::DoubleValueObject* dvo = dynamic_cast<osg::DoubleValueObject*>(indexObject);
|
||||
|
||||
35
src/osgWrappers/serializers/osgGA/Widget.cpp
Normal file
35
src/osgWrappers/serializers/osgGA/Widget.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include <osgGA/Widget>
|
||||
#include <osg/ValueObject>
|
||||
#include <osgDB/ObjectWrapper>
|
||||
#include <osgDB/InputStream>
|
||||
#include <osgDB/OutputStream>
|
||||
|
||||
struct CreateGraphics : public osgDB::MethodObject
|
||||
{
|
||||
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
|
||||
{
|
||||
osgGA::Widget* widget = reinterpret_cast<osgGA::Widget*>(objectPtr);
|
||||
widget->createGraphics();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
struct CreateGraphicsImplementation : public osgDB::MethodObject
|
||||
{
|
||||
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
|
||||
{
|
||||
osgGA::Widget* widget = reinterpret_cast<osgGA::Widget*>(objectPtr);
|
||||
widget->createGraphicsImplementation();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
REGISTER_OBJECT_WRAPPER( Widget,
|
||||
new osgGA::Widget,
|
||||
osgGA::Widget,
|
||||
"osg::Object osg::Node osg::Group osgGA::Widget" )
|
||||
{
|
||||
ADD_METHOD_OBJECT( "createGraphics", CreateGraphics );
|
||||
ADD_METHOD_OBJECT( "createGraphicsImplementation", CreateGraphicsImplementation );
|
||||
}
|
||||
Reference in New Issue
Block a user