OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OSGVruiSlider.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_SLIDER_H
9 #define OSG_VRUI_SLIDER_H
10 
12 
13 #include <osg/Array>
14 #include <osg/Geode>
15 #include <osg/Geometry>
16 #include <osg/MatrixTransform>
17 #include <osgText/Text>
18 #include <osg/Switch>
19 
20 namespace vrui
21 {
22 
23 class coSlider;
24 class OSGVruiTransformNode;
25 
29 class OSGVRUIEXPORT OSGVruiSlider : public OSGVruiUIElement
30 {
31 public:
32  OSGVruiSlider(coSlider *slider);
33  virtual ~OSGVruiSlider();
34 
35  void createGeometry();
36  void resizeGeometry();
37 
38  void update();
39 
40 protected:
42  osg::ref_ptr<osg::MatrixTransform> sliderTransform;
43 
44  osg::ref_ptr<osg::Vec3Array> coord1;
45  osg::ref_ptr<osg::Vec3Array> coord2;
46  osg::ref_ptr<osg::Vec3Array> normal;
47  osg::ref_ptr<osg::Vec2Array> texCoord1;
48  osg::ref_ptr<osg::Vec2Array> texCoord2;
49  osg::ref_ptr<osg::Geode> positionNode;
50  osg::ref_ptr<osg::Geode> dialNode;
51  osg::ref_ptr<osg::Geode> textNode;
52  osg::ref_ptr<osg::Geode> positionNodeDisabled;
53  osg::ref_ptr<osg::Geode> dialNodeDisabled;
54 
55  osg::ref_ptr<osg::Switch> switchPosition;
56  osg::ref_ptr<osg::Switch> switchDial;
57  osg::ref_ptr<osgText::Text> numberText;
58 
59  void updateSlider();
60  void updateDial();
61 
63 
64 private:
65  osg::ref_ptr<osg::Geode> createSlider(const std::string &textureName);
66  osg::ref_ptr<osg::Geode> createDial(const std::string &textureName);
67  osg::ref_ptr<osg::Geode> createText(float xPos = 0.0f);
68 
69  float sliderDialSize;
70 };
71 }
72 #endif
osg::ref_ptr< osg::Vec3Array > normal
slider textures normal
Definition: OSGVruiSlider.h:46
osg::ref_ptr< osg::Geode > positionNodeDisabled
disabled position indicator geode
Definition: OSGVruiSlider.h:52
osg::ref_ptr< osg::MatrixTransform > sliderTransform
&lt; DCS of slider position indicator
Definition: OSGVruiSlider.h:42
osg::ref_ptr< osg::Switch > switchPosition
Definition: OSGVruiSlider.h:55
osg::ref_ptr< osg::Geode > positionNode
position indicator geode
Definition: OSGVruiSlider.h:49
osg::ref_ptr< osg::Geode > textNode
Definition: OSGVruiSlider.h:51
osg::ref_ptr< osg::Switch > switchDial
Definition: OSGVruiSlider.h:56
osg::ref_ptr< osg::Vec2Array > texCoord1
texture coordinates of slider position indicator
Definition: OSGVruiSlider.h:47
Definition: coSlider.h:37
osg::ref_ptr< osg::Vec3Array > coord1
position indicator coordinates
Definition: OSGVruiSlider.h:44
osg::ref_ptr< osg::Geode > dialNodeDisabled
disabled dial geode
Definition: OSGVruiSlider.h:53
osg::ref_ptr< osg::Geode > dialNode
dial geode
Definition: OSGVruiSlider.h:50
coSlider * slider
Definition: OSGVruiSlider.h:62
osg::ref_ptr< osgText::Text > numberText
OSG string for slider value.
Definition: OSGVruiSlider.h:57
osg::ref_ptr< osg::Vec2Array > texCoord2
texture coordinates of dial
Definition: OSGVruiSlider.h:48
Definition: OSGVruiUIElement.h:20
osg::ref_ptr< osg::Vec3Array > coord2
dial coordinates
Definition: OSGVruiSlider.h:45
Definition: OSGVruiSlider.h:29