Panda3D
|
This is the data for one array of a GeomVertexData structure. More...
#include "geomVertexArrayData.h"
Classes | |
class | BamAuxData |
class | CData |
Public Types | |
enum | AnimationType { AT_none, AT_panda, AT_hardware } |
enum | Contents { C_other, C_point, C_clip_point, C_vector, C_texcoord, C_color, C_index, C_morph_delta } |
enum | GeomRendering { GR_indexed_point = 0x00001, GR_indexed_other = 0x10000, GR_indexed_bits = 0x10001, GR_point = 0x00002, GR_point_uniform_size = 0x00004, GR_per_point_size = 0x00008, GR_point_perspective = 0x00010, GR_point_aspect_ratio = 0x00020, GR_point_scale = 0x00040, GR_point_rotate = 0x00080, GR_point_sprite = 0x00100, GR_point_sprite_tex_matrix = 0x00200, GR_point_bits = 0x003fe, GR_triangle_strip = 0x00400, GR_triangle_fan = 0x00800, GR_line_strip = 0x01000, GR_composite_bits = 0x01c00, GR_flat_first_vertex = 0x02000, GR_flat_last_vertex = 0x04000, GR_shade_model_bits = 0x06000, GR_texcoord_light_vector = 0x08000 } |
enum | NumericType { NT_uint8, NT_uint16, NT_uint32, NT_packed_dcba, NT_packed_dabc, NT_float32 } |
enum | PrimitiveType { PT_none, PT_polygons, PT_lines, PT_points } |
enum | ShadeModel { SM_uniform, SM_smooth, SM_flat_first_vertex, SM_flat_last_vertex } |
enum | UsageHint { UH_client, UH_stream, UH_dynamic, UH_static, UH_unspecified } |
Public Member Functions | |
GeomVertexArrayData (const GeomVertexArrayFormat *array_format, UsageHint usage_hint) | |
GeomVertexArrayData (const GeomVertexArrayData ©) | |
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. | |
void | cache_ref () const |
Explicitly increments the cache reference count and the normal reference count simultaneously. | |
bool | cache_unref () const |
Explicitly decrements the cache reference count and the normal reference count simultaneously. | |
void | clear_rows () |
Removes all of the rows in the array. | |
int | compare_to (const GeomVertexArrayData &other) const |
Returns 0 if the two arrays are equivalent, even if they are not the same pointer. | |
virtual int | complete_pointers (TypedWritable **plist, BamReader *manager) |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). | |
CPT (GeomVertexArrayDataHandle) get_handle(Thread *current_thread | |
void | dequeue_lru () |
Removes the page from its SimpleLru. | |
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. | |
void | enqueue_lru (SimpleLru *lru) |
Adds the page to the LRU for the first time, or marks it recently-accessed if it has already been added. | |
virtual void | evict_lru () |
Evicts the page from the LRU. | |
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 () |
const GeomVertexArrayFormat * | get_array_format () const |
Returns the format object that describes this array. | |
UpdateSeq | get_bam_modified () const |
Returns the current bam_modified counter. | |
int | get_best_parent_from_Set (const std::set< int > &) const |
int | get_cache_ref_count () const |
Returns the current reference count. | |
int | get_data_size_bytes () const |
Returns the number of bytes stored in the array. | |
SimpleLru * | get_lru () const |
Returns the LRU that manages this page, or NULL if it is not currently managed by any LRU. | |
size_t | get_lru_size () const |
Returns the size of this page as reported to the LRU, presumably in bytes. | |
UpdateSeq | get_modified () const |
Returns a sequence number which is guaranteed to change at least every time the array vertex data is modified. | |
int | get_num_rows () const |
Returns the number of rows stored in the array, based on the number of bytes and the stride. | |
int | get_ref_count () const |
Returns the current reference count. | |
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. | |
UsageHint | get_usage_hint () const |
Returns the usage hint that describes to the rendering backend how often the vertex data will be modified and/or rendered. | |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. | |
bool | has_column (const InternalName *name) const |
Returns true if the array has the named column, false otherwise. | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
bool | is_prepared (PreparedGraphicsObjects *prepared_objects) const |
Returns true if the data has already been prepared or enqueued for preparation on the indicated GSG, 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 | mark_bam_modified () |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. | |
void | mark_used_lru () const |
To be called when the page is used; this will move it to the tail of the SimpleLru queue it is already on. | |
void | mark_used_lru (SimpleLru *lru) |
To be called when the page is used; this will move it to the tail of the specified SimpleLru queue. | |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *, void *) |
void | operator delete[] (void *, void *) |
void | operator delete[] (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 *ptr) |
void * | operator new[] (size_t size, void *ptr) |
void * | operator new[] (size_t size) |
void * | operator new[] (size_t size) |
void | operator= (const GeomVertexArrayData ©) |
The copy assignment operator is not pipeline-safe. | |
void | output (ostream &out) const |
void | prepare (PreparedGraphicsObjects *prepared_objects) |
Indicates that the data should be enqueued to be prepared in the indicated prepared_objects at the beginning of the next frame. | |
VertexBufferContext * | prepare_now (PreparedGraphicsObjects *prepared_objects, GraphicsStateGuardianBase *gsg) |
Creates a context for the data on the particular GSG, if it does not already exist. | |
PT (GeomVertexArrayDataHandle) modify_handle(Thread *current_thread | |
PTA_uchar | read_raw_data (BamReader *manager, DatagramIterator &source) |
Called by CData::fillin to read the raw data of the array from the indicated datagram. | |
void | ref () const |
Explicitly increments the reference count. | |
bool | release (PreparedGraphicsObjects *prepared_objects) |
Frees the data context only on the indicated object, if it exists there. | |
int | release_all () |
Frees the context allocated on all objects for which the data has been declared. | |
bool | request_resident () const |
Returns true if the vertex data is currently resident in memory. | |
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. | |
bool | set_num_rows (int n) |
Sets the length of the array to n rows. | |
void | set_usage_hint (UsageHint usage_hint) |
Changes the UsageHint hint for this array. | |
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. | |
bool | unclean_set_num_rows (int n) |
This method behaves like set_num_rows(), except the new data is not initialized. | |
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. | |
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, int indent_level=0) 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 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 VertexDataBook & | get_book () |
Returns the global VertexDataBook that will be used to allocate vertex data buffers. | |
static TypeHandle | get_class_type () |
static SimpleLru * | get_independent_lru () |
Returns a pointer to the global LRU object that manages the GeomVertexArrayData's that have not (yet) been paged out. | |
static SimpleLru * | get_small_lru () |
Returns a pointer to the global LRU object that manages the GeomVertexArrayData's that are deemed too small to be paged out. | |
static void | init_type () |
static void | lru_epoch () |
Marks that an epoch has passed in each LRU. | |
static | PT (TypedWritableReferenceCount) decode_from_bam_stream(const string &data |
static void | register_with_read_factory () |
Tells the BamReader how to create objects of type GeomVertexArrayData. | |
Public Attributes | |
static BamReader * | reader = NULL) |
Static Public Attributes | |
static TypedWritable *const | Null = (TypedWritable*)0L |
Protected Member Functions | |
void | cache_unref_only () const |
Decrements the cache reference count without affecting the normal reference count. | |
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) |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new GeomVertexArrayData. | |
void | insert_after (LinkedListNode *node) |
Adds a LinkedListNode record after the indicated node in the doubly-linked list. | |
void | insert_before (LinkedListNode *node) |
Adds a LinkedListNode record before the indicated node in the doubly-linked list. | |
bool | is_on_list () const |
Returns true if the node is member of any list, false if it has been removed or never added. | |
virtual | PT (CopyOnWriteObject) make_cow_copy() |
void | remove_from_list () |
Removes a LinkedListNode record from the doubly-linked list. | |
void | take_list_from (LinkedListNode *other_root) |
Given that this LinkedListNode represents the root of a list, and the other pointer represents the root of a different list, move all of the nodes (except the root itself) from other_root onto this list. | |
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 GeomVertexArrayData is encountered in the Bam file. | |
Protected Attributes | |
LinkedListNode * | _next |
LinkedListNode * | _prev |
Friends | |
class | GeomCacheManager |
class | GeomVertexArrayDataHandle |
class | GeomVertexData |
class | PreparedGraphicsObjects |
This is the data for one array of a GeomVertexData structure.
Many GeomVertexData structures will only define one array, with all data elements interleaved (DirectX 8.0 and before insisted on this format); some will define multiple arrays.
DirectX calls this concept of one array a "stream". It also closely correlates with the concept of a vertex buffer.
This object is just a block of data. In general, you should not be directly messing with this object from application code. See GeomVertexData for the organizing structure, and see GeomVertexReader/Writer/Rewriter for high-level tools to manipulate the actual vertex data.
Definition at line 63 of file geomVertexArrayData.h.
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.
void CachedTypedWritableReferenceCount::cache_ref | ( | ) | const [inline, inherited] |
Explicitly increments the cache reference count and the normal reference count simultaneously.
Reimplemented in RenderState, and TransformState.
Definition at line 147 of file cachedTypedWritableReferenceCount.I.
References ReferenceCount::ref(), and CachedTypedWritableReferenceCount::test_ref_count_integrity().
Referenced by CopyOnWritePointer::get_write_pointer().
bool CachedTypedWritableReferenceCount::cache_unref | ( | ) | const [inline, inherited] |
Explicitly decrements the cache reference count and the normal reference count simultaneously.
The return value is true if the new reference count is nonzero, false if it is zero.
Reimplemented in RenderState, and TransformState.
Definition at line 166 of file cachedTypedWritableReferenceCount.I.
References CachedTypedWritableReferenceCount::test_ref_count_integrity(), and ReferenceCount::unref().
void CachedTypedWritableReferenceCount::cache_unref_only | ( | ) | const [inline, protected, inherited] |
Decrements the cache reference count without affecting the normal reference count.
Intended to be called by derived classes only, presumably to reimplement cache_unref().
Definition at line 204 of file cachedTypedWritableReferenceCount.I.
References CachedTypedWritableReferenceCount::test_ref_count_integrity().
void GeomVertexArrayData::clear_rows | ( | ) | [inline] |
Removes all of the rows in the array.
Functionally equivalent to set_num_rows(0).
Definition at line 116 of file geomVertexArrayData.I.
int GeomVertexArrayData::compare_to | ( | const GeomVertexArrayData & | other | ) | const |
Returns 0 if the two arrays are equivalent, even if they are not the same pointer.
Definition at line 164 of file geomVertexArrayData.cxx.
References Thread::get_current_thread(), and get_usage_hint().
int GeomVertexArrayData::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 502 of file geomVertexArrayData.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().
void SimpleLruPage::dequeue_lru | ( | ) | [inline, inherited] |
Removes the page from its SimpleLru.
Definition at line 164 of file simpleLru.I.
References LinkedListNode::remove_from_list().
Referenced by SimpleLruPage::evict_lru(), and evict_lru().
bool CachedTypedWritableReferenceCount::do_test_ref_count_integrity | ( | ) | const [protected, inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Reimplemented from ReferenceCount.
Reimplemented in NodeCachedReferenceCount.
Definition at line 26 of file cachedTypedWritableReferenceCount.cxx.
Referenced by CachedTypedWritableReferenceCount::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().
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.
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().
void SimpleLruPage::enqueue_lru | ( | SimpleLru * | lru | ) | [inherited] |
Adds the page to the LRU for the first time, or marks it recently-accessed if it has already been added.
If lru is NULL, it means to remove this page from its LRU.
Definition at line 70 of file simpleLru.cxx.
References LinkedListNode::insert_before(), and LinkedListNode::remove_from_list().
Referenced by SimpleLru::begin_epoch(), and SimpleLruPage::mark_used_lru().
void GeomVertexArrayData::evict_lru | ( | ) | [virtual] |
Evicts the page from the LRU.
Called internally when the LRU determines that it is full. May also be called externally when necessary to explicitly evict the page.
It is legal for this method to either evict the page as requested, do nothing (in which case the eviction will be requested again at the next epoch), or requeue itself on the tail of the queue (in which case the eviction will be requested again much later).
Reimplemented from SimpleLruPage.
Definition at line 380 of file geomVertexArrayData.cxx.
References SimpleLruPage::dequeue_lru().
void GeomVertexArrayData::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 GeomVertexArrayData.
Reimplemented from TypedWritable.
Definition at line 576 of file geomVertexArrayData.cxx.
References BamReader::read_cdata(), and BamReader::read_pointer().
void GeomVertexArrayData::finalize | ( | BamReader * | manager | ) | [virtual] |
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 518 of file geomVertexArrayData.cxx.
References BamReader::change_pointer(), and BamReader::get_aux_data().
const GeomVertexArrayFormat * GeomVertexArrayData::get_array_format | ( | ) | const [inline] |
Returns the format object that describes this array.
Definition at line 22 of file geomVertexArrayData.I.
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().
VertexDataBook & GeomVertexArrayData::get_book | ( | ) | [inline, static] |
Returns the global VertexDataBook that will be used to allocate vertex data buffers.
Definition at line 222 of file geomVertexArrayData.I.
int CachedTypedWritableReferenceCount::get_cache_ref_count | ( | ) | const [inline, inherited] |
Returns the current reference count.
Definition at line 133 of file cachedTypedWritableReferenceCount.I.
References CachedTypedWritableReferenceCount::test_ref_count_integrity().
Referenced by TransformState::get_num_unused_states(), RenderState::get_num_unused_states(), NodeCachedReferenceCount::get_referenced_bits(), CopyOnWritePointer::get_write_pointer(), TransformState::unref(), and RenderState::unref().
int GeomVertexArrayData::get_data_size_bytes | ( | ) | const [inline] |
Returns the number of bytes stored in the array.
Definition at line 126 of file geomVertexArrayData.I.
Referenced by PreparedGraphicsObjects::prepare_vertex_buffer_now(), PreparedGraphicsObjects::release_vertex_buffer(), and SceneGraphAnalyzer::write().
SimpleLru * GeomVertexArrayData::get_independent_lru | ( | ) | [inline, static] |
Returns a pointer to the global LRU object that manages the GeomVertexArrayData's that have not (yet) been paged out.
Definition at line 199 of file geomVertexArrayData.I.
Referenced by GraphicsEngine::render_frame().
SimpleLru * SimpleLruPage::get_lru | ( | ) | const [inline, inherited] |
Returns the LRU that manages this page, or NULL if it is not currently managed by any LRU.
Definition at line 153 of file simpleLru.I.
size_t SimpleLruPage::get_lru_size | ( | ) | const [inline, inherited] |
Returns the size of this page as reported to the LRU, presumably in bytes.
Definition at line 208 of file simpleLru.I.
UpdateSeq GeomVertexArrayData::get_modified | ( | ) | const [inline] |
Returns a sequence number which is guaranteed to change at least every time the array vertex data is modified.
Definition at line 139 of file geomVertexArrayData.I.
int GeomVertexArrayData::get_num_rows | ( | ) | const [inline] |
Returns the number of rows stored in the array, based on the number of bytes and the stride.
This should be the same for all arrays within a given GeomVertexData object.
Definition at line 60 of file geomVertexArrayData.I.
Referenced by GeomTristrips::append_unused_vertices().
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().
SimpleLru * GeomVertexArrayData::get_small_lru | ( | ) | [inline, static] |
Returns a pointer to the global LRU object that manages the GeomVertexArrayData's that are deemed too small to be paged out.
Definition at line 211 of file geomVertexArrayData.I.
Referenced by GraphicsEngine::render_frame().
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().
GeomVertexArrayData::UsageHint GeomVertexArrayData::get_usage_hint | ( | ) | const [inline] |
Returns the usage hint that describes to the rendering backend how often the vertex data will be modified and/or rendered.
See geomEnums.h.
Definition at line 34 of file geomVertexArrayData.I.
Referenced by compare_to(), GeomPrimitive::finalize(), PreparedGraphicsObjects::prepare_vertex_buffer_now(), and PreparedGraphicsObjects::release_vertex_buffer().
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 GeomVertexArrayData::has_column | ( | const InternalName * | name | ) | const [inline] |
Returns true if the array has the named column, false otherwise.
This is really just a shortcut for asking the same thing from the format.
Definition at line 47 of file geomVertexArrayData.I.
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().
void LinkedListNode::insert_after | ( | LinkedListNode * | node | ) | [inline, protected, inherited] |
Adds a LinkedListNode record after the indicated node in the doubly-linked list.
Definition at line 108 of file linkedListNode.I.
void LinkedListNode::insert_before | ( | LinkedListNode * | node | ) | [inline, protected, inherited] |
Adds a LinkedListNode record before the indicated node in the doubly-linked list.
Definition at line 91 of file linkedListNode.I.
Referenced by SimpleAllocator::do_alloc(), AdaptiveLru::do_partial_lru_update(), and SimpleLruPage::enqueue_lru().
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 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().
bool LinkedListNode::is_on_list | ( | ) | const [inline, protected, inherited] |
Returns true if the node is member of any list, false if it has been removed or never added.
The head of a list generally appears to to always be a member of itself.
Definition at line 62 of file linkedListNode.I.
bool GeomVertexArrayData::is_prepared | ( | PreparedGraphicsObjects * | prepared_objects | ) | const |
Returns true if the data has already been prepared or enqueued for preparation on the indicated GSG, false otherwise.
Definition at line 246 of file geomVertexArrayData.cxx.
References PreparedGraphicsObjects::is_vertex_buffer_queued().
Referenced by PreparedGraphicsObjects::is_vertex_buffer_prepared().
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().
void GeomVertexArrayData::lru_epoch | ( | ) | [static] |
Marks that an epoch has passed in each LRU.
Asks the LRU's to consider whether they should perform evictions.
Definition at line 358 of file geomVertexArrayData.cxx.
References SimpleLru::begin_epoch(), and VertexDataPage::get_global_lru().
Referenced by GraphicsEngine::render_frame().
TypedWritable * GeomVertexArrayData::make_from_bam | ( | const FactoryParams & | params | ) | [static, protected] |
This function is called by the BamReader's factory when a new object of type GeomVertexArrayData is encountered in the Bam file.
It should create the GeomVertexArrayData and extract its information from the file.
Definition at line 556 of file geomVertexArrayData.cxx.
References BamReader::register_finalize().
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 SimpleLruPage::mark_used_lru | ( | SimpleLru * | lru | ) | [inline, inherited] |
To be called when the page is used; this will move it to the tail of the specified SimpleLru queue.
Definition at line 197 of file simpleLru.I.
References SimpleLruPage::enqueue_lru().
void SimpleLruPage::mark_used_lru | ( | ) | const [inline, inherited] |
To be called when the page is used; this will move it to the tail of the SimpleLru queue it is already on.
This method is const because it's not technically modifying the contents of the page itself.
Definition at line 184 of file simpleLru.I.
Referenced by VertexDataPage::get_page_data(), and operator=().
void GeomVertexArrayData::operator= | ( | const GeomVertexArrayData & | copy | ) |
The copy assignment operator is not pipeline-safe.
This will completely obliterate all stages of the pipeline, so don't do it for a GeomVertexArrayData that is actively being used for rendering.
Definition at line 129 of file geomVertexArrayData.cxx.
References Geom::get_next_modified(), and SimpleLruPage::mark_used_lru().
void GeomVertexArrayData::prepare | ( | PreparedGraphicsObjects * | prepared_objects | ) |
Indicates that the data should be enqueued to be prepared in the indicated prepared_objects at the beginning of the next frame.
This will ensure the data is already loaded into the GSG if it is expected to be rendered soon.
Use this function instead of prepare_now() to preload datas from a user interface standpoint.
Definition at line 234 of file geomVertexArrayData.cxx.
References PreparedGraphicsObjects::enqueue_vertex_buffer().
VertexBufferContext * GeomVertexArrayData::prepare_now | ( | PreparedGraphicsObjects * | prepared_objects, |
GraphicsStateGuardianBase * | gsg | ||
) |
Creates a context for the data on the particular GSG, if it does not already exist.
Returns the new (or old) VertexBufferContext. This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new datas. If this is not necessarily the case, you should use prepare() instead.
Normally, this is not called directly except by the GraphicsStateGuardian; a data does not need to be explicitly prepared by the user before it may be rendered.
Definition at line 275 of file geomVertexArrayData.cxx.
References PreparedGraphicsObjects::prepare_vertex_buffer_now().
Referenced by DXGraphicsStateGuardian9::begin_draw_primitives(), and PreparedGraphicsObjects::begin_frame().
PTA_uchar GeomVertexArrayData::read_raw_data | ( | BamReader * | manager, |
DatagramIterator & | source | ||
) |
Called by CData::fillin to read the raw data of the array from the indicated datagram.
Definition at line 483 of file geomVertexArrayData.cxx.
References DatagramIterator::get_current_index(), Datagram::get_data(), DatagramIterator::get_datagram(), DatagramIterator::get_uint32(), and DatagramIterator::skip_bytes().
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 GeomVertexArrayData::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type GeomVertexArrayData.
Definition at line 458 of file geomVertexArrayData.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
bool GeomVertexArrayData::release | ( | PreparedGraphicsObjects * | prepared_objects | ) |
Frees the data context only on the indicated object, if it exists there.
Returns true if it was released, false if it had not been prepared.
Definition at line 301 of file geomVertexArrayData.cxx.
References PreparedGraphicsObjects::dequeue_vertex_buffer(), and PreparedGraphicsObjects::release_vertex_buffer().
int GeomVertexArrayData::release_all | ( | ) |
Frees the context allocated on all objects for which the data has been declared.
Returns the number of contexts which have been freed.
Definition at line 324 of file geomVertexArrayData.cxx.
References PreparedGraphicsObjects::release_vertex_buffer().
void LinkedListNode::remove_from_list | ( | ) | [inline, protected, inherited] |
Removes a LinkedListNode record from the doubly-linked list.
Definition at line 73 of file linkedListNode.I.
Referenced by SimpleLruPage::dequeue_lru(), SimpleAllocatorBlock::do_free(), AdaptiveLru::do_partial_lru_update(), and SimpleLruPage::enqueue_lru().
bool GeomVertexArrayData::request_resident | ( | ) | const [inline] |
Returns true if the vertex data is currently resident in memory.
If this returns true, the next call to get_handle()->get_read_pointer() will probably not block. If this returns false, the vertex data will be brought back into memory shortly; try again later.
Definition at line 154 of file geomVertexArrayData.I.
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.
bool GeomVertexArrayData::set_num_rows | ( | int | n | ) | [inline] |
Sets the length of the array to n rows.
Normally, you would not call this directly, since all of the arrays in a particular GeomVertexData must have the same number of rows; instead, call GeomVertexData::set_num_rows().
The return value is true if the number of rows was changed, false if the object already contained n rows (or if there was some error).
The new vertex data is initialized to 0, including the "color" column (but see GeomVertexData::set_num_rows()).
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 87 of file geomVertexArrayData.I.
void GeomVertexArrayData::set_usage_hint | ( | GeomVertexArrayData::UsageHint | usage_hint | ) |
Changes the UsageHint hint for this array.
See get_usage_hint().
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 195 of file geomVertexArrayData.cxx.
References Geom::get_next_modified().
void LinkedListNode::take_list_from | ( | LinkedListNode * | other_root | ) | [inline, protected, inherited] |
Given that this LinkedListNode represents the root of a list, and the other pointer represents the root of a different list, move all of the nodes (except the root itself) from other_root onto this list.
Definition at line 127 of file linkedListNode.I.
Referenced by BufferContextChain::take_from().
bool CachedTypedWritableReferenceCount::test_ref_count_integrity | ( | ) | const [inline, inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Reimplemented from ReferenceCount.
Reimplemented in NodeCachedReferenceCount.
Definition at line 187 of file cachedTypedWritableReferenceCount.I.
References CachedTypedWritableReferenceCount::do_test_ref_count_integrity().
Referenced by CachedTypedWritableReferenceCount::cache_ref(), CachedTypedWritableReferenceCount::cache_unref(), CachedTypedWritableReferenceCount::cache_unref_only(), CachedTypedWritableReferenceCount::get_cache_ref_count(), and CopyOnWritePointer::test_ref_count_integrity().
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 GeomVertexArrayData::unclean_set_num_rows | ( | int | n | ) | [inline] |
This method behaves like set_num_rows(), except the new data is not initialized.
Furthermore, after this call, *any* of the data in the GeomVertexArrayData may be uninitialized, including the earlier rows.
Normally, you would not call this directly, since all of the arrays in a particular GeomVertexData must have the same number of rows; instead, call GeomVertexData::unclean_set_num_rows().
Definition at line 105 of file geomVertexArrayData.I.
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.
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().
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from TypedWritable.
Definition at line 469 of file geomVertexArrayData.cxx.
References BamWriter::write_cdata(), and BamWriter::write_pointer().