OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
osgUtil::RenderBin Class Reference

#include <RenderBin.h>

Inheritance diagram for osgUtil::RenderBin:
Inheritance graph
[legend]
Collaboration diagram for osgUtil::RenderBin:
Collaboration graph
[legend]

Classes

struct  DrawCallback
 
struct  SortCallback
 

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::ObjectcloneType () const
 
virtual osg::Objectclone (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 setStateSet (osg::StateSet *stateset)
 
osg::StateSetgetStateSet ()
 
const osg::StateSetgetStateSet () const
 
RenderBingetParent ()
 
const RenderBingetParent () const
 
RenderStagegetStage ()
 
const RenderStagegetStage () const
 
int getBinNum () const
 
StateGraphListgetStateGraphList ()
 
const StateGraphListgetStateGraphList () const
 
RenderBinListgetRenderBinList ()
 
const RenderBinListgetRenderBinList () const
 
RenderLeafListgetRenderLeafList ()
 
const RenderLeafListgetRenderLeafList () const
 
RenderBinfind_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)
 
SortCallbackgetSortCallback ()
 
const SortCallbackgetSortCallback () const
 
virtual void draw (osg::RenderInfo &renderInfo, RenderLeaf *&previous)
 
virtual void drawImplementation (osg::RenderInfo &renderInfo, RenderLeaf *&previous)
 
void setDrawCallback (DrawCallback *drawCallback)
 
DrawCallbackgetDrawCallback ()
 
const DrawCallbackgetDrawCallback () 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 NodeasNode ()
 
virtual const NodeasNode () const
 
virtual NodeVisitorasNodeVisitor ()
 
virtual const NodeVisitorasNodeVisitor () const
 
virtual StateAttributeasStateAttribute ()
 
virtual const StateAttributeasStateAttribute () const
 
virtual UniformasUniform ()
 
virtual const UniformasUniform () 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)
 
osg::UserDataContainergetUserDataContainer ()
 
const osg::UserDataContainergetUserDataContainer () const
 
osg::UserDataContainergetOrCreateUserDataContainer ()
 
virtual void setUserData (Referenced *obj)
 
virtual ReferencedgetUserData ()
 
virtual const ReferencedgetUserData () 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 &)
 
Referencedoperator= (const Referenced &)
 
bool getThreadSafeRefUnref () const
 
OpenThreads::MutexgetRefMutex () const
 
int ref () const
 
int unref () const
 
int unref_nodelete () const
 
int referenceCount () const
 
ObserverSetgetObserverSet () const
 
ObserverSetgetOrCreateObserverSet () const
 
void addObserver (Observer *observer) const
 
void removeObserver (Observer *observer) const
 

Static Public Member Functions

static RenderBincreateRenderBin (const std::string &binName)
 
