From d7ba995370f427d0b402aa4f69d101162be658a1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 24 Nov 2008 10:13:27 +0000 Subject: [PATCH] Updated wrappers --- examples/osgvnc/osgvnc.cpp | 7 +++- src/osgWrappers/osg/Image.cpp | 9 ++++ src/osgWrappers/osgUtil/IntersectVisitor.cpp | 2 - .../osgViewer/ViewerEventHandlers.cpp | 41 +++++++++++++++++++ 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/examples/osgvnc/osgvnc.cpp b/examples/osgvnc/osgvnc.cpp index 2c54e3ed7..15a3c7bcb 100644 --- a/examples/osgvnc/osgvnc.cpp +++ b/examples/osgvnc/osgvnc.cpp @@ -31,7 +31,12 @@ osg::Node* createInteractiveQuad(const osg::Vec3& origin, osg::Vec3& widthAxis, texture, osg::StateAttribute::ON); - pictureQuad->setEventCallback(new osgViewer::InteractiveImageHandler(image)); + + + osg::ref_ptr callback = new osgViewer::InteractiveImageHandler(image); + + pictureQuad->setEventCallback(callback.get()); + pictureQuad->setCullCallback(callback.get()); osg::Geode* geode = new osg::Geode; geode->addDrawable(pictureQuad); diff --git a/src/osgWrappers/osg/Image.cpp b/src/osgWrappers/osg/Image.cpp index 032885de4..470697990 100644 --- a/src/osgWrappers/osg/Image.cpp +++ b/src/osgWrappers/osg/Image.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -384,6 +385,11 @@ BEGIN_OBJECT_REFLECTOR(osg::Image) __void__sendKeyEvent__int__bool, "method for sending key events to images that are acting as front ends to interactive surfaces such as a vnc or browser window. ", ""); + I_Method1(void, setFrameLastRendered, IN, const osg::FrameStamp *, frameStamp, + Properties::VIRTUAL, + __void__setFrameLastRendered__C5_osg_FrameStamp_P1, + "method for passing frame information to the custom Image classes, to be called only when objects associated with imagery are not culled. ", + ""); I_StaticMethod1(bool, isPackedType, IN, GLenum, type, __bool__isPackedType__GLenum_S, "", @@ -433,6 +439,9 @@ BEGIN_OBJECT_REFLECTOR(osg::Image) I_SimpleProperty(const std::string &, FileName, __C5_std_string_R1__getFileName, __void__setFileName__C5_std_string_R1); + I_SimpleProperty(const osg::FrameStamp *, FrameLastRendered, + 0, + __void__setFrameLastRendered__C5_osg_FrameStamp_P1); I_SimpleProperty(unsigned int, ImageSizeInBytes, __unsigned_int__getImageSizeInBytes, 0); diff --git a/src/osgWrappers/osgUtil/IntersectVisitor.cpp b/src/osgWrappers/osgUtil/IntersectVisitor.cpp index 2ed9f221d..92e7a8330 100644 --- a/src/osgWrappers/osgUtil/IntersectVisitor.cpp +++ b/src/osgWrappers/osgUtil/IntersectVisitor.cpp @@ -361,7 +361,5 @@ END_REFLECTOR STD_MAP_REFLECTOR(std::map< const osg::LineSegment * COMMA osgUtil::IntersectVisitor::HitList >) -STD_VECTOR_REFLECTOR(std::vector< int >) - STD_VECTOR_REFLECTOR(std::vector< osgUtil::Hit >) diff --git a/src/osgWrappers/osgViewer/ViewerEventHandlers.cpp b/src/osgWrappers/osgViewer/ViewerEventHandlers.cpp index fa7f95905..4ee67d665 100644 --- a/src/osgWrappers/osgViewer/ViewerEventHandlers.cpp +++ b/src/osgWrappers/osgViewer/ViewerEventHandlers.cpp @@ -12,9 +12,12 @@ #include #include +#include +#include #include #include #include +#include #include #include #include @@ -111,16 +114,54 @@ END_REFLECTOR BEGIN_OBJECT_REFLECTOR(osgViewer::InteractiveImageHandler) I_DeclaringFile("osgViewer/ViewerEventHandlers"); I_BaseType(osgGA::GUIEventHandler); + I_BaseType(osg::Drawable::CullCallback); I_Constructor1(IN, osg::Image *, image, Properties::NON_EXPLICIT, ____InteractiveImageHandler__osg_Image_P1, "", ""); + I_Method0(osg::Object *, cloneType, + Properties::VIRTUAL, + __osg_Object_P1__cloneType, + "Clone the type of an object, with Object* return type. ", + "Must be defined by derived classes. "); + I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, copyop, + Properties::VIRTUAL, + __osg_Object_P1__clone__C5_osg_CopyOp_R1, + "Clone an object, with Object* return type. ", + "Must be defined by derived classes. "); + I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj, + Properties::VIRTUAL, + __bool__isSameKindAs__C5_osg_Object_P1, + "", + ""); + I_Method0(const char *, libraryName, + Properties::VIRTUAL, + __C5_char_P1__libraryName, + "return the name of the object's library. ", + "Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name. "); + I_Method0(const char *, className, + Properties::VIRTUAL, + __C5_char_P1__className, + "return the name of the object's class type. ", + "Must be defined by derived classes. "); I_Method4(bool, handle, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, aa, IN, osg::Object *, x, IN, osg::NodeVisitor *, nv, Properties::VIRTUAL, __bool__handle__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1__osg_Object_P1__osg_NodeVisitor_P1, "Handle events, return true if handled, false otherwise. ", ""); + I_Method3(bool, cull, IN, osg::NodeVisitor *, nv, IN, osg::Drawable *, drawable, IN, osg::RenderInfo *, renderInfo, + Properties::VIRTUAL, + __bool__cull__osg_NodeVisitor_P1__osg_Drawable_P1__osg_RenderInfo_P1, + "do customized cull code, return true if drawable should be culled. ", + ""); + I_ProtectedConstructor0(____InteractiveImageHandler, + "", + ""); + I_ProtectedConstructorWithDefaults2(IN, const osgViewer::InteractiveImageHandler &, rhs, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY, + ____InteractiveImageHandler__C5_InteractiveImageHandler_R1__C5_osg_CopyOp_R1, + "", + ""); I_ProtectedMethod5(bool, mousePosition, IN, osgViewer::View *, view, IN, osg::NodeVisitor *, nv, IN, const osgGA::GUIEventAdapter &, ea, IN, int &, x, IN, int &, y, Properties::NON_VIRTUAL, Properties::CONST,