2002-07-17 04:07:32 +08:00
|
|
|
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
|
2002-05-09 18:31:03 +08:00
|
|
|
//Distributed under the terms of the GNU Library General Public License (LGPL)
|
|
|
|
//as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
#ifndef OSGGA_GEOSTATE_MANIPULATOR
|
|
|
|
#define OSGGA_GEOSTATE_MANIPULATOR 1
|
|
|
|
|
|
|
|
#include <osgGA/Export>
|
|
|
|
#include <osgGA/GUIEventAdapter>
|
|
|
|
#include <osgGA/GUIActionAdapter>
|
|
|
|
#include <osgGA/GUIEventHandler>
|
|
|
|
|
2002-05-22 16:50:05 +08:00
|
|
|
#include <osg/StateSet>
|
|
|
|
|
2002-05-09 18:31:03 +08:00
|
|
|
namespace osgGA{
|
|
|
|
|
2002-08-28 22:27:18 +08:00
|
|
|
/**
|
|
|
|
Experimental class, not been looked at for a while, but which will
|
|
|
|
be returned to at some point :-\
|
|
|
|
*/
|
2002-05-09 18:31:03 +08:00
|
|
|
class OSGGA_EXPORT StateSetManipulator : public GUIEventHandler
|
|
|
|
{
|
2002-08-28 22:27:18 +08:00
|
|
|
public:
|
2002-05-09 18:31:03 +08:00
|
|
|
|
2002-08-28 22:27:18 +08:00
|
|
|
StateSetManipulator();
|
|
|
|
virtual ~StateSetManipulator();
|
2002-05-09 18:31:03 +08:00
|
|
|
|
2002-08-28 22:27:18 +08:00
|
|
|
/** attach a geostate to the manipulator to be used for specifying view.*/
|
|
|
|
virtual void setStateSet(osg::StateSet*);
|
2002-05-09 18:31:03 +08:00
|
|
|
|
2002-08-28 22:27:18 +08:00
|
|
|
/** get the attached a geostate.*/
|
|
|
|
virtual osg::StateSet * getStateSet();
|
2002-05-09 18:31:03 +08:00
|
|
|
|
2002-08-28 22:27:18 +08:00
|
|
|
/** get the attached a geostate.*/
|
|
|
|
virtual const osg::StateSet * getStateSet() const;
|
2002-05-09 18:31:03 +08:00
|
|
|
|
2002-08-28 22:27:18 +08:00
|
|
|
/** Handle events, return true if handled, false otherwise.*/
|
|
|
|
virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& us);
|
2002-05-09 18:31:03 +08:00
|
|
|
|
|
|
|
/** Handle visitations */
|
|
|
|
virtual void accept(GUIEventHandlerVisitor&);
|
|
|
|
|
2002-08-28 22:27:18 +08:00
|
|
|
protected:
|
2002-05-09 18:31:03 +08:00
|
|
|
|
2002-08-28 22:27:18 +08:00
|
|
|
// Reference pointer to a geostate
|
|
|
|
osg::ref_ptr<osg::StateSet> _drawState;
|
2002-05-09 18:31:03 +08:00
|
|
|
|
|
|
|
bool _backface;
|
|
|
|
bool _lighting;
|
|
|
|
bool _texture;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|