OpenCOVER
OSGVruiRectButtonGeometry.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//-*-c++-*-
9#ifndef OSG_VRUI_RECT_BUTTON_GEOMETRY_H
10#define OSG_VRUI_RECT_BUTTON_GEOMETRY_H
11
13
14#include <osg/Array>
15#include <osg/Geode>
16#include <osg/Material>
17#include <osg/PrimitiveSet>
18#include <osg/StateSet>
19#include <osg/Switch>
20#include <osg/Vec3>
21
22#include <string>
23
24namespace vrui
25{
26
27class coRectButtonGeometry;
28class OSGVruiTransformNode;
29
34{
35public:
38
40
41 virtual float getWidth() const
42 {
43 return 2.0 * (A + B) + C;
44 }
45 virtual float getHeight() const
46 {
47 return 2.0 * (A + B) + D;
48 }
49
50 virtual void createGeometry();
51 virtual void resizeGeometry();
52
54
55protected:
58 osg::ref_ptr<osg::Node> createGeode(const std::string &textureName, int style);
59
60 osg::ref_ptr<osg::Node> normalNode;
61 osg::ref_ptr<osg::Node> pressedNode;
62 osg::ref_ptr<osg::Node> highlightNode;
64 osg::ref_ptr<osg::Node> pressedHighlightNode;
65
66 osg::ref_ptr<osg::Switch> switchNode;
67
69
71
72private:
73 static float A;
74 static float B;
75 float C;
76 float D;
77
78 static osg::ref_ptr<osg::Vec4Array> color;
79 static osg::ref_ptr<osg::Vec3Array> coord1;
80 static osg::ref_ptr<osg::Vec3Array> coord2;
81 static osg::ref_ptr<osg::Vec3Array> coordt1;
82 static osg::ref_ptr<osg::Vec3Array> coordt2;
83 static osg::ref_ptr<osg::Vec3Array> normal1;
84 static osg::ref_ptr<osg::Vec3Array> normal2;
85 static osg::ref_ptr<osg::Vec3Array> normalt;
87 static osg::ref_ptr<osg::Vec2Array> texCoord;
88
89 static osg::ref_ptr<osg::DrawElementsUShort> coordIndex;
90
91 static osg::ref_ptr<osg::Material> textureMat;
92 static osg::ref_ptr<osg::StateSet> normalStateSet;
93
94 osg::ref_ptr<osg::Geode> geode1;
95 osg::ref_ptr<osg::Geode> geode2;
96};
97}
98#endif
collaborative interface manager
Definition: coVRCommunication.h:41
ActiveGeometry
Definition: coButtonGeometry.h:33
Definition: coRectButtonGeometry.h:19
Definition: vruiButtonProvider.h:21
Definition: vruiTransformNode.h:18
Definition: OSGVruiRectButtonGeometry.h:34
OSGVruiRectButtonGeometry(coRectButtonGeometry *button)
coRectButtonGeometry * button
Definition: OSGVruiRectButtonGeometry.h:68
osg::ref_ptr< osg::Node > createGeode(const std::string &textureName, int style)
osg::ref_ptr< osg::Node > pressedHighlightNode
Definition: OSGVruiRectButtonGeometry.h:64
OSGVruiTransformNode * myDCS
Definition: OSGVruiRectButtonGeometry.h:70
virtual void switchGeometry(coButtonGeometry::ActiveGeometry active)
virtual vruiTransformNode * getDCS()
osg::ref_ptr< osg::Switch > switchNode
Definition: OSGVruiRectButtonGeometry.h:66
osg::ref_ptr< osg::Node > highlightNode
pressed highlighted geometry
Definition: OSGVruiRectButtonGeometry.h:62
void createSharedLists()
creates the base button polygon
osg::ref_ptr< osg::Node > pressedNode
pressed normal geometry
Definition: OSGVruiRectButtonGeometry.h:61
virtual float getWidth() const
Definition: OSGVruiRectButtonGeometry.h:41
osg::ref_ptr< osg::Node > normalNode
normal geometry
Definition: OSGVruiRectButtonGeometry.h:60
virtual float getHeight() const
Definition: OSGVruiRectButtonGeometry.h:45
Definition: OSGVruiTransformNode.h:26