OpenCOVER
OSGVruiFlatButtonGeometry.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_FLAT_BUTTON_GEOMETRY_H
9#define OSG_VRUI_FLAT_BUTTON_GEOMETRY_H
10
12
13#include <osg/Array>
14#include <osg/Geode>
15#include <osg/StateSet>
16#include <osg/Switch>
17#include <osg/Vec3>
18#include <osg/Texture2D>
19
20#include <string>
21
22namespace vrui
23{
24
25class coFlatButtonGeometry;
26class OSGVruiTransformNode;
27
32{
33public:
36 virtual float getWidth() const
37 {
38 return A;
39 }
40 virtual float getHeight() const
41 {
42 return A;
43 }
44
46
47 virtual void createGeometry();
48 virtual void resizeGeometry();
49
51
52protected:
54 osg::ref_ptr<osg::Geode> createBox(const std::string &textureName);
56 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
72 osg::ref_ptr<osg::Texture2D> defaulTexture;
73
74private:
75 //shared coord and color list
76 static float A;
77 static float B;
78 static float D;
79 static osg::ref_ptr<osg::Vec3Array> coord1;
80 static osg::ref_ptr<osg::Vec3Array> coord2;
81 static osg::ref_ptr<osg::Vec3Array> normal;
83 static osg::ref_ptr<osg::Vec2Array> texCoord;
84
85 osg::ref_ptr<osg::Geode> geode1;
86 osg::ref_ptr<osg::Geode> geode2;
87};
88}
89#endif
collaborative interface manager
Definition: coVRCommunication.h:41
ActiveGeometry
Definition: coButtonGeometry.h:33
Definition: coFlatButtonGeometry.h:23
Definition: vruiButtonProvider.h:21
Definition: vruiTransformNode.h:18
Definition: OSGVruiFlatButtonGeometry.h:32
virtual float getWidth() const
Definition: OSGVruiFlatButtonGeometry.h:36
osg::ref_ptr< osg::Node > normalNode
normal geometry
Definition: OSGVruiFlatButtonGeometry.h:59
osg::ref_ptr< osg::Switch > switchNode
Definition: OSGVruiFlatButtonGeometry.h:66
void createSharedLists()
creates shared coordinate arrays
osg::ref_ptr< osg::Node > highlightNode
pressed highlighted geometry
Definition: OSGVruiFlatButtonGeometry.h:61
coFlatButtonGeometry * button
Definition: OSGVruiFlatButtonGeometry.h:68
osg::ref_ptr< osg::Texture2D > defaulTexture
Definition: OSGVruiFlatButtonGeometry.h:72
virtual float getHeight() const
Definition: OSGVruiFlatButtonGeometry.h:40
OSGVruiTransformNode * myDCS
Definition: OSGVruiFlatButtonGeometry.h:70
osg::ref_ptr< osg::Node > pressedHighlightNode
Definition: OSGVruiFlatButtonGeometry.h:63
virtual void switchGeometry(coButtonGeometry::ActiveGeometry active)
osg::ref_ptr< osg::Node > disabledNode
disabled geometry
Definition: OSGVruiFlatButtonGeometry.h:64
osg::ref_ptr< osg::Geode > createBox(const std::string &textureName)
< creates the base button polygon
osg::ref_ptr< osg::Node > pressedNode
pressed normal geometry
Definition: OSGVruiFlatButtonGeometry.h:60
virtual vruiTransformNode * getDCS()
osg::ref_ptr< osg::Geode > createCheck(const std::string &textureName)
OSGVruiFlatButtonGeometry(coFlatButtonGeometry *button)
Definition: OSGVruiTransformNode.h:26