Panda3D
|
Defines the properties of a named stage of the multitexture pipeline. More...
#include "textureStage.h"
Public Types | |
enum | CombineMode { CM_undefined, CM_replace, CM_modulate, CM_add, CM_add_signed, CM_interpolate, CM_subtract, CM_dot3_rgb, CM_dot3_rgba } |
enum | CombineOperand { CO_undefined, CO_src_color, CO_one_minus_src_color, CO_src_alpha, CO_one_minus_src_alpha } |
enum | CombineSource { CS_undefined, CS_texture, CS_constant, CS_primary_color, CS_previous, CS_constant_color_scale, CS_last_saved_result } |
enum | Mode { M_modulate, M_decal, M_blend, M_replace, M_add, M_combine, M_blend_color_scale, M_modulate_glow, M_modulate_gloss, M_normal, M_normal_height, M_glow, M_gloss, M_height, M_selector } |
Public Member Functions | |
TextureStage (const string &name) | |
Initialize the texture stage at construction. | |
TextureStage (TextureStage ©) | |
Initialize the texture stage from other. | |
virtual ReferenceCount * | as_reference_count () |
Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
int | compare_to (const TextureStage &other) const |
Returns a number less than zero if this TextureStage sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent. | |
virtual int | complete_pointers (TypedWritable **plist, BamReader *manager) |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). | |
string | encode_to_bam_stream () const |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. | |
bool | encode_to_bam_stream (string &data, BamWriter *writer=NULL) const |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. | |
virtual void | finalize (BamReader *manager) |
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 | force_init_type () |
int | get_alpha_scale () const |
See set_alpha_scale(). | |
UpdateSeq | get_bam_modified () const |
Returns the current bam_modified counter. | |
int | get_best_parent_from_Set (const std::set< int > &) const |
Colorf | get_color () const |
return the color for this stage | |
CombineMode | get_combine_alpha_mode () const |
Get combine_alpha_mode. | |
CombineOperand | get_combine_alpha_operand0 () const |
Get operand0 of combine_alpha_mode. | |
CombineOperand | get_combine_alpha_operand1 () const |
Get operand1 of combine_alpha_mode. | |
CombineOperand | get_combine_alpha_operand2 () const |
Get operand2 of combine_alpha_mode. | |
CombineSource | get_combine_alpha_source0 () const |
Get source0 of combine_alpha_mode. | |
CombineSource | get_combine_alpha_source1 () const |
Get source1 of combine_alpha_mode. | |
CombineSource | get_combine_alpha_source2 () const |
Get source2 of combine_alpha_mode. | |
CombineMode | get_combine_rgb_mode () const |
Get the combine_rgb_mode. | |
CombineOperand | get_combine_rgb_operand0 () const |
Get operand0 of combine_rgb_mode. | |
CombineOperand | get_combine_rgb_operand1 () const |
Get operand1 of combine_rgb_mode. | |
CombineOperand | get_combine_rgb_operand2 () const |
Get operand2 of combine_rgb_mode. | |
CombineSource | get_combine_rgb_source0 () const |
Get source0 of combine_rgb_mode. | |
CombineSource | get_combine_rgb_source1 () const |
Get source1 of combine_rgb_mode. | |
CombineSource | get_combine_rgb_source2 () const |
Get source2 of combine_rgb_mode. | |
Mode | get_mode () const |
Return the mode of this stage. | |
const string & | get_name () const |
Returns the name of this texture stage. | |
int | get_num_combine_alpha_operands () const |
Returns the number of meaningful operands that may be retrieved via get_combine_alpha_sourceN() and get_combine_alpha_operandN(). | |
int | get_num_combine_rgb_operands () const |
Returns the number of meaningful operands that may be retrieved via get_combine_rgb_sourceN() and get_combine_rgb_operandN(). | |
int | get_priority () const |
Returns the priority associated with this stage. | |
int | get_ref_count () const |
Returns the current reference count. | |
int | get_rgb_scale () const |
See set_rgb_scale(). | |
bool | get_saved_result () const |
Returns the current setting of the saved_result flag. | |
int | get_sort () const |
Returns the sort order of this texture stage. | |
InternalName * | get_texcoord_name () const |
Returns the InternalName. | |
virtual TypeHandle | get_type () const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
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. | |
bool | involves_color_scale () const |
Returns true if the TextureStage is affected by the setting of the current ColorScaleAttrib, false otherwise. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
bool | is_fixed_function () const |
Returns true if the TextureStage is relevant to the classic fixed function pipeline. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. | |
void | mark_bam_modified () |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *, void *) |
void | operator delete[] (void *, void *) |
void * | operator new (size_t size) |
void * | operator new (size_t size, void *ptr) |
void * | operator new (size_t size, 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 * | operator new[] (size_t size, void *ptr) |
bool | operator!= (const TextureStage &other) const |
bool | operator< (const TextureStage &other) const |
void | operator= (const TextureStage ©) |
just copy the members of other to this | |
bool | operator== (const TextureStage &other) const |
void | output (ostream &out) const |
Just a single line output. | |
void | ref () const |
Explicitly increments the reference count. | |
virtual bool | require_fully_complete () const |
Some objects require all of their nested pointers to have been completed before the objects themselves can be completed. | |
void | set_alpha_scale (int alpha_scale) |
Sets an additional factor that will scale the alpha component after the texture has been applied. | |
void | set_color (const Colorf &color) |
Set the color for this stage. | |
void | set_combine_alpha (CombineMode mode, CombineSource source0, CombineOperand operand0, CombineSource source1, CombineOperand operand1, CombineSource source2, CombineOperand operand2) |
Specifies any of the CombineMode values that represent a one-parameter operation. | |
void | set_combine_alpha (CombineMode mode, CombineSource source0, CombineOperand operand0) |
Specifies any of the CombineMode values that represent a one-parameter operation. | |
void | set_combine_alpha (CombineMode mode, CombineSource source0, CombineOperand operand0, CombineSource source1, CombineOperand operand1) |
Specifies any of the CombineMode values that represent a two-parameter operation. | |
void | set_combine_rgb (CombineMode mode, CombineSource source0, CombineOperand operand0, CombineSource source1, CombineOperand operand1) |
Specifies any of the CombineMode values that represent a two-parameter operation. | |
void | set_combine_rgb (CombineMode mode, CombineSource source0, CombineOperand operand0) |
Specifies any of the CombineMode values that represent a one-parameter operation. | |
void | set_combine_rgb (CombineMode mode, CombineSource source0, CombineOperand operand0, CombineSource source1, CombineOperand operand1, CombineSource source2, CombineOperand operand2) |
Specifies any of the CombineMode values that represent a one-parameter operation. | |
void | set_mode (Mode mode) |
Set the mode of this texture stage. | |
void | set_name (const string &name) |
Changes the name of this texture stage. | |
void | set_priority (int priority) |
Changes the relative importance of the texture associated with this stage relative to the other texture stages that are applied simultaneously. | |
void | set_rgb_scale (int rgb_scale) |
Sets an additional factor that will scale all three r, g, b components after the texture has been applied. | |
void | set_saved_result (bool saved_result) |
Sets the saved_result flag. | |
void | set_sort (int sort) |
Changes the order in which the texture associated with this stage is rendered relative to the other texture stages. | |
void | set_texcoord_name (const string &texcoord_name) |
Indicate which set of UV's this texture stage will use. | |
void | set_texcoord_name (InternalName *name) |
Indicate which set of UV's this texture stage will use. | |
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. | |
virtual void | update_bam_nested (BamWriter *manager) |
Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates. | |
bool | uses_color () const |
Returns true if the TextureStage makes use of whatever color is specified in set_color(), false otherwise. | |
bool | uses_last_saved_result () const |
Returns true if the TextureStage makes use of the CS_primary_color combine source. | |
bool | uses_primary_color () const |
Returns true if the TextureStage makes use of the CS_primary_color combine source. | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. | |
void | write (ostream &out) const |
Writes the details of this stage. | |
virtual void | write_datagram (BamWriter *manager, Datagram &me) |
Function to write the important information in the particular object to a Datagram. | |
Static Public Member Functions | |
static bool | decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, const string &data, BamReader *reader=NULL) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string. | |
static TypeHandle | get_class_type () |
static TextureStage * | get_default () |
Returns the default TextureStage that will be used for all texturing that does not name a particular stage. | |
static UpdateSeq | get_sort_seq () |
Returns a global sequence number that is incremented any time any TextureStage in the world changes sort or priority. | |
static void | init_type () |
static TypedWritable * | make_TextureStage (const FactoryParams ¶ms) |
Factory method to generate a TextureStage object. | |
static | PT (TypedWritableReferenceCount) decode_from_bam_stream(const string &data |
static void | register_with_read_factory () |
Factory method to generate a TextureStage object. | |
Public Attributes | |
static BamReader * | reader = NULL) |
Static Public Attributes | |
static TypedWritable *const | Null = (TypedWritable*)0L |
Protected Member Functions | |
bool | do_test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | do_test_ref_count_nonzero () const |
Returns true if the reference count is nonzero, false otherwise. | |
void | fillin (DatagramIterator &scan, BamReader *manager) |
Function that reads out of the datagram (or asks manager to read) all of the data that is needed to re-create this object and stores it in the appropiate place. |
Defines the properties of a named stage of the multitexture pipeline.
The TextureAttrib will associated a number of these stages with Texture objects, and the GSG will render geometry by sorting all of the currently active TextureStages in order and then issuing the appropriate rendering calls to activate them.
Definition at line 38 of file textureStage.h.
TextureStage::TextureStage | ( | const string & | name | ) |
Initialize the texture stage at construction.
Definition at line 31 of file textureStage.cxx.
Referenced by get_default(), and make_TextureStage().
TextureStage::TextureStage | ( | TextureStage & | copy | ) | [inline] |
Initialize the texture stage from other.
Definition at line 22 of file textureStage.I.
ReferenceCount * TypedWritableReferenceCount::as_reference_count | ( | ) | [virtual, inherited] |
Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type.
Reimplemented from TypedWritable.
Definition at line 26 of file typedWritableReferenceCount.cxx.
TypedObject * TypedObject::as_typed_object | ( | ) | [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 99 of file typedObject.I.
const TypedObject * TypedObject::as_typed_object | ( | ) | const [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 110 of file typedObject.I.
int TextureStage::compare_to | ( | const TextureStage & | other | ) | const |
Returns a number less than zero if this TextureStage sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.
The sorting order is arbitrary and largely meaningless, except to differentiate different stages.
Definition at line 117 of file textureStage.cxx.
References get_alpha_scale(), get_combine_alpha_mode(), get_combine_alpha_operand0(), get_combine_alpha_operand1(), get_combine_alpha_operand2(), get_combine_alpha_source0(), get_combine_alpha_source1(), get_combine_alpha_source2(), get_combine_rgb_mode(), get_combine_rgb_operand0(), get_combine_rgb_operand1(), get_combine_rgb_operand2(), get_combine_rgb_source0(), get_combine_rgb_source1(), get_combine_rgb_source2(), get_mode(), get_name(), get_num_combine_alpha_operands(), get_num_combine_rgb_operands(), get_priority(), get_rgb_scale(), get_saved_result(), get_sort(), and get_texcoord_name().
int TextureStage::complete_pointers | ( | TypedWritable ** | p_list, |
BamReader * | manager | ||
) | [virtual] |
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 435 of file textureStage.cxx.
bool TypedWritable::decode_raw_from_bam_stream | ( | TypedWritable *& | ptr, |
ReferenceCount *& | ref_ptr, | ||
const string & | data, | ||
BamReader * | reader = NULL |
||
) | [static, inherited] |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string.
Returns true on success, false on on error.
This variant sets the TypedWritable and ReferenceCount pointers separately; both are pointers to the same object. The reference count is not incremented; it is the caller's responsibility to manage the reference count.
Note that this method cannot be used to retrieve objects that do not inherit from ReferenceCount, because these objects cannot persist beyond the lifetime of the BamReader that reads them. To retrieve these objects from a bam stream, you must construct a BamReader directly.
If you happen to know that the particular object in question inherits from TypedWritableReferenceCount or PandaNode, consider calling the variant of decode_from_bam_stream() defined for those methods, which presents a simpler interface.
Definition at line 353 of file typedWritable.cxx.
References BamReader::init(), DatagramInputFile::open(), DatagramInputFile::read_header(), BamReader::read_object(), ReferenceCount::ref(), BamReader::resolve(), BamReader::set_source(), and ReferenceCount::unref().
bool ReferenceCount::do_test_ref_count_integrity | ( | ) | const [protected, inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
Definition at line 29 of file referenceCount.cxx.
Referenced by ReferenceCount::do_test_ref_count_nonzero(), and ReferenceCount::test_ref_count_integrity().
bool ReferenceCount::do_test_ref_count_nonzero | ( | ) | const [protected, inherited] |
Returns true if the reference count is nonzero, false otherwise.
Definition at line 56 of file referenceCount.cxx.
References ReferenceCount::do_test_ref_count_integrity().
Referenced by ReferenceCount::test_ref_count_nonzero().
bool TypedWritable::encode_to_bam_stream | ( | string & | data, |
BamWriter * | writer = NULL |
||
) | const [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
Returns true on success, false on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
Definition at line 283 of file typedWritable.cxx.
References BamWriter::init(), DatagramOutputFile::open(), BamWriter::set_target(), DatagramOutputFile::write_header(), and BamWriter::write_object().
string TypedWritable::encode_to_bam_stream | ( | ) | const [inline, inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.
Returns empty string on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
Definition at line 86 of file typedWritable.I.
void TextureStage::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
Function that reads out of the datagram (or asks manager to read) all of the data that is needed to re-create this object and stores it in the appropiate place.
Reimplemented from TypedWritable.
Definition at line 391 of file textureStage.cxx.
References DatagramIterator::get_bool(), DatagramIterator::get_int32(), DatagramIterator::get_string(), DatagramIterator::get_uint8(), LVecBase4f::read_datagram(), and BamReader::read_pointer().
Referenced by make_TextureStage().
void TypedWritable::finalize | ( | BamReader * | manager | ) | [virtual, inherited] |
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 in PartBundle, Geom, GeomPrimitive, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, InternalName, GeomNode, LightAttrib, RenderAttrib, RenderEffect, RenderEffects, RenderState, PaletteGroup, and Palettizer.
Definition at line 145 of file typedWritable.cxx.
Referenced by BamReader::finalize_now().
int TextureStage::get_alpha_scale | ( | ) | const [inline] |
See set_alpha_scale().
Definition at line 256 of file textureStage.I.
Referenced by compare_to(), and write().
UpdateSeq TypedWritable::get_bam_modified | ( | ) | const [inline, inherited] |
Returns the current bam_modified counter.
This counter is normally incremented automatically whenever the object is modified.
Definition at line 66 of file typedWritable.I.
Referenced by BamWriter::consider_update(), and BamWriter::write_pointer().
Colorf TextureStage::get_color | ( | ) | const [inline] |
return the color for this stage
Definition at line 205 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), and write().
TextureStage::CombineMode TextureStage::get_combine_alpha_mode | ( | ) | const [inline] |
Get combine_alpha_mode.
Definition at line 544 of file textureStage.I.
Referenced by compare_to(), and write().
TextureStage::CombineOperand TextureStage::get_combine_alpha_operand0 | ( | ) | const [inline] |
Get operand0 of combine_alpha_mode.
Definition at line 576 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), compare_to(), and write().
TextureStage::CombineOperand TextureStage::get_combine_alpha_operand1 | ( | ) | const [inline] |
Get operand1 of combine_alpha_mode.
Definition at line 596 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), compare_to(), and write().
TextureStage::CombineOperand TextureStage::get_combine_alpha_operand2 | ( | ) | const [inline] |
Get operand2 of combine_alpha_mode.
Definition at line 616 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), compare_to(), and write().
TextureStage::CombineSource TextureStage::get_combine_alpha_source0 | ( | ) | const [inline] |
Get source0 of combine_alpha_mode.
Definition at line 566 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), compare_to(), and write().
TextureStage::CombineSource TextureStage::get_combine_alpha_source1 | ( | ) | const [inline] |
Get source1 of combine_alpha_mode.
Definition at line 586 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), compare_to(), and write().
TextureStage::CombineSource TextureStage::get_combine_alpha_source2 | ( | ) | const [inline] |
Get source2 of combine_alpha_mode.
Definition at line 606 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), compare_to(), and write().
TextureStage::CombineMode TextureStage::get_combine_rgb_mode | ( | ) | const [inline] |
Get the combine_rgb_mode.
Definition at line 380 of file textureStage.I.
Referenced by compare_to(), and write().
TextureStage::CombineOperand TextureStage::get_combine_rgb_operand0 | ( | ) | const [inline] |
Get operand0 of combine_rgb_mode.
Definition at line 412 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), compare_to(), and write().
TextureStage::CombineOperand TextureStage::get_combine_rgb_operand1 | ( | ) | const [inline] |
Get operand1 of combine_rgb_mode.
Definition at line 432 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), compare_to(), and write().
TextureStage::CombineOperand TextureStage::get_combine_rgb_operand2 | ( | ) | const [inline] |
Get operand2 of combine_rgb_mode.
Definition at line 452 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), compare_to(), and write().
TextureStage::CombineSource TextureStage::get_combine_rgb_source0 | ( | ) | const [inline] |
Get source0 of combine_rgb_mode.
Definition at line 402 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), compare_to(), and write().
TextureStage::CombineSource TextureStage::get_combine_rgb_source1 | ( | ) | const [inline] |
Get source1 of combine_rgb_mode.
Definition at line 422 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), compare_to(), and write().
TextureStage::CombineSource TextureStage::get_combine_rgb_source2 | ( | ) | const [inline] |
Get source2 of combine_rgb_mode.
Definition at line 442 of file textureStage.I.
Referenced by ShaderGenerator::combine_source_as_string(), compare_to(), and write().
TextureStage * TextureStage::get_default | ( | ) | [inline, static] |
Returns the default TextureStage that will be used for all texturing that does not name a particular stage.
This generally handles the normal single-texture case.
Definition at line 705 of file textureStage.I.
References TextureStage().
Referenced by UvScrollNode::cull_callback(), TexMatrixAttrib::get_mat(), make_TextureStage(), NodePathCollection::set_texture(), NodePath::set_texture(), and write_datagram().
TextureStage::Mode TextureStage::get_mode | ( | ) | const [inline] |
Return the mode of this stage.
Definition at line 173 of file textureStage.I.
Referenced by ShaderGenerator::analyze_renderstate(), compare_to(), and write().
const string & TextureStage::get_name | ( | ) | const [inline] |
Returns the name of this texture stage.
Definition at line 32 of file textureStage.I.
Referenced by NodePath::clear_normal_map(), compare_to(), NodePath::find_all_texture_stages(), TextureStageCollection::find_texture_stage(), output(), and write().
int TextureStage::get_num_combine_alpha_operands | ( | ) | const [inline] |
Returns the number of meaningful operands that may be retrieved via get_combine_alpha_sourceN() and get_combine_alpha_operandN().
Definition at line 556 of file textureStage.I.
Referenced by compare_to(), and write().
int TextureStage::get_num_combine_rgb_operands | ( | ) | const [inline] |
Returns the number of meaningful operands that may be retrieved via get_combine_rgb_sourceN() and get_combine_rgb_operandN().
Definition at line 392 of file textureStage.I.
Referenced by compare_to(), and write().
int TextureStage::get_priority | ( | ) | const [inline] |
Returns the priority associated with this stage.
This is specially helpful for cards that do not support more than n stages of multi-texturing.
Definition at line 113 of file textureStage.I.
Referenced by compare_to(), and write().
int ReferenceCount::get_ref_count | ( | ) | const [inline, inherited] |
Returns the current reference count.
Definition at line 155 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by TransformState::clear_cache(), RenderState::clear_cache(), RenderState::finalize(), RenderEffects::finalize(), RenderEffect::finalize(), RenderAttrib::finalize(), InternalName::finalize(), TransformState::get_num_unused_states(), RenderState::get_num_unused_states(), TransformState::list_cycles(), RenderState::list_cycles(), GeomVertexFormat::remove_column(), TransformState::unref(), RenderState::unref(), RenderState::~RenderState(), and TransformState::~TransformState().
int TextureStage::get_rgb_scale | ( | ) | const [inline] |
See set_rgb_scale().
Definition at line 231 of file textureStage.I.
Referenced by compare_to(), and write().
bool TextureStage::get_saved_result | ( | ) | const [inline] |
Returns the current setting of the saved_result flag.
See set_saved_result().
Definition at line 288 of file textureStage.I.
Referenced by compare_to(), and write().
int TextureStage::get_sort | ( | ) | const [inline] |
Returns the sort order of this texture stage.
Definition at line 75 of file textureStage.I.
Referenced by compare_to(), and write().
UpdateSeq TextureStage::get_sort_seq | ( | ) | [inline, static] |
Returns a global sequence number that is incremented any time any TextureStage in the world changes sort or priority.
This is used by TextureAttrib to determine when it is necessary to re-sort its internal array of stages.
Definition at line 722 of file textureStage.I.
InternalName * TextureStage::get_texcoord_name | ( | ) | const [inline] |
Returns the InternalName.
Definition at line 147 of file textureStage.I.
Referenced by GeomNode::apply_attribs_to_vertices(), GeomTransformer::apply_texture_colors(), TinyGraphicsStateGuardian::begin_draw_primitives(), compare_to(), set_texcoord_name(), and write().
int TypedObject::get_type_index | ( | ) | const [inline, inherited] |
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 52 of file typedObject.I.
References TypeHandle::get_index().
WeakReferenceList * ReferenceCount::get_weak_list | ( | ) | const [inline, inherited] |
Returns the WeakReferenceList associated with this ReferenceCount object.
If there has never been a WeakReferenceList associated with this object, creates one now.
Definition at line 307 of file referenceCount.I.
Referenced by ReferenceCount::weak_ref().
bool ReferenceCount::has_weak_list | ( | ) | const [inline, inherited] |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
In general, this will be true if there was ever a WeakPointerTo created for this object (even if there is not any for it now).
Definition at line 294 of file referenceCount.I.
Referenced by ReferenceCount::weak_unref().
bool TextureStage::involves_color_scale | ( | ) | const [inline] |
Returns true if the TextureStage is affected by the setting of the current ColorScaleAttrib, false otherwise.
Definition at line 628 of file textureStage.I.
bool TypedObject::is_exact_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is the indicated type exactly.
Definition at line 74 of file typedObject.I.
References TypeHandle::get_name().
Referenced by GraphicsStateGuardian::async_reload_texture(), PortalNode::combine_with(), PandaNode::combine_with(), GeomNode::combine_with(), CollisionNode::combine_with(), Character::combine_with(), PGItem::cull_callback(), FactoryParams::get_param_of_type(), CollisionHandlerPusher::handle_entries(), SceneGraphReducer::r_flatten(), ConnectionWriter::send(), FltToEggLevelState::set_transform(), and VirtualFileSystem::unmount().
bool TextureStage::is_fixed_function | ( | ) | const [inline] |
Returns true if the TextureStage is relevant to the classic fixed function pipeline.
This excludes texture stages such as normal mapping and the like.
Definition at line 185 of file textureStage.I.
bool TypedObject::is_of_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is or derives from the indicated type.
Definition at line 63 of file typedObject.I.
References TypeHandle::is_derived_from().
Referenced by EggSliderData::add_back_pointer(), EggJointData::add_back_pointer(), CIntervalManager::add_c_interval(), XFileNode::add_child(), CollisionTraverser::add_collider(), CollisionHandlerPhysical::add_collider(), EggXfmSAnim::add_data(), CharacterJointBundle::add_node(), NonlinearImager::add_screen(), EggGroupNode::apply_first_attribute(), EggGroupNode::apply_last_attribute(), DeferredNodeProperty::apply_to_node(), RecorderController::begin_playback(), NodePath::clear_clip_plane(), EggGroupNode::clear_connected_shading(), NodePath::clear_light(), EggBase::convert_paths(), NodePath::decode_from_bam_stream(), VrpnClient::disconnect_device(), PhysicsManager::do_physics(), GraphicsStateGuardian::fetch_specified_part(), EggRenderState::fill_state(), AnimBundleNode::find_anim_bundle(), EggGroupNode::find_coordsys_entry(), XFile::find_data_object(), Character::find_joint(), EggGroupNode::find_materials(), Character::find_slider(), XFile::find_template(), EggGroupNode::find_textures(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggGroupNode::force_filenames(), EggJointData::force_initial_rest_frame(), WindowFramework::get_aspect_2d(), EggPoolUniquifier::get_category(), EggGroupUniquifier::get_category(), EggGroupNode::get_connected_shading(), PandaFramework::get_mouse(), FactoryParams::get_param_of_type(), EggGroupNode::has_absolute_pathnames(), NodePath::has_clip_plane(), NodePath::has_clip_plane_off(), NodePath::has_light(), PandaFramework::hide_collision_solids(), x11GraphicsWindow::open_window(), eglGraphicsWindow::open_window(), EggNode::parse_egg(), CharacterMaker::part_to_node(), EggGroupNode::post_apply_flat_attribute(), EggBinner::prepare_node(), PortalClipper::prepare_portal(), NodePath::project_texture(), EggMatrixTablePointer::quantize_channels(), ParametricCurveCollection::r_add_curves(), SceneGraphReducer::r_collect_vertex_data(), EggGroupNode::r_load_externals(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::remove_invalid_primitives(), EggGroupNode::remove_unused_vertices(), EggLoader::reparent_decals(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggGroupNode::resolve_filenames(), EggGroupNode::reverse_vertex_ordering(), NodePath::set_clip_plane(), NodePath::set_clip_plane_off(), NodePath::set_light(), ProjectionScreen::set_projector(), NonlinearImager::set_source_camera(), EggXfmSAnim::set_value(), NonlinearImager::set_viewer_camera(), PandaFramework::show_collision_solids(), BamCache::store(), XFileToEggConverter::strip_nodes(), EggGroupNode::strip_normals(), DataGraphTraverser::traverse(), DataGraphTraverser::traverse_below(), EggGroupNode::triangulate_polygons(), EggGroupNode::unify_attributes(), EggNameUniquifier::uniquify(), NodeCullCallbackData::upcall(), PhysicsCollisionHandler::validate_target(), EggXfmSAnim::write(), EggGroup::write(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_entities().
void ReferenceCount::local_object | ( | ) | [inline, inherited] |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
This allows the object to be passed to functions that will increment and decrement the object's reference count temporarily, and it will prevent the object from being deleted (inappropriately), when the reference count returns to zero. It actually achieves this by setting a large positive value in the reference count field.
Definition at line 276 of file referenceCount.I.
Referenced by PGTop::cull_callback(), BoundingSphere::extend_by_hexahedron(), AsyncTaskManager::find_task(), AsyncTaskManager::find_tasks(), and AsyncTaskManager::find_tasks_matching().
TypedWritable * TextureStage::make_TextureStage | ( | const FactoryParams & | params | ) | [static] |
Factory method to generate a TextureStage object.
Definition at line 366 of file textureStage.cxx.
References fillin(), DatagramIterator::get_bool(), get_default(), and TextureStage().
Referenced by register_with_read_factory().
void TypedWritable::mark_bam_modified | ( | ) | [inline, inherited] |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
This should normally not need to be called by user code; it should be called internally when the object has been changed in a way that legitimately requires its retransmission to any connected clients.
Definition at line 54 of file typedWritable.I.
Referenced by PandaNode::add_child(), PandaNode::add_stashed(), PandaNode::adjust_draw_mask(), PandaNode::apply_attribs_to_vertices(), PandaNode::clear_attrib(), PandaNode::clear_effect(), PandaNode::clear_tag(), PandaNode::copy_all_properties(), PandaNode::copy_tags(), PandaNode::disable_cull_callback(), PandaNode::force_bounds_stale(), PandaNode::remove_all_children(), PandaNode::remove_child(), PandaNode::remove_stashed(), PandaNode::reset_all_prev_transform(), PandaNode::reset_prev_transform(), PandaNode::set_attrib(), PandaNode::set_bounds(), PandaNode::set_bounds_type(), PandaNode::set_cull_callback(), PandaNode::set_effect(), PandaNode::set_effects(), PandaNode::set_final(), PandaNode::set_internal_bounds(), PandaNode::set_into_collide_mask(), PandaNode::set_prev_transform(), PandaNode::set_state(), PandaNode::set_tag(), PandaNode::set_transform(), PandaNode::stash_child(), and PandaNode::unstash_child().
void TextureStage::operator= | ( | const TextureStage & | copy | ) |
just copy the members of other to this
Definition at line 68 of file textureStage.cxx.
void TextureStage::output | ( | ostream & | out | ) | const |
void ReferenceCount::ref | ( | ) | const [inline, inherited] |
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.
Definition at line 179 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by CachedTypedWritableReferenceCount::cache_ref(), TypedWritable::decode_raw_from_bam_stream(), NodeCachedReferenceCount::node_ref(), NodeReferenceCount::node_ref(), BamCacheRecord::set_data(), CullableObject::set_draw_callback(), and ModelRoot::set_reference().
void TextureStage::register_with_read_factory | ( | ) | [static] |
Factory method to generate a TextureStage object.
Definition at line 356 of file textureStage.cxx.
References BamReader::get_factory(), make_TextureStage(), and Factory< Type >::register_factory().
bool TypedWritable::require_fully_complete | ( | ) | const [virtual, inherited] |
Some objects require all of their nested pointers to have been completed before the objects themselves can be completed.
If this is the case, override this method to return true, and be careful with circular references (which would make the object unreadable from a bam file).
Reimplemented in GeomVertexData, ClipPlaneAttrib, and RenderEffects.
Definition at line 118 of file typedWritable.cxx.
void TextureStage::set_alpha_scale | ( | int | alpha_scale | ) | [inline] |
Sets an additional factor that will scale the alpha component after the texture has been applied.
This is used only when the mode is CM_combine.
The only legal values are 1, 2, or 4.
Definition at line 245 of file textureStage.I.
void TextureStage::set_color | ( | const Colorf & | color | ) | [inline] |
Set the color for this stage.
Definition at line 195 of file textureStage.I.
void TextureStage::set_combine_alpha | ( | CombineMode | mode, |
CombineSource | source0, | ||
CombineOperand | operand0 | ||
) | [inline] |
Specifies any of the CombineMode values that represent a one-parameter operation.
Specifically, this is CM_replace only.
Definition at line 464 of file textureStage.I.
void TextureStage::set_combine_alpha | ( | CombineMode | mode, |
CombineSource | source0, | ||
CombineOperand | operand0, | ||
CombineSource | source1, | ||
CombineOperand | operand1 | ||
) | [inline] |
Specifies any of the CombineMode values that represent a two-parameter operation.
Specifically, this is everything except for CM_replace and CM_interpolate.
Definition at line 490 of file textureStage.I.
void TextureStage::set_combine_alpha | ( | CombineMode | mode, |
CombineSource | source0, | ||
CombineOperand | operand0, | ||
CombineSource | source1, | ||
CombineOperand | operand1, | ||
CombineSource | source2, | ||
CombineOperand | operand2 | ||
) | [inline] |
Specifies any of the CombineMode values that represent a one-parameter operation.
Specifically, this is CM_interpolate only.
Definition at line 517 of file textureStage.I.
void TextureStage::set_combine_rgb | ( | CombineMode | mode, |
CombineSource | source0, | ||
CombineOperand | operand0 | ||
) | [inline] |
Specifies any of the CombineMode values that represent a one-parameter operation.
Specifically, this is CM_replace only.
Definition at line 300 of file textureStage.I.
void TextureStage::set_combine_rgb | ( | CombineMode | mode, |
CombineSource | source0, | ||
CombineOperand | operand0, | ||
CombineSource | source1, | ||
CombineOperand | operand1, | ||
CombineSource | source2, | ||
CombineOperand | operand2 | ||
) | [inline] |
Specifies any of the CombineMode values that represent a one-parameter operation.
Specifically, this is CM_interpolate only.
Definition at line 353 of file textureStage.I.
void TextureStage::set_combine_rgb | ( | CombineMode | mode, |
CombineSource | source0, | ||
CombineOperand | operand0, | ||
CombineSource | source1, | ||
CombineOperand | operand1 | ||
) | [inline] |
Specifies any of the CombineMode values that represent a two-parameter operation.
Specifically, this is everything except for CM_replace and CM_interpolate.
Definition at line 326 of file textureStage.I.
void TextureStage::set_mode | ( | TextureStage::Mode | mode | ) | [inline] |
Set the mode of this texture stage.
Definition at line 157 of file textureStage.I.
void TextureStage::set_name | ( | const string & | name | ) | [inline] |
Changes the name of this texture stage.
Definition at line 42 of file textureStage.I.
void TextureStage::set_priority | ( | int | priority | ) | [inline] |
Changes the relative importance of the texture associated with this stage relative to the other texture stages that are applied simultaneously.
This is unrelated to set_sort(), which controls the order in which multiple textures are applied. The priority number is used to decide which of the requested textures are to be selected for rendering when more textures are requested than the hardware will support. The highest-priority n textures are selected for rendering, and then rendered in order by their sort factor.
Definition at line 96 of file textureStage.I.
void TextureStage::set_rgb_scale | ( | int | rgb_scale | ) | [inline] |
Sets an additional factor that will scale all three r, g, b components after the texture has been applied.
This is used only when the mode is CM_combine.
The only legal values are 1, 2, or 4.
Definition at line 220 of file textureStage.I.
void TextureStage::set_saved_result | ( | bool | saved_result | ) | [inline] |
Sets the saved_result flag.
When this is true, the output of this stage will be supplied as the "last_saved_result" source for any future stages, until the next TextureStage with a saved_result set true is encountered.
This can be used to reuse the results of this texture stage as input to more than one stage later in the pipeline.
The last texture in the pipeline (the one with the highest sort value) should not have this flag set.
Definition at line 277 of file textureStage.I.
void TextureStage::set_sort | ( | int | sort | ) | [inline] |
Changes the order in which the texture associated with this stage is rendered relative to the other texture stages.
When geometry is rendered with multiple textures, the textures are rendered in order from the lowest sort number to the highest sort number.
Also see set_priority(), which is used to select the most important textures for rendering when some must be omitted because of hardware limitations.
Definition at line 61 of file textureStage.I.
void TextureStage::set_texcoord_name | ( | const string & | name | ) | [inline] |
Indicate which set of UV's this texture stage will use.
Geometry may have any number of associated UV sets, each of which must have a unique name.
Definition at line 137 of file textureStage.I.
References get_texcoord_name().
void TextureStage::set_texcoord_name | ( | InternalName * | name | ) | [inline] |
Indicate which set of UV's this texture stage will use.
Geometry may have any number of associated UV sets, each of which must have a unique name.
Definition at line 125 of file textureStage.I.
bool ReferenceCount::test_ref_count_integrity | ( | ) | const [inline, inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
Definition at line 236 of file referenceCount.I.
References ReferenceCount::do_test_ref_count_integrity().
Referenced by EggGroupNode::add_child(), InternalName::find_ancestor(), InternalName::get_ancestor(), ReferenceCount::get_ref_count(), InternalName::get_top(), ReferenceCount::ref(), EggVertex::test_gref_integrity(), EggVertex::test_pref_integrity(), EggNode::test_under_integrity(), EggPrimitive::test_vref_integrity(), EggGroup::test_vref_integrity(), MouseWatcher::throw_event_pattern(), ReferenceCount::unref(), and EggNode::update_under().
bool ReferenceCount::test_ref_count_nonzero | ( | ) | const [inline, inherited] |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
Returns true if ok, false otherwise.
Definition at line 252 of file referenceCount.I.
References ReferenceCount::do_test_ref_count_nonzero().
Referenced by CopyOnWritePointer::test_ref_count_nonzero().
bool ReferenceCount::unref | ( | ) | const [inline, virtual, inherited] |
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.) 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 true if the new reference count is nonzero, false if it is zero.
Reimplemented in GeomVertexArrayFormat, GeomVertexFormat, InternalName, RenderAttrib, RenderEffects, RenderState, and TransformState.
Definition at line 214 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by CachedTypedWritableReferenceCount::cache_unref(), TypedWritable::decode_raw_from_bam_stream(), RenderEffect::finalize(), NodeCachedReferenceCount::node_unref(), NodeReferenceCount::node_unref(), TransformState::unref(), RenderState::unref(), RenderEffects::unref(), RenderAttrib::unref(), InternalName::unref(), GeomVertexFormat::unref(), and GeomVertexArrayFormat::unref().
void TypedWritable::update_bam_nested | ( | BamWriter * | manager | ) | [virtual, inherited] |
Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates.
Reimplemented in CFDoCullCommand, and PandaNode.
Definition at line 77 of file typedWritable.cxx.
bool TextureStage::uses_color | ( | ) | const [inline] |
Returns true if the TextureStage makes use of whatever color is specified in set_color(), false otherwise.
Definition at line 640 of file textureStage.I.
bool TextureStage::uses_last_saved_result | ( | ) | const [inline] |
Returns true if the TextureStage makes use of the CS_primary_color combine source.
Definition at line 662 of file textureStage.I.
bool TextureStage::uses_primary_color | ( | ) | const [inline] |
Returns true if the TextureStage makes use of the CS_primary_color combine source.
Definition at line 651 of file textureStage.I.
void ReferenceCount::weak_ref | ( | WeakPointerToVoid * | ptv | ) | [inline, inherited] |
Adds the indicated PointerToVoid as a weak reference to this object.
Definition at line 321 of file referenceCount.I.
References WeakReferenceList::add_reference(), and ReferenceCount::get_weak_list().
void ReferenceCount::weak_unref | ( | WeakPointerToVoid * | ptv | ) | [inline, inherited] |
Removes the indicated PointerToVoid as a weak reference to this object.
It must have previously been added via a call to weak_ref().
Definition at line 334 of file referenceCount.I.
References WeakReferenceList::clear_reference(), and ReferenceCount::has_weak_list().
void TextureStage::write | ( | ostream & | out | ) | const |
Writes the details of this stage.
Definition at line 229 of file textureStage.cxx.
References get_alpha_scale(), get_color(), get_combine_alpha_mode(), get_combine_alpha_operand0(), get_combine_alpha_operand1(), get_combine_alpha_operand2(), get_combine_alpha_source0(), get_combine_alpha_source1(), get_combine_alpha_source2(), get_combine_rgb_mode(), get_combine_rgb_operand0(), get_combine_rgb_operand1(), get_combine_rgb_operand2(), get_combine_rgb_source0(), get_combine_rgb_source1(), get_combine_rgb_source2(), get_mode(), InternalName::get_name(), get_name(), get_num_combine_alpha_operands(), get_num_combine_rgb_operands(), get_priority(), get_rgb_scale(), get_saved_result(), get_sort(), and get_texcoord_name().
Function to write the important information in the particular object to a Datagram.
Reimplemented from TypedWritable.
Definition at line 450 of file textureStage.cxx.
References Datagram::add_bool(), Datagram::add_int32(), Datagram::add_string(), Datagram::add_uint8(), get_default(), LVecBase4f::write_datagram(), and BamWriter::write_pointer().