FixedFunctionTechnique 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 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 OSGVOLUME_FIXEDFUNCTIONTECHNIQUE
  14. #define OSGVOLUME_FIXEDFUNCTIONTECHNIQUE 1
  15. #include <osgVolume/VolumeTechnique>
  16. namespace osgVolume {
  17. class OSGVOLUME_EXPORT FixedFunctionTechnique : public VolumeTechnique
  18. {
  19. public:
  20. FixedFunctionTechnique();
  21. /** Copy constructor using CopyOp to manage deep vs shallow copy.*/
  22. FixedFunctionTechnique(const FixedFunctionTechnique&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
  23. META_Object(osgVolume, FixedFunctionTechnique);
  24. virtual void init();
  25. virtual void update(osgUtil::UpdateVisitor* nv);
  26. virtual void cull(osgUtil::CullVisitor* nv);
  27. void setNumSlices(unsigned int numSlices);
  28. unsigned int getNumSlices() const { return _numSlices; }
  29. /** Clean scene graph from any terrain technique specific nodes.*/
  30. virtual void cleanSceneGraph();
  31. /** Traverse the terrain subgraph.*/
  32. virtual void traverse(osg::NodeVisitor& nv);
  33. protected:
  34. virtual ~FixedFunctionTechnique();
  35. osg::ref_ptr<osg::Node> _node;
  36. unsigned int _numSlices;
  37. };
  38. }
  39. #endif