From 196256fdcdef349119ea69d276d8f613fe7d21f3 Mon Sep 17 00:00:00 2001 From: Julien Valentin Date: Thu, 4 Jan 2018 04:34:48 +0100 Subject: [PATCH 1/2] Evolve DSO add Node associate on Drawable based: Drawable Geometry DrawPixels.cpp ShapeDrawable.cpp RigGeometry.cpp ConnectedParticleSystem.cpp FadeText.cpp Text.cpp Text3D.cpp TextBase.cpp --- CMakeLists.txt | 2 +- src/osgWrappers/serializers/osg/DrawPixels.cpp | 7 ++++++- src/osgWrappers/serializers/osg/Drawable.cpp | 7 ++++++- src/osgWrappers/serializers/osg/Geometry.cpp | 7 +++++-- src/osgWrappers/serializers/osg/ShapeDrawable.cpp | 7 ++++++- src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp | 8 +++++++- .../serializers/osgParticle/ConnectedParticleSystem.cpp | 7 ++++++- src/osgWrappers/serializers/osgText/FadeText.cpp | 7 ++++++- src/osgWrappers/serializers/osgText/Text.cpp | 7 ++++++- src/osgWrappers/serializers/osgText/Text3D.cpp | 8 +++++++- src/osgWrappers/serializers/osgText/TextBase.cpp | 7 ++++++- 11 files changed, 62 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8c8e755b..285725729 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ SET(OPENSCENEGRAPH_MAJOR_VERSION 3) SET(OPENSCENEGRAPH_MINOR_VERSION 5) SET(OPENSCENEGRAPH_PATCH_VERSION 10) -SET(OPENSCENEGRAPH_SOVERSION 153) +SET(OPENSCENEGRAPH_SOVERSION 154) # set to 0 when not a release candidate, non zero means that any generated diff --git a/src/osgWrappers/serializers/osg/DrawPixels.cpp b/src/osgWrappers/serializers/osg/DrawPixels.cpp index 4746aa314..2cc618391 100644 --- a/src/osgWrappers/serializers/osg/DrawPixels.cpp +++ b/src/osgWrappers/serializers/osg/DrawPixels.cpp @@ -27,8 +27,13 @@ static bool writeArea( osgDB::OutputStream& os, const osg::DrawPixels& drawable REGISTER_OBJECT_WRAPPER( DrawPixels, new osg::DrawPixels, osg::DrawPixels, - "osg::Object osg::Drawable osg::DrawPixels" ) + "osg::Object osg::Node osg::Drawable osg::DrawPixels" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::Node") + } + ADD_VEC3_SERIALIZER( Position, osg::Vec3() ); // _position ADD_IMAGE_SERIALIZER( Image, osg::Image, NULL ); // _image ADD_BOOL_SERIALIZER( UseSubImage, false ); // _useSubImage diff --git a/src/osgWrappers/serializers/osg/Drawable.cpp b/src/osgWrappers/serializers/osg/Drawable.cpp index ff8a39e04..42ebfb195 100644 --- a/src/osgWrappers/serializers/osg/Drawable.cpp +++ b/src/osgWrappers/serializers/osg/Drawable.cpp @@ -33,8 +33,12 @@ static bool writeInitialBound( osgDB::OutputStream& os, const osg::Drawable& dra REGISTER_OBJECT_WRAPPER( Drawable, /*new osg::Drawable*/NULL, osg::Drawable, - "osg::Object osg::Drawable" ) + "osg::Object osg::Node osg::Drawable" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::Node") + } ADD_OBJECT_SERIALIZER( StateSet, osg::StateSet, NULL ); // _stateset ADD_USER_SERIALIZER( InitialBound ); // _initialBound ADD_OBJECT_SERIALIZER( ComputeBoundingBoxCallback, @@ -57,4 +61,5 @@ REGISTER_OBJECT_WRAPPER( Drawable, UPDATE_TO_VERSION_SCOPED( 145 ) ADD_BOOL_SERIALIZER( CullingActive, true ); // _cullingActive } + } diff --git a/src/osgWrappers/serializers/osg/Geometry.cpp b/src/osgWrappers/serializers/osg/Geometry.cpp index 416d136b0..ce359c8c7 100644 --- a/src/osgWrappers/serializers/osg/Geometry.cpp +++ b/src/osgWrappers/serializers/osg/Geometry.cpp @@ -144,8 +144,12 @@ static bool writeFastPathHint( osgDB::OutputStream& os, const osg::Geometry& geo REGISTER_OBJECT_WRAPPER( Geometry, new osg::Geometry, osg::Geometry, - "osg::Object osg::Drawable osg::Geometry" ) + "osg::Object osg::Node osg::Drawable osg::Geometry" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::Node") + } //ADD_LIST_SERIALIZER( PrimitiveSetList, osg::Geometry::PrimitiveSetList ); // _primitives ADD_VECTOR_SERIALIZER( PrimitiveSetList, osg::Geometry::PrimitiveSetList, osgDB::BaseSerializer::RW_OBJECT, 0 ); @@ -180,6 +184,5 @@ REGISTER_OBJECT_WRAPPER( Geometry, ADD_VECTOR_SERIALIZER( VertexAttribArrayList, osg::Geometry::ArrayList, osgDB::BaseSerializer::RW_OBJECT, 0 ); } - wrapper->addFinishedObjectReadCallback( new GeometryFinishedObjectReadCallback() ); } diff --git a/src/osgWrappers/serializers/osg/ShapeDrawable.cpp b/src/osgWrappers/serializers/osg/ShapeDrawable.cpp index 68548fcbf..3974ad386 100644 --- a/src/osgWrappers/serializers/osg/ShapeDrawable.cpp +++ b/src/osgWrappers/serializers/osg/ShapeDrawable.cpp @@ -6,8 +6,13 @@ REGISTER_OBJECT_WRAPPER( ShapeDrawable, new osg::ShapeDrawable, osg::ShapeDrawable, - "osg::Object osg::Drawable osg::ShapeDrawable" ) + "osg::Object osg::Node osg::Drawable osg::ShapeDrawable" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::Node") + } + ADD_VEC4_SERIALIZER( Color, osg::Vec4() ); // _color ADD_OBJECT_SERIALIZER( TessellationHints, osg::TessellationHints, NULL ); // _tessellationHints } diff --git a/src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp b/src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp index be47b97b1..db2acb3ef 100644 --- a/src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp +++ b/src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp @@ -68,8 +68,13 @@ static bool writeInfluenceMap( osgDB::OutputStream& os, const osgAnimation::RigG REGISTER_OBJECT_WRAPPER( osgAnimation_RigGeometry, new osgAnimation::RigGeometry, osgAnimation::RigGeometry, - "osg::Object osg::Drawable osg::Geometry osgAnimation::RigGeometry" ) + "osg::Object osg::Node osg::Drawable osg::Geometry osgAnimation::RigGeometry" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::Node") + } + ADD_USER_SERIALIZER( InfluenceMap ); // _vertexInfluenceMap ADD_OBJECT_SERIALIZER( SourceGeometry, osg::Geometry, NULL ); // _geometry @@ -77,5 +82,6 @@ REGISTER_OBJECT_WRAPPER( osgAnimation_RigGeometry, UPDATE_TO_VERSION_SCOPED( 145 ) ADD_OBJECT_SERIALIZER( RigTransformImplementation, osgAnimation::RigTransform, NULL ); // _geometry } + } } diff --git a/src/osgWrappers/serializers/osgParticle/ConnectedParticleSystem.cpp b/src/osgWrappers/serializers/osgParticle/ConnectedParticleSystem.cpp index 22bc579b2..c8cccbe79 100644 --- a/src/osgWrappers/serializers/osgParticle/ConnectedParticleSystem.cpp +++ b/src/osgWrappers/serializers/osgParticle/ConnectedParticleSystem.cpp @@ -6,6 +6,11 @@ REGISTER_OBJECT_WRAPPER( osgParticleConnectedParticleSystem, new osgParticle::ConnectedParticleSystem, osgParticle::ConnectedParticleSystem, - "osg::Object osg::Drawable osgParticle::ParticleSystem osgParticle::ConnectedParticleSystem" ) + "osg::Object osg::Node osg::Drawable osgParticle::ParticleSystem osgParticle::ConnectedParticleSystem" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::Node") + } + } diff --git a/src/osgWrappers/serializers/osgText/FadeText.cpp b/src/osgWrappers/serializers/osgText/FadeText.cpp index 9e82a758c..f03733f45 100644 --- a/src/osgWrappers/serializers/osgText/FadeText.cpp +++ b/src/osgWrappers/serializers/osgText/FadeText.cpp @@ -6,7 +6,12 @@ REGISTER_OBJECT_WRAPPER( osgText_FadeText, new osgText::FadeText, osgText::FadeText, - "osg::Object osg::Drawable osgText::TextBase osgText::Text osgText::FadeText" ) + "osg::Object osg::Node osg::Drawable osgText::TextBase osgText::Text osgText::FadeText" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::Node") + } + ADD_FLOAT_SERIALIZER( FadeSpeed, 0.0f ); // _fadeSpeed } diff --git a/src/osgWrappers/serializers/osgText/Text.cpp b/src/osgWrappers/serializers/osgText/Text.cpp index 444b95c2e..a156ff80b 100644 --- a/src/osgWrappers/serializers/osgText/Text.cpp +++ b/src/osgWrappers/serializers/osgText/Text.cpp @@ -56,8 +56,13 @@ static bool writeColorGradientCorners( osgDB::OutputStream& os, const osgText::T REGISTER_OBJECT_WRAPPER( osgText_Text, new osgText::Text, osgText::Text, - "osg::Object osg::Drawable osgText::TextBase osgText::Text" ) + "osg::Object osg::Node osg::Drawable osgText::TextBase osgText::Text" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::Node") + } + ADD_VEC4_SERIALIZER( Color, osg::Vec4() ); // _color BEGIN_ENUM_SERIALIZER( BackdropType, NONE ); diff --git a/src/osgWrappers/serializers/osgText/Text3D.cpp b/src/osgWrappers/serializers/osgText/Text3D.cpp index 2c41b5655..233efd91f 100644 --- a/src/osgWrappers/serializers/osgText/Text3D.cpp +++ b/src/osgWrappers/serializers/osgText/Text3D.cpp @@ -6,8 +6,12 @@ REGISTER_OBJECT_WRAPPER( osgText_Text3D, new osgText::Text3D, osgText::Text3D, - "osg::Object osg::Drawable osgText::TextBase osgText::Text3D" ) + "osg::Object osg::Node osg::Drawable osgText::TextBase osgText::Text3D" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::Node") + } ADD_FLOAT_SERIALIZER( CharacterDepth, 1.0f ); // _characterDepth BEGIN_ENUM_SERIALIZER( RenderMode, PER_GLYPH ); @@ -19,4 +23,6 @@ REGISTER_OBJECT_WRAPPER( osgText_Text3D, UPDATE_TO_VERSION_SCOPED( 68 ) ADD_VEC4_SERIALIZER( Color, osg::Vec4(1.0,1.0,1.0,1.0) ); // _color } + + } diff --git a/src/osgWrappers/serializers/osgText/TextBase.cpp b/src/osgWrappers/serializers/osgText/TextBase.cpp index 3885461e6..948047957 100644 --- a/src/osgWrappers/serializers/osgText/TextBase.cpp +++ b/src/osgWrappers/serializers/osgText/TextBase.cpp @@ -128,8 +128,13 @@ static bool writeText( osgDB::OutputStream& os, const osgText::TextBase& text ) REGISTER_OBJECT_WRAPPER( osgText_TextBase, /*new osgText::TextBase*/NULL, osgText::TextBase, - "osg::Object osg::Drawable osgText::TextBase" ) + "osg::Object osg::Node osg::Drawable osgText::TextBase" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::Node") + } + ADD_USER_SERIALIZER( Font ); // _font ADD_USER_SERIALIZER( FontSize ); // _fontSize ADD_USER_SERIALIZER( CharacterSize ); // _characterHeight, _characterAspectRatio From e33a407aafc7b12c8d77e18cffcdaf63c5d73ca6 Mon Sep 17 00:00:00 2001 From: Julien Valentin Date: Thu, 4 Jan 2018 05:16:21 +0100 Subject: [PATCH 2/2] add BufferData associate to Image and subclasses --- src/osgWrappers/serializers/osg/Image.cpp | 7 ++++++- src/osgWrappers/serializers/osg/ImageSequence.cpp | 6 +++++- src/osgWrappers/serializers/osg/ImageStream.cpp | 6 +++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/osgWrappers/serializers/osg/Image.cpp b/src/osgWrappers/serializers/osg/Image.cpp index e13ed19fb..0d316b46b 100644 --- a/src/osgWrappers/serializers/osg/Image.cpp +++ b/src/osgWrappers/serializers/osg/Image.cpp @@ -6,8 +6,13 @@ REGISTER_OBJECT_WRAPPER( Image, new osg::Image, osg::Image, - "osg::Object osg::Image" ) + "osg::Object osg::BufferData osg::Image" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::BufferData") + } + { UPDATE_TO_VERSION_SCOPED( 112 ) diff --git a/src/osgWrappers/serializers/osg/ImageSequence.cpp b/src/osgWrappers/serializers/osg/ImageSequence.cpp index 06f566355..bc26cf97b 100644 --- a/src/osgWrappers/serializers/osg/ImageSequence.cpp +++ b/src/osgWrappers/serializers/osg/ImageSequence.cpp @@ -72,8 +72,12 @@ static bool writeImages( osgDB::OutputStream& os, const osg::ImageSequence& imag REGISTER_OBJECT_WRAPPER( ImageSequence, new osg::ImageSequence, osg::ImageSequence, - "osg::Object osg::Image osg::ImageStream osg::ImageSequence" ) + "osg::Object osg::BufferData osg::Image osg::ImageStream osg::ImageSequence" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::BufferData") + } ADD_DOUBLE_SERIALIZER( ReferenceTime, DBL_MAX ); // _referenceTime ADD_DOUBLE_SERIALIZER( TimeMultiplier, 1.0 ); // _timeMultiplier diff --git a/src/osgWrappers/serializers/osg/ImageStream.cpp b/src/osgWrappers/serializers/osg/ImageStream.cpp index 744e11110..07cda8a08 100644 --- a/src/osgWrappers/serializers/osg/ImageStream.cpp +++ b/src/osgWrappers/serializers/osg/ImageStream.cpp @@ -6,8 +6,12 @@ REGISTER_OBJECT_WRAPPER( ImageStream, new osg::ImageStream, osg::ImageStream, - "osg::Object osg::Image osg::ImageStream" ) + "osg::Object osg::BufferData osg::Image osg::ImageStream" ) { + { + UPDATE_TO_VERSION_SCOPED( 154 ) + ADDED_ASSOCIATE("osg::BufferData") + } BEGIN_ENUM_SERIALIZER( LoopingMode, NO_LOOPING ); ADD_ENUM_VALUE( NO_LOOPING ); ADD_ENUM_VALUE( LOOPING );