OpenSceneGraph/include/osgPresentation/Element
2013-09-03 10:17:06 +00:00

69 lines
2.2 KiB
C++

/* -*-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 <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_Node(osgPresentation, Element);
virtual void traverse(osg::NodeVisitor& nv);
/** 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; }
/** Do updates as part of the update traversal.*/
virtual void updateTraversal(osgUtil::UpdateVisitor& uv);
/** Do updates as part of the event traversal.*/
virtual void eventTraversal(osgGA::EventVisitor& ev);
/** 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() {}
protected :
virtual ~Element() {}
};
}
#endif