OpenSceneGraph 3.6.5
LineStipple
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_LINESTIPPLE
15#define OSG_LINESTIPPLE 1
16
17#include <osg/StateAttribute>
18
19#ifndef GL_LINE_STIPPLE
20 #define GL_LINE_STIPPLE 0x0B24
21#endif
22
23namespace osg {
24
26{
27 public :
28
30
31 LineStipple(GLint factor, GLushort pattern):
32 _factor(factor),
33 _pattern(pattern) {}
34
37 StateAttribute(lw,copyop),
38 _factor(lw._factor),
39 _pattern(lw._pattern) {}
40
42
44 virtual int compare(const StateAttribute& sa) const
45 {
46 // check if the types are equal and then create the rhs variable.
47 // used by the COMPARE_StateAttribute_Parameter macros below.
49
50 // compare each parameter in turn against the rhs.
53
54 return 0; // passed all the above comparison macros, must be equal.
55 }
56
57 virtual bool getModeUsage(StateAttribute::ModeUsage& usage) const
58 {
60 return true;
61 }
62
63 void setFactor(GLint factor);
64 inline GLint getFactor() const { return _factor; }
65
66 void setPattern(GLushort pattern);
67 inline GLushort getPattern() const { return _pattern; }
68
69 virtual void apply(State& state) const;
70
71
72 protected :
73
74 virtual ~LineStipple();
75
76 GLint _factor;
77 GLushort _pattern;
78
79};
80
81}
82
83#endif
#define GL_LINE_STIPPLE
Definition LineStipple:20
#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
GLushort _pattern
Definition LineStipple:77
GLint getFactor() const
Definition LineStipple:64
GLint _factor
Definition LineStipple:76
LineStipple(const LineStipple &lw, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
Definition LineStipple:36
virtual void apply(State &state) const
apply the OpenGL state attributes.
virtual bool getModeUsage(StateAttribute::ModeUsage &usage) const
Return the modes associated with this StateAttribute.
Definition LineStipple:57
virtual ~LineStipple()
void setPattern(GLushort pattern)
virtual int compare(const StateAttribute &sa) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition LineStipple:44
GLushort getPattern() const
Definition LineStipple:67
LineStipple(GLint factor, GLushort pattern)
Definition LineStipple:31
void setFactor(GLint factor)
META_StateAttribute(osg, LineStipple, LINESTIPPLE)
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
@ LINESTIPPLE
Definition StateAttribute:141
Definition StateAttribute:308
virtual void usesMode(GLMode mode)=0
#define OSG_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.