OpenSceneGraph 3.6.5
ScissorIndexed
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2016 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_ScissorIndexed
15#define OSG_ScissorIndexed 1
16
17#include <osg/Depth>
18
19namespace osg {
20
24{
25 public :
26
28
29 ScissorIndexed(unsigned int index, float x, float y, float width, float height):
30 _index(index),
31 _x(x),
32 _y(y),
33 _width(width),
34 _height(height) {}
35
38 StateAttribute(dp,copyop),
39 _index(dp._index),
40 _x(dp._x),
41 _y(dp._y),
42 _width(dp._width),
43 _height(dp._height) {}
44
46
48 virtual int compare(const StateAttribute& sa) const
49 {
50 // Check for equal types, then create the rhs variable
51 // used by the COMPARE_StateAttribute_Parameter macros below.
53
59
60 return 0;
61 }
62
64 virtual unsigned int getMember() const { return _index; }
65
67 void setIndex(unsigned int index);
68
70 unsigned int getIndex() const { return _index; }
71
72 inline void setX(float x) { _x=x; }
73 inline float getX() const { return _x; }
74
75 inline void setY(float y) { _y=y; }
76 inline float getY() const { return _y; }
77
78 inline void setWidth(float w) { _width=w; }
79 inline float getWidth() const { return _width; }
80
81 inline void setHeight(float height) { _height=height; }
82 inline float getHeight() const { return _height; }
83
84 virtual void apply(State& state) const;
85
86 protected:
87
88 virtual ~ScissorIndexed();
89
90 unsigned int _index;
91 float _x;
92 float _y;
93 float _width;
94 float _height;
95
96};
97
98}
99
100#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 setX(float x)
Definition ScissorIndexed:72
unsigned int _index
Definition ScissorIndexed:90
ScissorIndexed(unsigned int index, float x, float y, float width, float height)
Definition ScissorIndexed:29
void setY(float y)
Definition ScissorIndexed:75
float getWidth() const
Definition ScissorIndexed:79
void setIndex(unsigned int index)
Set the index of the ScissorIndexed.
virtual int compare(const StateAttribute &sa) const
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition ScissorIndexed:48
virtual unsigned int getMember() const
Return the buffer index as the member identifier.
Definition ScissorIndexed:64
virtual void apply(State &state) const
apply the OpenGL state attributes.
float getX() const
Definition ScissorIndexed:73
float getY() const
Definition ScissorIndexed:76
float _width
Definition ScissorIndexed:93
ScissorIndexed(const ScissorIndexed &dp, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
Definition ScissorIndexed:37
float _x
Definition ScissorIndexed:91
float getHeight() const
Definition ScissorIndexed:82
unsigned int getIndex() const
Get the index of the ScissorIndexed.
Definition ScissorIndexed:70
float _y
Definition ScissorIndexed:92
META_StateAttribute(osg, ScissorIndexed, SCISSORINDEXED)
void setWidth(float w)
Definition ScissorIndexed:78
virtual ~ScissorIndexed()
float _height
Definition ScissorIndexed:94
void setHeight(float height)
Definition ScissorIndexed:81
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Base class for state attributes.
Definition StateAttribute:77
@ SCISSORINDEXED
Definition StateAttribute:209
#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.