Panda3D
|
Assigns geometry to a particular bin by name. More...
#include "cullBinAttrib.h"
Public Member Functions | |
virtual TypeHandle | force_init_type () |
const string & | get_bin_name () const |
Returns the name of the bin this attribute specifies. | |
int | get_draw_order () const |
Returns the draw order this attribute specifies. | |
virtual int | get_slot () const |
virtual TypeHandle | get_type () const |
virtual void | output (ostream &out) const |
virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
Writes the contents of this object to the datagram for shipping out to a Bam file. | |
Static Public Member Functions | |
static | CPT (RenderAttrib) make(const string &bin_name |
static | CPT (RenderAttrib) make_default() |
static int | get_class_slot () |
static TypeHandle | get_class_type () |
static void | init_type () |
static void | register_with_read_factory () |
Tells the BamReader how to create objects of type CullBinAttrib. | |
Public Attributes | |
static int | draw_order |
Protected Member Functions | |
virtual int | compare_to_impl (const RenderAttrib *other) const |
Intended to be overridden by derived CullBinAttrib types to return a unique number indicating whether this CullBinAttrib is equivalent to the other one. | |
void | fillin (DatagramIterator &scan, BamReader *manager) |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new CullBinAttrib. | |
virtual size_t | get_hash_impl () const |
Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties. | |
Static Protected Member Functions | |
static TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
This function is called by the BamReader's factory when a new object of type CullBinAttrib is encountered in the Bam file. |
Assigns geometry to a particular bin by name.
The bins must be created separately via the CullBinManager interface.
Definition at line 30 of file cullBinAttrib.h.
int CullBinAttrib::compare_to_impl | ( | const RenderAttrib * | other | ) | const [protected, virtual] |
Intended to be overridden by derived CullBinAttrib types to return a unique number indicating whether this CullBinAttrib is equivalent to the other one.
This should return 0 if the two CullBinAttrib objects are equivalent, a number less than zero if this one should be sorted before the other one, and a number greater than zero otherwise.
This will only be called with two CullBinAttrib objects whose get_type() functions return the same.
Reimplemented from RenderAttrib.
Definition at line 86 of file cullBinAttrib.cxx.
void CullBinAttrib::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new CullBinAttrib.
Reimplemented from RenderAttrib.
Definition at line 166 of file cullBinAttrib.cxx.
References DatagramIterator::get_int32(), and DatagramIterator::get_string().
Referenced by make_from_bam().
const string & CullBinAttrib::get_bin_name | ( | ) | const [inline] |
Returns the name of the bin this attribute specifies.
If this is the empty string, it refers to the default bin.
Definition at line 35 of file cullBinAttrib.I.
Referenced by CullResult::add_object(), and NodePath::get_bin_name().
int CullBinAttrib::get_draw_order | ( | ) | const [inline] |
Returns the draw order this attribute specifies.
Some bins (in particular, CullBinFixed bins) use this to further specify the order in which objects should be rendered.
Definition at line 48 of file cullBinAttrib.I.
Referenced by NodePath::get_bin_draw_order().
size_t CullBinAttrib::get_hash_impl | ( | ) | const [protected, virtual] |
Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties.
RenderAttribs that compare the same with compare_to_impl(), above, should return the same hash; RenderAttribs that compare differently should return a different hash.
Reimplemented from RenderAttrib.
Definition at line 106 of file cullBinAttrib.cxx.
References sequence_hash< Key, Compare >::add_hash(), and integer_hash< Key, Compare >::add_hash().
TypedWritable * CullBinAttrib::make_from_bam | ( | const FactoryParams & | params | ) | [static, protected] |
This function is called by the BamReader's factory when a new object of type CullBinAttrib is encountered in the Bam file.
It should create the CullBinAttrib and extract its information from the file.
Definition at line 147 of file cullBinAttrib.cxx.
References fillin().
Referenced by register_with_read_factory().
void CullBinAttrib::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type CullBinAttrib.
Definition at line 120 of file cullBinAttrib.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from RenderAttrib.
Definition at line 131 of file cullBinAttrib.cxx.
References Datagram::add_int32(), and Datagram::add_string().