2012-03-22 01:36:20 +08:00
|
|
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
2003-01-22 00:45:36 +08:00
|
|
|
*
|
2012-03-22 01:36:20 +08:00
|
|
|
* This library is open source and may be redistributed and/or modified under
|
|
|
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
2003-01-22 00:45:36 +08:00
|
|
|
* (at your option) any later version. The full license is in LICENSE file
|
|
|
|
* included with this distribution, and on the openscenegraph.org website.
|
2012-03-22 01:36:20 +08:00
|
|
|
*
|
2003-01-22 00:45:36 +08:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2012-03-22 01:36:20 +08:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2003-01-22 00:45:36 +08:00
|
|
|
* OpenSceneGraph Public License for more details.
|
|
|
|
*/
|
2002-05-29 07:43:22 +08:00
|
|
|
|
2002-08-29 19:02:01 +08:00
|
|
|
#ifndef OSG_CONVEXPLANAROCCLUDER
|
|
|
|
#define OSG_CONVEXPLANAROCCLUDER 1
|
2002-05-29 07:43:22 +08:00
|
|
|
|
2002-08-29 19:02:01 +08:00
|
|
|
#include <osg/ConvexPlanarPolygon>
|
2002-06-20 00:06:03 +08:00
|
|
|
#include <osg/Object>
|
2002-05-29 07:43:22 +08:00
|
|
|
|
|
|
|
namespace osg {
|
|
|
|
|
|
|
|
class OccluderVolume;
|
|
|
|
|
2007-01-05 17:55:04 +08:00
|
|
|
/** A class for representing convex clipping volumes made up of several ConvexPlanarPolygon. */
|
2005-04-12 01:14:17 +08:00
|
|
|
class OSG_EXPORT ConvexPlanarOccluder : public Object
|
2002-05-29 07:43:22 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2002-08-29 19:02:01 +08:00
|
|
|
ConvexPlanarOccluder():Object() {}
|
|
|
|
ConvexPlanarOccluder(const ConvexPlanarOccluder& cpo,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
2002-06-20 00:06:03 +08:00
|
|
|
Object(cpo,copyop),
|
|
|
|
_occluder(cpo._occluder),
|
|
|
|
_holeList(cpo._holeList) {}
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2003-04-27 18:58:39 +08:00
|
|
|
META_Object(osg,ConvexPlanarOccluder);
|
2002-05-29 07:43:22 +08:00
|
|
|
|
2002-08-29 19:02:01 +08:00
|
|
|
void setOccluder(const ConvexPlanarPolygon& cpp) { _occluder = cpp; }
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2002-08-29 19:02:01 +08:00
|
|
|
ConvexPlanarPolygon& getOccluder() { return _occluder; }
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2002-08-29 19:02:01 +08:00
|
|
|
const ConvexPlanarPolygon& getOccluder() const { return _occluder; }
|
2012-03-22 01:36:20 +08:00
|
|
|
|
|
|
|
|
2002-05-29 07:43:22 +08:00
|
|
|
|
2002-08-29 19:02:01 +08:00
|
|
|
typedef std::vector<ConvexPlanarPolygon> HoleList;
|
2002-05-29 07:43:22 +08:00
|
|
|
|
2002-08-29 19:02:01 +08:00
|
|
|
void addHole(const ConvexPlanarPolygon& cpp) { _holeList.push_back(cpp); }
|
2002-05-29 07:43:22 +08:00
|
|
|
|
2004-12-17 09:06:33 +08:00
|
|
|
void setHoleList(const HoleList& holeList) { _holeList=holeList; }
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2005-11-18 01:44:48 +08:00
|
|
|
HoleList& getHoleList() { return _holeList; }
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2005-11-18 01:44:48 +08:00
|
|
|
const HoleList& getHoleList() const { return _holeList; }
|
2002-05-29 07:43:22 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2004-08-02 17:11:31 +08:00
|
|
|
~ConvexPlanarOccluder(); // {}
|
2002-05-29 07:43:22 +08:00
|
|
|
|
2002-08-29 19:02:01 +08:00
|
|
|
ConvexPlanarPolygon _occluder;
|
2002-05-29 07:43:22 +08:00
|
|
|
HoleList _holeList;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2005-11-18 01:44:48 +08:00
|
|
|
} // end of namespace
|
2002-05-29 07:43:22 +08:00
|
|
|
|
2012-03-22 01:36:20 +08:00
|
|
|
#endif
|