Removed the experiemental osgPresentation classes. These are only partially functional and not appropriate for the stable OSG-3.4 release

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14758 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-03-04 17:42:30 +00:00
parent 412a9154c3
commit 26d1679248
49 changed files with 1 additions and 1894 deletions

View File

@ -94,7 +94,6 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgprecipitation)
ADD_SUBDIRECTORY(osgprerender)
ADD_SUBDIRECTORY(osgprerendercubemap)
ADD_SUBDIRECTORY(osgpresentation)
ADD_SUBDIRECTORY(osgreflect)
ADD_SUBDIRECTORY(osgrobot)
ADD_SUBDIRECTORY(osgSSBO)

View File

@ -17,7 +17,6 @@
#include <osgDB/ObjectWrapper>
#include <osgDB/Registry>
#include <osgPresentation/Group>
#include <osg/ValueObject>
namespace osgDB

View File

@ -1,107 +0,0 @@
/* -*-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.
*/
#ifndef OSGPRESENTATION_ACTION
#define OSGPRESENTATION_ACTION 1
#include <osgPresentation/Export>
#include <osg/NodeVisitor>
namespace osgPresentation
{
// forward declare osgPresention nodes
class Group;
class Element;
class Text;
class Volume;
class Model;
class Image;
class Movie;
class Section;
class Layer;
class Slide;
class Presentation;
/** Action base class that is a NodeVistor that addes osgPresentation node support.*/
class OSGPRESENTATION_EXPORT Action : public osg::NodeVisitor
{
public:
Action(osg::NodeVisitor::TraversalMode traversalMode=osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN):
osg::NodeVisitor(traversalMode) {}
virtual void apply(osgPresentation::Group& group);
virtual void apply(osgPresentation::Element& element);
virtual void apply(osgPresentation::Text& text);
virtual void apply(osgPresentation::Volume& volume);
virtual void apply(osgPresentation::Model& model);
virtual void apply(osgPresentation::Image& image);
virtual void apply(osgPresentation::Movie& movie);
virtual void apply(osgPresentation::Section& section);
virtual void apply(osgPresentation::Layer& layer);
virtual void apply(osgPresentation::Slide& slide);
virtual void apply(osgPresentation::Presentation& presentation);
};
struct OSGPRESENTATION_EXPORT LoadAction : public Action
{
void apply(osgPresentation::Element& element);
};
struct OSGPRESENTATION_EXPORT UnloadAction : public Action
{
void apply(osgPresentation::Element& element);
};
struct OSGPRESENTATION_EXPORT ResetAction : public Action
{
void apply(osgPresentation::Element& element);
};
struct OSGPRESENTATION_EXPORT PauseAction : public Action
{
void apply(osgPresentation::Element& element);
};
struct OSGPRESENTATION_EXPORT PlayAction : public Action
{
void apply(osgPresentation::Element& element);
};
struct OSGPRESENTATION_EXPORT PrintProperties : public osgPresentation::Action
{
PrintProperties(std::ostream& output) : osgPresentation::Action(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), _output(output) {}
void apply(osgPresentation::Group& group);
std::ostream& _output;
};
struct OSGPRESENTATION_EXPORT PrintSupportedProperties : public osgPresentation::Action
{
PrintSupportedProperties(std::ostream& output) : osgPresentation::Action(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), _output(output) {}
void apply(osgPresentation::Group& group);
std::ostream& _output;
};
}
#endif

View File

@ -1,47 +0,0 @@
/* -*-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_AUDIO
#define OSGPRESENTATION_AUDIO 1
#include <osgPresentation/Element>
namespace osgPresentation {
/** osgPresentation::Audio
*/
class OSGPRESENTATION_EXPORT Audio : public osgPresentation::Element
{
public :
Audio() {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Audio(const Audio& audio,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osgPresentation::Element(audio,copyop) {}
META_Presentation(Audio);
/** load the audio subgraph.*/
virtual bool load();
/** Get all types of Properties supported by Presentation Object type, return true if the Properties are supported, false otherwise.*/
virtual bool getSupportedProperties(PropertyList&);
protected :
virtual ~Audio() {}
};
}
#endif

View File

@ -1,69 +0,0 @@
/* -*-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.
*/
#ifndef OSGPRESENTATION_ELEMENT
#define OSGPRESENTATION_ELEMENT 1
#include <osgPresentation/Group>
#include <osgUtil/UpdateVisitor>
#include <osgGA/EventVisitor>
namespace osgPresentation {
/** osgPresentation::Element
*/
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_Presentation(Element);
/** Load the subgraph implementation of the element.*/
virtual bool load() { return false; }
/** Remove the the subgraph implementation, freeing up space.*/
virtual bool unload() { removeChildren(0, getNumChildren()); return true; }
/** Return true if the subgraph implementation has been loaded.*/
virtual bool loaded() const { return getNumChildren()!=0; }
/** Enter the element for the first time, starting any animations, movies, audio etc..*/
virtual void enter() {}
/** Leave the element, stopping any animations, movies, audio etc..*/
virtual void leave() {}
/** Pause any animatios, videos, audio etc.*/
virtual void pause() {}
/** Play any animatios, videos, audio etc.*/
virtual void play() {}
/** Reset any animations, vidoes, audio etc. back to the begininng.*/
virtual void reset() {}
protected :
virtual ~Element() {}
};
}
#endif

