/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2013 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 #include #include #include #include #include #include #include #include #include #include #include #include using namespace osgPresentation; ////////////////////////////////////////////////////////////////////////////////// // // Action base class // void Action::apply(osgPresentation::Group& group) { OSG_NOTICE<<"LoadAction::apply()"<(element)); } void Action::apply(osgPresentation::Text& text) { apply(static_cast(text)); } void Action::apply(osgPresentation::Volume& volume) { apply(static_cast(volume)); } void Action::apply(osgPresentation::Model& model) { apply(static_cast(model)); } void Action::apply(osgPresentation::Image& image) { apply(static_cast(image)); } void Action::apply(osgPresentation::Movie& movie) { apply(static_cast(movie)); } void Action::apply(osgPresentation::Section& section) { apply(static_cast(section)); } void Action::apply(osgPresentation::Layer& layer) { apply(static_cast(layer)); } void Action::apply(osgPresentation::Slide& slide) { apply(static_cast(slide)); } void Action::apply(osgPresentation::Presentation& presentation) { apply(static_cast(presentation)); } ///////////////////////////////////////////////////////////////////////// // // Specific Action implementations // void LoadAction::apply(osgPresentation::Element& element) { OSG_NOTICE<<"LoadAction::apply()"< void print(const T& value) { _output << value; } virtual void apply(bool value) { print(value); } virtual void apply(char value) { print(value); } virtual void apply(unsigned char value) { print(value); } virtual void apply(short value) { print(value); } virtual void apply(unsigned short value) { print(value); } virtual void apply(int value) { print(value); } virtual void apply(unsigned int value) { print(value); } virtual void apply(float value) { print(value); } virtual void apply(double value) { print(value); } virtual void apply(const std::string& value) { print(value); } virtual void apply(const osg::Vec2f& value) { print(value); } virtual void apply(const osg::Vec3f& value) { print(value); } virtual void apply(const osg::Vec4f& value) { print(value); } virtual void apply(const osg::Vec2d& value) { print(value); } virtual void apply(const osg::Vec3d& value) { print(value); } virtual void apply(const osg::Vec4d& value) { print(value); } virtual void apply(const osg::Quat& value) { print(value); } virtual void apply(const osg::Plane& value) { print(value); } virtual void apply(const osg::Matrixf& value) { print(value); } virtual void apply(const osg::Matrixd& value) { print(value); } std::ostream& _output; }; void PrintProperties::apply(osgPresentation::Group& group) { _output<<"PrintProperties osgPresentation object : "<getNumUserObjects(); ++i) { osg::ValueObject* value_object = dynamic_cast(udc->getUserObject(i)); if (value_object) { _output<<" "<className()<<" : "<getName()<<" : "; value_object->get(pvv); _output<className()<<" : "<getName()<<", description = "<