#include <renderEffects.h>
Inheritance diagram for RenderEffects:
Public Member Functions | |
virtual | ~RenderEffects () |
The destructor is responsible for removing the RenderEffects from the global set if it is there. | |
bool | operator< (const RenderEffects &other) const |
Provides an arbitrary ordering among all unique RenderEffectss, so we can store the essentially different ones in a big set and throw away the rest. | |
bool | safe_to_transform () const |
Returns true if all of the effects in this set can safely be transformed, and therefore the complete set can be transformed, by calling xform(). | |
bool | safe_to_combine () const |
Returns true if all of the effects in this set can safely be shared with a sibling node that has the exact same set of effects, or false if this would be bad for any of the effects. | |
ConstPointerTo< RenderEffects > | xform (const LMatrix4f &mat) const |
Returns a new RenderEffects transformed by the indicated matrix. | |
bool | is_empty () const |
Returns true if the state is empty, false otherwise. | |
int | get_num_effects () const |
Returns the number of separate effects indicated in the state. | |
const RenderEffect * | get_effect (int n) const |
Returns the nth effect in the state. | |
int | find_effect (TypeHandle type) const |
Searches for an effect with the indicated type in the state, and returns its index if it is found, or -1 if it is not. | |
ConstPointerTo< RenderEffects > | add_effect (const RenderEffect *effect) const |
Returns a new RenderEffects object that represents the same as the source state, with the new RenderEffect added. | |
ConstPointerTo< RenderEffects > | remove_effect (TypeHandle type) const |
Returns a new RenderEffects object that represents the same as the source state, with the indicated RenderEffect removed. | |
const RenderEffect * | get_effect (TypeHandle type) const |
Looks for a RenderEffect of the indicated type in the state, and returns it if it is found, or NULL if it is not. | |
void | output (ostream &out) const |
void | write (ostream &out, int indent_level) const |
const BillboardEffect * | get_billboard () const |
This function is provided as an optimization, to speed up the render-time checking for the existance of a BillboardEffect on this state. | |
bool | has_decal () const |
This function is provided as an optimization, to speed up the render-time checking for the existance of a DecalEffect on this state. | |
const CompassEffect * | get_compass () const |
This function is provided as an optimization, to speed up the render-time checking for the existance of a CompassEffect on this state. | |
bool | has_show_bounds () const |
This function is provided as an optimization, to speed up the render-time checking for the existance of a ShowBoundsEffect on this state. | |
virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
Writes the contents of this object to the datagram for shipping out to a Bam file. | |
virtual int | complete_pointers (TypedWritable **plist, BamReader *manager) |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). | |
virtual void | finalize () |
Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed. | |
virtual TypeHandle | get_type () const |
virtual TypeHandle | force_init_type () |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
int | get_ref_count () const |
Returns the current reference count. | |
int | ref () const |
Explicitly increments the reference count. | |
int | unref () const |
Explicitly decrements the reference count. | |
void | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
Static Public Member Functions | |
ConstPointerTo< RenderEffects > | make_empty () |
Returns a RenderEffects with no effects set. | |
ConstPointerTo< RenderEffects > | make (const RenderEffect *effect) |
Returns a RenderEffects with one effect set. | |
ConstPointerTo< RenderEffects > | make (const RenderEffect *effect1, const RenderEffect *effect2) |
Returns a RenderEffects with two effects set. | |
ConstPointerTo< RenderEffects > | make (const RenderEffect *effect1, const RenderEffect *effect2, const RenderEffect *effect3) |
Returns a RenderEffects with three effects set. | |
ConstPointerTo< RenderEffects > | make (const RenderEffect *effect1, const RenderEffect *effect2, const RenderEffect *effect3, const RenderEffect *effect4) |
Returns a RenderEffects with four effects set. | |
void | register_with_read_factory () |
Tells the BamReader how to create objects of type RenderEffects. | |
TypedWritable * | change_this (TypedWritable *old_ptr, BamReader *manager) |
Called immediately after complete_pointers(), this gives the object a chance to adjust its own pointer if desired. | |
TypeHandle | get_class_type () |
void | init_type () |
Static Public Attributes | |
TypedWritable *const | Null = (TypedWritable*)0L |
Protected Member Functions | |
RenderEffects () | |
Actually, this could be a private constructor, since no one inherits from RenderEffects, but gcc gives us a spurious warning if all constructors are private. | |
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 RenderEffects. | |
Static Protected Member Functions | |
TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
This function is called by the BamReader's factory when a new object of type RenderEffects is encountered in the Bam file. | |
Private Types | |
typedef pset< const RenderEffects *, IndirectLess< RenderEffects > > | States |
typedef ov_set< Effect > | Effects |
enum | Flags { F_checked_billboard = 0x0001, F_checked_decal = 0x0002, F_has_decal = 0x0004, F_checked_show_bounds = 0x0008, F_has_show_bounds = 0x0010, F_checked_compass = 0x0020 } |
Private Member Functions | |
RenderEffects (const RenderEffects ©) | |
RenderEffectss are not meant to be copied. | |
void | operator= (const RenderEffects ©) |
RenderEffectss are not meant to be copied. | |
void | determine_billboard () |
This is the private implementation of get_billboard(). | |
void | determine_decal () |
This is the private implementation of has_decal(). | |
void | determine_compass () |
This is the private implementation of has_compass(). | |
void | determine_show_bounds () |
This is the private implementation of has_show_bounds(). | |
Static Private Member Functions | |
ConstPointerTo< RenderEffects > | return_new (RenderEffects *state) |
This function is used to share a common RenderEffects pointer for all equivalent RenderEffects objects. | |
Private Attributes | |
States::iterator | _saved_entry |
Effects | _effects |
const BillboardEffect * | _billboard |
const CompassEffect * | _compass |
short | _flags |
Static Private Attributes | |
States | _states |
ConstPointerTo< RenderEffects > | _empty_state |
TypeHandle | _type_handle |
You should not attempt to create or modify a RenderEffects object directly. Instead, call one of the make() functions to create one for you. And instead of modifying a RenderEffects object, create a new one.
Definition at line 60 of file renderEffects.h.
|
Definition at line 143 of file renderEffects.h. |
|
Definition at line 118 of file renderEffects.h. |
|
Definition at line 151 of file renderEffects.h. |
|
Actually, this could be a private constructor, since no one inherits from RenderEffects, but gcc gives us a spurious warning if all constructors are private.
Definition at line 51 of file renderEffects.cxx. References nassertv. |
|
RenderEffectss are not meant to be copied.
Definition at line 65 of file renderEffects.cxx. |
|
The destructor is responsible for removing the RenderEffects from the global set if it is there.
Definition at line 93 of file renderEffects.cxx. References _effects. |
|
Returns a new RenderEffects object that represents the same as the source state, with the new RenderEffect added. If there is already a RenderEffect with the same type, it is replaced. Definition at line 352 of file renderEffects.cxx. References _effects. |
|
Called immediately after complete_pointers(), this gives the object a chance to adjust its own pointer if desired. Most objects don't change pointers after completion, but some need to. Once this function has been called, the old pointer will no longer be accessed. Definition at line 698 of file renderEffects.cxx. Referenced by register_with_read_factory(). |
|
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). Returns the number of pointers processed. Reimplemented from TypedWritable. Definition at line 655 of file renderEffects.cxx. |
|
This is the private implementation of get_billboard().
Definition at line 540 of file renderEffects.cxx. |
|
This is the private implementation of has_compass().
Definition at line 575 of file renderEffects.cxx. References BamReader::register_finalize(). |
|
This is the private implementation of has_decal().
Definition at line 558 of file renderEffects.cxx. References CPT, DCAST, and return_new(). |
|
This is the private implementation of has_show_bounds().
Definition at line 593 of file renderEffects.cxx. References ReferenceCount::get_ref_count(), nassertv, and ReferenceCount::unref(). |
|
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new RenderEffects.
Reimplemented from TypedWritable. Definition at line 783 of file renderEffects.cxx. Referenced by register_with_read_factory(). |
|
Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.
Reimplemented from TypedWritable. Definition at line 731 of file renderEffects.cxx. |
|
Searches for an effect with the indicated type in the state, and returns its index if it is found, or -1 if it is not.
Definition at line 230 of file renderEffects.cxx. |
|
Reimplemented from TypedWritableReferenceCount. Definition at line 184 of file renderEffects.h. |
|
This function is provided as an optimization, to speed up the render-time checking for the existance of a BillboardEffect on this state. It returns a pointer to the BillboardEffect, if there is one, or NULL if there is not. Definition at line 205 of file renderEffects.I. References _flags, F_checked_show_bounds, F_has_show_bounds, and INLINE. |
|
Reimplemented from TypedWritableReferenceCount. Definition at line 173 of file renderEffects.h. |
|
This function is provided as an optimization, to speed up the render-time checking for the existance of a CompassEffect on this state. It returns a pointer to the CompassEffect, if there is one, or NULL if there is not. Definition at line 261 of file renderEffects.I. |
|
Looks for a RenderEffect of the indicated type in the state, and returns it if it is found, or NULL if it is not.
Definition at line 429 of file renderEffects.cxx. |
|
Returns the nth effect in the state.
Definition at line 183 of file renderEffects.I. References _compass, _flags, F_checked_compass, and INLINE. |
|
Returns the number of separate effects indicated in the state.
Definition at line 170 of file renderEffects.I. References _flags, F_checked_decal, F_has_decal, and INLINE. |
|
Returns the current reference count.
Definition at line 183 of file referenceCount.I. Referenced by RenderState::determine_bin_index(), determine_show_bounds(), FontPool::ns_garbage_collect(), TexturePool::ns_garbage_collect(), MaterialPool::ns_get_material(), and TexturePool::ns_release_texture(). |
|
Reimplemented from TypedWritableReferenceCount. Definition at line 181 of file renderEffects.h. |
|
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index(). Definition at line 71 of file typedObject.I. References TypeHandle::get_name(), TypedObject::get_type(), and INLINE. |
|
This function is provided as an optimization, to speed up the render-time checking for the existance of a DecalEffect on this state. It returns true if a DecalEffect exists, false otherwise. Note that since there is no additional information stored on the DecalEffect, there's no point in returning it if it exists. Definition at line 235 of file renderEffects.I. |
|
This function is provided as an optimization, to speed up the render-time checking for the existance of a ShowBoundsEffect on this state. It returns true if a ShowBoundsEffect exists, false otherwise. Note that since there is no additional information stored on the ShowBoundsEffect, there's no point in returning it if it exists. Definition at line 291 of file renderEffects.I. Referenced by CullTraverser::traverse(). |
|
Reimplemented from TypedWritableReferenceCount. Definition at line 176 of file renderEffects.h. |
|
Returns true if the state is empty, false otherwise.
Definition at line 155 of file renderEffects.I. Referenced by safe_to_transform(). |
|
Returns true if the current object is the indicated type exactly.
Definition at line 101 of file typedObject.I. Referenced by PT(), and CollisionNode::xform(). |
|
|
Returns a RenderEffects with four effects set.
Definition at line 323 of file renderEffects.cxx. References _effects, and return_new(). |
|
Returns a RenderEffects with three effects set.
Definition at line 302 of file renderEffects.cxx. |
|
Returns a RenderEffects with two effects set.
Definition at line 283 of file renderEffects.cxx. References _effects. |
|
Returns a RenderEffects with one effect set.
Definition at line 267 of file renderEffects.cxx. |
|
Returns a RenderEffects with no effects set.
Definition at line 247 of file renderEffects.cxx. Referenced by PandaNode::has_attrib(). |
|
This function is called by the BamReader's factory when a new object of type RenderEffects is encountered in the Bam file. It should create the RenderEffects and extract its information from the file. Definition at line 758 of file renderEffects.cxx. |
|
Provides an arbitrary ordering among all unique RenderEffectss, so we can store the essentially different ones in a big set and throw away the rest. This method is not needed outside of the RenderEffects class because all equivalent RenderEffects objects are guaranteed to share the same pointer; thus, a pointer comparison is always sufficient. Definition at line 124 of file renderEffects.cxx. References RenderEffects::Effect::_effect, and _effects. |
|
RenderEffectss are not meant to be copied.
Definition at line 78 of file renderEffects.cxx. References _saved_entry, and _states. |
|
Definition at line 447 of file renderEffects.cxx. References _flags, and F_checked_billboard. Referenced by init_type(). |
|
Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. Definition at line 225 of file referenceCount.I. Referenced by ClientDevice::ClientDevice(), EggGroupNode::find_textures(), EggGroupNode::r_apply_texmats(), EggGroupNode::r_flatten_transforms(), and EggGroupNode::reverse_vertex_ordering(). |
|
Tells the BamReader how to create objects of type RenderEffects.
Definition at line 612 of file renderEffects.cxx. References change_this(), fillin(), parse_params(), and BamReader::register_change_this(). |
|
Returns a new RenderEffects object that represents the same as the source state, with the indicated RenderEffect removed.
Definition at line 398 of file renderEffects.cxx. References _saved_entry, _states, CPT, nassertr, and NULL. |
|
This function is used to share a common RenderEffects pointer for all equivalent RenderEffects objects. See the similar logic in RenderEffect. The idea is to create a new RenderEffects object and pass it through this function, which will share the pointer with a previously-created RenderEffects object if it is equivalent. Definition at line 505 of file renderEffects.cxx. References RenderEffects::Effect::_effect, _effects, Datagram::add_uint16(), nassertv, PN_uint16, TypedWritable::write_datagram(), and BamWriter::write_pointer(). Referenced by determine_decal(), make(), safe_to_transform(), and xform(). |
|
Returns true if all of the effects in this set can safely be shared with a sibling node that has the exact same set of effects, or false if this would be bad for any of the effects.
Definition at line 172 of file renderEffects.cxx. References _effects. |
|
Returns true if all of the effects in this set can safely be transformed, and therefore the complete set can be transformed, by calling xform().
Definition at line 145 of file renderEffects.cxx. References RenderEffects::Effect::_effect, _effects, is_empty(), and return_new(). |
|
Does some easy checks to make sure that the reference count isn't completely bogus.
Definition at line 328 of file referenceCount.I. References INLINE. Referenced by EggNode::determine_bin(), and ReferenceCount::~ReferenceCount(). |
|
Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. Definition at line 293 of file referenceCount.I. References INLINE. Referenced by RenderState::determine_bin_index(), and determine_show_bounds(). |
|
Definition at line 473 of file renderEffects.cxx. |
|
Writes the contents of this object to the datagram for shipping out to a Bam file.
Implements TypedWritableReferenceCount. Definition at line 627 of file renderEffects.cxx. |
|
Returns a new RenderEffects transformed by the indicated matrix.
Definition at line 195 of file renderEffects.cxx. References _empty_state, NULL, and return_new(). |
|
Definition at line 148 of file renderEffects.h. |
|
Definition at line 149 of file renderEffects.h. Referenced by get_effect(), and write(). |
|
Definition at line 144 of file renderEffects.h. Referenced by add_effect(), make(), operator<(), return_new(), safe_to_combine(), safe_to_transform(), and ~RenderEffects(). |
|
Definition at line 35 of file renderEffects.cxx. Referenced by xform(). |
|
Definition at line 159 of file renderEffects.h. Referenced by get_billboard(), get_effect(), get_num_effects(), and output(). |
|
Definition at line 125 of file renderEffects.h. Referenced by operator=(), and remove_effect(). |
|
Definition at line 34 of file renderEffects.cxx. Referenced by operator=(), and remove_effect(). |
|
Reimplemented from TypedWritableReferenceCount. Definition at line 36 of file renderEffects.cxx. |
|
Definition at line 25 of file typedWritable.cxx. Referenced by Child::complete_pointers(), Parent::complete_pointers(), Person::complete_pointers(), LoaderFileTypeBam::get_extension(), PartGroup::pick_channel_index(), BamReader::read_pointer(), and AnimGroup::write_datagram(). |