ViewportIndexed
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 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_VIEWPORTINDEXED
#define OSG_VIEWPORTINDEXED 1
#include <osg/Viewport>
namespace osg {
class OSG_EXPORT ViewportIndexed : public Viewport
{
public :
ViewportIndexed();
ViewportIndexed(unsigned int index, value_type x,value_type y,value_type width,value_type height):
Viewport(x,y,width,height),
_index(index) {}
ViewportIndexed(const ViewportIndexed& cm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Viewport(cm,copyop),
_index(cm._index) {}
META_StateAttribute(osg, ViewportIndexed, VIEWPORTINDEXED);
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(ViewportIndexed,sa)
COMPARE_StateAttribute_Parameter(_index);
return Viewport::compare(sa);
}
virtual unsigned int getMember() const { return _index; }
void setIndex(unsigned int index);
unsigned int getIndex() const { return _index; }
virtual void apply(State& state) const;
protected:
virtual ~ViewportIndexed();
unsigned int _index;
};
}
#endif
COMPARE_StateAttribute_Parameter
#define COMPARE_StateAttribute_Parameter(parameter)
Definition StateAttribute:69
COMPARE_StateAttribute_Types
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
Definition StateAttribute:57
Viewport
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::StateAttribute
Definition StateAttribute:77
osg::StateAttribute::VIEWPORTINDEXED
@ VIEWPORTINDEXED
Definition StateAttribute:207
osg::State
Definition State:80
osg::ViewportIndexed::compare
virtual int compare(const StateAttribute &sa) const
Definition ViewportIndexed:41
osg::ViewportIndexed::getMember
virtual unsigned int getMember() const
Definition ViewportIndexed:53
osg::ViewportIndexed::getIndex
unsigned int getIndex() const
Definition ViewportIndexed:59
osg::ViewportIndexed::apply
virtual void apply(State &state) const
osg::ViewportIndexed::ViewportIndexed
ViewportIndexed(const ViewportIndexed &cm, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition ViewportIndexed:34
osg::ViewportIndexed::~ViewportIndexed
virtual ~ViewportIndexed()
osg::ViewportIndexed::ViewportIndexed
ViewportIndexed()
osg::ViewportIndexed::_index
unsigned int _index
Definition ViewportIndexed:67
osg::ViewportIndexed::ViewportIndexed
ViewportIndexed(unsigned int index, value_type x, value_type y, value_type width, value_type height)
Definition ViewportIndexed:29
osg::ViewportIndexed::setIndex
void setIndex(unsigned int index)
osg::ViewportIndexed::META_StateAttribute
META_StateAttribute(osg, ViewportIndexed, VIEWPORTINDEXED)
osg::Viewport::y
value_type & y()
Definition Viewport:107
osg::Viewport::value_type
double value_type
Definition Viewport:30
osg::Viewport::width
value_type & width()
Definition Viewport:110
osg::Viewport::height
value_type & height()
Definition Viewport:113
osg::Viewport::Viewport
Viewport()
osg::Viewport::compare
virtual int compare(const StateAttribute &sa) const
Definition Viewport:52
osg::Viewport::x
value_type & x()
Definition Viewport:104
osg
Definition AlphaFunc:19
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39