StateAttribute File Reference
`#include <osg/Export>`
`#include <osg/Object>`
`#include <osg/Callback>`
`#include <osg/Shader>`
`#include <osg/GL>`
`#include <typeinfo>`
`#include <utility>`
`#include <vector>`

Go to the source code of this file.

## Classes

class | osg::StateAttribute
struct | osg::StateAttribute::ModeUsage
struct | osg::StateAttribute::ReassignToParents

## Namespaces

namespace | osg

## Macros

#define | OSG_STATEATTRIBUTE 1
#define | GL_COLOR_SUM 0x8458
#define | META_StateAttribute(library, name, type)
#define | COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
#define | COMPARE_StateAttribute_Parameter(parameter)

## Macro Definition Documentation

## COMPARE_StateAttribute_Parameter

#define COMPARE_StateAttribute_Parameter | ( |  | parameter | ) |

Value:
if (parameter<rhs.parameter) return -1; \
if (rhs.parameter<parameter) return 1;

COMPARE_StateAttribute_Parameter macro is a helper for implementing the StatateAtribute::compare(..) method. Macro assumes that variable rhs has been correctly defined by preceding code macro.

Referenced by osg::AlphaFunc::compare(), osg::AtomicCounterBufferBinding::compare(), osg::BlendColor::compare(), osg::BlendEquation::compare(), osg::BlendEquationi::compare(), osg::BlendFunc::compare(), osg::BlendFunci::compare(), osg::Capability::compare(), osg::Capabilityi::compare(), osg::ClampColor::compare(), osg::ClipControl::compare(), osg::ClipPlane::compare(), osg::ColorMask::compare(), osg::ColorMaski::compare(), osg::ColorMatrix::compare(), osg::CullFace::compare(), osg::Depth::compare(), osg::DepthRangeIndexed::compare(), osg::Fog::compare(), osg::FragmentProgram::compare(), osg::FrontFace::compare(), osg::Hint::compare(), osg::Light::compare(), osg::LightModel::compare(), osg::LineStipple::compare(), osg::LineWidth::compare(), osg::LogicOp::compare(), osg::Material::compare(), osg::Multisample::compare(), osg::PatchParameter::compare(), osg::Point::compare(), osg::PolygonMode::compare(), osg::PolygonOffset::compare(), osg::Scissor::compare(), osg::ScissorIndexed::compare(), osg::ShadeModel::compare(), osg::ShaderStorageBufferBinding::compare(), osg::Stencil::compare(), osg::TexEnv::compare(), osg::TexEnvCombine::compare(), osg::TexEnvFilter::compare(), osg::TexGen::compare(), osg::TexMat::compare(), osg::TransformFeedbackBufferBinding::compare(), osg::UniformBufferBinding::compare(), osg::VertexAttribDivisor::compare(), osg::VertexProgram::compare(), osg::Viewport::compare(), osg::ViewportIndexed::compare(), and osgFX::Validator::compare().

## COMPARE_StateAttribute_Types

#define COMPARE_StateAttribute_Types | ( |  | TYPE,
|  |  | rhs_attribute )

Value:
if (this==&rhs_attribute) return 0;\
const std::type_info* type_lhs = &typeid(*this);\
const std::type_info* type_rhs = &typeid(rhs_attribute);\
if (type_lhs->before(*type_rhs)) return -1;\
if (*type_lhs != *type_rhs) return 1;\
const TYPE& rhs = static_cast<const TYPE&>(rhs_attribute);

COMPARE_StateAttribute_Types macro is a helper for implementing the StateAtribute::compare(..) method.

Referenced by osg::AlphaFunc::compare(), osg::AtomicCounterBufferBinding::compare(), osg::BlendColor::compare(), osg::BlendEquation::compare(), osg::BlendEquationi::compare(), osg::BlendFunc::compare(), osg::BlendFunci::compare(), osg::Capability::compare(), osg::Capabilityi::compare(), osg::ClampColor::compare(), osg::ClipControl::compare(), osg::ClipPlane::compare(), osg::ColorMask::compare(), osg::ColorMaski::compare(), osg::ColorMatrix::compare(), osg::CullFace::compare(), osg::Depth::compare(), osg::DepthRangeIndexed::compare(), osg::Fog::compare(), osg::FragmentProgram::compare(), osg::FrontFace::compare(), osg::Hint::compare(), osg::Light::compare(), osg::LightModel::compare(), osg::LineStipple::compare(), osg::LineWidth::compare(), osg::LogicOp::compare(), osg::Material::compare(), osg::Multisample::compare(), osg::PatchParameter::compare(), osg::Point::compare(), osg::PolygonMode::compare(), osg::PolygonOffset::compare(), osg::Scissor::compare(), osg::ScissorIndexed::compare(), osg::ShadeModel::compare(), osg::ShaderStorageBufferBinding::compare(), osg::Stencil::compare(), osg::TexEnv::compare(), osg::TexEnvCombine::compare(), osg::TexEnvFilter::compare(), osg::TexGen::compare(), osg::TexMat::compare(), osg::TransformFeedbackBufferBinding::compare(), osg::UniformBufferBinding::compare(), osg::VertexAttribDivisor::compare(), osg::VertexProgram::compare(), osg::Viewport::compare(), osg::ViewportIndexed::compare(), and osgFX::Validator::compare().

## GL_COLOR_SUM

#define GL_COLOR_SUM 0x8458

## META_StateAttribute

#define META_StateAttribute | ( |  | library,
|  |  | name,
|  |  | type )

Value:
virtual osg::Object* cloneType() const { return new name(); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
virtual const char* libraryName() const { return #library; } \
virtual const char* className() const { return #name; } \
virtual Type getType() const { return type; }
osg::CopyOp
Definition CopyOp:41
osg::Object
Definition Object:61
NULL
#define NULL
Definition osg/Export:55

META_StateAttribute macro define the standard clone, isSameKindAs, className and getType methods. Use when subclassing from Object to make it more convenient to define the standard pure virtual methods which are required for all Object subclasses.

## OSG_STATEATTRIBUTE

#define OSG_STATEATTRIBUTE 1