1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
14#ifndef OSGPRESENTATION_CURSOR
15#define OSGPRESENTATION_CURSOR 1
17#include <osg/AutoTransform>
19#include <osgPresentation/Export>
21namespace osgPresentation {
23class OSGPRESENTATION_EXPORT Cursor : public osg::Group
29 Cursor(const std::string& filename, float size);
31 /** Copy constructor using CopyOp to manage deep vs shallow copy.*/
32 Cursor(const Cursor& rhs,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
34 META_Node(osgPresentation, Cursor)
36 void setFilename(const std::string& filename) { _filename = filename; _cursorDirty=true; }
37 const std::string& getFilename() const { return _filename; }
39 void setSize(float size) { _size = size; _cursorDirty=true; }
40 float getSize() const { return _size; }
42 virtual void traverse(osg::NodeVisitor& nv);
48 void initializeCursor();
49 void updatePosition();
51 std::string _filename;
56 osg::ref_ptr<osg::AutoTransform> _transform;
59 osg::observer_ptr<osg::Camera> _camera;