DepthRangeIndexed
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2016 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSG_DepthRangeIndexed
#define OSG_DepthRangeIndexed 1
#include <osg/Depth>
namespace osg {
class OSG_EXPORT DepthRangeIndexed : public osg::StateAttribute
{
public :
DepthRangeIndexed();
DepthRangeIndexed(unsigned int index, double zNear=0.0, double zFar=1.0):
_index(index),
_zNear(zNear),
_zFar(zFar) {}
DepthRangeIndexed(const DepthRangeIndexed& dp,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
StateAttribute(dp,copyop),
_index(dp._index),
_zNear(dp._zNear),
_zFar(dp._zFar) {}
META_StateAttribute(osg, DepthRangeIndexed, DEPTHRANGEINDEXED);
virtual int compare(const StateAttribute& sa) const
{
// Check for equal types, then create the rhs variable
// used by the COMPARE_StateAttribute_Parameter macros below.
COMPARE_StateAttribute_Types(DepthRangeIndexed,sa)
COMPARE_StateAttribute_Parameter(_index);
COMPARE_StateAttribute_Parameter(_zNear)
COMPARE_StateAttribute_Parameter(_zFar)
return 0;
}
virtual unsigned int getMember() const { return _index; }
void setIndex(unsigned int index);
unsigned int getIndex() const { return _index; }
inline void setZNear(double zNear) { _zNear=zNear; }
inline double getZNear() const { return _zNear; }
inline void setZFar(double zFar) { _zFar=zFar; }
inline double getZFar() const { return _zFar; }
virtual void apply(State& state) const;
protected:
virtual ~DepthRangeIndexed();
unsigned int _index;
double _zNear;
double _zFar;
};
}
#endif
Depth
COMPARE_StateAttribute_Parameter
#define COMPARE_StateAttribute_Parameter(parameter)
Definition StateAttribute:69
COMPARE_StateAttribute_Types
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
Definition StateAttribute:57
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::DepthRangeIndexed::getZNear
double getZNear() const
Definition DepthRangeIndexed:67
osg::DepthRangeIndexed::DepthRangeIndexed
DepthRangeIndexed()
osg::DepthRangeIndexed::_index
unsigned int _index
Definition DepthRangeIndexed:78
osg::DepthRangeIndexed::_zFar
double _zFar
Definition DepthRangeIndexed:80
osg::DepthRangeIndexed::DepthRangeIndexed
DepthRangeIndexed(const DepthRangeIndexed &dp, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition DepthRangeIndexed:35
osg::DepthRangeIndexed::compare
virtual int compare(const StateAttribute &sa) const
Definition DepthRangeIndexed:44
osg::DepthRangeIndexed::getMember
virtual unsigned int getMember() const
Definition DepthRangeIndexed:58
osg::DepthRangeIndexed::META_StateAttribute
META_StateAttribute(osg, DepthRangeIndexed, DEPTHRANGEINDEXED)
osg::DepthRangeIndexed::setIndex
void setIndex(unsigned int index)
osg::DepthRangeIndexed::getZFar
double getZFar() const
Definition DepthRangeIndexed:70
osg::DepthRangeIndexed::setZNear
void setZNear(double zNear)
Definition DepthRangeIndexed:66
osg::DepthRangeIndexed::apply
virtual void apply(State &state) const
osg::DepthRangeIndexed::_zNear
double _zNear
Definition DepthRangeIndexed:79
osg::DepthRangeIndexed::getIndex
unsigned int getIndex() const
Definition DepthRangeIndexed:64
osg::DepthRangeIndexed::setZFar
void setZFar(double zFar)
Definition DepthRangeIndexed:69
osg::DepthRangeIndexed::DepthRangeIndexed
DepthRangeIndexed(unsigned int index, double zNear=0.0, double zFar=1.0)
Definition DepthRangeIndexed:29
osg::DepthRangeIndexed::~DepthRangeIndexed
virtual ~DepthRangeIndexed()
osg::StateAttribute
Definition StateAttribute:77
osg::StateAttribute::StateAttribute
StateAttribute()
osg::StateAttribute::DEPTHRANGEINDEXED
@ DEPTHRANGEINDEXED
Definition StateAttribute:208
osg::State
Definition State:80
osg
Definition AlphaFunc:19
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39