PositionalStateContainer
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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 OSGUTIL_POSITIONALSTATECONTAINER
#define OSGUTIL_POSITIONALSTATECONTAINER 1
#include <osg/Object>
#include <osg/Light>
#include <osg/State>
#include <osgUtil/RenderLeaf>
#include <osgUtil/StateGraph>
namespace osgUtil {
class OSGUTIL_EXPORT PositionalStateContainer : public osg::Object
{
public:
PositionalStateContainer();
virtual osg::Object* cloneType() const { return new PositionalStateContainer(); }
virtual osg::Object* clone(const osg::CopyOp&) const { return new PositionalStateContainer(); } // note only implements a clone of type.
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const PositionalStateContainer*>(obj)!=0L; }
virtual const char* libraryName() const { return "osgUtil"; }
virtual const char* className() const { return "PositionalStateContainer"; }
virtual void reset();
typedef std::pair< osg::ref_ptr<const osg::StateAttribute> , osg::ref_ptr<osg::RefMatrix> > AttrMatrixPair;
typedef std::vector< AttrMatrixPair > AttrMatrixList;
typedef std::map< unsigned int, AttrMatrixList > TexUnitAttrMatrixListMap;
AttrMatrixList& getAttrMatrixList() { return _attrList; }
virtual void addPositionedAttribute(osg::RefMatrix* matrix,const osg::StateAttribute* attr)
{
_attrList.push_back(AttrMatrixPair(attr,matrix));
}
TexUnitAttrMatrixListMap& getTexUnitAttrMatrixListMap() { return _texAttrListMap; }
virtual void addPositionedTextureAttribute(unsigned int textureUnit, osg::RefMatrix* matrix,const osg::StateAttribute* attr)
{
_texAttrListMap[textureUnit].push_back(AttrMatrixPair(attr,matrix));
}
virtual void draw(osg::State& state,RenderLeaf*& previous, const osg::Matrix* postMultMatrix = 0);
public:
AttrMatrixList _attrList;
TexUnitAttrMatrixListMap _texAttrListMap;
protected:
virtual ~PositionalStateContainer();
};
}
#endif
Light
Object
RenderLeaf
StateGraph
State
osgUtil::PositionalStateContainer::getTexUnitAttrMatrixListMap
TexUnitAttrMatrixListMap & getTexUnitAttrMatrixListMap()
Definition PositionalStateContainer:54
osgUtil::PositionalStateContainer::libraryName
virtual const char * libraryName() const
Definition PositionalStateContainer:38
osgUtil::PositionalStateContainer::addPositionedAttribute
virtual void addPositionedAttribute(osg::RefMatrix *matrix, const osg::StateAttribute *attr)
Definition PositionalStateContainer:49
osgUtil::PositionalStateContainer::reset
virtual void reset()
osgUtil::PositionalStateContainer::cloneType
virtual osg::Object * cloneType() const
Definition PositionalStateContainer:35
osgUtil::PositionalStateContainer::isSameKindAs
virtual bool isSameKindAs(const osg::Object *obj) const
Definition PositionalStateContainer:37
osgUtil::PositionalStateContainer::PositionalStateContainer
PositionalStateContainer()
osgUtil::PositionalStateContainer::clone
virtual osg::Object * clone(const osg::CopyOp &) const
Definition PositionalStateContainer:36
osgUtil::PositionalStateContainer::addPositionedTextureAttribute
virtual void addPositionedTextureAttribute(unsigned int textureUnit, osg::RefMatrix *matrix, const osg::StateAttribute *attr)
Definition PositionalStateContainer:56
osgUtil::PositionalStateContainer::_texAttrListMap
TexUnitAttrMatrixListMap _texAttrListMap
Definition PositionalStateContainer:66
osgUtil::PositionalStateContainer::_attrList
AttrMatrixList _attrList
Definition PositionalStateContainer:65
osgUtil::PositionalStateContainer::className
virtual const char * className() const
Definition PositionalStateContainer:39
osgUtil::PositionalStateContainer::TexUnitAttrMatrixListMap
std::map< unsigned int, AttrMatrixList > TexUnitAttrMatrixListMap
Definition PositionalStateContainer:45
osgUtil::PositionalStateContainer::AttrMatrixList
std::vector< AttrMatrixPair > AttrMatrixList
Definition PositionalStateContainer:44
osgUtil::PositionalStateContainer::getAttrMatrixList
AttrMatrixList & getAttrMatrixList()
Definition PositionalStateContainer:47
osgUtil::PositionalStateContainer::AttrMatrixPair
std::pair< osg::ref_ptr< const osg::StateAttribute >, osg::ref_ptr< osg::RefMatrix > > AttrMatrixPair
Definition PositionalStateContainer:43
osgUtil::PositionalStateContainer::~PositionalStateContainer
virtual ~PositionalStateContainer()
osgUtil::PositionalStateContainer::draw
virtual void draw(osg::State &state, RenderLeaf *&previous, const osg::Matrix *postMultMatrix=0)
osgUtil::RenderLeaf
Definition RenderLeaf:34
osg::CopyOp
Definition CopyOp:41
osg::Object
Definition Object:61
osg::StateAttribute
Definition StateAttribute:77
osg::State
Definition State:80
osg::ref_ptr
Definition ref_ptr:32
osgUtil
Definition NodeVisitor:25
osg::Matrix
Matrixd Matrix
Definition Matrix:27
osg::RefMatrix
RefMatrixd RefMatrix
Definition Matrix:28
OSGUTIL_EXPORT
#define OSGUTIL_EXPORT
Definition osgUtil/Export:40