OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OSGVruiTexturedBackground.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 
10 #ifndef OSG_VRUI_TEXTURED_BACKGROUND_H
11 #define OSG_VRUI_TEXTURED_BACKGROUND_H
12 
14 
15 #include <osg/Array>
16 #include <osg/Geode>
17 #include <osg/Geometry>
18 #include <osg/MatrixTransform>
19 #include <osg/StateSet>
20 #include <osg/Texture2D>
21 
23 
24 namespace vrui
25 {
26 
33 class OSGVRUIEXPORT OSGVruiTexturedBackground
34  : public OSGVruiUIContainer
35 {
36 public:
38  virtual ~OSGVruiTexturedBackground();
39 
40  virtual void createGeometry();
41  virtual void resizeGeometry();
42 
43  virtual void update();
44 
45  virtual void setEnabled(bool en);
46  virtual void setHighlighted(bool hl);
47 
48 protected:
49  void createSharedLists();
50 
51  void rescaleTexture();
52  void createTexturesFromFiles();
53  void createTexturesFromArrays(uint *normalImage, uint *highlightImage, uint *disabledImage,
54  int comp, int ns, int nt, int nr);
55 
58 
59 private:
60  //shared coord and color list
61  osg::ref_ptr<osg::Vec3Array> coord;
62  osg::ref_ptr<osg::Vec2Array> texcoord;
63 
64  static osg::ref_ptr<osg::Vec3Array> normal;
65 
66  osg::ref_ptr<osg::StateSet> state;
67  osg::ref_ptr<osg::StateSet> highlightState;
68  osg::ref_ptr<osg::StateSet> disabledState;
69 
70  osg::ref_ptr<osg::Geode> geometryNode;
71  osg::ref_ptr<osg::Geometry> geometry;
72 
73  osg::ref_ptr<osg::Texture2D> texNormal;
74  osg::ref_ptr<osg::Texture2D> texHighlighted;
75  osg::ref_ptr<osg::Texture2D> texDisabled;
76 
77  void createGeode();
78 
79  bool repeat;
80  float texXSize;
81  float texYSize;
82 };
83 }
84 #endif
coTexturedBackground::TextureSet * tex
Definition: OSGVruiTexturedBackground.h:57
Definition: coTexturedBackground.h:59
Definition: OSGVruiUIContainer.h:17
unsigned int uint
abbreviation for unsigned int
Definition: rel_mcast-old.h:77
Definition: OSGVruiTexturedBackground.h:33
coTexturedBackground * background
Definition: OSGVruiTexturedBackground.h:56
Definition: coTexturedBackground.h:71