OpenSceneGraph 3.6.5
PositionalStateContainer
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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 OSGUTIL_POSITIONALSTATECONTAINER
15#define OSGUTIL_POSITIONALSTATECONTAINER 1
16
17#include <osg/Object>
18#include <osg/Light>
19#include <osg/State>
20
21#include <osgUtil/RenderLeaf>
22#include <osgUtil/StateGraph>
23
24namespace osgUtil {
25
30{
31 public:
32
33
35 virtual osg::Object* cloneType() const { return new PositionalStateContainer(); }
36 virtual osg::Object* clone(const osg::CopyOp&) const { return new PositionalStateContainer(); } // note only implements a clone of type.
37 virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const PositionalStateContainer*>(obj)!=0L; }
38 virtual const char* libraryName() const { return "osgUtil"; }
39 virtual const char* className() const { return "PositionalStateContainer"; }
40
41 virtual void reset();
42
43 typedef std::pair< osg::ref_ptr<const osg::StateAttribute> , osg::ref_ptr<osg::RefMatrix> > AttrMatrixPair;
44 typedef std::vector< AttrMatrixPair > AttrMatrixList;
45 typedef std::map< unsigned int, AttrMatrixList > TexUnitAttrMatrixListMap;
46
48
50 {
51 _attrList.push_back(AttrMatrixPair(attr,matrix));
52 }
53
55
56 virtual void addPositionedTextureAttribute(unsigned int textureUnit, osg::RefMatrix* matrix,const osg::StateAttribute* attr)
57 {
58 _texAttrListMap[textureUnit].push_back(AttrMatrixPair(attr,matrix));
59 }
60
61 virtual void draw(osg::State& state,RenderLeaf*& previous, const osg::Matrix* postMultMatrix = 0);
62
63 public:
64
67
68 protected:
69
71
72};
73
74}
75
76#endif
77
Matrixd Matrix
Definition Matrix:27
RefMatrixd RefMatrix
Definition Matrix:28
The osgUtil library provides general purpose utility classes such as update, cull and draw traverses,...
Definition NodeVisitor:25
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Base class for state attributes.
Definition StateAttribute:77
TexUnitAttrMatrixListMap & getTexUnitAttrMatrixListMap()
Definition PositionalStateContainer:54
virtual const char * libraryName() const
return the name of the object's library.
Definition PositionalStateContainer:38
virtual void addPositionedAttribute(osg::RefMatrix *matrix, const osg::StateAttribute *attr)
Definition PositionalStateContainer:49
virtual osg::Object * cloneType() const
Clone the type of an object, with Object* return type.
Definition PositionalStateContainer:35
virtual bool isSameKindAs(const osg::Object *obj) const
Definition PositionalStateContainer:37
virtual osg::Object * clone(const osg::CopyOp &) const
Clone an object, with Object* return type.
Definition PositionalStateContainer:36
virtual void addPositionedTextureAttribute(unsigned int textureUnit, osg::RefMatrix *matrix, const osg::StateAttribute *attr)
Definition PositionalStateContainer:56
TexUnitAttrMatrixListMap _texAttrListMap
Definition PositionalStateContainer:66
AttrMatrixList _attrList
Definition PositionalStateContainer:65
virtual const char * className() const
return the name of the object's class type.
Definition PositionalStateContainer:39
std::map< unsigned int, AttrMatrixList > TexUnitAttrMatrixListMap
Definition PositionalStateContainer:45
std::vector< AttrMatrixPair > AttrMatrixList
Definition PositionalStateContainer:44
AttrMatrixList & getAttrMatrixList()
Definition PositionalStateContainer:47
std::pair< osg::ref_ptr< const osg::StateAttribute >, osg::ref_ptr< osg::RefMatrix > > AttrMatrixPair
Definition PositionalStateContainer:43
virtual void draw(osg::State &state, RenderLeaf *&previous, const osg::Matrix *postMultMatrix=0)
Container class for all data required for rendering of drawables.
Definition RenderLeaf:34
#define OSGUTIL_EXPORT
Definition Export:40

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.