+ class PreOrderBin:
+ public osgUtil::RenderBin
+ {
+ public:
+
+ PreOrderBin()
+ {}
+ PreOrderBin( const RenderBin& rhs,
+ const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY ):
+ RenderBin(rhs, copyop)
+ {}
+
+ virtual osg::Object* cloneType() const
+ {
+ return new PreOrderBin();
+ }
+ virtual osg::Object* clone(const osg::CopyOp& copyop) const
+ {
+ return new PreOrderBin(*this,copyop);
+ }
+ virtual bool isSameKindAs(const osg::Object* obj) const
+ {
+ return dynamic_cast<const PreOrderBin*>(obj) != 0L;
+ }
+ virtual const char* className() const
+ {
+ return "PreOrderBin";
+ }
+
+ virtual void sort()
+ {
+ // Do not sort to keep traversal order...
+ }
+ };
+
+#ifndef OSG_INIT_SINGLETON_PROXY
+ /**
+ * http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk/include/osg/Object
+ *
+ * Helper macro that creates a static proxy object to call singleton function
+ * on it's construction, ensuring that the singleton gets initialized at
+ * startup.
+ */
+# define OSG_INIT_SINGLETON_PROXY(ProxyName, Func)\
+ static struct ProxyName{ ProxyName() { Func; } } s_##ProxyName;
+#endif
+
+ OSG_INIT_SINGLETON_PROXY(
+ PreOrderBinProxy,
+ (osgUtil::RenderBin::addRenderBinPrototype("PreOrderBin", new PreOrderBin))
+ );
+