openscenegraph
CompileSlideCallback
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 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 OSG_COMPILESLIDECALLBACK
15#define OSG_COMPILESLIDECALLBACK 1
16
17#include <osgViewer/Viewer>
18#include <osgPresentation/Export>
19
20namespace osgPresentation {
21
22class OSGPRESENTATION_EXPORT CompileSlideCallback : public osg::Camera::DrawCallback
23{
24 public:
25
26 CompileSlideCallback():
27 _needCompile(false),
28 _frameNumber(0) {}
29
30 virtual void operator()(const osg::Camera& camera) const;
31
32 void needCompile(osg::Node* node) { _needCompile=true; _sceneToCompile = node; }
33
34 protected:
35
36 virtual ~CompileSlideCallback() {}
37
38 mutable bool _needCompile;
39 mutable unsigned int _frameNumber;
40 osg::ref_ptr<osg::Node> _sceneToCompile;
41
42};
43
44}
45
46#endif