openscenegraph
ViewDependentShadowTechnique
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 * ViewDependentShadow codes Copyright (C) 2008 Wojciech Lewandowski
14 * Thanks to to my company http://www.ai.com.pl for allowing me free this work.
15*/
16
17#ifndef OSGSHADOW_VIEWDEPENDENTSHADOWTECHINIQUE
18#define OSGSHADOW_VIEWDEPENDENTSHADOWTECHINIQUE 1
19
20#include <osg/Identifier>
22#include <osgShadow/Export>
23#include <map>
24
25namespace osgShadow {
32#define META_ViewDependentShadowTechniqueData( ShadowTechnique, TechniqueData )\
33virtual ViewDependentShadowTechnique::ViewData * initViewDependentData \
34( osgUtil::CullVisitor *cv, ViewDependentShadowTechnique::ViewData * vd ) \
35{ \
36 TechniqueData* td = dynamic_cast<TechniqueData*>( vd ); \
37 if ( !td ) td = new TechniqueData; \
38 td->init( this, cv ); \
39 return td; \
40}
41
107{
108 public:
115
120
121
124
126 virtual void dirty();
127
129 virtual void init();
130
132 virtual void update(osg::NodeVisitor& nv);
133
135 virtual void cull(osgUtil::CullVisitor& cv);
136
138 virtual void cleanSceneGraph();
139
141 virtual void traverse(osg::NodeVisitor& nv);
142
143
145 virtual void resizeGLObjectBuffers(unsigned int maxSize);
146
150 virtual void releaseGLObjects(osg::State* = 0) const;
151
152protected:
155
162 {
163 virtual const char* className() const { return "ViewData"; }
164
168 virtual void init
170
175 virtual void cull();
176
181 virtual void dirty( bool flag );
182
186 ViewData(): _dirty( true ), _cv( NULL ), _st( NULL ) { };
187
193
197 bool _dirty;
198
203
208
209 virtual void resizeGLObjectBuffers(unsigned int /*maxSize*/) {}
210
214 virtual void releaseGLObjects(osg::State* = 0) const {}
215 };
216
222 typedef std::map< osg::ref_ptr< osg::Identifier >,
224
226
227
232
235
238
243};
244
245
246} // namespace osgShadow
247
248#endif
#define META_ViewDependentShadowTechniqueData(ShadowTechnique, TechniqueData)
Definition ViewDependentShadowTechnique:32
This class provides an object-oriented thread mutex interface.
Definition Mutex:31
Definition ShadowTechnique:32
Definition ViewDependentShadowTechnique:107
virtual void update(osg::NodeVisitor &nv)
virtual void cull(osgUtil::CullVisitor &cv)
ViewDataMap _viewDataMap
Definition ViewDependentShadowTechnique:225
std::map< osg::ref_ptr< osg::Identifier >, osg::ref_ptr< ViewData > > ViewDataMap
Definition ViewDependentShadowTechnique:223
OpenThreads::Mutex _viewDataMapMutex
Definition ViewDependentShadowTechnique:231
virtual void setViewDependentData(osgUtil::CullVisitor *cv, ViewDependentShadowTechnique::ViewData *data)
ViewDependentShadowTechnique(const ViewDependentShadowTechnique &vdst, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
virtual void traverse(osg::NodeVisitor &nv)
virtual ViewDependentShadowTechnique::ViewData * getViewDependentData(osgUtil::CullVisitor *cv)
META_Object(osgShadow, ViewDependentShadowTechnique)
virtual void resizeGLObjectBuffers(unsigned int maxSize)
virtual void releaseGLObjects(osg::State *=0) const
Definition CullVisitor:49
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Definition NodeVisitor:82
Definition Referenced:44
Definition State:80
Definition ref_ptr:32
Definition ConvexPolyhedron:33
#define OSGSHADOW_EXPORT
Definition osgShadow/Export:39
#define NULL
Definition osg/Export:55
Definition ViewDependentShadowTechnique:162
virtual void resizeGLObjectBuffers(unsigned int)
Definition ViewDependentShadowTechnique:209
bool _dirty
Definition ViewDependentShadowTechnique:197
virtual void releaseGLObjects(osg::State *=0) const
Definition ViewDependentShadowTechnique:214
ViewData()
Definition ViewDependentShadowTechnique:186
OpenThreads::Mutex _mutex
Definition ViewDependentShadowTechnique:192
virtual const char * className() const
Definition ViewDependentShadowTechnique:163
virtual void init(ViewDependentShadowTechnique *st, osgUtil::CullVisitor *cv)
osg::observer_ptr< osgUtil::CullVisitor > _cv
Definition ViewDependentShadowTechnique:202
osg::observer_ptr< ViewDependentShadowTechnique > _st
Definition ViewDependentShadowTechnique:207