openscenegraph
osgUI/Style
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGUI_STYLE
15#define OSGUI_STYLE
16
17#include <osg/Object>
18#include <osg/BoundingBox>
19#include <osg/Texture2D>
20#include <osg/Depth>
21#include <osg/ColorMask>
22#include <osg/Vec4>
23
25#include <osgUI/FrameSettings>
26#include <osgUI/TextSettings>
27
28namespace osgUI
29{
30
32{
33public:
35 Style(const Style& style, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
37
39
40 void setBackgroundColor(const osg::Vec4& color) { _backgroundColor = color; }
41 const osg::Vec4& getBackgroundColor() const { return _backgroundColor; }
42
43 void setTextColor(const osg::Vec4& color) { _textColor = color; }
44 const osg::Vec4& getTextColor() const { return _textColor; }
45
46 void setDisabledTextColor(const osg::Vec4& color) { _disabledTextColor = color; }
47 const osg::Vec4& getDisabledTextColor() const { return _disabledTextColor; }
48
50 virtual osg::Node* createPanel(const osg::BoundingBox& extents, const osg::Vec4& colour);
51 virtual osg::Node* createFrame(const osg::BoundingBox& extents, const FrameSettings* frameSettings, const osg::Vec4& colour);
52 virtual osg::Node* createText(const osg::BoundingBox& extents, const AlignmentSettings* as, const TextSettings* textSettings, const std::string& text);
53 virtual osg::Node* createIcon(const osg::BoundingBox& extents, const std::string& filename, const osg::Vec4& colour);
54 virtual void setupDialogStateSet(osg::StateSet* stateset, int binNum);
55 virtual void setupPopupStateSet(osg::StateSet* stateset, int binNum);
56 virtual void setupClipStateSet(const osg::BoundingBox& extents, osg::StateSet* stateset);
57
58protected:
59 virtual ~Style() {}
60
65
69};
70
71}
72
73#endif
Definition AlignmentSettings:26
Definition FrameSettings:25
Definition osgUI/Style:32
void setBackgroundColor(const osg::Vec4 &color)
Definition osgUI/Style:40
virtual osg::Node * createIcon(const osg::BoundingBox &extents, const std::string &filename, const osg::Vec4 &colour)
virtual void setupClipStateSet(const osg::BoundingBox &extents, osg::StateSet *stateset)
virtual void setupPopupStateSet(osg::StateSet *stateset, int binNum)
virtual osg::Node * createDepthSetPanel(const osg::BoundingBox &extents)
osg::ref_ptr< osg::Depth > _enabledDepthWrite
Definition osgUI/Style:62
const osg::Vec4 & getDisabledTextColor() const
Definition osgUI/Style:47
void setTextColor(const osg::Vec4 &color)
Definition osgUI/Style:43
osg::ref_ptr< osg::Texture2D > _clipTexture
Definition osgUI/Style:64
void setDisabledTextColor(const osg::Vec4 &color)
Definition osgUI/Style:46
Style(const Style &style, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osg::ref_ptr< osg::ColorMask > _disableColorWriteMask
Definition osgUI/Style:63
const osg::Vec4 & getBackgroundColor() const
Definition osgUI/Style:41
virtual osg::Node * createFrame(const osg::BoundingBox &extents, const FrameSettings *frameSettings, const osg::Vec4 &colour)
osg::Vec4 _backgroundColor
Definition osgUI/Style:66
virtual ~Style()
Definition osgUI/Style:59
virtual void setupDialogStateSet(osg::StateSet *stateset, int binNum)
osg::Vec4 _textColor
Definition osgUI/Style:67
osg::Vec4 _disabledTextColor
Definition osgUI/Style:68
META_Object(osgUI, Style)
virtual osg::Node * createText(const osg::BoundingBox &extents, const AlignmentSettings *as, const TextSettings *textSettings, const std::string &text)
static osg::ref_ptr< Style > & instance()
virtual osg::Node * createPanel(const osg::BoundingBox &extents, const osg::Vec4 &colour)
const osg::Vec4 & getTextColor() const
Definition osgUI/Style:44
osg::ref_ptr< osg::Depth > _disabledDepthWrite
Definition osgUI/Style:61
Definition TextSettings:26
Definition BoundingBox:34
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Definition Node:72
Definition Object:61
Definition StateSet:46
Definition Vec4f:28
Definition ref_ptr:32
Definition AlignmentSettings:23
#define OSGUI_EXPORT
Definition osgUI/Export:40