openscenegraph
ShadowTechnique
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 OSGSHADOW_SHADOWEDTECHNIQUE
15#define OSGSHADOW_SHADOWEDTECHNIQUE 1
16
17#include <osg/buffered_value>
18#include <osg/Camera>
19#include <osg/Texture2D>
20#include <osg/TexGenNode>
21#include <osgUtil/CullVisitor>
22
23#include <osgShadow/Export>
24
25namespace osgShadow {
26
27// forward declare ShadowedScene
28class ShadowedScene;
29
32{
33 public :
35
37
38 virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const ShadowTechnique*>(obj)!=NULL; } \
39 virtual const char* libraryName() const { return "osgShadow"; }\
40 virtual const char* className() const { return "ShadowTechnique"; }
41
43
44 ShadowedScene* getShadowedScene() { return _shadowedScene; }
45
46 const ShadowedScene* getShadowedScene() const { return _shadowedScene; }
47
49 virtual void init();
50
52 virtual void update(osg::NodeVisitor& nv);
53
55 virtual void cull(osgUtil::CullVisitor& cv);
56
58 virtual void cleanSceneGraph();
59
60 virtual void traverse(osg::NodeVisitor& nv);
61
63 virtual void dirty() { _dirty = true; }
64
66 virtual void resizeGLObjectBuffers(unsigned int maxSize) = 0;
67
71 virtual void releaseGLObjects(osg::State* = 0) const = 0;
72
73protected :
74
87
89
91
92 friend class ShadowedScene;
93
95 bool _dirty;
96
97};
98
99}
100
101#endif
virtual void operator()(osg::Node *, osg::NodeVisitor *nv)
ShadowTechnique * _shadowTechnique
Definition ShadowTechnique:85
Definition ShadowTechnique:32
virtual void update(osg::NodeVisitor &nv)
virtual const char * className() const
Definition ShadowTechnique:40
virtual void setShadowedScene(ShadowedScene *ss)
ShadowedScene * _shadowedScene
Definition ShadowTechnique:94
virtual void releaseGLObjects(osg::State *=0) const =0
ShadowTechnique(const ShadowTechnique &es, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
bool _dirty
Definition ShadowTechnique:95
virtual void cull(osgUtil::CullVisitor &cv)
virtual void cleanSceneGraph()
const ShadowedScene * getShadowedScene() const
Definition ShadowTechnique:46
virtual void traverse(osg::NodeVisitor &nv)
virtual void dirty()
Definition ShadowTechnique:63
virtual bool isSameKindAs(const osg::Object *obj) const
Definition ShadowTechnique:38
virtual const char * libraryName() const
Definition ShadowTechnique:39
virtual void resizeGLObjectBuffers(unsigned int maxSize)=0
osg::Vec3 computeOrthogonalVector(const osg::Vec3 &direction) const
ShadowedScene * getShadowedScene()
Definition ShadowTechnique:44
Definition ShadowedScene:29
Definition CullVisitor:49
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Definition Callback:215
Definition NodeVisitor:82
Definition Node:72
Definition Object:61
Definition State:80
Definition Vec3f:29
Definition ConvexPolyhedron:33
#define OSGSHADOW_EXPORT
Definition osgShadow/Export:39
#define NULL
Definition osg/Export:55