OccluderNode 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #ifndef OSG_OCCLUDERNODE
  14. #define OSG_OCCLUDERNODE 1
  15. #include <osg/Group>
  16. #include <osg/ConvexPlanarOccluder>
  17. namespace osg {
  18. /**
  19. * OccluderNode is a Group node which provides hooks for adding
  20. * ConvexPlanarOccluders to the scene.
  21. */
  22. class OSG_EXPORT OccluderNode : public Group
  23. {
  24. public :
  25. OccluderNode();
  26. /** Copy constructor using CopyOp to manage deep vs shallow copy.*/
  27. OccluderNode(const OccluderNode&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
  28. META_Node(osg, OccluderNode);
  29. /** Attach a ConvexPlanarOccluder to an OccluderNode.*/
  30. void setOccluder(ConvexPlanarOccluder* occluder) { _occluder = occluder; }
  31. /** Get the ConvexPlanarOccluder* attached to a OccluderNode. */
  32. ConvexPlanarOccluder* getOccluder() { return _occluder.get(); }
  33. /** Get the const ConvexPlanarOccluder* attached to a OccluderNode.*/
  34. const ConvexPlanarOccluder* getOccluder() const { return _occluder.get(); }
  35. /** Overrides Group's computeBound.*/
  36. virtual BoundingSphere computeBound() const;
  37. protected :
  38. virtual ~OccluderNode() {}
  39. ref_ptr<ConvexPlanarOccluder> _occluder;
  40. };
  41. }
  42. #endif