OpenCOVER
OSGVruiPresets.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_PRESETS
9#define OSG_VRUI_PRESETS
10
12
13#include <osg/StateSet>
14#include <osg/Material>
15#include <osg/BlendFunc>
16#include <osg/CullFace>
17#include <osg/TexEnv>
18#include <osg/PolygonMode>
19#include <osg/Node>
20
21#include <vector>
22
23namespace vrui
24{
25
26class OSGVRUIEXPORT OSGVruiPresets
27{
28
29private:
31 virtual ~OSGVruiPresets();
32
33 static OSGVruiPresets *instance;
34
35public:
36 static osg::StateSet *getStateSet(coUIElement::Material material);
37 static osg::StateSet *getStateSetCulled(coUIElement::Material material);
38 static osg::StateSet *makeStateSet(coUIElement::Material material);
39 static osg::StateSet *makeStateSetCulled(coUIElement::Material material);
40 static osg::Material *getMaterial(coUIElement::Material material);
41 static osg::TexEnv *getTexEnvModulate();
42 static osg::PolygonMode *getPolyModeFill();
43 static osg::CullFace *getCullFaceBack();
44 static osg::BlendFunc *getBlendOneMinusSrcAlpha();
45 static void makeTransparent(osg::StateSet *state, bool continuous = false);
46 static std::string getFontFile();
47
48private:
49 std::vector<osg::ref_ptr<osg::StateSet> > stateSets;
50 std::vector<osg::ref_ptr<osg::StateSet> > stateSetsCulled;
51 std::vector<osg::ref_ptr<osg::Material> > materials;
52 osg::ref_ptr<osg::TexEnv> texEnvModulate;
53 osg::ref_ptr<osg::PolygonMode> polyModeFill;
54 osg::ref_ptr<osg::CullFace> cullFaceBack;
55 osg::ref_ptr<osg::BlendFunc> oneMinusSourceAlphaBlendFunc;
56 std::string fontFile;
57
58 void setColorFromConfig(const char *configEntry, int materialIndex, osg::Vec4 def);
59};
60}
61#endif
collaborative interface manager
Definition: coVRCommunication.h:41
Material
Color definitions, to be used whenever a material is needed.
Definition: coUIElement.h:66
Definition: OSGVruiPresets.h:27
static void makeTransparent(osg::StateSet *state, bool continuous=false)
static osg::PolygonMode * getPolyModeFill()
static osg::TexEnv * getTexEnvModulate()
static osg::StateSet * getStateSetCulled(coUIElement::Material material)
static osg::BlendFunc * getBlendOneMinusSrcAlpha()
static osg::StateSet * makeStateSet(coUIElement::Material material)
static osg::Material * getMaterial(coUIElement::Material material)
static std::string getFontFile()
static osg::StateSet * getStateSet(coUIElement::Material material)
static osg::StateSet * makeStateSetCulled(coUIElement::Material material)
static osg::CullFace * getCullFaceBack()