58 lines
1.5 KiB
Plaintext
58 lines
1.5 KiB
Plaintext
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
|
|
//Distributed under the terms of the GNU Library General Public License (LGPL)
|
|
//as published by the Free Software Foundation.
|
|
|
|
#ifndef OSG_CONVEXPLANAROCCLUDER
|
|
#define OSG_CONVEXPLANAROCCLUDER 1
|
|
|
|
#include <osg/ConvexPlanarPolygon>
|
|
#include <osg/Object>
|
|
|
|
namespace osg {
|
|
|
|
class OccluderVolume;
|
|
|
|
/** A class for representing convex clipping volumes made up.
|
|
* When adding planes, their normals should point inwards (into the volume) */
|
|
class SG_EXPORT ConvexPlanarOccluder : public Object
|
|
{
|
|
|
|
public:
|
|
|
|
ConvexPlanarOccluder():Object() {}
|
|
ConvexPlanarOccluder(const ConvexPlanarOccluder& cpo,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
|
Object(cpo,copyop),
|
|
_occluder(cpo._occluder),
|
|
_holeList(cpo._holeList) {}
|
|
|
|
META_Object(osg,ConvexPlanarOccluder)
|
|
|
|
void setOccluder(const ConvexPlanarPolygon& cpp) { _occluder = cpp; }
|
|
|
|
ConvexPlanarPolygon& getOccluder() { return _occluder; }
|
|
|
|
const ConvexPlanarPolygon& getOccluder() const { return _occluder; }
|
|
|
|
|
|
|
|
typedef std::vector<ConvexPlanarPolygon> HoleList;
|
|
|
|
void addHole(const ConvexPlanarPolygon& cpp) { _holeList.push_back(cpp); }
|
|
|
|
HoleList& getHoleList() { return _holeList; }
|
|
|
|
const HoleList& getHoleList() const { return _holeList; }
|
|
|
|
protected:
|
|
|
|
~ConvexPlanarOccluder() {}
|
|
|
|
ConvexPlanarPolygon _occluder;
|
|
HoleList _holeList;
|
|
|
|
};
|
|
|
|
} // end of namespace
|
|
|
|
#endif
|