OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Style.h
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 
24 #include <osgUI/AlignmentSettings>
25 #include <osgUI/FrameSettings>
26 #include <osgUI/TextSettings>
27 
28 namespace osgUI
29 {
30 
32 {
33 public:
34  Style();
35  Style(const Style& style, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
37 
38  static osg::ref_ptr<Style>& instance();
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 
49  virtual osg::Node* createDepthSetPanel(const osg::BoundingBox& extents);
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 
58 protected:
59  virtual ~Style() {}
60 
65 
69 };
70 
71 }
72 
73 #endif
const osg::Vec4 & getDisabledTextColor() const
Definition: Style.h:47
osg::ref_ptr< osg::Depth > _disabledDepthWrite
Definition: Style.h:61
osg::Vec4 _backgroundColor
Definition: Style.h:66
void setDisabledTextColor(const osg::Vec4 &color)
Definition: Style.h:46
void setBackgroundColor(const osg::Vec4 &color)
Definition: Style.h:40
virtual ~Style()
Definition: Style.h:59
void setTextColor(const osg::Vec4 &color)
Definition: Style.h:43
const osg::Vec4 & getBackgroundColor() const
Definition: Style.h:41
#define META_Object(library, name)
Definition: Object.h:42
const osg::Vec4 & getTextColor() const
Definition: Style.h:44
osg::ref_ptr< osg::ColorMask > _disableColorWriteMask
Definition: Style.h:63
Definition: Node.h:71
osg::ref_ptr< osg::Texture2D > _clipTexture
Definition: Style.h:64
osg::ref_ptr< osg::Depth > _enabledDepthWrite
Definition: Style.h:62
osg::Vec4 _disabledTextColor
Definition: Style.h:68
osg::Vec4 _textColor
Definition: Style.h:67
#define OSGUI_EXPORT
Definition: Widget.h:22