View File

@ -1,118 +0,0 @@
/* -*-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.
*/
#ifndef OSGPRESENTATION_GROUP
#define OSGPRESENTATION_GROUP 1
#include <osg/MatrixTransform>
#include <osg/ValueObject>
#include <osgPresentation/Action>
#include <sstream>
namespace osgPresentation {
typedef std::pair< osg::ref_ptr<osg::Object>, std::string> ObjectDescription;
typedef std::list< ObjectDescription > PropertyList;
/** META_Presentation macro define the standard clone, isSameKindAs, className
* and accept methods. Use when subclassing from Node to make it
* more convenient to define the required pure virtual methods.*/
#define META_Presentation(name) \
virtual osg::Object* cloneType() const { return new name (); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
virtual const char* className() const { return #name; } \
virtual const char* libraryName() const { return "osgPresentation"; } \
virtual void accept(osg::NodeVisitor& nv) \
{ \
if (nv.validNodeMask(*this)) \
{ \
nv.pushOntoNodePath(this); \
osgPresentation::Action* action = dynamic_cast<osgPresentation::Action*>(&nv); \
if (action) action->apply(*this); \
else nv.apply(*this); \
nv.popFromNodePath(); \
} \
}
/** 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_Presentation(Group);
/** Convinience method that casts the named UserObject to osg::TemplateValueObject<T> and gets the value.
* To use this template method you need to include the osg/ValueObject header.*/
template<typename T>
bool getProperty(const std::string& name, T& value) const
{
return getUserValue(name, value);
}
/** Convinience method that creates the osg::TemplateValueObject<T> 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<typename T>
void setProperty(const std::string& name, const T& value)
{
setUserValue(name, value);
}
/** Check for named Property, if it doesn't exist on this object check parents recursively for instances.*/
osg::Object* getPropertyObject(const std::string& name, bool checkParents = true);
/** Check for name Property, and convert to desired template value where possible. */
template<typename T>
bool getPropertyValue(const std::string& name, T& value, bool checkParents = true)
{
osg::Object* object = getPropertyObject(name, checkParents);
if (!object) return false;
typedef osg::TemplateValueObject<T> UserValueObject;
const UserValueObject* uvo = dynamic_cast<const UserValueObject*>(object);
if (uvo)
{
value = uvo->getValue();
return true;
}
osg::StringValueObject* svo = dynamic_cast<osg::StringValueObject*>(object);
if (svo)
{
std::istringstream str(svo->getValue());
str >> value;
return !str.fail();
}
return false;
}
/** Get all types of Properties supported by Presentation Object type, return true if the Properties are supported, false otherwise.*/
virtual bool getSupportedProperties(PropertyList&) { return false; }
protected :
virtual ~Group() {}
};
}
#endif

View File

@ -1,47 +0,0 @@
/* -*-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_IMAGE
#define OSGPRESENTATION_IMAGE 1
#include <osgPresentation/Element>
namespace osgPresentation {
/** osgPresentation::Image
*/
class OSGPRESENTATION_EXPORT Image : public osgPresentation::Element
{
public :
Image() {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Image(const Image& image,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osgPresentation::Element(image,copyop) {}
META_Presentation(Image);
/** load the image subgraph.*/
virtual bool load();
/** Get all types of Properties supported by Presentation Object type, return true if the Properties are supported, false otherwise.*/
virtual bool getSupportedProperties(PropertyList&);
protected :
virtual ~Image() {}
};
}
#endif

View File

@ -1,44 +0,0 @@
/* -*-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 <osgPresentation/Group>
namespace osgPresentation {
/** osgPresentation::Layer
*/
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_Presentation(Layer);
/** Get all types of Properties supported by Presentation Object type, return true if the Properties are supported, false otherwise.*/
virtual bool getSupportedProperties(PropertyList&);
protected :
virtual ~Layer() {}
};
}
#endif

View File

