| 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 | |
|---|
| 14 | #ifndef OSG_CONVEXPLANAROCCLUDER |
|---|
| 15 | #define OSG_CONVEXPLANAROCCLUDER 1 |
|---|
| 16 | |
|---|
| 17 | #include <osg/ConvexPlanarPolygon> |
|---|
| 18 | #include <osg/Object> |
|---|
| 19 | |
|---|
| 20 | namespace osg { |
|---|
| 21 | |
|---|
| 22 | class OccluderVolume; |
|---|
| 23 | |
|---|
| 24 | /** A class for representing convex clipping volumes made up of several ConvexPlanarPolygon. */ |
|---|
| 25 | class OSG_EXPORT ConvexPlanarOccluder : public Object |
|---|
| 26 | { |
|---|
| 27 | |
|---|
| 28 | public: |
|---|
| 29 | |
|---|
| 30 | ConvexPlanarOccluder():Object() {} |
|---|
| 31 | ConvexPlanarOccluder(const ConvexPlanarOccluder& cpo,const CopyOp& copyop=CopyOp::SHALLOW_COPY): |
|---|
| 32 | Object(cpo,copyop), |
|---|
| 33 | _occluder(cpo._occluder), |
|---|
| 34 | _holeList(cpo._holeList) {} |
|---|
| 35 | |
|---|
| 36 | META_Object(osg,ConvexPlanarOccluder); |
|---|
| 37 | |
|---|
| 38 | void setOccluder(const ConvexPlanarPolygon& cpp) { _occluder = cpp; } |
|---|
| 39 | |
|---|
| 40 | ConvexPlanarPolygon& getOccluder() { return _occluder; } |
|---|
| 41 | |
|---|
| 42 | const ConvexPlanarPolygon& getOccluder() const { return _occluder; } |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | typedef std::vector<ConvexPlanarPolygon> HoleList; |
|---|
| 47 | |
|---|
| 48 | void addHole(const ConvexPlanarPolygon& cpp) { _holeList.push_back(cpp); } |
|---|
| 49 | |
|---|
| 50 | void setHoleList(const HoleList& holeList) { _holeList=holeList; } |
|---|
| 51 | |
|---|
| 52 | HoleList& getHoleList() { return _holeList; } |
|---|
| 53 | |
|---|
| 54 | const HoleList& getHoleList() const { return _holeList; } |
|---|
| 55 | |
|---|
| 56 | protected: |
|---|
| 57 | |
|---|
| 58 | ~ConvexPlanarOccluder(); // {} |
|---|
| 59 | |
|---|
| 60 | ConvexPlanarPolygon _occluder; |
|---|
| 61 | HoleList _holeList; |
|---|
| 62 | |
|---|
| 63 | }; |
|---|
| 64 | |
|---|
| 65 | } // end of namespace |
|---|
| 66 | |
|---|
| 67 | #endif |
|---|