2002-07-17 04:07:32 +08:00
|
|
|
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
|
2001-10-04 23:12:57 +08:00
|
|
|
//Distributed under the terms of the GNU Library General Public License (LGPL)
|
|
|
|
//as published by the Free Software Foundation.
|
|
|
|
|
2001-09-20 05:19:47 +08:00
|
|
|
#ifndef OSGUTIL_DEPTHSORTEDBIN
|
|
|
|
#define OSGUTIL_DEPTHSORTEDBIN 1
|
|
|
|
|
|
|
|
#include <osgUtil/RenderBin>
|
|
|
|
|
|
|
|
namespace osgUtil {
|
|
|
|
|
|
|
|
class OSGUTIL_EXPORT DepthSortedBin : public RenderBin
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
DepthSortedBin();
|
|
|
|
|
2002-07-21 07:54:55 +08:00
|
|
|
virtual osg::Object* cloneType() const { return osgNew DepthSortedBin(); }
|
|
|
|
virtual osg::Object* clone(const osg::CopyOp&) const { return osgNew DepthSortedBin(); } // note only implements a clone of type.
|
2001-09-20 05:19:47 +08:00
|
|
|
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const DepthSortedBin*>(obj)!=0L; }
|
2002-06-06 21:25:36 +08:00
|
|
|
virtual const char* libraryName() const { return "osgUtil"; }
|
2001-09-20 05:19:47 +08:00
|
|
|
virtual const char* className() const { return "DepthSortedBin"; }
|
|
|
|
|
|
|
|
virtual void reset();
|
|
|
|
|
|
|
|
virtual void sort_local();
|
|
|
|
|
|
|
|
virtual void draw_local(osg::State& state,RenderLeaf*& previous);
|
|
|
|
|
|
|
|
enum DrawOrder
|
|
|
|
{
|
|
|
|
FRONT_TO_BACK,
|
|
|
|
BACK_TO_FRONT
|
|
|
|
};
|
|
|
|
|
|
|
|
void setDrawOrder(const DrawOrder drawOrder) { _drawOrder = drawOrder; }
|
|
|
|
|
|
|
|
const DrawOrder getDrawOrder() const { return _drawOrder; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
virtual ~DepthSortedBin();
|
|
|
|
|
|
|
|
DrawOrder _drawOrder;
|
2002-05-28 18:24:43 +08:00
|
|
|
//RenderLeafList _renderLeafList;
|
2001-09-20 05:19:47 +08:00
|
|
|
};
|
|
|
|
|
2002-02-03 20:33:41 +08:00
|
|
|
}
|
2001-09-20 05:19:47 +08:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|