From d87ec7cb188e3cbc7b2dc2c1606186dc7a160051 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 14 Jan 2009 15:16:29 +0000 Subject: [PATCH] Introduced osgVolume::Property, CompositePropery and TransferFunctionPropety classes --- examples/osgvolume/osgvolume.cpp | 4 +- include/osgVolume/Export | 2 +- include/osgVolume/FixedFunctionTechnique | 2 +- include/osgVolume/Layer | 22 +- include/osgVolume/Locator | 2 +- include/osgVolume/Property | 95 ++++++++ include/osgVolume/ShaderTechnique | 2 +- include/osgVolume/Version | 2 +- include/osgVolume/Volume | 2 +- include/osgVolume/VolumeTechnique | 2 +- include/osgVolume/VolumeTile | 15 +- src/osgPlugins/dicom/ReaderWriterDICOM.cpp | 2 +- src/osgVolume/CMakeLists.txt | 2 + src/osgVolume/Layer.cpp | 2 +- src/osgVolume/Locator.cpp | 2 +- src/osgVolume/Property.cpp | 63 +++++ src/osgVolume/ShaderTechnique.cpp | 21 +- src/osgVolume/Version.cpp | 2 +- src/osgVolume/Volume.cpp | 2 +- src/osgVolume/VolumeTechnique.cpp | 2 +- src/osgVolume/VolumeTile.cpp | 24 +- .../osgVolume/FixedFunctionTechnique.cpp | 89 +++++++ src/osgWrappers/osgVolume/Layer.cpp | 30 +-- src/osgWrappers/osgVolume/Property.cpp | 221 ++++++++++++++++++ src/osgWrappers/osgVolume/ShaderTechnique.cpp | 89 +++++++ src/osgWrappers/osgVolume/VolumeTile.cpp | 35 +-- 26 files changed, 625 insertions(+), 111 deletions(-) create mode 100644 include/osgVolume/Property create mode 100644 src/osgVolume/Property.cpp create mode 100644 src/osgWrappers/osgVolume/FixedFunctionTechnique.cpp create mode 100644 src/osgWrappers/osgVolume/Property.cpp create mode 100644 src/osgWrappers/osgVolume/ShaderTechnique.cpp diff --git a/examples/osgvolume/osgvolume.cpp b/examples/osgvolume/osgvolume.cpp index 090722677..192af181d 100644 --- a/examples/osgvolume/osgvolume.cpp +++ b/examples/osgvolume/osgvolume.cpp @@ -2296,7 +2296,7 @@ int main( int argc, char **argv ) volume->addChild(tile); osg::ref_ptr layer = new osgVolume::ImageLayer(image_3d); - layer->setTransferFunction(transferFunction.get()); + layer->setProperty(new osgVolume::TransferFunctionProperty(transferFunction.get())); if (matrix) { @@ -2305,7 +2305,7 @@ int main( int argc, char **argv ) tile->setLocator(locator); } - tile->addLayer(layer.get()); + tile->setLayer(layer.get()); if (useShader) { diff --git a/include/osgVolume/Export b/include/osgVolume/Export index 3493e2740..582eb91d9 100644 --- a/include/osgVolume/Export +++ b/include/osgVolume/Export @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or diff --git a/include/osgVolume/FixedFunctionTechnique b/include/osgVolume/FixedFunctionTechnique index 450eda1d5..a0e0019e0 100644 --- a/include/osgVolume/FixedFunctionTechnique +++ b/include/osgVolume/FixedFunctionTechnique @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or diff --git a/include/osgVolume/Layer b/include/osgVolume/Layer index 97992b4fa..d2099dbae 100644 --- a/include/osgVolume/Layer +++ b/include/osgVolume/Layer @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or @@ -14,13 +14,10 @@ #ifndef OSGVOLUME_LAYER #define OSGVOLUME_LAYER 1 -#include #include -#include -#include -#include #include +#include namespace osgVolume { @@ -67,15 +64,14 @@ class OSGVOLUME_EXPORT Layer : public osg::Object virtual const osg::Image* getImage() const { return 0; } - /** Set the optional transfer function that maps the imagery pixels to new colours. - * Transfer function may be implemented on the GPU or via pre-processing step. */ - void setTransferFunction(osg::TransferFunction* tf) { _transferFunction = tf; } + /** Set the Property (or Properties via the CompositeProperty) that informs the VolumeTechnique how this layer should be rendered.*/ + void setProperty(Property* property) { _property = property; } - /** Get the transfer function.*/ - osg::TransferFunction* getTransferFunction() { return _transferFunction.get(); } + /** Get the Property that informs the VolumeTechnique how this layer should be rendered.*/ + Property* getProperty() { return _property.get(); } - /** Get the const transfer function.*/ - const osg::TransferFunction* getTransferFunction() const { return _transferFunction.get(); } + /** Get the const Property that informs the VolumeTechnique how this layer should be rendered.*/ + const Property* getProperty() const { return _property.get(); } /** increment the modified count."*/ @@ -99,7 +95,7 @@ class OSGVOLUME_EXPORT Layer : public osg::Object osg::Texture::FilterMode _minFilter; osg::Texture::FilterMode _magFilter; - osg::ref_ptr _transferFunction; + osg::ref_ptr _property; }; diff --git a/include/osgVolume/Locator b/include/osgVolume/Locator index f1861c757..99498bdf0 100644 --- a/include/osgVolume/Locator +++ b/include/osgVolume/Locator @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or diff --git a/include/osgVolume/Property b/include/osgVolume/Property new file mode 100644 index 000000000..47fdd306d --- /dev/null +++ b/include/osgVolume/Property @@ -0,0 +1,95 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSGVOLUME_PROPERTY +#define OSGVOLUME_PROPERTY 1 + +#include + +#include + +namespace osgVolume { + +class OSGVOLUME_EXPORT Property : public osg::Object +{ + public: + + Property(); + + /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ + Property(const Property&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); + + META_Object(osgVolume, Property); + + protected: + + virtual ~Property(); +}; + +class OSGVOLUME_EXPORT CompositeProperty : public Property +{ + public: + + CompositeProperty(); + + /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ + CompositeProperty(const CompositeProperty& compositeProperty,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); + + META_Object(osgVolume, CompositeProperty); + + void clear(); + + typedef std::vector< osg::ref_ptr > Properties; + + void setProperty(unsigned int i, Property* property) { if (i>=_properties.size()) _properties.resize(i+1); _properties[i] = property; } + + Property* getProperty(unsigned int i) { return i<_properties.size() ? _properties[i].get() : 0; } + + const Property* getProperty(unsigned int i) const { return i<_properties.size() ? _properties[i].get() : 0; } + + void addProperty(Property* property) { _properties.push_back(property); } + + void removeProperty(unsigned int i) { _properties.erase(_properties.begin()+i); } + + unsigned int getNumProperties() const { return _properties.size(); } + + protected: + + virtual ~CompositeProperty() {} + + + Properties _properties; +}; + +class OSGVOLUME_EXPORT TransferFunctionProperty : public Property +{ + public: + + TransferFunctionProperty(osg::TransferFunction* tf = 0); + + /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ + TransferFunctionProperty(const TransferFunctionProperty& tfProperty,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); + + META_Object(osgVolume, TransferFunctionProperty); + + protected: + + virtual ~TransferFunctionProperty() {} + + osg::ref_ptr _tf; +}; + + +} + +#endif diff --git a/include/osgVolume/ShaderTechnique b/include/osgVolume/ShaderTechnique index 4c54410d8..d9a2e3007 100644 --- a/include/osgVolume/ShaderTechnique +++ b/include/osgVolume/ShaderTechnique @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or diff --git a/include/osgVolume/Version b/include/osgVolume/Version index 17b194397..ab10b9718 100644 --- a/include/osgVolume/Version +++ b/include/osgVolume/Version @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or diff --git a/include/osgVolume/Volume b/include/osgVolume/Volume index 6d3d9432e..f8587d5a5 100644 --- a/include/osgVolume/Volume +++ b/include/osgVolume/Volume @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or diff --git a/include/osgVolume/VolumeTechnique b/include/osgVolume/VolumeTechnique index ec8f64c56..640e2e961 100644 --- a/include/osgVolume/VolumeTechnique +++ b/include/osgVolume/VolumeTechnique @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or diff --git a/include/osgVolume/VolumeTile b/include/osgVolume/VolumeTile index 064640a0d..b925855f4 100644 --- a/include/osgVolume/VolumeTile +++ b/include/osgVolume/VolumeTile @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or @@ -115,13 +115,9 @@ class OSGVOLUME_EXPORT VolumeTile : public osg::Group const Locator* getLocator() const { return _locator.get(); } - void setLayer(unsigned int i, Layer* layer); - Layer* getLayer(unsigned int i) { return i<_layers.size() ? _layers[i].get() : 0; } - const Layer* getImage(unsigned int i) const { return i<_layers.size() ? _layers[i].get() : 0; } - - void addLayer(Layer* layer) { if (layer) _layers.push_back(layer); } - - unsigned int getNumLayers() { return _layers.size(); } + void setLayer(Layer* layer) { _layer = layer; } + Layer* getLayer() { return _layer.get(); } + const Layer* getImage() const { return _layer.get(); } /** Set the VolumeTechnique*/ @@ -160,8 +156,7 @@ class OSGVOLUME_EXPORT VolumeTile : public osg::Group osg::ref_ptr _locator; - typedef std::vector< osg::ref_ptr > Layers; - Layers _layers; + osg::ref_ptr _layer; }; } diff --git a/src/osgPlugins/dicom/ReaderWriterDICOM.cpp b/src/osgPlugins/dicom/ReaderWriterDICOM.cpp index 905780825..ca6bbae81 100644 --- a/src/osgPlugins/dicom/ReaderWriterDICOM.cpp +++ b/src/osgPlugins/dicom/ReaderWriterDICOM.cpp @@ -124,7 +124,7 @@ class ReaderWriterDICOM : public osgDB::ReaderWriter osg::ref_ptr layer= new osgVolume::ImageLayer(result.getImage()); - tile->addLayer(layer.get()); + tile->setLayer(layer.get()); // get matrix providing size of texels (in mm) osg::RefMatrix* matrix = dynamic_cast(result.getImage()->getUserData()); diff --git a/src/osgVolume/CMakeLists.txt b/src/osgVolume/CMakeLists.txt index bb8e9816d..d6159299a 100644 --- a/src/osgVolume/CMakeLists.txt +++ b/src/osgVolume/CMakeLists.txt @@ -12,6 +12,7 @@ SET(LIB_PUBLIC_HEADERS ${HEADER_PATH}/FixedFunctionTechnique ${HEADER_PATH}/Layer ${HEADER_PATH}/Locator + ${HEADER_PATH}/Property ${HEADER_PATH}/ShaderTechnique ${HEADER_PATH}/Version ${HEADER_PATH}/Volume @@ -26,6 +27,7 @@ ADD_LIBRARY(${LIB_NAME} FixedFunctionTechnique.cpp Layer.cpp Locator.cpp + Property.cpp ShaderTechnique.cpp Version.cpp Volume.cpp diff --git a/src/osgVolume/Layer.cpp b/src/osgVolume/Layer.cpp index 0d4c71b5b..18c11e8e2 100644 --- a/src/osgVolume/Layer.cpp +++ b/src/osgVolume/Layer.cpp @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or diff --git a/src/osgVolume/Locator.cpp b/src/osgVolume/Locator.cpp index 300cc27b3..3d09026bc 100644 --- a/src/osgVolume/Locator.cpp +++ b/src/osgVolume/Locator.cpp @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or diff --git a/src/osgVolume/Property.cpp b/src/osgVolume/Property.cpp new file mode 100644 index 000000000..013871722 --- /dev/null +++ b/src/osgVolume/Property.cpp @@ -0,0 +1,63 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#include + +using namespace osgVolume; + +Property::Property() +{ +} + +Property::Property(const Property& property,const osg::CopyOp& copyop): + osg::Object(property,copyop) +{ +} + +Property::~Property() +{ +} + +///////////////////////////////////////////////////////////////////////////// +// +// CompositeProperty +// +CompositeProperty::CompositeProperty() +{ +} + +CompositeProperty::CompositeProperty(const CompositeProperty& compositeProperty,const osg::CopyOp& copyop): + Property(compositeProperty,copyop) +{ +} + + +void CompositeProperty::clear() +{ + _properties.clear(); +} + +///////////////////////////////////////////////////////////////////////////// +// +// TransferFunctionProperty +// +TransferFunctionProperty::TransferFunctionProperty(osg::TransferFunction* tf): + _tf(tf) +{ +} + +TransferFunctionProperty::TransferFunctionProperty(const TransferFunctionProperty& tfp,const osg::CopyOp& copyop): + Property(tfp,copyop), + _tf(tfp._tf) +{ +} diff --git a/src/osgVolume/ShaderTechnique.cpp b/src/osgVolume/ShaderTechnique.cpp index ca5710ebf..d5cced338 100644 --- a/src/osgVolume/ShaderTechnique.cpp +++ b/src/osgVolume/ShaderTechnique.cpp @@ -63,22 +63,13 @@ void ShaderTechnique::init() osg::Image* image_3d = 0; osg::TransferFunction1D* tf = 0; osgVolume::Locator* masterLocator = _volumeTile->getLocator(); - for(unsigned int i = 0; - i < _volumeTile->getNumLayers(); - ++i) + + image_3d = _volumeTile->getLayer()->getImage(); + + if (_volumeTile->getLayer() && !masterLocator) { - if (_volumeTile->getLayer(i) && !masterLocator) - { - masterLocator = _volumeTile->getLayer(i)->getLocator(); - osg::notify(osg::NOTICE)<<"assigning locator = "<getLayer(i)->getImage()) - { - osg::notify(osg::NOTICE)<<"assigning image = "<getLayer(i)->getImage(); - tf = dynamic_cast(_volumeTile->getLayer(i)->getTransferFunction()); - } + masterLocator = _volumeTile->getLayer()->getLocator(); + osg::notify(osg::NOTICE)<<"assigning locator = "<computeBound(); - for(Layers::const_iterator itr = _layers.begin(); - itr != _layers.end(); - ++itr) - { - if (itr->valid()) bs.expandBy((*itr)->computeBound()); - } - - return bs; - - return bs; + return osg::BoundingSphere(); } diff --git a/src/osgWrappers/osgVolume/FixedFunctionTechnique.cpp b/src/osgWrappers/osgVolume/FixedFunctionTechnique.cpp new file mode 100644 index 000000000..8f04b81de --- /dev/null +++ b/src/osgWrappers/osgVolume/FixedFunctionTechnique.cpp @@ -0,0 +1,89 @@ +// *************************************************************************** +// +// Generated automatically by genwrapper. +// Please DO NOT EDIT this file! +// +// *************************************************************************** + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +// Must undefine IN and OUT macros defined in Windows headers +#ifdef IN +#undef IN +#endif +#ifdef OUT +#undef OUT +#endif + +BEGIN_OBJECT_REFLECTOR(osgVolume::FixedFunctionTechnique) + I_DeclaringFile("osgVolume/FixedFunctionTechnique"); + I_BaseType(osgVolume::VolumeTechnique); + I_Constructor0(____FixedFunctionTechnique, + "", + ""); + I_ConstructorWithDefaults2(IN, const osgVolume::FixedFunctionTechnique &, x, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY, + ____FixedFunctionTechnique__C5_FixedFunctionTechnique_R1__C5_osg_CopyOp_R1, + "Copy constructor using CopyOp to manage deep vs shallow copy. ", + ""); + 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_Method0(void, init, + Properties::VIRTUAL, + __void__init, + "", + ""); + I_Method1(void, update, IN, osgUtil::UpdateVisitor *, nv, + Properties::VIRTUAL, + __void__update__osgUtil_UpdateVisitor_P1, + "", + ""); + I_Method1(void, cull, IN, osgUtil::CullVisitor *, nv, + Properties::VIRTUAL, + __void__cull__osgUtil_CullVisitor_P1, + "", + ""); + I_Method0(void, cleanSceneGraph, + Properties::VIRTUAL, + __void__cleanSceneGraph, + "Clean scene graph from any terrain technique specific nodes. ", + ""); + I_Method1(void, traverse, IN, osg::NodeVisitor &, nv, + Properties::VIRTUAL, + __void__traverse__osg_NodeVisitor_R1, + "Traverse the terrain subgraph. ", + ""); +END_REFLECTOR + diff --git a/src/osgWrappers/osgVolume/Layer.cpp b/src/osgWrappers/osgVolume/Layer.cpp index f039fd5f1..0bfb70bbc 100644 --- a/src/osgWrappers/osgVolume/Layer.cpp +++ b/src/osgWrappers/osgVolume/Layer.cpp @@ -15,10 +15,10 @@ #include #include #include -#include #include #include #include +#include // Must undefine IN and OUT macros defined in Windows headers #ifdef IN @@ -309,20 +309,20 @@ BEGIN_OBJECT_REFLECTOR(osgVolume::Layer) __C5_osg_Image_P1__getImage, "Return const image associated with layer if supported. ", ""); - I_Method1(void, setTransferFunction, IN, osg::TransferFunction *, tf, + I_Method1(void, setProperty, IN, osgVolume::Property *, property, Properties::NON_VIRTUAL, - __void__setTransferFunction__osg_TransferFunction_P1, - "Set the optional transfer function that maps the imagery pixels to new colours. ", - "Transfer function may be implemented on the GPU or via pre-processing step. "); - I_Method0(osg::TransferFunction *, getTransferFunction, - Properties::NON_VIRTUAL, - __osg_TransferFunction_P1__getTransferFunction, - "Get the transfer function. ", + __void__setProperty__Property_P1, + "Set the Property (or Properties via the CompositeProperty) that informs the VolumeTechnique how this layer should be rendered. ", ""); - I_Method0(const osg::TransferFunction *, getTransferFunction, + I_Method0(osgVolume::Property *, getProperty, Properties::NON_VIRTUAL, - __C5_osg_TransferFunction_P1__getTransferFunction, - "Get the const transfer function. ", + __Property_P1__getProperty, + "Get the Property that informs the VolumeTechnique how this layer should be rendered. ", + ""); + I_Method0(const osgVolume::Property *, getProperty, + Properties::NON_VIRTUAL, + __C5_Property_P1__getProperty, + "Get the const Property that informs the VolumeTechnique how this layer should be rendered. ", ""); I_Method0(void, dirty, Properties::VIRTUAL, @@ -365,8 +365,8 @@ BEGIN_OBJECT_REFLECTOR(osgVolume::Layer) I_SimpleProperty(unsigned, ModifiedCount, 0, __void__setModifiedCount__unsigned); - I_SimpleProperty(osg::TransferFunction *, TransferFunction, - __osg_TransferFunction_P1__getTransferFunction, - __void__setTransferFunction__osg_TransferFunction_P1); + I_SimpleProperty(osgVolume::Property *, Property, + __Property_P1__getProperty, + __void__setProperty__Property_P1); END_REFLECTOR diff --git a/src/osgWrappers/osgVolume/Property.cpp b/src/osgWrappers/osgVolume/Property.cpp new file mode 100644 index 000000000..ae14818e6 --- /dev/null +++ b/src/osgWrappers/osgVolume/Property.cpp @@ -0,0 +1,221 @@ +// *************************************************************************** +// +// Generated automatically by genwrapper. +// Please DO NOT EDIT this file! +// +// *************************************************************************** + +#include +#include +#include +#include + +#include +#include +#include +#include + +// Must undefine IN and OUT macros defined in Windows headers +#ifdef IN +#undef IN +#endif +#ifdef OUT +#undef OUT +#endif + +TYPE_NAME_ALIAS(std::vector< osg::ref_ptr< osgVolume::Property > >, osgVolume::CompositeProperty::Properties) + +BEGIN_OBJECT_REFLECTOR(osgVolume::CompositeProperty) + I_DeclaringFile("osgVolume/Property"); + I_BaseType(osgVolume::Property); + I_Constructor0(____CompositeProperty, + "", + ""); + I_ConstructorWithDefaults2(IN, const osgVolume::CompositeProperty &, compositeProperty, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY, + ____CompositeProperty__C5_CompositeProperty_R1__C5_osg_CopyOp_R1, + "Copy constructor using CopyOp to manage deep vs shallow copy. ", + ""); + 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_Method0(void, clear, + Properties::NON_VIRTUAL, + __void__clear, + "", + ""); + I_Method2(void, setProperty, IN, unsigned int, i, IN, osgVolume::Property *, property, + Properties::NON_VIRTUAL, + __void__setProperty__unsigned_int__Property_P1, + "", + ""); + I_Method1(osgVolume::Property *, getProperty, IN, unsigned int, i, + Properties::NON_VIRTUAL, + __Property_P1__getProperty__unsigned_int, + "", + ""); + I_Method1(const osgVolume::Property *, getProperty, IN, unsigned int, i, + Properties::NON_VIRTUAL, + __C5_Property_P1__getProperty__unsigned_int, + "", + ""); + I_Method1(void, addProperty, IN, osgVolume::Property *, property, + Properties::NON_VIRTUAL, + __void__addProperty__Property_P1, + "", + ""); + I_Method1(void, removeProperty, IN, unsigned int, i, + Properties::NON_VIRTUAL, + __void__removeProperty__unsigned_int, + "", + ""); + I_Method0(unsigned int, getNumProperties, + Properties::NON_VIRTUAL, + __unsigned_int__getNumProperties, + "", + ""); + I_IndexedProperty(osgVolume::Property *, Property, + __Property_P1__getProperty__unsigned_int, + __void__setProperty__unsigned_int__Property_P1, + 0); +END_REFLECTOR + +BEGIN_OBJECT_REFLECTOR(osgVolume::Property) + I_DeclaringFile("osgVolume/Property"); + I_BaseType(osg::Object); + I_Constructor0(____Property, + "", + ""); + I_ConstructorWithDefaults2(IN, const osgVolume::Property &, x, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY, + ____Property__C5_Property_R1__C5_osg_CopyOp_R1, + "Copy constructor using CopyOp to manage deep vs shallow copy. ", + ""); + 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. "); +END_REFLECTOR + +BEGIN_OBJECT_REFLECTOR(osgVolume::TransferFunctionProperty) + I_DeclaringFile("osgVolume/Property"); + I_BaseType(osgVolume::Property); + I_ConstructorWithDefaults1(IN, osg::TransferFunction *, tf, 0, + Properties::NON_EXPLICIT, + ____TransferFunctionProperty__osg_TransferFunction_P1, + "", + ""); + I_ConstructorWithDefaults2(IN, const osgVolume::TransferFunctionProperty &, tfProperty, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY, + ____TransferFunctionProperty__C5_TransferFunctionProperty_R1__C5_osg_CopyOp_R1, + "Copy constructor using CopyOp to manage deep vs shallow copy. ", + ""); + 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. "); +END_REFLECTOR + +BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgVolume::Property >) + I_DeclaringFile("osg/ref_ptr"); + I_Constructor0(____ref_ptr, + "", + ""); + I_Constructor1(IN, osgVolume::Property *, ptr, + Properties::NON_EXPLICIT, + ____ref_ptr__T_P1, + "", + ""); + I_Constructor1(IN, const osg::ref_ptr< osgVolume::Property > &, rp, + Properties::NON_EXPLICIT, + ____ref_ptr__C5_ref_ptr_R1, + "", + ""); + I_Method0(osgVolume::Property *, get, + Properties::NON_VIRTUAL, + __T_P1__get, + "", + ""); + I_Method0(bool, valid, + Properties::NON_VIRTUAL, + __bool__valid, + "", + ""); + I_Method0(osgVolume::Property *, release, + Properties::NON_VIRTUAL, + __T_P1__release, + "", + ""); + I_Method1(void, swap, IN, osg::ref_ptr< osgVolume::Property > &, rp, + Properties::NON_VIRTUAL, + __void__swap__ref_ptr_R1, + "", + ""); + I_SimpleProperty(osgVolume::Property *, , + __T_P1__get, + 0); +END_REFLECTOR + +STD_VECTOR_REFLECTOR(std::vector< osg::ref_ptr< osgVolume::Property > >) + diff --git a/src/osgWrappers/osgVolume/ShaderTechnique.cpp b/src/osgWrappers/osgVolume/ShaderTechnique.cpp new file mode 100644 index 000000000..2b5e626aa --- /dev/null +++ b/src/osgWrappers/osgVolume/ShaderTechnique.cpp @@ -0,0 +1,89 @@ +// *************************************************************************** +// +// Generated automatically by genwrapper. +// Please DO NOT EDIT this file! +// +// *************************************************************************** + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +// Must undefine IN and OUT macros defined in Windows headers +#ifdef IN +#undef IN +#endif +#ifdef OUT +#undef OUT +#endif + +BEGIN_OBJECT_REFLECTOR(osgVolume::ShaderTechnique) + I_DeclaringFile("osgVolume/ShaderTechnique"); + I_BaseType(osgVolume::VolumeTechnique); + I_Constructor0(____ShaderTechnique, + "", + ""); + I_ConstructorWithDefaults2(IN, const osgVolume::ShaderTechnique &, x, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY, + ____ShaderTechnique__C5_ShaderTechnique_R1__C5_osg_CopyOp_R1, + "", + ""); + 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_Method0(void, init, + Properties::VIRTUAL, + __void__init, + "", + ""); + I_Method1(void, update, IN, osgUtil::UpdateVisitor *, nv, + Properties::VIRTUAL, + __void__update__osgUtil_UpdateVisitor_P1, + "", + ""); + I_Method1(void, cull, IN, osgUtil::CullVisitor *, nv, + Properties::VIRTUAL, + __void__cull__osgUtil_CullVisitor_P1, + "", + ""); + I_Method0(void, cleanSceneGraph, + Properties::VIRTUAL, + __void__cleanSceneGraph, + "Clean scene graph from any terrain technique specific nodes. ", + ""); + I_Method1(void, traverse, IN, osg::NodeVisitor &, nv, + Properties::VIRTUAL, + __void__traverse__osg_NodeVisitor_R1, + "Traverse the terrain subgraph. ", + ""); +END_REFLECTOR + diff --git a/src/osgWrappers/osgVolume/VolumeTile.cpp b/src/osgWrappers/osgVolume/VolumeTile.cpp index 278eda5ed..d878ee6b2 100644 --- a/src/osgWrappers/osgVolume/VolumeTile.cpp +++ b/src/osgWrappers/osgVolume/VolumeTile.cpp @@ -138,29 +138,19 @@ BEGIN_OBJECT_REFLECTOR(osgVolume::VolumeTile) __C5_Locator_P1__getLocator, "", ""); - I_Method2(void, setLayer, IN, unsigned int, i, IN, osgVolume::Layer *, layer, + I_Method1(void, setLayer, IN, osgVolume::Layer *, layer, Properties::NON_VIRTUAL, - __void__setLayer__unsigned_int__Layer_P1, + __void__setLayer__Layer_P1, "", ""); - I_Method1(osgVolume::Layer *, getLayer, IN, unsigned int, i, + I_Method0(osgVolume::Layer *, getLayer, Properties::NON_VIRTUAL, - __Layer_P1__getLayer__unsigned_int, + __Layer_P1__getLayer, "", ""); - I_Method1(const osgVolume::Layer *, getImage, IN, unsigned int, i, + I_Method0(const osgVolume::Layer *, getImage, Properties::NON_VIRTUAL, - __C5_Layer_P1__getImage__unsigned_int, - "", - ""); - I_Method1(void, addLayer, IN, osgVolume::Layer *, layer, - Properties::NON_VIRTUAL, - __void__addLayer__Layer_P1, - "", - ""); - I_Method0(unsigned int, getNumLayers, - Properties::NON_VIRTUAL, - __unsigned_int__getNumLayers, + __C5_Layer_P1__getImage, "", ""); I_Method1(void, setVolumeTechnique, IN, osgVolume::VolumeTechnique *, VolumeTechnique, @@ -196,13 +186,12 @@ BEGIN_OBJECT_REFLECTOR(osgVolume::VolumeTile) I_SimpleProperty(bool, Dirty, __bool__getDirty, __void__setDirty__bool); - I_ArrayProperty(osgVolume::Layer *, Layer, - __Layer_P1__getLayer__unsigned_int, - __void__setLayer__unsigned_int__Layer_P1, - __unsigned_int__getNumLayers, - __void__addLayer__Layer_P1, - 0, - 0); + I_SimpleProperty(const osgVolume::Layer *, Image, + __C5_Layer_P1__getImage, + 0); + I_SimpleProperty(osgVolume::Layer *, Layer, + __Layer_P1__getLayer, + __void__setLayer__Layer_P1); I_SimpleProperty(osgVolume::Locator *, Locator, __Locator_P1__getLocator, __void__setLocator__Locator_P1);