OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
22 namespace vrui
23 {
24 
25 class coFlatButtonGeometry;
26 class OSGVruiTransformNode;
27 
31 class OSGVRUIEXPORT OSGVruiFlatButtonGeometry : public vruiButtonProvider
32 {
33 public:
35  virtual ~OSGVruiFlatButtonGeometry();
36  virtual float getWidth() const
37  {
38  return A;
39  }
40  virtual float getHeight() const
41  {
42  return A;
43  }
44 
45  virtual void switchGeometry(coButtonGeometry::ActiveGeometry active);
46 
47  virtual void createGeometry();
48  virtual void resizeGeometry();
49 
50  virtual vruiTransformNode *getDCS();
51 
52 protected:
54  osg::ref_ptr<osg::Geode> createBox(const std::string &textureName);
56  osg::ref_ptr<osg::Geode> createCheck(const std::string &textureName);
57  void createSharedLists();
58 
59  osg::ref_ptr<osg::Node> normalNode;
60  osg::ref_ptr<osg::Node> pressedNode;
61  osg::ref_ptr<osg::Node> highlightNode;
62  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 
74 private:
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;
82  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
OSGVruiTransformNode * myDCS
Definition: OSGVruiFlatButtonGeometry.h:70
osg::ref_ptr< osg::Node > pressedNode
pressed normal geometry
Definition: OSGVruiFlatButtonGeometry.h:60
Definition: vruiTransformNode.h:17
Definition: vruiButtonProvider.h:20
Definition: coFlatButtonGeometry.h:21
virtual float getHeight() const
Definition: OSGVruiFlatButtonGeometry.h:40
osg::ref_ptr< osg::Switch > switchNode
Definition: OSGVruiFlatButtonGeometry.h:66
ActiveGeometry
Definition: coButtonGeometry.h:32
virtual float getWidth() const
Definition: OSGVruiFlatButtonGeometry.h:36
coFlatButtonGeometry * button
Definition: OSGVruiFlatButtonGeometry.h:68
osg::ref_ptr< osg::Node > highlightNode
pressed highlighted geometry
Definition: OSGVruiFlatButtonGeometry.h:61
Definition: OSGVruiTransformNode.h:25
osg::ref_ptr< osg::Node > normalNode
normal geometry
Definition: OSGVruiFlatButtonGeometry.h:59
Definition: OSGVruiFlatButtonGeometry.h:31
osg::ref_ptr< osg::Texture2D > defaulTexture
Definition: OSGVruiFlatButtonGeometry.h:72
osg::ref_ptr< osg::Node > disabledNode
disabled geometry
Definition: OSGVruiFlatButtonGeometry.h:64