OpenCOVER
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
24namespace vrui
25{
26
33class OSGVRUIEXPORT OSGVruiTexturedBackground
34 : public OSGVruiUIContainer
35{
36public:
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
48protected:
50
53 void createTexturesFromArrays(const uint *normalImage, const uint *highlightImage, const uint *disabledImage,
54 int comp, int ns, int nt, int nr);
55
58
59private:
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
unsigned int uint
abbreviation for unsigned int
Definition: rel_mcast-old.h:77
collaborative interface manager
Definition: coVRCommunication.h:41
Definition: coTexturedBackground.h:62
Definition: coTexturedBackground.h:72
Definition: OSGVruiTexturedBackground.h:35
void createTexturesFromArrays(const uint *normalImage, const uint *highlightImage, const uint *disabledImage, int comp, int ns, int nt, int nr)
virtual void setEnabled(bool en)
coTexturedBackground * background
Definition: OSGVruiTexturedBackground.h:56
OSGVruiTexturedBackground(coTexturedBackground *background)
virtual void setHighlighted(bool hl)
coTexturedBackground::TextureSet * tex
Definition: OSGVruiTexturedBackground.h:57
Definition: OSGVruiUIContainer.h:18