@ -1,47 +0,0 @@
/* -*-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_MODEL
#define OSGPRESENTATION_MODEL 1
#include <osgPresentation/Element>
namespace osgPresentation {
/** osgPresentation::Model
*/
class OSGPRESENTATION_EXPORT Model : public osgPresentation::Element
{
public :
Model() {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Model(const Model& model,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osgPresentation::Element(model,copyop) {}
META_Presentation(Model);
/** load the model subgraph.*/
virtual bool load();
/** Get all types of Properties supported by Presentation Object type, return true if the Properties are supported, false otherwise.*/
virtual bool getSupportedProperties(PropertyList&);
protected :
virtual ~Model() {}
};
}
#endif

View File

@ -1,47 +0,0 @@
/* -*-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_MOVIE
#define OSGPRESENTATION_MOVIE 1
#include <osgPresentation/Element>
namespace osgPresentation {
/** osgPresentation::Movie
*/
class OSGPRESENTATION_EXPORT Movie : public osgPresentation::Element
{
public :
Movie() {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Movie(const Movie& movie,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osgPresentation::Element(movie,copyop) {}
META_Presentation(Movie);
/** load the movie subgraph.*/
virtual bool load();
/** Get all types of Properties supported by Presentation Object type, return true if the Properties are supported, false otherwise.*/
virtual bool getSupportedProperties(PropertyList&);
protected :
virtual ~Movie() {}
};
}
#endif

View File

@ -1,44 +0,0 @@
/* -*-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 <osgPresentation/Group>
namespace osgPresentation {
/** osgPresentation::Presentation
*/
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_Presentation(Presentation);
/** Get all types of Properties supported by Presentation Object type, return true if the Properties are supported, false otherwise.*/
virtual bool getSupportedProperties(PropertyList&);
protected :
virtual ~Presentation() {}
};
}
#endif

View File

@ -1,62 +0,0 @@
/* -*-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_PRESENTATIONINTERFACE
#define OSGPRESENTATION_PRESENTATIONINTERFACE 1
#include <osgViewer/ViewerBase>
#include <osgPresentation/deprecated/SlideEventHandler>
namespace osgPresentation {
/** PresentationInterface is a helper class for scripting languages to use to access the key services of the presentation.*/
class OSGPRESENTATION_EXPORT PresentationInterface : public osg::Object
{
public :
PresentationInterface() {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
PresentationInterface(const PresentationInterface& pi,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osg::Object(pi,copyop) {}
META_Object(osgPresentation, PresentationInterface);
/** get the viewer associated with the current active presentation.*/
osgViewer::ViewerBase* getViewer();
/** get current active root presentation Node.*/
osg::Node* getPresentation();
/** get SlideEventHandler that is managing the current active presentation.*/
osgPresentation::SlideEventHandler* getSlideEventHandler();
/** pass on a jump command to the presentation to change layer/slide.*/
void jump(const osgPresentation::JumpData* jumpdata);
/** send KeyPosition event to viewer so that that it can be handled by the viewer and associated event handlers. */
void sendEventToViewer(const osgPresentation::KeyPosition* kp);
/** send event to viewer so that that it can be handled by the viewer and associated event handlers. */
void sendEventToViewer(osgGA::Event* event);
/** send event to devices attached to the viewer. */
void sendEventToDevices(osgGA::Event* event);
protected :
virtual ~PresentationInterface() {}
};
}
#endif

View File

@ -1,44 +0,0 @@
/* -*-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 <osgPresentation/Group>
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_Presentation(Section);
/** Get all types of Properties supported by Presentation Object type, return true if the Properties are supported, false otherwise.*/
virtual bool getSupportedProperties(PropertyList&);
protected :
virtual ~Section() {}
};
}
#endif

View File

@ -1,44 +0,0 @@
/* -*-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_SHOW
#define OSGPRESENTATION_SHOW 1
#include <osgPresentation/Group>
namespace osgPresentation {
/** osgPresentation::Show
*/
class OSGPRESENTATION_EXPORT Show : public osgPresentation::Group
{
public :
Show() {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Show(const Show& presentation,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osgPresentation::Group(presentation,copyop) {}
META_Presentation(Show);
/** Get all types of Properties supported by Presentation Object type, return true if the Properties are supported, false otherwise.*/
virtual bool getSupportedProperties(PropertyList&);
protected :
virtual ~Show() {}
};
}
#endif

View File

@ -1,44 +0,0 @@
/* -*-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 <osgPresentation/Group>
namespace osgPresentation {
/** osgPresentation::Slide
*/
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_Presentation(Slide);
/** Get all types of Properties supported by Presentation Object type, return true if the Properties are supported, false otherwise.*/
virtual bool getSupportedProperties(PropertyList&);
protected :
virtual ~Slide() {}
};
}
#endif

View File

