1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
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.
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.
14#ifndef OSG_CONVEXPLANAROCCLUDER
15#define OSG_CONVEXPLANAROCCLUDER 1
17#include <osg/ConvexPlanarPolygon>
24/** A class for representing convex clipping volumes made up of several ConvexPlanarPolygon. */
25class OSG_EXPORT ConvexPlanarOccluder : public Object
30 ConvexPlanarOccluder():Object() {}
31 ConvexPlanarOccluder(const ConvexPlanarOccluder& cpo,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
33 _occluder(cpo._occluder),
34 _holeList(cpo._holeList) {}
36 META_Object(osg,ConvexPlanarOccluder);
38 void setOccluder(const ConvexPlanarPolygon& cpp) { _occluder = cpp; }
40 ConvexPlanarPolygon& getOccluder() { return _occluder; }
42 const ConvexPlanarPolygon& getOccluder() const { return _occluder; }
46 typedef std::vector<ConvexPlanarPolygon> HoleList;
48 void addHole(const ConvexPlanarPolygon& cpp) { _holeList.push_back(cpp); }
50 void setHoleList(const HoleList& holeList) { _holeList=holeList; }
52 HoleList& getHoleList() { return _holeList; }
54 const HoleList& getHoleList() const { return _holeList; }
58 ~ConvexPlanarOccluder(); // {}
60 ConvexPlanarPolygon _occluder;