CompileSlideCallback 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #ifndef OSG_COMPILESLIDECALLBACK
  14. #define OSG_COMPILESLIDECALLBACK 1
  15. #include <osgViewer/Viewer>
  16. #include <osgPresentation/Export>
  17. namespace osgPresentation {
  18. class OSGPRESENTATION_EXPORT CompileSlideCallback : public osg::Camera::DrawCallback
  19. {
  20. public:
  21. CompileSlideCallback():
  22. _needCompile(false),
  23. _frameNumber(0) {}
  24. virtual void operator()(const osg::Camera& camera) const;
  25. void needCompile(osg::Node* node) { _needCompile=true; _sceneToCompile = node; }
  26. protected:
  27. virtual ~CompileSlideCallback() {}
  28. mutable bool _needCompile;
  29. mutable unsigned int _frameNumber;
  30. osg::ref_ptr<osg::Node> _sceneToCompile;
  31. };
  32. }
  33. #endif