static RenderBingetRenderBinPrototype (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::MutexgetGlobalReferencedMutex ()
 
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 
static bool getThreadSafeReferenceCounting ()
 
static void setDeleteHandler (DeleteHandler *handler)
 
static DeleteHandlergetDeleteHandler ()
 

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

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.

Definition at line 33 of file RenderBin.h.

Member Typedef Documentation

Definition at line 39 of file RenderBin.h.

Definition at line 37 of file RenderBin.h.

Definition at line 38 of file RenderBin.h.

Member Enumeration Documentation

Enumerator
SORT_BY_STATE 
SORT_BY_STATE_THEN_FRONT_TO_BACK 
SORT_FRONT_TO_BACK 
SORT_BACK_TO_FRONT 
TRAVERSAL_ORDER 

Definition at line 41 of file RenderBin.h.

Constructor & Destructor Documentation

osgUtil::RenderBin::RenderBin ( )
osgUtil::RenderBin::RenderBin ( SortMode  mode)
osgUtil::RenderBin::RenderBin ( const RenderBin rhs,
const osg::CopyOp copyop = osg::CopyOp::SHALLOW_COPY 
)

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osgUtil::RenderBin::~RenderBin ( )
protectedvirtual

Member Function Documentation

static void osgUtil::RenderBin::addRenderBinPrototype ( const std::string &  binName,
RenderBin proto 
)
static
void osgUtil::RenderBin::addStateGraph ( StateGraph rg)
inline

Definition at line 101 of file RenderBin.h.

Here is the caller graph for this function:

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

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

Implements osg::Object.

Reimplemented in osgUtil::RenderStage.

Definition at line 72 of file RenderBin.h.

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

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

Implements osg::Object.

Reimplemented in osgUtil::RenderStage.

Definition at line 69 of file RenderBin.h.

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

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

Implements osg::Object.

Reimplemented in osgUtil::RenderStage.

Definition at line 68 of file RenderBin.h.

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

Compute the number of dynamic RenderLeaves.

Reimplemented in osgUtil::RenderStage.

void osgUtil::RenderBin::copyLeavesFromStateGraphListToRenderLeafList ( )
static RenderBin* osgUtil::RenderBin::createRenderBin ( const std::string &  binName)
static
virtual void osgUtil::RenderBin::draw ( osg::RenderInfo renderInfo,
RenderLeaf *&  previous 
)
virtual

Reimplemented in osgUtil::RenderStage.

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

Reimplemented in osgUtil::RenderStage.

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

Definition at line 87 of file RenderBin.h.

static SortMode osgUtil::RenderBin::getDefaultRenderBinSortMode ( )
static
DrawCallback* osgUtil::RenderBin::getDrawCallback ( )
inline

Definition at line 140 of file RenderBin.h.

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

Definition at line 141 of file RenderBin.h.

RenderBin* osgUtil::RenderBin::getParent ( )
inline

Definition at line 81 of file RenderBin.h.

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

Definition at line 82 of file RenderBin.h.

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

Definition at line 92 of file RenderBin.h.

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

Definition at line 93 of file RenderBin.h.

static RenderBin* osgUtil::RenderBin::getRenderBinPrototype ( const std::string &  binName)
static
RenderLeafList& osgUtil::RenderBin::getRenderLeafList ( )
inline

Definition at line 95 of file RenderBin.h.

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

Definition at line 96 of file RenderBin.h.

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

Definition at line 125 of file RenderBin.h.

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

Definition at line 126 of file RenderBin.h.

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

Definition at line 111 of file RenderBin.h.

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

Definition at line 84 of file RenderBin.h.

Here is the caller graph for this function:

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

Definition at line 85 of file RenderBin.h.

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

Definition at line 89 of file RenderBin.h.

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

Definition at line 90 of file RenderBin.h.

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

Definition at line 77 of file RenderBin.h.

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

Definition at line 78 of file RenderBin.h.

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

Extract stats for current draw list.

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

Reimplemented from osg::Object.

Reimplemented in osgUtil::RenderStage.

Definition at line 70 of file RenderBin.h.

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

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.

Definition at line 71 of file RenderBin.h.

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.

static void osgUtil::RenderBin::removeRenderBinPrototype ( RenderBin proto)
static
virtual void osgUtil::RenderBin::reset ( )
virtual

Reimplemented in osgUtil::RenderStage.

static void osgUtil::RenderBin::setDefaultRenderBinSortMode ( SortMode  mode)
static
void osgUtil::RenderBin::setDrawCallback ( DrawCallback drawCallback)
inline

Definition at line 139 of file RenderBin.h.

void osgUtil::RenderBin::setSortCallback ( SortCallback sortCallback)
inline

Definition at line 124 of file RenderBin.h.

void osgUtil::RenderBin::setSortMode ( SortMode  mode)
void osgUtil::RenderBin::setStateSet ( osg::StateSet stateset)
inline

Definition at line 76 of file RenderBin.h.

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

Reimplemented in osgUtil::RenderStage.

virtual void osgUtil::RenderBin::sortBackToFront ( )
virtual
virtual void osgUtil::RenderBin::sortByState ( )
virtual
virtual void osgUtil::RenderBin::sortByStateThenFrontToBack ( )
virtual
virtual void osgUtil::RenderBin::sortFrontToBack ( )
virtual
virtual void osgUtil::RenderBin::sortImplementation ( )
virtual
virtual void osgUtil::RenderBin::sortTraversalOrder ( )
virtual

Member Data Documentation

int osgUtil::RenderBin::_binNum
protected

Definition at line 160 of file RenderBin.h.

RenderBinList osgUtil::RenderBin::_bins
protected

Definition at line 163 of file RenderBin.h.

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

Definition at line 171 of file RenderBin.h.

RenderBin* osgUtil::RenderBin::_parent
protected

Definition at line 161 of file RenderBin.h.

RenderLeafList osgUtil::RenderBin::_renderLeafList
protected

Definition at line 165 of file RenderBin.h.

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

Definition at line 169 of file RenderBin.h.

bool osgUtil::RenderBin::_sorted
protected

Definition at line 167 of file RenderBin.h.

SortMode osgUtil::RenderBin::_sortMode
protected

Definition at line 168 of file RenderBin.h.

RenderStage* osgUtil::RenderBin::_stage
protected

Definition at line 162 of file RenderBin.h.

StateGraphList osgUtil::RenderBin::_stateGraphList
protected

Definition at line 164 of file RenderBin.h.

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

Definition at line 173 of file RenderBin.h.


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