OpenCOVER
OSGVruiToggleButtonGeometry.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef OSG_VRUI_TOGGLE_BUTTON_GEOMETRY_H
9#define OSG_VRUI_TOGGLE_BUTTON_GEOMETRY_H
10
12
13#include <osg/Array>
14#include <osg/Geode>
15#include <osg/StateSet>
16#include <osg/Switch>
17#include <osg/Texture2D>
18#include <osg/Vec3>
19
20#include <string>
21
22namespace vrui
23{
24
25class coToggleButtonGeometry;
26class OSGVruiTransformNode;
27
29{
30public:
33 virtual float getWidth() const
34 {
35 return A;
36 }
37 virtual float getHeight() const
38 {
39 return A;
40 }
41
43
44 virtual void createGeometry();
45 virtual void resizeGeometry();
46
48
49protected:
50 // create Texture, either normal or checked
51 osg::ref_ptr<osg::Geode> createNode(const std::string &textureName, bool checkTexture);
52
54
55 // kept for compatibility only! They re-call createTexture()
56 osg::ref_ptr<osg::Geode> createBox(const std::string &textureName);
57 osg::ref_ptr<osg::Geode> createCheck(const std::string &textureName);
58
59 osg::ref_ptr<osg::Node> normalNode;
60 osg::ref_ptr<osg::Node> pressedNode;
61 osg::ref_ptr<osg::Node> highlightNode;
63 osg::ref_ptr<osg::Node> pressedHighlightNode;
64 osg::ref_ptr<osg::Node> disabledNode;
65
66 osg::ref_ptr<osg::Switch> switchNode;
67
69
71
72private:
73 //shared coord and color list
74 static float A;
75 static float B;
76 static float D;
77 static osg::ref_ptr<osg::Vec3Array> coord;
78 static osg::ref_ptr<osg::Vec3Array> normal;
79 static osg::ref_ptr<osg::Vec2Array> texCoord;
80
81 osg::ref_ptr<osg::Texture2D> texture;
82};
83}
84#endif
collaborative interface manager
Definition: coVRCommunication.h:41
ActiveGeometry
Definition: coButtonGeometry.h:33
Definition: coToggleButtonGeometry.h:19
Definition: vruiButtonProvider.h:21
Definition: vruiTransformNode.h:18
Definition: OSGVruiToggleButtonGeometry.h:29
OSGVruiTransformNode * myDCS
Definition: OSGVruiToggleButtonGeometry.h:70
osg::ref_ptr< osg::Node > highlightNode
pressed highlighted geometry
Definition: OSGVruiToggleButtonGeometry.h:61
virtual float getHeight() const
Definition: OSGVruiToggleButtonGeometry.h:37
osg::ref_ptr< osg::Geode > createBox(const std::string &textureName)
osg::ref_ptr< osg::Geode > createNode(const std::string &textureName, bool checkTexture)
osg::ref_ptr< osg::Geode > createCheck(const std::string &textureName)
OSGVruiToggleButtonGeometry(coToggleButtonGeometry *button)
virtual float getWidth() const
Definition: OSGVruiToggleButtonGeometry.h:33
virtual vruiTransformNode * getDCS()
osg::ref_ptr< osg::Node > disabledNode
Definition: OSGVruiToggleButtonGeometry.h:64
osg::ref_ptr< osg::Node > pressedNode
pressed normal geometry
Definition: OSGVruiToggleButtonGeometry.h:60
osg::ref_ptr< osg::Node > pressedHighlightNode
Definition: OSGVruiToggleButtonGeometry.h:63
coToggleButtonGeometry * button
Definition: OSGVruiToggleButtonGeometry.h:68
osg::ref_ptr< osg::Switch > switchNode
Definition: OSGVruiToggleButtonGeometry.h:66
osg::ref_ptr< osg::Node > normalNode
normal geometry
Definition: OSGVruiToggleButtonGeometry.h:59
virtual void switchGeometry(coButtonGeometry::ActiveGeometry active)
Definition: OSGVruiTransformNode.h:26