From c678fed1132c1e4388989dace14c0177ada0d2a4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 21 Aug 2013 19:54:03 +0000 Subject: [PATCH] Added initial classes for present3D refactor --- include/osgPresentation/Element | 41 +++++++++++++ include/osgPresentation/Group | 59 +++++++++++++++++++ include/osgPresentation/Layer | 41 +++++++++++++ include/osgPresentation/Presentation | 41 +++++++++++++ include/osgPresentation/Section | 41 +++++++++++++ include/osgPresentation/Slide | 41 +++++++++++++ src/osgPresentation/CMakeLists.txt | 8 +++ src/osgWrappers/serializers/CMakeLists.txt | 1 + .../osgPresentation/CMakeLists.txt | 7 +++ .../serializers/osgPresentation/Element.cpp | 11 ++++ .../serializers/osgPresentation/Group.cpp | 11 ++++ .../serializers/osgPresentation/Layer.cpp | 11 ++++ .../osgPresentation/Presentation.cpp | 11 ++++ .../serializers/osgPresentation/Section.cpp | 11 ++++ .../serializers/osgPresentation/Slide.cpp | 11 ++++ 15 files changed, 346 insertions(+) create mode 100644 include/osgPresentation/Element create mode 100644 include/osgPresentation/Group create mode 100644 include/osgPresentation/Layer create mode 100644 include/osgPresentation/Presentation create mode 100644 include/osgPresentation/Section create mode 100644 include/osgPresentation/Slide create mode 100644 src/osgWrappers/serializers/osgPresentation/CMakeLists.txt create mode 100644 src/osgWrappers/serializers/osgPresentation/Element.cpp create mode 100644 src/osgWrappers/serializers/osgPresentation/Group.cpp create mode 100644 src/osgWrappers/serializers/osgPresentation/Layer.cpp create mode 100644 src/osgWrappers/serializers/osgPresentation/Presentation.cpp create mode 100644 src/osgWrappers/serializers/osgPresentation/Section.cpp create mode 100644 src/osgWrappers/serializers/osgPresentation/Slide.cpp diff --git a/include/osgPresentation/Element b/include/osgPresentation/Element new file mode 100644 index 000000000..dad047b6b --- /dev/null +++ b/include/osgPresentation/Element @@ -0,0 +1,41 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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 OSGPRESENTATION_ELEMENT +#define OSGPRESENTATION_ELEMENT 1 + +#include + +namespace osgPresentation { + +/** osgPresentation::Group +*/ +class OSGPRESENTATION_EXPORT Element : public osgPresentation::Group +{ + public : + + Element() {} + + /** Copy constructor using CopyOp to manage deep vs shallow copy. */ + Element(const Element& element,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osgPresentation::Group(element,copyop) {} + + META_Node(osgPresentation, Element); + +protected : + + virtual ~Element() {} +}; + +} + +#endif diff --git a/include/osgPresentation/Group b/include/osgPresentation/Group new file mode 100644 index 000000000..e1c1085a6 --- /dev/null +++ b/include/osgPresentation/Group @@ -0,0 +1,59 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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 OSGPRESENTATION_GROUP +#define OSGPRESENTATION_GROUP 1 + +#include +#include + +namespace osgPresentation { + +/** osgPresentation::Group +*/ +class OSGPRESENTATION_EXPORT Group : public osg::MatrixTransform +{ + public : + + Group() {} + + /** Copy constructor using CopyOp to manage deep vs shallow copy. */ + Group(const Group& group,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osg::MatrixTransform(group,copyop) {} + + META_Node(osgPresentation, Group); + + /** Convinience method that casts the named UserObject to osg::TemplateValueObject and gets the value. + * To use this template method you need to include the osg/ValueObject header.*/ + template + bool getProperty(const std::string& name, T& value) const + { + return getUserValue(name, value); + } + + /** Convinience method that creates the osg::TemplateValueObject to store the + * specified value and adds it as a named UserObject. + * To use this template method you need to include the osg/ValueObject header. */ + template + void setProperty(const std::string& name, const T& value) + { + return setUserValue(name, value); + } + + protected : + + virtual ~Group() {} +}; + +} + +#endif diff --git a/include/osgPresentation/Layer b/include/osgPresentation/Layer new file mode 100644 index 000000000..b1c35a1ee --- /dev/null +++ b/include/osgPresentation/Layer @@ -0,0 +1,41 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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 OSGPRESENTATION_LAYER +#define OSGPRESENTATION_LAYER 1 + +#include + +namespace osgPresentation { + +/** osgPresentation::Group +*/ +class OSGPRESENTATION_EXPORT Layer : public osgPresentation::Group +{ + public : + + Layer() {} + + /** Copy constructor using CopyOp to manage deep vs shallow copy. */ + Layer(const Layer& layer,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osgPresentation::Group(layer,copyop) {} + + META_Node(osgPresentation, Layer); + +protected : + + virtual ~Layer() {} +}; + +} + +#endif diff --git a/include/osgPresentation/Presentation b/include/osgPresentation/Presentation new file mode 100644 index 000000000..4746e3e8f --- /dev/null +++ b/include/osgPresentation/Presentation @@ -0,0 +1,41 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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 OSGPRESENTATION_PRESENTATION +#define OSGPRESENTATION_PRESENTATION 1 + +#include + +namespace osgPresentation { + +/** osgPresentation::Group +*/ +class OSGPRESENTATION_EXPORT Presentation : public osgPresentation::Group +{ + public : + + Presentation() {} + + /** Copy constructor using CopyOp to manage deep vs shallow copy. */ + Presentation(const Presentation& presentation,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osgPresentation::Group(presentation,copyop) {} + + META_Node(osgPresentation, Presentation); + +protected : + + virtual ~Presentation() {} +}; + +} + +#endif diff --git a/include/osgPresentation/Section b/include/osgPresentation/Section new file mode 100644 index 000000000..b0f058be0 --- /dev/null +++ b/include/osgPresentation/Section @@ -0,0 +1,41 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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 OSGPRESENTATION_SECTION +#define OSGPRESENTATION_SECTION 1 + +#include + +namespace osgPresentation { + +/** osgPresentation::Group +*/ +class OSGPRESENTATION_EXPORT Section : public osgPresentation::Group +{ + public : + + Section() {} + + /** Copy constructor using CopyOp to manage deep vs shallow copy. */ + Section(const Section& section,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osgPresentation::Group(section,copyop) {} + + META_Node(osgPresentation, Section); + +protected : + + virtual ~Section() {} +}; + +} + +#endif diff --git a/include/osgPresentation/Slide b/include/osgPresentation/Slide new file mode 100644 index 000000000..cab80830d --- /dev/null +++ b/include/osgPresentation/Slide @@ -0,0 +1,41 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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 OSGPRESENTATION_SLIDE +#define OSGPRESENTATION_SLIDE 1 + +#include + +namespace osgPresentation { + +/** osgPresentation::Group +*/ +class OSGPRESENTATION_EXPORT Slide : public osgPresentation::Group +{ + public : + + Slide() {} + + /** Copy constructor using CopyOp to manage deep vs shallow copy. */ + Slide(const Slide& slide,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osgPresentation::Group(slide,copyop) {} + + META_Node(osgPresentation, Slide); + +protected : + + virtual ~Slide() {} +}; + +} + +#endif diff --git a/src/osgPresentation/CMakeLists.txt b/src/osgPresentation/CMakeLists.txt index d7af9b5a9..b9df8e61a 100644 --- a/src/osgPresentation/CMakeLists.txt +++ b/src/osgPresentation/CMakeLists.txt @@ -10,6 +10,13 @@ SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) SET(TARGET_H ${HEADER_PATH}/Export ${HEADER_PATH}/Cursor + ${HEADER_PATH}/Presentation + ${HEADER_PATH}/Section + ${HEADER_PATH}/Slide + ${HEADER_PATH}/Layer + ${HEADER_PATH}/Element + ${HEADER_PATH}/Group + ${HEADER_PATH}/deprecated/AnimationMaterial ${HEADER_PATH}/deprecated/CompileSlideCallback ${HEADER_PATH}/deprecated/PickEventHandler @@ -23,6 +30,7 @@ SET(TARGET_H # FIXME: For OS X, need flag for Framework or dylib SET(TARGET_SRC Cursor.cpp + deprecated/AnimationMaterial.cpp deprecated/CompileSlideCallback.cpp deprecated/PickEventHandler.cpp diff --git a/src/osgWrappers/serializers/CMakeLists.txt b/src/osgWrappers/serializers/CMakeLists.txt index 2156a23bf..67a00064c 100644 --- a/src/osgWrappers/serializers/CMakeLists.txt +++ b/src/osgWrappers/serializers/CMakeLists.txt @@ -48,4 +48,5 @@ ADD_SUBDIRECTORY(osgGA) ADD_SUBDIRECTORY(osgTerrain) ADD_SUBDIRECTORY(osgText) ADD_SUBDIRECTORY(osgVolume) +ADD_SUBDIRECTORY(osgPresentation) ADD_SUBDIRECTORY(osgViewer) diff --git a/src/osgWrappers/serializers/osgPresentation/CMakeLists.txt b/src/osgWrappers/serializers/osgPresentation/CMakeLists.txt new file mode 100644 index 000000000..9f3ea6043 --- /dev/null +++ b/src/osgWrappers/serializers/osgPresentation/CMakeLists.txt @@ -0,0 +1,7 @@ +FILE(GLOB TARGET_SRC *.cpp) +FILE(GLOB TARGET_H *.h) + +SET(TARGET_ADDED_LIBRARIES osgPresentation ) + +#### end var setup ### +SETUP_PLUGIN(osgpresentation) diff --git a/src/osgWrappers/serializers/osgPresentation/Element.cpp b/src/osgWrappers/serializers/osgPresentation/Element.cpp new file mode 100644 index 000000000..4b18c49ea --- /dev/null +++ b/src/osgWrappers/serializers/osgPresentation/Element.cpp @@ -0,0 +1,11 @@ +#include +#include +#include +#include + +REGISTER_OBJECT_WRAPPER( Element, + new osgPresentation::Element, + osgPresentation::Element, + "osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Element" ) +{ +} diff --git a/src/osgWrappers/serializers/osgPresentation/Group.cpp b/src/osgWrappers/serializers/osgPresentation/Group.cpp new file mode 100644 index 000000000..7a6f5beaa --- /dev/null +++ b/src/osgWrappers/serializers/osgPresentation/Group.cpp @@ -0,0 +1,11 @@ +#include +#include +#include +#include + +REGISTER_OBJECT_WRAPPER( Group, + new osgPresentation::Group, + osgPresentation::Group, + "osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group" ) +{ +} diff --git a/src/osgWrappers/serializers/osgPresentation/Layer.cpp b/src/osgWrappers/serializers/osgPresentation/Layer.cpp new file mode 100644 index 000000000..f02e45bc4 --- /dev/null +++ b/src/osgWrappers/serializers/osgPresentation/Layer.cpp @@ -0,0 +1,11 @@ +#include +#include +#include +#include + +REGISTER_OBJECT_WRAPPER( Layer, + new osgPresentation::Layer, + osgPresentation::Layer, + "osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Layer" ) +{ +} diff --git a/src/osgWrappers/serializers/osgPresentation/Presentation.cpp b/src/osgWrappers/serializers/osgPresentation/Presentation.cpp new file mode 100644 index 000000000..5d330158b --- /dev/null +++ b/src/osgWrappers/serializers/osgPresentation/Presentation.cpp @@ -0,0 +1,11 @@ +#include +#include +#include +#include + +REGISTER_OBJECT_WRAPPER( Presentation, + new osgPresentation::Presentation, + osgPresentation::Presentation, + "osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Presentation" ) +{ +} diff --git a/src/osgWrappers/serializers/osgPresentation/Section.cpp b/src/osgWrappers/serializers/osgPresentation/Section.cpp new file mode 100644 index 000000000..8b5d533d3 --- /dev/null +++ b/src/osgWrappers/serializers/osgPresentation/Section.cpp @@ -0,0 +1,11 @@ +#include +#include +#include +#include + +REGISTER_OBJECT_WRAPPER( Section, + new osgPresentation::Section, + osgPresentation::Section, + "osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Section" ) +{ +} diff --git a/src/osgWrappers/serializers/osgPresentation/Slide.cpp b/src/osgWrappers/serializers/osgPresentation/Slide.cpp new file mode 100644 index 000000000..6dad8b8cb --- /dev/null +++ b/src/osgWrappers/serializers/osgPresentation/Slide.cpp @@ -0,0 +1,11 @@ +#include +#include +#include +#include + +REGISTER_OBJECT_WRAPPER( Slide, + new osgPresentation::Slide, + osgPresentation::Slide, + "osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Slide" ) +{ +}