#include <builderBucket.h>
Inheritance diagram for BuilderBucket:
Public Member Functions | |
BuilderBucket () | |
BuilderBucket (const BuilderBucket ©) | |
BuilderBucket & | operator= (const BuilderBucket ©) |
virtual | ~BuilderBucket () |
virtual BuilderBucket * | make_copy () const |
Allocates and returns a new copy of this object. | |
virtual GeomNode * | make_geom_node () |
Called by the builder when it is time to create a new GeomNode. | |
virtual Geom * | done_geom (Geom *geom) |
Called after all the geometry has been added to the Geom. | |
void | add_attrib (const RenderAttrib *attrib) |
A convenience function to add the indicated render attribute to the bucket's state. | |
virtual bool | operator< (const BuilderBucket &other) const |
Defines an arbitrary ordering among different buckets, and groups identical buckets together. | |
void | set_coords (const PTA_Vertexf &coords) |
Sets the array that will be used to define the vertices for any indexed geometry that is associated with this bucket. | |
PTA_Vertexf | get_coords () const |
void | set_normals (const PTA_Normalf &normals) |
Sets the array that will be used to define the normals for any indexed geometry that is associated with this bucket. | |
PTA_Normalf | get_normals () const |
void | set_texcoords (const PTA_TexCoordf &texcoords) |
Sets the array that will be used to define the texture coordinates for any indexed geometry that is associated with this bucket. | |
PTA_TexCoordf | get_texcoords () const |
void | set_colors (const PTA_Colorf &colors) |
Sets the array that will be used to define the colors for any indexed geometry that is associated with this bucket. | |
PTA_Colorf | get_colors () const |
virtual void | output (ostream &out) const |
Formats the bucket for output in some sensible way. | |
bool | operator< (const BuilderProperties &other) const |
Defines an arbitrary ordering among different properties, and groups identical sets of properties together. | |
void | set_name (const string &name) |
void | clear_name () |
Resets the Namable's name to empty. | |
bool | has_name () const |
Returns true if the Namable has a nonempty name set, false if the name is empty. | |
const string & | get_name () const |
Static Public Member Functions | |
BuilderBucket * | get_default_bucket () |
Returns a pointer to the BuilderBucket that is used to initialize any BuilderBuckets created with a default constructor. | |
TypeHandle | get_class_type () |
void | init_type () |
Public Attributes | |
PandaNode * | _node |
short | _drawBin |
unsigned int | _drawOrder |
ConstPointerTo< RenderState > | _state |
bool | _mesh |
bool | _retesselate_coplanar |
bool | _unroll_fans |
bool | _show_tstrips |
bool | _show_qsheets |
bool | _show_quads |
bool | _show_normals |
double | _normal_scale |
BuilderC | _normal_color |
bool | _subdivide_polys |
double | _coplanar_threshold |
bool | _consider_fans |
double | _max_tfan_angle |
int | _min_tfan_tris |
Protected Member Functions | |
int | sort_value () const |
Returns a number for grouping properties. | |
Protected Attributes | |
PTA_Vertexf | _coords |
PTA_Normalf | _normals |
PTA_TexCoordf | _texcoords |
PTA_Colorf | _colors |
Static Protected Attributes | |
BuilderBucket * | _default_bucket = NULL |
Private Member Functions | |
BuilderBucket (int) | |
This special constructor is used only to initialize the _default_bucket pointer. |
See the comments at the beginning of builder.h.
As each primitive is added to the builder, it is associated with a bucket. The bucket stores the scene-graph properties of the primitive, and is used to identify primitives that have the same properties and thus may be joined into a common triangle strip.
This grouping is done via the ordering operator, <, which defines an arbitrary ordering for buckets and identifies those buckets which are equivalent to each other. By subclassing off of BuilderBucket and redefining this operator, you can change the grouping behavior to suit your needs, if necessary.
Definition at line 79 of file builderBucket.h.
|
Definition at line 41 of file builderBucket.cxx. Referenced by ~BuilderBucket(). |
|
Definition at line 55 of file builderBucket.cxx. References _colors, _coords, _normals, _texcoords, Namable::get_name(), set_colors(), set_coords(), Namable::set_name(), set_normals(), and set_texcoords(). |
|
Definition at line 97 of file builderBucket.cxx. References BuilderBucket(). |
|
This special constructor is used only to initialize the _default_bucket pointer. It sets up the initial defaults. The normal constructor copies from this instance. Definition at line 304 of file builderBucket.cxx. |
|
A convenience function to add the indicated render attribute to the bucket's state.
Definition at line 176 of file builderBucket.cxx. References _colors, _drawBin, _drawOrder, and _state. |
|
Resets the Namable's name to empty.
Definition at line 82 of file namable.I. References Namable::_name, and INLINE. |
|
Called after all the geometry has been added to the Geom. This is just a hook for the user to redefine to do any post-processing that may be desired on the geometry. It may deallocate it and return a new copy. If it returns NULL, the geom is discarded. Definition at line 161 of file builderBucket.cxx. References _coords, _node, _normals, _texcoords, and Namable::get_name(). |
|
|
Definition at line 142 of file builderBucket.I. |
|
Definition at line 49 of file builderBucket.I. References _normals, and INLINE. Referenced by BuilderVertex::get_color_value(). |
|
Returns a pointer to the BuilderBucket that is used to initialize any BuilderBuckets created with a default constructor. This is just a convenient way to set some global parameters. Definition at line 162 of file builderBucket.I. |
|
|
Definition at line 80 of file builderBucket.I. References _texcoords, and INLINE. Referenced by BuilderVertexI::set_coord_value(). |
|
Definition at line 111 of file builderBucket.I. References _colors. |
|
Returns true if the Namable has a nonempty name set, false if the name is empty.
Definition at line 97 of file namable.I. References Namable::get_name(), and INLINE. Referenced by EggGroupUniquifier::EggGroupUniquifier(), Texture::read(), and Texture::Texture(). |
|
|
Allocates and returns a new copy of this object. If you are subclassing from BuilderBucket, you must redefine this to return an instance of your new subclass, because the Builder will call this function to get its own copy. Definition at line 118 of file builderBucket.cxx. |
|
Called by the builder when it is time to create a new GeomNode. This function should allocate and return a new GeomNode suitable for adding geometry to. You may redefine it to return a subclass of GeomNode, or to do some initialization to the node. Definition at line 140 of file builderBucket.cxx. References _state. |
|
Defines an arbitrary ordering among different properties, and groups identical sets of properties together. This operator is used for the more important task of grouping BuilderBuckets together; see the comments for the similar function in builderBucket.cxx. Definition at line 43 of file builderProperties.cxx. References BuilderProperties::_max_tfan_angle. |
|
Defines an arbitrary ordering among different buckets, and groups identical buckets together. (Buckets a and b are identical if !(a < b) and !(b < a).) The actual order between different buckets is arbitrary and largely irrelevant, so long as it is consistent. That is, if (a < b) and (b < c), it must also be true that (a < c). Also, if (a < b), it cannot be true that (b < a). Definition at line 209 of file builderBucket.cxx. |
|
Definition at line 69 of file builderBucket.cxx. References _drawBin, _drawOrder, _node, and _state. |
|
Formats the bucket for output in some sensible way.
Reimplemented from BuilderProperties. Definition at line 248 of file builderBucket.cxx. References BuilderProperties::_consider_fans, BuilderProperties::_coplanar_threshold, _drawBin, _drawOrder, BuilderProperties::_max_tfan_angle, BuilderProperties::_mesh, BuilderProperties::_min_tfan_tris, _node, BuilderProperties::_normal_color, BuilderProperties::_normal_scale, BuilderProperties::_retesselate_coplanar, BuilderProperties::_show_normals, BuilderProperties::_show_qsheets, BuilderProperties::_show_quads, BuilderProperties::_show_tstrips, _state, BuilderProperties::_subdivide_polys, BuilderProperties::_unroll_fans, and NULL. |
|
Sets the array that will be used to define the colors for any indexed geometry that is associated with this bucket.
Definition at line 129 of file builderBucket.I. References _default_bucket. Referenced by BuilderBucket(). |
|
Sets the array that will be used to define the vertices for any indexed geometry that is associated with this bucket.
Definition at line 37 of file builderBucket.I. References _coords, and INLINE. Referenced by BuilderBucket(). |
|
Definition at line 69 of file namable.I. References Namable::_name. Referenced by BuilderBucket(), SceneGraphReducer::do_flatten_siblings(), Texture::read(), PandaNode::reparent(), and Texture::Texture(). |
|
Sets the array that will be used to define the normals for any indexed geometry that is associated with this bucket.
Definition at line 67 of file builderBucket.I. References _texcoords, and INLINE. Referenced by BuilderBucket(). |
|
Sets the array that will be used to define the texture coordinates for any indexed geometry that is associated with this bucket.
Definition at line 98 of file builderBucket.I. References _colors, and INLINE. Referenced by BuilderBucket(). |
|
Returns a number for grouping properties. This is used as a helper function to the ordering operator, above. It simply collects all the booleans together into a single number. Definition at line 137 of file builderProperties.cxx. |
|
Definition at line 120 of file builderBucket.h. Referenced by add_attrib(), BuilderBucket(), get_texcoords(), and set_texcoords(). |
|
Definition at line 124 of file builderProperties.h. Referenced by output(). |
|
Definition at line 117 of file builderBucket.h. Referenced by BuilderBucket(), done_geom(), and set_coords(). |
|
Definition at line 119 of file builderProperties.h. Referenced by MesherStrip< PrimType >::mate(), and output(). |
|
Definition at line 30 of file builderBucket.cxx. Referenced by set_colors(). |
|
Definition at line 111 of file builderBucket.h. Referenced by add_attrib(), operator=(), and output(). |
|
Definition at line 112 of file builderBucket.h. Referenced by add_attrib(), operator=(), and output(). |
|
Definition at line 129 of file builderProperties.h. Referenced by BuilderProperties::operator<(), and output(). |
|
Definition at line 72 of file builderProperties.h. Referenced by expand_lines(), and output(). |
|
Definition at line 136 of file builderProperties.h. Referenced by output(). |
|
Definition at line 109 of file builderBucket.h. Referenced by BuilderBucket(), done_geom(), operator=(), and output(). |
|
Definition at line 109 of file builderProperties.h. Referenced by output(). |
|
Definition at line 108 of file builderProperties.h. Referenced by output(). |
|
Definition at line 118 of file builderBucket.h. Referenced by BuilderBucket(), done_geom(), get_coords(), and operator<(). |
|
Definition at line 78 of file builderProperties.h. Referenced by MesherStrip< PrimType >::mate(), and output(). |
|
Definition at line 107 of file builderProperties.h. Referenced by output(). |
|
Definition at line 97 of file builderProperties.h. Referenced by output(). |
|
Definition at line 103 of file builderProperties.h. Referenced by output(). |
|
Definition at line 92 of file builderProperties.h. Referenced by output(). |
|
Definition at line 114 of file builderBucket.h. Referenced by add_attrib(), make_geom_node(), operator=(), and output(). |
|
Definition at line 113 of file builderProperties.h. Referenced by expand_lines(), and output(). |
|
Definition at line 119 of file builderBucket.h. Referenced by BuilderBucket(), done_geom(), get_normals(), and set_normals(). |
|
Definition at line 84 of file builderProperties.h. Referenced by output(). |