@ -1,47 +0,0 @@
/* -*-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.
*/
#ifndef OSGPRESENTATION_TEXT
#define OSGPRESENTATION_TEXT 1
#include <osgPresentation/Element>
namespace osgPresentation {
/** osgPresentation::Text
*/
class OSGPRESENTATION_EXPORT Text : public osgPresentation::Element
{
public :
Text() {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Text(const Text& text,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osgPresentation::Element(text,copyop) {}
META_Presentation(Text);
/** load the text subgraph.*/
virtual bool load();
/** Get all types of Properties supported by Presentation Object type, return true if the Properties are supported, false otherwise.*/
virtual bool getSupportedProperties(PropertyList&);
protected :
virtual ~Text() {}
};
}
#endif

View File

@ -1,47 +0,0 @@
/* -*-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_VOLUME
#define OSGPRESENTATION_VOLUME 1
#include <osgPresentation/Element>
namespace osgPresentation {
/** osgPresentation::Volume
*/
class OSGPRESENTATION_EXPORT Volume : public osgPresentation::Element
{
public :
Volume() {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Volume(const Volume& volume,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) : osgPresentation::Element(volume,copyop) {}
META_Presentation(Volume);
/** load the volume subgraph.*/
virtual bool load();
/** Get all types of Properties supported by Presentation Object type, return true if the Properties are supported, false otherwise.*/
virtual bool getSupportedProperties(PropertyList&);
protected :
virtual ~Volume() {}
};
}
#endif

View File

@ -1,195 +0,0 @@
/* -*-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 <osgPresentation/Action>
#include <osgPresentation/Group>
#include <osgPresentation/Element>
#include <osgPresentation/Text>
#include <osgPresentation/Model>
#include <osgPresentation/Volume>
#include <osgPresentation/Movie>
#include <osgPresentation/Image>
#include <osgPresentation/Section>
#include <osgPresentation/Layer>
#include <osgPresentation/Slide>
#include <osgPresentation/Presentation>
#include <osg/io_utils>
using namespace osgPresentation;
//////////////////////////////////////////////////////////////////////////////////
//
// Action base class
//
void Action::apply(osgPresentation::Group& group)
{
OSG_NOTICE<<"LoadAction::apply()"<<std::endl;
osg::NodeVisitor::apply(group);
}
void Action::apply(osgPresentation::Element& element)
{
apply(static_cast<osgPresentation::Group&>(element));
}
void Action::apply(osgPresentation::Text& text)
{
apply(static_cast<osgPresentation::Element&>(text));
}
void Action::apply(osgPresentation::Volume& volume)
{
apply(static_cast<osgPresentation::Element&>(volume));
}
void Action::apply(osgPresentation::Model& model)
{
apply(static_cast<osgPresentation::Element&>(model));
}
void Action::apply(osgPresentation::Image& image)
{
apply(static_cast<osgPresentation::Element&>(image));
}
void Action::apply(osgPresentation::Movie& movie)
{
apply(static_cast<osgPresentation::Element&>(movie));
}
void Action::apply(osgPresentation::Section& section)
{
apply(static_cast<osgPresentation::Group&>(section));
}
void Action::apply(osgPresentation::Layer& layer)
{
apply(static_cast<osgPresentation::Group&>(layer));
}
void Action::apply(osgPresentation::Slide& slide)
{
apply(static_cast<osgPresentation::Group&>(slide));
}
void Action::apply(osgPresentation::Presentation& presentation)
{
apply(static_cast<osgPresentation::Group&>(presentation));
}
/////////////////////////////////////////////////////////////////////////
//
// Specific Action implementations
//
void LoadAction::apply(osgPresentation::Element& element)
{
OSG_NOTICE<<"LoadAction::apply()"<<std::endl;
element.load();
}
void UnloadAction::apply(osgPresentation::Element& element)
{
element.unload();
}
void ResetAction::apply(osgPresentation::Element& element)
{
element.reset();
}
void PauseAction::apply(osgPresentation::Element& element)
{
element.pause();
}
void PlayAction::apply(osgPresentation::Element& element)
{
element.play();
}
struct PrintValueVisitor: public osg::ValueObject::GetValueVisitor
{
PrintValueVisitor(std::ostream& output) : _output(output) {}
template<typename T>
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 : "<<group.className()<<std::endl;
osg::UserDataContainer* udc = group.getUserDataContainer();
if (udc)
{
PrintValueVisitor pvv(_output);
for(unsigned i=0; i<udc->getNumUserObjects(); ++i)
{
osg::ValueObject* value_object = dynamic_cast<osg::ValueObject*>(udc->getUserObject(i));
if (value_object)
{
_output<<" "<<value_object->className()<<" : "<<value_object->getName()<<" : ";
value_object->get(pvv);
_output<<std::endl;
}
}
}
traverse(group);
}
void PrintSupportedProperties::apply(osgPresentation::Group& group)
{
_output<<"PrintSupportedProperties osgPresentation object : "<<group.className()<<std::endl;
osgPresentation::PropertyList properties;
if (group.getSupportedProperties(properties))
{
for(osgPresentation::PropertyList::iterator itr = properties.begin();
itr != properties.end();
++itr)
{
osgPresentation::ObjectDescription& od = *itr;
_output<<" "<<od.first->className()<<" : "<<od.first->getName()<<", description = "<<od.second<<std::endl;
}
}
traverse(group);
}

View File

@ -1,42 +0,0 @@
/* -*-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 <osgPresentation/Audio>
#include <osg/ValueObject>
#include <osgDB/ReadFile>
using namespace osgPresentation;
bool Audio::load()
{
OSG_NOTICE<<"Audio::load() Not implemented yet"<<std::endl;
std::string filename;
getPropertyValue("filename", filename);
double volume = 1.0;
getPropertyValue("volume", volume);
OSG_NOTICE<<"Audio : filename = "<<filename<<std::endl;
OSG_NOTICE<<" volume = "<<volume<<std::endl;
return false;
}
bool Audio::getSupportedProperties(PropertyList& pl)
{
pl.push_back(ObjectDescription(new osg::StringValueObject("filename",""), std::string("Audio filename to load.")));
pl.push_back(ObjectDescription(new osg::DoubleValueObject("volume",1.0), std::string("Audio volume.")));
return true;
}

View File

@ -9,25 +9,7 @@ SET(LIB_NAME osgPresentation)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})
SET(TARGET_H
${HEADER_PATH}/Export
${HEADER_PATH}/Action
${HEADER_PATH}/Cursor
${HEADER_PATH}/Group
${HEADER_PATH}/Presentation
${HEADER_PATH}/Section
${HEADER_PATH}/Slide
${HEADER_PATH}/Layer
${HEADER_PATH}/Element
${HEADER_PATH}/Audio
${HEADER_PATH}/Image
${HEADER_PATH}/Model
${HEADER_PATH}/Movie
${HEADER_PATH}/Text
${HEADER_PATH}/Volume
${HEADER_PATH}/PresentationInterface
${HEADER_PATH}/deprecated/AnimationMaterial
${HEADER_PATH}/deprecated/CompileSlideCallback
@ -41,25 +23,8 @@ SET(TARGET_H
# FIXME: For OS X, need flag for Framework or dylib
SET(TARGET_SRC
Action.cpp
Cursor.cpp
Group.cpp
Show.cpp
Presentation.cpp
Section.cpp
Slide.cpp
Layer.cpp
Element.cpp
Audio.cpp
Image.cpp
Model.cpp
Movie.cpp
Text.cpp
Volume.cpp
PresentationInterface.cpp
deprecated/AnimationMaterial.cpp
deprecated/CompileSlideCallback.cpp

View File

@ -1,18 +0,0 @@
/* -*-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 <osgPresentation/Element>
using namespace osgPresentation;

View File

@ -1,41 +0,0 @@
/* -*-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 <osg/UserDataContainer>
#include <osgPresentation/Group>
using namespace osgPresentation;
class PropertyVisitor : public osg::NodeVisitor
{
public:
PropertyVisitor(const std::string& name) : _name(name), _object(0) {}
void apply(osg::Node& node)
{
osg::UserDataContainer* udc = node.getUserDataContainer();
_object = udc ? udc->getUserObject(_name) : 0;
if (!_object) traverse(node);
};
std::string _name;
osg::Object* _object;
};
osg::Object* Group::getPropertyObject(const std::string& name, bool checkParents)
{
PropertyVisitor pv(name);
if (checkParents) pv.setTraversalMode(osg::NodeVisitor::TRAVERSE_PARENTS);
accept(pv);
return pv._object;
}

View File

@ -1,64 +0,0 @@
/* -*-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 <osgPresentation/Image>
#include <osg/ValueObject>
#include <osg/Geometry>
#include <osg/Texture2D>
#include <osgDB/ReadFile>
using namespace osgPresentation;
bool Image::load()
{
OSG_NOTICE<<"Image::load() Not implemented yet"<<std::endl;
std::string filename;
getPropertyValue("filename", filename);
double scale = 1.0;
getPropertyValue("scale", scale);
OSG_NOTICE<<"Image : filename = "<<filename<<std::endl;
OSG_NOTICE<<" scale = "<<scale<<std::endl;
osg::ref_ptr<osg::Image> image = osgDB::readImageFile(filename);
if (image.valid())
{
osg::Vec3d position(0.0,0.0,0.0);
osg::Vec3d widthVec(1.0,0.0,0.0);
osg::Vec3d heightVec(0.0,0.0,1.0);
osg::ref_ptr<osg::Geometry> geometry = osg::createTexturedQuadGeometry(position, widthVec, heightVec);
osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D(image.get());
texture->setResizeNonPowerOfTwoHint(false);
texture->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR);
texture->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
geometry->getOrCreateStateSet()->setTextureAttributeAndModes(0, texture.get(), osg::StateAttribute::ON);
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
geode->addDrawable(geometry.get());
addChild(geode.get());
}
return false;
}
bool Image::getSupportedProperties(PropertyList& pl)
{
pl.push_back(ObjectDescription(new osg::StringValueObject("filename",""), std::string("Image filename to load.")));
pl.push_back(ObjectDescription(new osg::DoubleValueObject("scale",1.0), std::string("Image scale.")));
return true;
}

View File

@ -1,24 +0,0 @@
/* -*-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 <osg/ValueObject>
#include <osgPresentation/Layer>
using namespace osgPresentation;
bool Layer::getSupportedProperties(PropertyList& pl)
{
pl.push_back(ObjectDescription(new osg::Vec4dValueObject("background_colour",osg::Vec4d(0.0,0.0,0.0,0.0)), std::string("Background colour.")));
pl.push_back(ObjectDescription(new osg::Vec4dValueObject("text_colour",osg::Vec4d(1.0,1.0,1.0,1.0)), std::string("Text colour.")));
return true;
}

View File

@ -1,51 +0,0 @@
/* -*-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 <osgPresentation/Model>
#include <osg/ValueObject>
#include <osgDB/ReadFile>
using namespace osgPresentation;
bool Model::load()
{
OSG_NOTICE<<"Model::load() Not implemented yet"<<std::endl;
std::string filename;
getPropertyValue("filename", filename);
double scale = 1.0;
getPropertyValue("scale", scale);
double character_size = 0.06;
getPropertyValue("character_size", character_size);
OSG_NOTICE<<"Model : filename = "<<filename<<std::endl;
OSG_NOTICE<<" scale = "<<scale<<std::endl;
osg::ref_ptr<osg::Node> model = osgDB::readNodeFile(filename);
if (model.valid())
{
addChild(model.get());
}
return false;
}
bool Model::getSupportedProperties(PropertyList& pl)
{
pl.push_back(ObjectDescription(new osg::StringValueObject("filename",""), std::string("Model filename to load.")));
pl.push_back(ObjectDescription(new osg::DoubleValueObject("scale",1.0), std::string("Model scale.")));
return true;
}

View File

@ -1,69 +0,0 @@
/* -*-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 <osgPresentation/Movie>
#include <osg/ValueObject>
#include <osg/Geometry>
#include <osg/Texture2D>
#include <osgDB/ReadFile>
using namespace osgPresentation;
bool Movie::load()
{
OSG_NOTICE<<"Movie::load() Not implemented yet"<<std::endl;
std::string filename;
getPropertyValue("filename", filename);
double volume = 1.0;
getPropertyValue("volume", volume);
double scale = 1.0;
getPropertyValue("scale", scale);
OSG_NOTICE<<"Movie : filename = "<<filename<<std::endl;
OSG_NOTICE<<" volume = "<<volume<<std::endl;
OSG_NOTICE<<" scale = "<<scale<<std::endl;
osg::ref_ptr<osg::Image> image = osgDB::readImageFile(filename);
if (image.valid())
{
osg::Vec3d position(0.0,0.0,0.0);
osg::Vec3d widthVec(1.0,0.0,0.0);
osg::Vec3d heightVec(0.0,0.0,1.0);
osg::ref_ptr<osg::Geometry> geometry = osg::createTexturedQuadGeometry(position, widthVec, heightVec);
osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D(image.get());
texture->setResizeNonPowerOfTwoHint(false);
texture->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR);
texture->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
geometry->getOrCreateStateSet()->setTextureAttributeAndModes(0, texture.get(), osg::StateAttribute::ON);
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
geode->addDrawable(geometry.get());
addChild(geode.get());
}
return false;
}
bool Movie::getSupportedProperties(PropertyList& pl)
{
pl.push_back(ObjectDescription(new osg::StringValueObject("filename",""), std::string("Movie filename to load.")));
pl.push_back(ObjectDescription(new osg::DoubleValueObject("volume",1.0), std::string("Audio volume.")));
pl.push_back(ObjectDescription(new osg::DoubleValueObject("scale",1.0), std::string("Movie scale.")));
return true;
}

View File

@ -1,23 +0,0 @@
/* -*-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 <osgPresentation/Presentation>
using namespace osgPresentation;
bool Presentation::getSupportedProperties(PropertyList& pl)
{
pl.push_back(ObjectDescription(new osg::Vec4dValueObject("background_colour",osg::Vec4d(0.0,0.0,0.0,0.0)), std::string("Background colour.")));
pl.push_back(ObjectDescription(new osg::Vec4dValueObject("text_colour",osg::Vec4d(1.0,1.0,1.0,1.0)), std::string("Text colour.")));
return true;
}

View File

@ -1,57 +0,0 @@
/* -*-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 <osgPresentation/PresentationInterface>
using namespace osgPresentation;
osgViewer::ViewerBase* PresentationInterface::getViewer()
{
SlideEventHandler* seh = SlideEventHandler::instance();
return (seh!=0) ? seh->getViewer() : 0;
}
osg::Node* PresentationInterface::getPresentation()
{
SlideEventHandler* seh = SlideEventHandler::instance();
return (seh!=0) ? seh->getPresentationSwitch() : 0;
}
osgPresentation::SlideEventHandler* PresentationInterface::getSlideEventHandler()
{
return SlideEventHandler::instance();
}
void PresentationInterface::jump(const osgPresentation::JumpData* jumpdata)
{
SlideEventHandler* seh = SlideEventHandler::instance();
if ((seh!=0) && (jumpdata!=0)) jumpdata->jump(seh);
}
void PresentationInterface::sendEventToViewer(osgGA::Event* event)
{
SlideEventHandler* seh = SlideEventHandler::instance();
if ((seh!=0) && (event!=0)) seh->dispatchEvent(event);
}
void PresentationInterface::sendEventToViewer(const osgPresentation::KeyPosition* kp)
{
SlideEventHandler* seh = SlideEventHandler::instance();
if ((seh!=0) && (kp!=0)) seh->dispatchEvent(*kp);
}
void PresentationInterface::sendEventToDevices(osgGA::Event* event)
{
SlideEventHandler* seh = SlideEventHandler::instance();
if ((seh!=0) && (event!=0)) seh->forwardEventToDevices(event);
}

View File

@ -1,23 +0,0 @@
/* -*-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 <osgPresentation/Section>
using namespace osgPresentation;
bool Section::getSupportedProperties(PropertyList& pl)
{
pl.push_back(ObjectDescription(new osg::Vec4dValueObject("background_colour",osg::Vec4d(0.0,0.0,0.0,0.0)), std::string("Background colour.")));
pl.push_back(ObjectDescription(new osg::Vec4dValueObject("text_colour",osg::Vec4d(1.0,1.0,1.0,1.0)), std::string("Text colour.")));
return true;
}

View File

@ -1,23 +0,0 @@
/* -*-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 <osgPresentation/Show>
using namespace osgPresentation;
bool Show::getSupportedProperties(PropertyList& pl)
{
pl.push_back(ObjectDescription(new osg::Vec4dValueObject("background_colour",osg::Vec4d(0.0,0.0,0.0,0.0)), std::string("Background colour.")));
pl.push_back(ObjectDescription(new osg::Vec4dValueObject("text_colour",osg::Vec4d(1.0,1.0,1.0,1.0)), std::string("Text colour.")));
return true;
}

View File

@ -1,23 +0,0 @@
/* -*-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 <osgPresentation/Slide>
using namespace osgPresentation;
bool Slide::getSupportedProperties(PropertyList& pl)
{
pl.push_back(ObjectDescription(new osg::Vec4dValueObject("background_colour",osg::Vec4d(0.0,0.0,0.0,0.0)), std::string("Background colour.")));
pl.push_back(ObjectDescription(new osg::Vec4dValueObject("text_colour",osg::Vec4d(1.0,1.0,1.0,1.0)), std::string("Text colour.")));
return true;
}

View File

@ -1,52 +0,0 @@
/* -*-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 <osgPresentation/Text>
#include <osg/ValueObject>
#include <osgText/Text>
using namespace osgPresentation;
bool Text::load()
{
OSG_NOTICE<<"Text::load() Not implemented yet"<<std::endl;
std::string value;
getPropertyValue("string", value);
std::string font("arial.ttf");
getPropertyValue("font", font);
double width = 1.0;
getPropertyValue("width", width);
double character_size = 0.06;
getPropertyValue("character_size", character_size);
OSG_NOTICE<<"Text : string = "<<value<<std::endl;
OSG_NOTICE<<" font = "<<font<<std::endl;
OSG_NOTICE<<" width = "<<width<<std::endl;
OSG_NOTICE<<" character_size = "<<character_size<<std::endl;
return false;
}
bool Text::getSupportedProperties(PropertyList& pl)
{
pl.push_back(ObjectDescription(new osg::StringValueObject("string",""), std::string("Text to render.")));
pl.push_back(ObjectDescription(new osg::StringValueObject("font",""), std::string("Font name.")));
pl.push_back(ObjectDescription(new osg::DoubleValueObject("width",1.0), std::string("Maximum width of the text.")));
pl.push_back(ObjectDescription(new osg::DoubleValueObject("character_size",0.06), std::string("Character size.")));
return true;
}

View File

@ -1,55 +0,0 @@
/* -*-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 <osgPresentation/Volume>
#include <osg/ValueObject>
#include <osgVolume/VolumeTile>
#include <osgDB/ReadFile>
using namespace osgPresentation;
bool Volume::load()
{
OSG_NOTICE<<"Volume::load() Not implemented yet"<<std::endl;
std::string filename;
getPropertyValue("filename", filename);
double scale = 1.0;
getPropertyValue("scale", scale);
std::string technique;
getPropertyValue("technique", technique);
OSG_NOTICE<<"Volume : filename = "<<filename<<std::endl;
OSG_NOTICE<<" technique = "<<technique<<std::endl;
OSG_NOTICE<<" scale = "<<scale<<std::endl;
osg::ref_ptr<osg::Object> object = osgDB::readObjectFile(filename);
if (object.valid())
{
osg::ref_ptr<osgVolume::VolumeTile> volume = dynamic_cast<osgVolume::VolumeTile*>(object.get());
if (volume.valid()) addChild(volume.get());
}
return false;
}
bool Volume::getSupportedProperties(PropertyList& pl)
{
pl.push_back(ObjectDescription(new osg::StringValueObject("filename",""), std::string("Volume filename to load.")));
pl.push_back(ObjectDescription(new osg::StringValueObject("technique",""), std::string("Volume technique to use when rendering.")));
pl.push_back(ObjectDescription(new osg::DoubleValueObject("scale",1.0), std::string("Volume scale.")));
return true;
}

View File

@ -49,6 +49,5 @@ ADD_SUBDIRECTORY(osgGA)
ADD_SUBDIRECTORY(osgTerrain)
ADD_SUBDIRECTORY(osgText)
ADD_SUBDIRECTORY(osgVolume)
ADD_SUBDIRECTORY(osgPresentation)
ADD_SUBDIRECTORY(osgViewer)
ADD_SUBDIRECTORY(osgUI)

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Audio>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Audio,
new osgPresentation::Audio,
osgPresentation::Audio,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Element osgPresentation::Audio" )
{
}

View File

@ -1,7 +0,0 @@
FILE(GLOB TARGET_SRC *.cpp)
FILE(GLOB TARGET_H *.h)
SET(TARGET_ADDED_LIBRARIES osgPresentation )
#### end var setup ###
SETUP_PLUGIN(osgpresentation)

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Element>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Element,
new osgPresentation::Element,
osgPresentation::Element,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Element" )
{
}

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Group>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Group,
new osgPresentation::Group,
osgPresentation::Group,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group" )
{
}

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Image>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Image,
new osgPresentation::Image,
osgPresentation::Image,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Element osgPresentation::Image" )
{
}

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Layer>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Layer,
new osgPresentation::Layer,
osgPresentation::Layer,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Layer" )
{
}

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Model>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Model,
new osgPresentation::Model,
osgPresentation::Model,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Element osgPresentation::Model" )
{
}

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Movie>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Movie,
new osgPresentation::Movie,
osgPresentation::Movie,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Element osgPresentation::Movie" )
{
}

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Presentation>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Presentation,
new osgPresentation::Presentation,
osgPresentation::Presentation,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Presentation" )
{
}

View File

@ -1,87 +0,0 @@
#include <osgPresentation/PresentationInterface>
#include <osgGA/Event>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
struct PresentationInterfaceGetSlideEventHandler : public osgDB::MethodObject
{
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
{
osgPresentation::PresentationInterface* pi = reinterpret_cast<osgPresentation::PresentationInterface*>(objectPtr);
outputParameters.push_back(pi->getSlideEventHandler());
return true;
}
};
struct PresentationInterfaceGetViewer : public osgDB::MethodObject
{
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
{
osgPresentation::PresentationInterface* pi = reinterpret_cast<osgPresentation::PresentationInterface*>(objectPtr);
outputParameters.push_back(pi->getViewer());
return true;
}
};
struct PresentationInterfaceGetPresentation : public osgDB::MethodObject
{
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
{
osgPresentation::PresentationInterface* pi = reinterpret_cast<osgPresentation::PresentationInterface*>(objectPtr);
outputParameters.push_back(pi->getPresentation());
return true;
}
};
struct PresentationInterfaceSendEventToViewer : public osgDB::MethodObject
{
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
{
osgPresentation::PresentationInterface* pi = reinterpret_cast<osgPresentation::PresentationInterface*>(objectPtr);
if (inputParameters.empty()) return false;
for(osg::Parameters::iterator itr = inputParameters.begin();
itr != inputParameters.end();
++itr)
{
osgGA::Event* event = dynamic_cast<osgGA::Event*>(itr->get());
osgPresentation::KeyPosition* kp = dynamic_cast<osgPresentation::KeyPosition*>(itr->get());
if (kp) pi->sendEventToViewer(kp);
else if (event) pi->sendEventToViewer(event);
}
return true;
}
};
struct PresentationInterfaceSendEventToDevices : public osgDB::MethodObject
{
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
{
osgPresentation::PresentationInterface* pi = reinterpret_cast<osgPresentation::PresentationInterface*>(objectPtr);
if (inputParameters.empty()) return false;
for(osg::Parameters::iterator itr = inputParameters.begin();
itr != inputParameters.end();
++itr)
{
osgGA::Event* event = dynamic_cast<osgGA::Event*>(itr->get());
if (event) pi->sendEventToDevices(event);
}
return true;
}
};
REGISTER_OBJECT_WRAPPER( osgPresentation_PresentationInterface,
new osgPresentation::PresentationInterface,
osgPresentation::PresentationInterface,
"osg::Object osgPresentation::PresentationInterface" )
{
ADD_METHOD_OBJECT( "getSlideEventHandler", PresentationInterfaceGetSlideEventHandler );
ADD_METHOD_OBJECT( "getViewer", PresentationInterfaceGetViewer );
ADD_METHOD_OBJECT( "getPresentation", PresentationInterfaceGetPresentation );
ADD_METHOD_OBJECT( "sendEventToViewer", PresentationInterfaceSendEventToViewer );
ADD_METHOD_OBJECT( "sendEventToDevices", PresentationInterfaceSendEventToDevices );
}

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Section>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Section,
new osgPresentation::Section,
osgPresentation::Section,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Section" )
{
}

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Show>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Show,
new osgPresentation::Show,
osgPresentation::Show,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Show" )
{
}

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Slide>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Slide,
new osgPresentation::Slide,
osgPresentation::Slide,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Slide" )
{
}

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Text>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Text,
new osgPresentation::Text,
osgPresentation::Text,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Element osgPresentation::Text" )
{
}

View File

@ -1,11 +0,0 @@
#include <osgPresentation/Volume>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( osgPresentation_Volume,
new osgPresentation::Volume,
osgPresentation::Volume,
"osg::Object osg::Node osg::Group osg::Transform osg::MatrixTransform osgPresentation::Group osgPresentation::Element osgPresentation::Volume" )
{
}