OpenSceneGraph 3.6.5
StateSetManipulator
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
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.
7 *
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.
12*/
13
14#ifndef OSGGA_STATESET_MANIPULATOR
15#define OSGGA_STATESET_MANIPULATOR 1
16
17#include <osgGA/Export>
18#include <osgGA/GUIEventAdapter>
20#include <osgGA/GUIEventHandler>
21
22#include <osg/StateSet>
23#include <osg/PolygonMode>
24
25
26namespace osgGA {
27
33{
34public:
35
37
38 virtual const char* className() const { return "StateSetManipulator"; }
39
41 virtual void setStateSet(osg::StateSet*);
42
45
47 virtual const osg::StateSet * getStateSet() const;
48
49
51 virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& us);
52
54 virtual void getUsage(osg::ApplicationUsage& usage) const;
55
57 unsigned int getMaximumNumOfTextureUnits() const { return _maxNumOfTextureUnits; }
58
59 void setBackfaceEnabled(bool newbackface);
60 bool getBackfaceEnabled() const {return _backface;};
61
62 void setLightingEnabled(bool newlighting);
63 bool getLightingEnabled() const {return _lighting;};
64
65 void setTextureEnabled(bool newtexture);
66 bool getTextureEnabled() const {return _texture;};
67
70
72
73
76
79
82
85
86protected:
87
89
90 void clone();
91
93
99
104
106};
107
108}
109
110#endif
The 'GA' in osgGA stands for 'GUI Abstraction'; the osgGA namespace provides facilities to help devel...
Definition Callback:21
Definition ApplicationUsage:26
State Class for setting OpenGL's polygon culling mode.
Definition PolygonMode:31
Mode
Definition PolygonMode:34
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
Definition GUIActionAdapter:62
Event class for storing Keyboard, mouse and window events.
Definition GUIEventAdapter:82
GUIEventHandler()
Definition GUIEventHandler:53
void setKeyEventToggleTexturing(int key)
Definition StateSetManipulator:80
void setKeyEventCyclePolygonMode(int key)
Definition StateSetManipulator:83
int getKeyEventCyclePolygonMode() const
Definition StateSetManipulator:84
bool getLightingEnabled() const
Definition StateSetManipulator:63
virtual const osg::StateSet * getStateSet() const
get the attached a StateSet.
int _keyEventCyclePolygonMode
Definition StateSetManipulator:103
virtual void getUsage(osg::ApplicationUsage &usage) const
Get the keyboard and mouse usage of this manipulator.
void setBackfaceEnabled(bool newbackface)
void setKeyEventToggleLighting(int key)
Definition StateSetManipulator:77
StateSetManipulator(osg::StateSet *stateset=0)
void setMaximumNumOfTextureUnits(unsigned int i)
Definition StateSetManipulator:56
osg::ref_ptr< osg::StateSet > _stateset
Definition StateSetManipulator:92
virtual const char * className() const
return the name of the object's class type.
Definition StateSetManipulator:38
bool _initialized
Definition StateSetManipulator:94
int getKeyEventToggleTexturing() const
Definition StateSetManipulator:81
void setTextureEnabled(bool newtexture)
void setPolygonMode(osg::PolygonMode::Mode newpolygonmode)
bool _lighting
Definition StateSetManipulator:96
void setLightingEnabled(bool newlighting)
unsigned int getMaximumNumOfTextureUnits() const
Definition StateSetManipulator:57
void setKeyEventToggleBackfaceCulling(int key)
Definition StateSetManipulator:74
bool getBackfaceEnabled() const
Definition StateSetManipulator:60
virtual bool handle(const GUIEventAdapter &ea, GUIActionAdapter &us)
Handle events, return true if handled, false otherwise.
bool getTextureEnabled() const
Definition StateSetManipulator:66
unsigned int _maxNumOfTextureUnits
Definition StateSetManipulator:98
virtual osg::StateSet * getStateSet()
get the attached a StateSet.
osg::PolygonMode * getOrCreatePolygonMode()
int getKeyEventToggleLighting() const
Definition StateSetManipulator:78
bool _backface
Definition StateSetManipulator:95
int _keyEventToggleBackfaceCulling
Definition StateSetManipulator:100
virtual void setStateSet(osg::StateSet *)
attach a StateSet to the manipulator to be used for specifying view.
osg::PolygonMode::Mode getPolygonMode() const
bool _texture
Definition StateSetManipulator:97
int _keyEventToggleLighting
Definition StateSetManipulator:101
int getKeyEventToggleBackfaceCulling() const
Definition StateSetManipulator:75
int _keyEventToggleTexturing
Definition StateSetManipulator:102
#define OSGGA_EXPORT
Definition Export:40

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.