OpenSceneGraph 3.6.5
LineWidth
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 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 OSG_LINEWIDTH
15#define OSG_LINEWIDTH 1
16
17#include <osg/StateAttribute>
18
19namespace osg {
20
23{
24 public :
25
26 LineWidth(float width=1.0f);
27
30 StateAttribute(lw,copyop),
31 _width(lw._width) {}
32
34
36 virtual int compare(const StateAttribute& sa) const
37 {
38 // check if the types are equal and then create the rhs variable
39 // used by the COMPARE_StateAttribute_Parameter macros below.
41
42 // compare each parameter in turn against the rhs.
44
45 return 0; // passed all the above comparison macros, must be equal.
46 }
47
48 void setWidth(float width);
49
50 inline float getWidth() const { return _width; }
51
52 virtual void apply(State& state) const;
53
54 protected :
55
56 virtual ~LineWidth();
57
58 float _width;
59
60};
61
62}
63
64#endif
#define COMPARE_StateAttribute_Parameter(parameter)
COMPARE_StateAttribute_Parameter macro is a helper for implementing the StatateAtribute::compare(....
Definition StateAttribute:69
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
COMPARE_StateAttribute_Types macro is a helper for implementing the StateAtribute::compare(....
Definition StateAttribute:57
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
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
void setWidth(float width)
virtual void apply(State &state) const
apply the OpenGL state attributes.
LineWidth(const LineWidth &lw, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
Definition LineWidth:29
META_StateAttribute(osg, LineWidth, LINEWIDTH)
virtual ~LineWidth()
float _width
Definition LineWidth:58
float getWidth() const
Definition LineWidth:50
LineWidth(float width=1.0f)
virtual int compare(const StateAttribute &sa) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition LineWidth:36
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
@ LINEWIDTH
Definition StateAttribute:140
#define OSG_EXPORT
Definition Export:39

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