OpenSceneGraph 3.6.5
DepthRangeIndexed
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_DepthRangeIndexed
15#define OSG_DepthRangeIndexed 1
16
17#include <osg/Depth>
18
19namespace osg {
20
24{
25 public :
26
28
29 DepthRangeIndexed(unsigned int index, double zNear=0.0, double zFar=1.0):
30 _index(index),
31 _zNear(zNear),
32 _zFar(zFar) {}
33
36 StateAttribute(dp,copyop),
37 _index(dp._index),
38 _zNear(dp._zNear),
39 _zFar(dp._zFar) {}
40
42
44 virtual int compare(const StateAttribute& sa) const
45 {
46 // Check for equal types, then create the rhs variable
47 // used by the COMPARE_StateAttribute_Parameter macros below.
49
53
54 return 0;
55 }
56
58 virtual unsigned int getMember() const { return _index; }
59
61 void setIndex(unsigned int index);
62
64 unsigned int getIndex() const { return _index; }
65
66 inline void setZNear(double zNear) { _zNear=zNear; }
67 inline double getZNear() const { return _zNear; }
68
69 inline void setZFar(double zFar) { _zFar=zFar; }
70 inline double getZFar() const { return _zFar; }
71
72 virtual void apply(State& state) const;
73
74 protected:
75
77
78 unsigned int _index;
79 double _zNear;
80 double _zFar;
81
82};
83
84}
85
86#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
double getZNear() const
Definition DepthRangeIndexed:67
unsigned int _index
Definition DepthRangeIndexed:78
double _zFar
Definition DepthRangeIndexed:80
DepthRangeIndexed(const DepthRangeIndexed &dp, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
Definition DepthRangeIndexed:35
virtual int compare(const StateAttribute &sa) const
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition DepthRangeIndexed:44
virtual unsigned int getMember() const
Return the buffer index as the member identifier.
Definition DepthRangeIndexed:58
META_StateAttribute(osg, DepthRangeIndexed, DEPTHRANGEINDEXED)
void setIndex(unsigned int index)
Set the index of the DepthRangeIndexed.
double getZFar() const
Definition DepthRangeIndexed:70
void setZNear(double zNear)
Definition DepthRangeIndexed:66
virtual void apply(State &state) const
apply the OpenGL state attributes.
double _zNear
Definition DepthRangeIndexed:79
unsigned int getIndex() const
Get the index of the DepthRangeIndexed.
Definition DepthRangeIndexed:64
void setZFar(double zFar)
Definition DepthRangeIndexed:69
DepthRangeIndexed(unsigned int index, double zNear=0.0, double zFar=1.0)
Definition DepthRangeIndexed:29
virtual ~DepthRangeIndexed()
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Base class for state attributes.
Definition StateAttribute:77
@ DEPTHRANGEINDEXED
Definition StateAttribute:208
#define OSG_EXPORT
Definition Export:39

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