|
Panda3D
|
This stores the result of a BinCullHandler traversal: an ordered collection of CullBins, each of which holds a number of Geoms and RenderStates to be rendered in some defined order. More...
#include "cullResult.h"
Public Member Functions | |
| CullResult (GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector) | |
| void | add_object (CullableObject *object, const CullTraverser *traverser) |
| Adds the indicated CullableObject to the appropriate bin. | |
| void | draw (Thread *current_thread) |
| Asks all the bins to draw themselves in the correct order. | |
| void | finish_cull (SceneSetup *scene_setup, Thread *current_thread) |
| Called after all the geoms have been added, this indicates that the cull process is finished for this frame and gives the bins a chance to do any post-processing (like sorting) before moving on to draw. | |
| CullBin * | get_bin (int bin_index) |
| Returns the CullBin associated with the indicated bin_index, or NULL if the bin_index is invalid. | |
| PointerTo< CullResult > | make_next () const |
| Returns a newly-allocated CullResult object that contains a copy of just the subset of the data from this CullResult object that is worth keeping around for next frame. | |
| PointerTo< PandaNode > | make_result_graph () |
| Returns a special scene graph constructed to represent the results of the cull. | |
Public Member Functions inherited from ReferenceCount | |
| int | get_ref_count () const |
| WeakReferenceList * | get_weak_list () const |
| Returns the WeakReferenceList associated with this ReferenceCount object. | |
| bool | has_weak_list () const |
| Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. | |
| void | local_object () |
| This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. | |
| void | ref () const |
| Explicitly increments the reference count. | |
| bool | ref_if_nonzero () const |
| Atomically increases the reference count of this object if it is not zero. | |
| bool | test_ref_count_integrity () const |
| Does some easy checks to make sure that the reference count isn't completely bogus. | |
| bool | test_ref_count_nonzero () const |
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
| virtual bool | unref () const |
| Explicitly decrements the reference count. | |
| bool | unref_if_one () const |
| Atomically decreases the reference count of this object if it is one. | |
| WeakReferenceList * | weak_ref () |
| Adds the indicated PointerToVoid as a weak reference to this object. | |
| void | weak_unref () |
| Removes the indicated PointerToVoid as a weak reference to this object. | |
Public Member Functions inherited from MemoryBase | |
| void | operator delete (void *, void *) |
| void | operator delete (void *ptr) |
| void | operator delete[] (void *, void *) |
| void | operator delete[] (void *ptr) |
| void * | operator new (size_t size) |
| void * | operator new (size_t size, void *ptr) |
| void * | operator new[] (size_t size) |
| void * | operator new[] (size_t size, void *ptr) |
Static Public Member Functions | |
| static void | bin_removed (int bin_index) |
| Intended to be called by CullBinManager::remove_bin(), this informs all the CullResults in the world to remove the indicated bin_index from their cache if it has been cached. | |
| static TypeHandle | get_class_type () |
| static void | init_type () |
Static Public Member Functions inherited from ReferenceCount | |
| static TypeHandle | get_class_type () |
| static void | init_type () |
Additional Inherited Members | |
Public Attributes inherited from ReferenceCount | |
| get_ref_count | |
| Returns the current reference count. | |
This stores the result of a BinCullHandler traversal: an ordered collection of CullBins, each of which holds a number of Geoms and RenderStates to be rendered in some defined order.
This is also used to keep the results of last frame's cull traversal around to make next frame's traversal of the same scene a little easier.
Definition at line 44 of file cullResult.h.
| CullResult::CullResult | ( | GraphicsStateGuardianBase * | gsg, |
| const PStatCollector & | draw_region_pcollector ) |
Definition at line 58 of file cullResult.cxx.
|
inline |
Definition at line 17 of file cullResult.I.
| void CullResult::add_object | ( | CullableObject * | object, |
| const CullTraverser * | traverser ) |
Adds the indicated CullableObject to the appropriate bin.
The bin becomes the owner of the object pointer, and will eventually delete it.
Definition at line 102 of file cullResult.cxx.
References CullBinManager::find_bin(), get_bin(), CullBinAttrib::get_bin_name, CullTraverser::get_current_thread(), CullTraverser::get_effective_incomplete_render(), CullBinManager::get_global_ptr(), RenderModeAttrib::get_mode, RescaleNormalAttrib::get_mode, TransparencyAttrib::get_mode, and CullableObject::munge_geom().
|
static |
Intended to be called by CullBinManager::remove_bin(), this informs all the CullResults in the world to remove the indicated bin_index from their cache if it has been cached.
Definition at line 343 of file cullResult.cxx.
Referenced by CullBinManager::remove_bin().
| void CullResult::draw | ( | Thread * | current_thread | ) |
Asks all the bins to draw themselves in the correct order.
Definition at line 289 of file cullResult.cxx.
References CullBinManager::get_bin, CullBinManager::get_global_ptr(), and CullBinManager::get_num_bins.
| void CullResult::finish_cull | ( | SceneSetup * | scene_setup, |
| Thread * | current_thread ) |
Called after all the geoms have been added, this indicates that the cull process is finished for this frame and gives the bins a chance to do any post-processing (like sorting) before moving on to draw.
Definition at line 267 of file cullResult.cxx.
References CullBin::finish_cull(), CullBinManager::get_bin_active(), and CullBinManager::get_global_ptr().
|
inline |
Returns the CullBin associated with the indicated bin_index, or NULL if the bin_index is invalid.
If there is the first time this bin_index has been requested for this CullResult, creates a new CullBin object on the fly.
Definition at line 26 of file cullResult.I.
Referenced by add_object().
|
inlinestatic |
Definition at line 92 of file cullResult.h.
|
inlinestatic |
Definition at line 95 of file cullResult.h.
| PointerTo< CullResult > CullResult::make_next | ( | ) | const |
Returns a newly-allocated CullResult object that contains a copy of just the subset of the data from this CullResult object that is worth keeping around for next frame.
Definition at line 78 of file cullResult.cxx.
References CullBinManager::get_bin_type(), CullBinManager::get_global_ptr(), and CullBin::make_next().
Returns a special scene graph constructed to represent the results of the cull.
This will be a hierarchy of nodes, one node for each bin, each of which will in term be a parent of a number of GeomNodes, representing the geometry drawn in each bin.
This is useful mainly for high-level debugging and abstraction tools; it should not be mistaken for the low-level cull result itself. For the low- level cull result, use draw() to efficiently draw the culled scene.
Definition at line 319 of file cullResult.cxx.
References CullBinManager::get_bin, CullBinManager::get_global_ptr(), CullBinManager::get_num_bins, and make_result_graph().
Referenced by DisplayRegion::make_cull_result_graph(), and make_result_graph().