OpenSceneGraph 3.6.5
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; }
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; }
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
BoundingBoxd BoundingBox
Definition BoundingBox:257
Vec4f Vec4
Definition Vec4:21
Definition AlignmentSettings:23
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Base class for all internal nodes in the scene graph.
Definition Node:72
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
Definition AlignmentSettings:26
Definition FrameSettings:25
void setBackgroundColor(const osg::Vec4 &color)
Definition 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 Style:62
const osg::Vec4 & getDisabledTextColor() const
Definition Style:47
void setTextColor(const osg::Vec4 &color)
Definition Style:43
osg::ref_ptr< osg::Texture2D > _clipTexture
Definition Style:64
void setDisabledTextColor(const osg::Vec4 &color)
Definition Style:46
Style(const Style &style, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osg::ref_ptr< osg::ColorMask > _disableColorWriteMask
Definition Style:63
const osg::Vec4 & getBackgroundColor() const
Definition Style:41
virtual osg::Node * createFrame(const osg::BoundingBox &extents, const FrameSettings *frameSettings, const osg::Vec4 &colour)
osg::Vec4 _backgroundColor
Definition Style:66
virtual ~Style()
Definition Style:59
virtual void setupDialogStateSet(osg::StateSet *stateset, int binNum)
osg::Vec4 _textColor
Definition Style:67
osg::Vec4 _disabledTextColor
Definition 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 Style:44
osg::ref_ptr< osg::Depth > _disabledDepthWrite
Definition Style:61
Definition TextSettings:26
#define OSGUI_EXPORT
Definition Export:40

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.