osgUtil::RenderBin Class Reference

`#include <RenderBin>`

Inheritance diagram for osgUtil::RenderBin:

## Classes

struct | SortCallback
struct | DrawCallback

## Public Types

enum | SortMode { SORT_BY_STATE , SORT_BY_STATE_THEN_FRONT_TO_BACK , SORT_FRONT_TO_BACK , SORT_BACK_TO_FRONT , TRAVERSAL_ORDER }
typedef std::vector< RenderLeaf * > | RenderLeafList
typedef std::vector< StateGraph * > | StateGraphList
typedef std::map< int, osg::ref_ptr< RenderBin > > | RenderBinList
Public Types inherited from osg::Object
enum | DataVariance { DYNAMIC , STATIC , UNSPECIFIED }

## Public Member Functions

| RenderBin ()
| RenderBin (SortMode mode)
| RenderBin (const RenderBin &rhs, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
virtual osg::Object * | cloneType () const
virtual osg::Object * | clone (const osg::CopyOp &copyop) const
virtual bool | isSameKindAs (const osg::Object *obj) const
virtual const char * | libraryName () const
virtual const char * | className () const
virtual void | reset ()
void | setStateGraph (StateGraph *sg)
StateGraph * | getStateGraph ()
void | setStateSet (osg::StateSet *stateset)
osg::StateSet * | getStateSet ()
const osg::StateSet * | getStateSet () const
RenderBin * | getParent ()
const RenderBin * | getParent () const
RenderStage * | getStage ()
const RenderStage * | getStage () const
int | getBinNum () const
StateGraphList & | getStateGraphList ()
const StateGraphList & | getStateGraphList () const
RenderBinList & | getRenderBinList ()
const RenderBinList & | getRenderBinList () const
RenderLeafList & | getRenderLeafList ()
const RenderLeafList & | getRenderLeafList () const
RenderBin * | find_or_insert (int binNum, const std::string &binName)
void | addStateGraph (StateGraph *rg)
virtual void | sort ()
virtual void | sortImplementation ()
void | setSortMode (SortMode mode)
SortMode | getSortMode () const
virtual void | sortByState ()
virtual void | sortByStateThenFrontToBack ()
virtual void | sortFrontToBack ()
virtual void | sortBackToFront ()
virtual void | sortTraversalOrder ()
void | setSortCallback (SortCallback *sortCallback)
SortCallback * | getSortCallback ()
const SortCallback * | getSortCallback () const
virtual void | draw (osg::RenderInfo &renderInfo, RenderLeaf *&previous)
virtual void | drawImplementation (osg::RenderInfo &renderInfo, RenderLeaf *&previous)
void | setDrawCallback (DrawCallback *drawCallback)
DrawCallback * | getDrawCallback ()
const DrawCallback * | getDrawCallback () const
bool | getStats (Statistics &primStats) const
virtual unsigned int | computeNumberOfDynamicRenderLeaves () const
void | copyLeavesFromStateGraphListToRenderLeafList ()
virtual void | releaseGLObjects (osg::State *state=0) const
Public Member Functions inherited from osg::Object
| Object ()
| Object (bool threadSafeRefUnref)
| Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
std::string | getCompoundClassName () const
virtual Node * | asNode ()
virtual const Node * | asNode () const
virtual NodeVisitor * | asNodeVisitor ()
virtual const NodeVisitor * | asNodeVisitor () const
virtual StateSet * | asStateSet ()
virtual const StateSet * | asStateSet () const
virtual StateAttribute * | asStateAttribute ()
virtual const StateAttribute * | asStateAttribute () const
virtual Uniform * | asUniform ()
virtual const Uniform * | asUniform () const
virtual Camera * | asCamera ()
virtual const Camera * | asCamera () const
virtual Drawable * | asDrawable ()
virtual const Drawable * | asDrawable () const
virtual Callback * | asCallback ()
virtual const Callback * | asCallback () const
virtual CallbackObject * | asCallbackObject ()
virtual const CallbackObject * | asCallbackObject () const
virtual UserDataContainer * | asUserDataContainer ()
virtual const UserDataContainer * | asUserDataContainer () const
virtual ValueObject * | asValueObject ()
virtual const ValueObject * | asValueObject () const
virtual Image * | asImage ()
virtual const Image * | asImage () const
virtual void | setThreadSafeRefUnref (bool threadSafe)
virtual void | setName (const std::string &name)
void | setName (const char *name)
const std::string & | getName () const
void | setDataVariance (DataVariance dv)
DataVariance | getDataVariance () const
virtual void | computeDataVariance ()
void | setUserDataContainer (osg::UserDataContainer *udc)
template<class T>
void | setUserDataContainer (const ref_ptr< T > &udc)
osg::UserDataContainer * | getUserDataContainer ()
const osg::UserDataContainer * | getUserDataContainer () const
osg::UserDataContainer * | getOrCreateUserDataContainer ()
virtual void | setUserData (Referenced *obj)
template<class T>
void | setUserData (const ref_ptr< T > &ud)
virtual Referenced * | getUserData ()
virtual const Referenced * | getUserData () const
template<typename T>
bool | getUserValue (const std::string &name, T &value) const
template<typename T>
void | setUserValue (const std::string &name, const T &value)
virtual void | resizeGLObjectBuffers (unsigned int)
template<typename T>
BoolValueObject UCharValueObject UShortValueObject UIntValueObject DoubleValueObject Vec3fValueObject Vec2dValueObject Vec4dValueObject PlaneValueObject MatrixdValueObject BoundingBoxdValueObject BoundingSpheredValueObject bool | getUserValue (const std::string &name, T &value) const
Public Member Functions inherited from osg::Referenced
| Referenced ()
| Referenced (bool threadSafeRefUnref)
| Referenced (const Referenced &)
Referenced & | operator= (const Referenced &)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () const
void | addObserver (Observer *observer) const
void | removeObserver (Observer *observer) const

## Static Public Member Functions

static RenderBin * | createRenderBin (const std::string &binName)
static RenderBin * | getRenderBinPrototype (const std::string &binName)
static void | addRenderBinPrototype (const std::string &binName, RenderBin *proto)
static void | removeRenderBinPrototype (RenderBin *proto)
static void | setDefaultRenderBinSortMode (SortMode mode)
static SortMode | getDefaultRenderBinSortMode ()
Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()

## Protected Member Functions

virtual | ~RenderBin ()
Protected Member Functions inherited from osg::Object
virtual | ~Object ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const

## Protected Attributes

osg::ref_ptr< StateGraph > | _rootStateGraph
int | _binNum
RenderBin * | _parent
RenderStage * | _stage
RenderBinList | _bins
StateGraphList | _stateGraphList
RenderLeafList | _renderLeafList
bool | _sorted
SortMode | _sortMode
osg::ref_ptr< SortCallback > | _sortCallback
osg::ref_ptr< DrawCallback > | _drawCallback
osg::ref_ptr< osg::StateSet > | _stateset
Protected Attributes inherited from osg::Object
std::string | _name
DataVariance | _dataVariance
osg::UserDataContainer * | _userDataContainer
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr | _observerSet
OpenThreads::Atomic | _refCount

## Detailed Description

RenderBin base class. Renderbin contains geometries to be rendered as a group, renderbins are rendered once each. They can improve efficiency or use different rendering algorithms. A renderBin can contain further renderBins producing a tree hierarchy of renderBins.

## Member Typedef Documentation

## RenderBinList

typedef std::map< int, osg::ref_ptr<RenderBin> > osgUtil::RenderBin::RenderBinList

## RenderLeafList

typedef std::vector<RenderLeaf*> osgUtil::RenderBin::RenderLeafList

## StateGraphList

typedef std::vector<StateGraph*> osgUtil::RenderBin::StateGraphList

## Member Enumeration Documentation

## SortMode

enum osgUtil::RenderBin::SortMode

Enumerator
SORT_BY_STATE |
SORT_BY_STATE_THEN_FRONT_TO_BACK |
SORT_FRONT_TO_BACK |
SORT_BACK_TO_FRONT |
TRAVERSAL_ORDER |

## Constructor & Destructor Documentation

## RenderBin() [1/3]

osgUtil::RenderBin::RenderBin | ( |  | ) |

Referenced by addRenderBinPrototype(), clone(), cloneType(), createRenderBin(), osgUtil::RenderBin::DrawCallback::drawImplementation(), find_or_insert(), getParent(), getParent(), getRenderBinPrototype(), isSameKindAs(), removeRenderBinPrototype(), RenderBin(), and osgUtil::RenderBin::SortCallback::sortImplementation().

## RenderBin() [2/3]

osgUtil::RenderBin::RenderBin | ( | SortMode | mode | ) |

## RenderBin() [3/3]

osgUtil::RenderBin::RenderBin | ( | const RenderBin & | rhs,
|  | const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY )

Copy constructor using CopyOp to manage deep vs shallow copy.

References RenderBin(), and osg::CopyOp::SHALLOW_COPY.

## ~RenderBin()

virtual osgUtil::RenderBin::~RenderBin | ( |  | ) |

protected virtual

## Member Function Documentation

## addRenderBinPrototype()

void osgUtil::RenderBin::addRenderBinPrototype | ( | const std::string & | binName,
|  | RenderBin * | proto )

static

References RenderBin().

## addStateGraph()

void osgUtil::RenderBin::addStateGraph | ( | StateGraph * | rg | ) |

inline

References _stateGraphList.

## className()

virtual const char * osgUtil::RenderBin::className | ( |  | ) | const

inline virtual

return the name of the object's class type. Must be defined by derived classes.

Implements osg::Object.

Reimplemented in osgUtil::RenderStage.

## clone()

virtual osg::Object * osgUtil::RenderBin::clone | ( | const osg::CopyOp & |  | ) | const

inline virtual

Clone an object, with Object* return type. Must be defined by derived classes.

Implements osg::Object.

Reimplemented in osgUtil::RenderStage.

References RenderBin().

## cloneType()

virtual osg::Object * osgUtil::RenderBin::cloneType | ( |  | ) | const

inline virtual

Clone the type of an object, with Object* return type. Must be defined by derived classes.

Implements osg::Object.

Reimplemented in osgUtil::RenderStage.

References RenderBin().

## computeNumberOfDynamicRenderLeaves()

virtual unsigned int osgUtil::RenderBin::computeNumberOfDynamicRenderLeaves | ( |  | ) | const

virtual

Compute the number of dynamic RenderLeaves.

Reimplemented in osgUtil::RenderStage.

## copyLeavesFromStateGraphListToRenderLeafList()

void osgUtil::RenderBin::copyLeavesFromStateGraphListToRenderLeafList | ( |  | ) |

## createRenderBin()

RenderBin * osgUtil::RenderBin::createRenderBin | ( | const std::string & | binName | ) |

static

References RenderBin().

## draw()

virtual void osgUtil::RenderBin::draw | ( | osg::RenderInfo & | renderInfo,
|  | RenderLeaf *& | previous )

virtual

Reimplemented in osgUtil::RenderStage.

## drawImplementation()

virtual void osgUtil::RenderBin::drawImplementation | ( | osg::RenderInfo & | renderInfo,
|  | RenderLeaf *& | previous )

virtual

Reimplemented in osgUtil::RenderStage.

## find_or_insert()

RenderBin * osgUtil::RenderBin::find_or_insert | ( | int | binNum,
|  | const std::string & | binName )

References RenderBin().

## getBinNum()

int osgUtil::RenderBin::getBinNum | ( |  | ) | const

inline

References _binNum.

## getDefaultRenderBinSortMode()

SortMode osgUtil::RenderBin::getDefaultRenderBinSortMode | ( |  | ) |

static

## getDrawCallback() [1/2]

DrawCallback * osgUtil::RenderBin::getDrawCallback | ( |  | ) |

inline

References _drawCallback.

## getDrawCallback() [2/2]

const DrawCallback * osgUtil::RenderBin::getDrawCallback | ( |  | ) | const

inline

References _drawCallback.

## getParent() [1/2]

RenderBin * osgUtil::RenderBin::getParent | ( |  | ) |

inline

References _parent, and RenderBin().

## getParent() [2/2]

const RenderBin * osgUtil::RenderBin::getParent | ( |  | ) | const

inline

References _parent, and RenderBin().

## getRenderBinList() [1/2]

RenderBinList & osgUtil::RenderBin::getRenderBinList | ( |  | ) |

inline

References _bins.

## getRenderBinList() [2/2]

const RenderBinList & osgUtil::RenderBin::getRenderBinList | ( |  | ) | const

inline

References _bins.

## getRenderBinPrototype()

RenderBin * osgUtil::RenderBin::getRenderBinPrototype | ( | const std::string & | binName | ) |

static

References RenderBin().

## getRenderLeafList() [1/2]

RenderLeafList & osgUtil::RenderBin::getRenderLeafList | ( |  | ) |

inline

References _renderLeafList.

## getRenderLeafList() [2/2]

const RenderLeafList & osgUtil::RenderBin::getRenderLeafList | ( |  | ) | const

inline

References _renderLeafList.

## getSortCallback() [1/2]

SortCallback * osgUtil::RenderBin::getSortCallback | ( |  | ) |

inline

References _sortCallback.

## getSortCallback() [2/2]

const SortCallback * osgUtil::RenderBin::getSortCallback | ( |  | ) | const

inline

References _sortCallback.

## getSortMode()

SortMode osgUtil::RenderBin::getSortMode | ( |  | ) | const

inline

References _sortMode.

## getStage() [1/2]

RenderStage * osgUtil::RenderBin::getStage | ( |  | ) |

inline

References _stage.

## getStage() [2/2]

const RenderStage * osgUtil::RenderBin::getStage | ( |  | ) | const

inline

References _stage.

## getStateGraph()

StateGraph * osgUtil::RenderBin::getStateGraph | ( |  | ) |

inline

References _rootStateGraph.

## getStateGraphList() [1/2]

StateGraphList & osgUtil::RenderBin::getStateGraphList | ( |  | ) |

inline

References _stateGraphList.

## getStateGraphList() [2/2]

const StateGraphList & osgUtil::RenderBin::getStateGraphList | ( |  | ) | const

inline

References _stateGraphList.

## getStateSet() [1/2]

osg::StateSet * osgUtil::RenderBin::getStateSet | ( |  | ) |

inline

References _stateset.

## getStateSet() [2/2]

const osg::StateSet * osgUtil::RenderBin::getStateSet | ( |  | ) | const

inline

References _stateset.

## getStats()

bool osgUtil::RenderBin::getStats | ( | Statistics & | primStats | ) | const

Extract stats for current draw list.

## isSameKindAs()

virtual bool osgUtil::RenderBin::isSameKindAs | ( | const osg::Object * | obj | ) | const

inline virtual

Reimplemented from osg::Object.

Reimplemented in osgUtil::RenderStage.

References RenderBin().

## libraryName()

virtual const char * osgUtil::RenderBin::libraryName | ( |  | ) | const

inline virtual

return the name of the object's library. Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name.

Implements osg::Object.

## releaseGLObjects()

virtual void osgUtil::RenderBin::releaseGLObjects | ( | osg::State * | state = 0 | ) | const

virtual

If State is non-zero, this function releases any associated OpenGL objects for the specified graphics context. Otherwise, releases OpenGL objexts for all graphics contexts.

Reimplemented from osg::Object.

Reimplemented in osgUtil::RenderStage.

## removeRenderBinPrototype()

void osgUtil::RenderBin::removeRenderBinPrototype | ( | RenderBin * | proto | ) |

static

References RenderBin().

## reset()

virtual void osgUtil::RenderBin::reset | ( |  | ) |

virtual

Reimplemented in osgUtil::RenderStage.

## setDefaultRenderBinSortMode()

void osgUtil::RenderBin::setDefaultRenderBinSortMode | ( | SortMode | mode | ) |

static

## setDrawCallback()

void osgUtil::RenderBin::setDrawCallback | ( | DrawCallback * | drawCallback | ) |

inline

References _drawCallback.

## setSortCallback()

void osgUtil::RenderBin::setSortCallback | ( | SortCallback * | sortCallback | ) |

inline

References _sortCallback.

## setSortMode()

void osgUtil::RenderBin::setSortMode | ( | SortMode | mode | ) |

## setStateGraph()

void osgUtil::RenderBin::setStateGraph | ( | StateGraph * | sg | ) |

inline

References _rootStateGraph.

## setStateSet()

void osgUtil::RenderBin::setStateSet | ( | osg::StateSet * | stateset | ) |

inline

References _stateset.

## sort()

virtual void osgUtil::RenderBin::sort | ( |  | ) |

virtual

Reimplemented in osgUtil::RenderStage.

## sortBackToFront()

virtual void osgUtil::RenderBin::sortBackToFront | ( |  | ) |

virtual

## sortByState()

virtual void osgUtil::RenderBin::sortByState | ( |  | ) |

virtual

## sortByStateThenFrontToBack()

virtual void osgUtil::RenderBin::sortByStateThenFrontToBack | ( |  | ) |

virtual

## sortFrontToBack()

virtual void osgUtil::RenderBin::sortFrontToBack | ( |  | ) |

virtual

## sortImplementation()

virtual void osgUtil::RenderBin::sortImplementation | ( |  | ) |

virtual

## sortTraversalOrder()

virtual void osgUtil::RenderBin::sortTraversalOrder | ( |  | ) |

virtual

## Member Data Documentation

## _binNum

int osgUtil::RenderBin::_binNum

protected

Referenced by getBinNum().

## _bins

RenderBinList osgUtil::RenderBin::_bins

protected

Referenced by getRenderBinList(), and getRenderBinList().

## _drawCallback

osg::ref_ptr<DrawCallback> osgUtil::RenderBin::_drawCallback

protected

Referenced by getDrawCallback(), getDrawCallback(), and setDrawCallback().

## _parent

RenderBin* osgUtil::RenderBin::_parent

protected

Referenced by getParent(), and getParent().

## _renderLeafList

RenderLeafList osgUtil::RenderBin::_renderLeafList

protected

Referenced by getRenderLeafList(), and getRenderLeafList().

## _rootStateGraph

osg::ref_ptr<StateGraph> osgUtil::RenderBin::_rootStateGraph

protected

Referenced by getStateGraph(), and setStateGraph().

## _sortCallback

osg::ref_ptr<SortCallback> osgUtil::RenderBin::_sortCallback

protected

Referenced by getSortCallback(), getSortCallback(), and setSortCallback().

## _sorted

bool osgUtil::RenderBin::_sorted

protected

## _sortMode

SortMode osgUtil::RenderBin::_sortMode

protected

Referenced by getSortMode().

## _stage

RenderStage* osgUtil::RenderBin::_stage

protected

Referenced by getStage(), and getStage().

## _stateGraphList

StateGraphList osgUtil::RenderBin::_stateGraphList

protected

Referenced by addStateGraph(), getStateGraphList(), and getStateGraphList().

## _stateset

osg::ref_ptr<osg::StateSet> osgUtil::RenderBin::_stateset

protected

Referenced by getStateSet(), getStateSet(), and setStateSet().

The documentation for this class was generated from the following file:

- RenderBin