Panda3D
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Friends

Geom Class Reference

A container for geometry primitives. More...

#include "geom.h"

Inheritance diagram for Geom:
CopyOnWriteObject GeomEnums CachedTypedWritableReferenceCount TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Classes

class  CacheEntry
class  CacheKey
class  CData
class  CDataCache

Public Types

enum  AnimationType { AT_none, AT_panda, AT_hardware }
typedef pmap< const CacheKey
*, PT(CacheEntry),
IndirectLess< CacheKey > > 
Cache
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

 Geom (const GeomVertexData *data)
void add_primitive (const GeomPrimitive *primitive)
 Adds a new GeomPrimitive structure to the Geom object.
virtual ReferenceCountas_reference_count ()
 Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type.
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObjectas_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 calc_tight_bounds (LPoint3f &min_point, LPoint3f &max_point, bool &found_any, const GeomVertexData *vertex_data, bool got_mat, const LMatrix4f &mat, Thread *current_thread) const
 Expands min_point and max_point to include all of the vertices in the Geom, if any.
void calc_tight_bounds (LPoint3f &min_point, LPoint3f &max_point, bool &found_any, Thread *current_thread) const
 Expands min_point and max_point to include all of the vertices in the Geom, if any.
void calc_tight_bounds (LPoint3f &min_point, LPoint3f &max_point, bool &found_any, const GeomVertexData *vertex_data, bool got_mat, const LMatrix4f &mat, const InternalName *column_name, Thread *current_thread) const
 Similar to calc_tight_bounds(), for UV coordinates or other named columns.
bool check_valid (const GeomVertexData *vertex_data) const
 Verifies that the all of the primitives within the geom reference vertices that actually exist within the indicated GeomVertexData.
bool check_valid () const
 Verifies that the all of the primitives within the geom reference vertices that actually exist within the geom's GeomVertexData.
void clear_bounds ()
 Reverses the effect of a previous call to set_bounds(), and allows the bounding volume to be automatically computed once more based on the vertices.
void clear_cache ()
 Removes all of the previously-cached results of munge_geom().
void clear_cache_stage (Thread *current_thread)
 Removes all of the previously-cached results of munge_geom(), at the current pipeline stage and upstream.
void clear_primitives ()
 Removes all the primitives from the Geom object (but keeps the same table of vertices).
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
 Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
virtual bool copy_primitives_from (const Geom *other)
 Copies the primitives from the indicated Geom into this one.
 CPT (GeomPrimitive) get_primitive(int i) const
 CPT (BoundingVolume) get_bounds(Thread *current_thread
 CPT (GeomVertexData) get_vertex_data(Thread *current_thread
void decompose_in_place ()
 Decomposes all of the primitives within this Geom, leaving the results in place.
void doubleside_in_place ()
 Doublesides all of the primitives within this Geom, leaving the results in place.
bool draw (GraphicsStateGuardianBase *gsg, const GeomMunger *munger, const GeomVertexData *vertex_data, bool force, Thread *current_thread) const
 Actually draws the Geom with the indicated GSG, using the indicated vertex data (which might have been pre-munged to support the GSG's needs).
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 ()
UpdateSeq get_bam_modified () const
 Returns the current bam_modified counter.
int get_best_parent_from_Set (const std::set< int > &) const
BoundingVolume::BoundsType get_bounds_type () const
 Returns the bounding volume type set with set_bounds_type().
int get_cache_ref_count () const
 Returns the current reference count.
int get_geom_rendering () const
 Returns the set of GeomRendering bits that represent the rendering properties required to properly render this Geom.
UpdateSeq get_modified (Thread *current_thread=Thread::get_current_thread()) const
 Returns a sequence number which is guaranteed to change at least every time any of the primitives in the Geom is modified, or the set of primitives is modified.
int get_nested_vertices (Thread *current_thread=Thread::get_current_thread()) const
 Returns the number of vertices rendered by all primitives within the Geom.
int get_num_bytes () const
 Returns the number of bytes consumed by the geom and its primitives (but not including its vertex table).
int get_num_primitives () const
 Returns the number of GeomPrimitive objects stored within the Geom, each of which represents a number of primitives of a particular type.
PrimitiveType get_primitive_type () const
 Returns the fundamental primitive type that is common to all GeomPrimitives added within the Geom.
int get_ref_count () const
 Returns the current reference count.
ShadeModel get_shade_model () const
 Returns the shade model common to all of the individual GeomPrimitives that have been added to the geom.
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 minimum (i.e.
WeakReferenceListget_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 is_empty () const
 Returns true if there appear to be no vertices to be rendered by this Geom, false if has some actual data.
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 geom 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.
virtual Geommake_copy () const
 Returns a newly-allocated Geom that is a shallow copy of this one.
int make_nonindexed (bool composite_only)
 Converts the geom from indexed to nonindexed by duplicating vertices as necessary.
void make_points_in_place ()
 Replaces the GeomPrimitives within this Geom with corresponding GeomPoints.
 MAKE_SEQ (get_primitives, get_num_primitives, get_primitive)
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_bounds_stale () const
 Marks the bounding volume of the Geom as stale so that it should be recomputed.
void offset_vertices (const GeomVertexData *data, int offset)
 Replaces a Geom's vertex table with a new table, and simultaneously adds the indicated offset to all vertex references within the Geom's primitives.
void operator delete (void *ptr, void *)
void operator delete (void *ptr)
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 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 new[] (size_t size, void *ptr)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size)
void operator= (const Geom &copy)
 The copy assignment operator is not pipeline-safe.
virtual void output (ostream &out) const
void prepare (PreparedGraphicsObjects *prepared_objects)
 Indicates that the geom should be enqueued to be prepared in the indicated prepared_objects at the beginning of the next frame.
GeomContextprepare_now (PreparedGraphicsObjects *prepared_objects, GraphicsStateGuardianBase *gsg)
 Creates a context for the geom on the particular GSG, if it does not already exist.
 PT (Geom) reverse() const
 PT (GeomVertexData) modify_vertex_data()
 PT (GeomPrimitive) modify_primitive(int i)
 PT (Geom) doubleside() const
 PT (Geom) decompose() const
 PT (Geom) rotate() const
 PT (Geom) unify(int max_indices
 PT (Geom) make_points() const
void ref () const
 Explicitly increments the reference count.
bool release (PreparedGraphicsObjects *prepared_objects)
 Frees the geom context only on the indicated object, if it exists there.
int release_all ()
 Frees the context allocated on all objects for which the geom has been declared.
void remove_primitive (int i)
 Removes the ith primitive from the list.
bool request_resident () const
 Returns true if all the primitive arrays are 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.
void reverse_in_place ()
 Reverses all of the primitives within this Geom, leaving the results in place.
void rotate_in_place ()
 Rotates all of the primitives within this Geom, leaving the results in place.
void set_bounds (const BoundingVolume *volume)
 Resets the bounding volume so that it is the indicated volume.
void set_bounds_type (BoundingVolume::BoundsType bounds_type)
 Specifies the desired type of bounding volume that will be created for this Geom.
void set_primitive (int i, const GeomPrimitive *primitive)
 Replaces the ith GeomPrimitive object stored within the Geom with the new object.
void set_usage_hint (UsageHint usage_hint)
 Changes the UsageHint hint for all of the primitives on this Geom to the same value.
void set_vertex_data (const GeomVertexData *data)
 Replaces the Geom's underlying vertex data table with a completely new table.
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.
void transform_vertices (const LMatrix4f &mat)
 Applies the indicated transform to all of the vertices in the Geom.
void unify_in_place (int max_indices, bool preserve_order)
 Unifies all of the primitives contained within this Geom into a single (or as few as possible, within the constraints of max_indices) primitive objects.
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.
virtual 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 TypeHandle get_class_type ()
static UpdateSeq get_next_modified ()
 Returns a monotonically increasing sequence.
static void init_type ()
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 Geom.

Public Attributes

bool preserve_order const
static BamReaderreader = NULL)

Static Public Attributes

static TypedWritable *const Null = (TypedWritable*)0L

Protected Member Functions

 Geom (const Geom &copy)
 Use make_copy() to duplicate a Geom.
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 Geom.
virtual PT (CopyOnWriteObject) make_cow_copy()

Static Protected Member Functions

static TypedWritablemake_from_bam (const FactoryParams &params)
 This function is called by the BamReader's factory when a new object of type Geom is encountered in the Bam file.

Friends

class CacheEntry
class GeomContext
class GeomMunger
class GeomPipelineReader
class PreparedGraphicsObjects

Detailed Description

A container for geometry primitives.

This class associates one or more GeomPrimitive objects with a table of vertices defined by a GeomVertexData object. All of the primitives stored in a particular Geom are drawn from the same set of vertices (each primitive uses a subset of all of the vertices in the table), and all of them must be rendered at the same time, in the same graphics state.

Definition at line 58 of file geom.h.


Constructor & Destructor Documentation

Geom::Geom ( const Geom copy) [protected]

Use make_copy() to duplicate a Geom.

Definition at line 69 of file geom.cxx.


Member Function Documentation

void Geom::add_primitive ( const GeomPrimitive primitive)

Adds a new GeomPrimitive structure to the Geom object.

This specifies a particular subset of vertices that are used to define geometric primitives of the indicated type.

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 366 of file geom.cxx.

References GeomPrimitive::check_valid(), clear_cache_stage(), Thread::get_current_thread(), and get_next_modified().

Referenced by copy_primitives_from().

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 Geom::calc_tight_bounds ( LPoint3f min_point,
LPoint3f max_point,
bool &  found_any,
const GeomVertexData vertex_data,
bool  got_mat,
const LMatrix4f mat,
Thread current_thread 
) const [inline]

Expands min_point and max_point to include all of the vertices in the Geom, if any.

found_any is set true if any points are found. It is the caller's responsibility to initialize min_point, max_point, and found_any before calling this function.

This version of the method allows the Geom to specify an alternate vertex data table (for instance, if the vertex data has already been munged), and also allows the result to be computed in any coordinate space by specifying a transform matrix.

Definition at line 370 of file geom.I.

Referenced by calc_tight_bounds().

void Geom::calc_tight_bounds ( LPoint3f min_point,
LPoint3f max_point,
bool &  found_any,
Thread current_thread 
) const [inline]

Expands min_point and max_point to include all of the vertices in the Geom, if any.

found_any is set true if any points are found. It is the caller's responsibility to initialize min_point, max_point, and found_any before calling this function.

This version of the method assumes the Geom will use its own vertex data, and the results are computed in the Geom's own coordinate space.

Definition at line 397 of file geom.I.

References calc_tight_bounds(), and LMatrix4f::ident_mat().

void Geom::calc_tight_bounds ( LPoint3f min_point,
LPoint3f max_point,
bool &  found_any,
const GeomVertexData vertex_data,
bool  got_mat,
const LMatrix4f mat,
const InternalName column_name,
Thread current_thread 
) const [inline]

Similar to calc_tight_bounds(), for UV coordinates or other named columns.

Definition at line 412 of file geom.I.

bool Geom::check_valid ( ) const

Verifies that the all of the primitives within the geom reference vertices that actually exist within the geom's GeomVertexData.

Returns true if the geom appears to be valid, false otherwise.

Definition at line 924 of file geom.cxx.

References Thread::get_current_thread().

Referenced by GeomNode::add_geom(), GeomNode::check_valid(), and GeomNode::set_geom().

bool Geom::check_valid ( const GeomVertexData vertex_data) const

Verifies that the all of the primitives within the geom reference vertices that actually exist within the indicated GeomVertexData.

Returns true if the geom appears to be valid, false otherwise.

Definition at line 941 of file geom.cxx.

References Thread::get_current_thread().

void Geom::clear_bounds ( ) [inline]

Reverses the effect of a previous call to set_bounds(), and allows the bounding volume to be automatically computed once more based on the vertices.

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 348 of file geom.I.

void Geom::clear_cache ( )

Removes all of the previously-cached results of munge_geom().

This blows away the entire cache, upstream and downstream the pipeline. Use clear_cache_stage() instead if you only want to blow away the cache at the current stage and upstream.

Definition at line 1045 of file geom.cxx.

Referenced by operator=().

void Geom::clear_cache_stage ( Thread current_thread)

Removes all of the previously-cached results of munge_geom(), at the current pipeline stage and upstream.

Does not affect the downstream cache.

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 1068 of file geom.cxx.

Referenced by add_primitive(), clear_primitives(), decompose_in_place(), doubleside_in_place(), make_nonindexed(), make_points_in_place(), offset_vertices(), remove_primitive(), reverse_in_place(), rotate_in_place(), set_primitive(), set_usage_hint(), set_vertex_data(), and unify_in_place().

void Geom::clear_primitives ( )

Removes all the primitives from the Geom object (but keeps the same table of vertices).

You may then re-add primitives one at a time via calls to add_primitive().

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 438 of file geom.cxx.

References clear_cache_stage(), and Thread::get_current_thread().

int TypedWritable::complete_pointers ( TypedWritable **  p_list,
BamReader manager 
) [virtual, inherited]

Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().

Returns the number of pointers processed.

This is the callback function that is made by the BamReader at some later point, after all of the required pointers have been filled in. It is necessary because there might be forward references in a bam file; when we call read_pointer() in fillin(), the object may not have been read from the file yet, so we do not have a pointer available at that time. Thus, instead of returning a pointer, read_pointer() simply reserves a later callback. This function provides that callback. The calling object is responsible for keeping track of the number of times it called read_pointer() and extracting the same number of pointers out of the supplied vector, and storing them appropriately within the object.

Reimplemented in CFDoCullCommand, AnimBundleNode, AnimChannelMatrixDynamic, AnimChannelScalarDynamic, AnimGroup, MovingPartBase, PartBundle, PartBundleNode, PartGroup, Character, CharacterJoint, CharacterJointEffect, CharacterVertexSlider, JointVertexTransform, CollisionNode, DataNodeTransmit, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, GeomVertexFormat, SliderTable, TextureStage, TransformBlendTable, TransformTable, PiecewiseCurve, ClipPlaneAttrib, FogAttrib, LensNode, LightAttrib, MaterialAttrib, PortalNode, RenderEffects, RenderState, TexGenAttrib, TexMatrixAttrib, TexProjectorEffect, TextureAttrib, BamCacheIndex, RecorderFrame, EggFile, ImageFile, PaletteGroup, PaletteGroups, PaletteImage, PalettePage, Palettizer, SourceTextureImage, TextureImage, TexturePlacement, TextureProperties, and TextureReference.

Definition at line 103 of file typedWritable.cxx.

bool Geom::copy_primitives_from ( const Geom other) [virtual]

Copies the primitives from the indicated Geom into this one.

This does require that both Geoms contain the same fundamental type primitives, both have a compatible shade model, and both use the same GeomVertexData. Both Geoms must also be the same specific class type (i.e. if one is a GeomTextGlyph, they both must be.)

Returns true if the copy is successful, or false otherwise (because the Geoms were mismatched).

Definition at line 794 of file geom.cxx.

References add_primitive(), get_num_primitives(), get_primitive_type(), and get_shade_model().

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 Geom::decompose_in_place ( )

Decomposes all of the primitives within this Geom, leaving the results in place.

See GeomPrimitive::decompose().

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 461 of file geom.cxx.

References clear_cache_stage(), Thread::get_current_thread(), and get_next_modified().

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().

void Geom::doubleside_in_place ( )

Doublesides all of the primitives within this Geom, leaving the results in place.

See GeomPrimitive::doubleside().

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 499 of file geom.cxx.

References clear_cache_stage(), Thread::get_current_thread(), and get_next_modified().

bool Geom::draw ( GraphicsStateGuardianBase gsg,
const GeomMunger munger,
const GeomVertexData vertex_data,
bool  force,
Thread current_thread 
) const

Actually draws the Geom with the indicated GSG, using the indicated vertex data (which might have been pre-munged to support the GSG's needs).

Returns true if all of the primitives were drawn normally, false if there was a problem (for instance, some of the data was nonresident). If force is passed true, it will wait for the data to become resident if necessary.

Definition at line 1210 of file geom.cxx.

References GeomPipelineReader::check_usage_hint(), and GeomPipelineReader::draw().

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 Geom::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 Geom.

Reimplemented from TypedWritable.

Definition at line 1570 of file geom.cxx.

References BamReader::read_cdata().

void Geom::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 1547 of file geom.cxx.

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().

BoundingVolume::BoundsType Geom::get_bounds_type ( ) const [inline]

Returns the bounding volume type set with set_bounds_type().

Definition at line 307 of file geom.I.

int CachedTypedWritableReferenceCount::get_cache_ref_count ( ) const [inline, inherited]
int Geom::get_geom_rendering ( ) const [inline]

Returns the set of GeomRendering bits that represent the rendering properties required to properly render this Geom.

Definition at line 54 of file geom.I.

Referenced by StandardMunger::munge_geom_impl(), and StandardMunger::premunge_geom_impl().

UpdateSeq Geom::get_modified ( Thread current_thread = Thread::get_current_thread()) const [inline]

Returns a sequence number which is guaranteed to change at least every time any of the primitives in the Geom is modified, or the set of primitives is modified.

However, this does not include modifications to the vertex data, which should be tested separately.

Definition at line 257 of file geom.I.

Referenced by GeomMunger::munge_geom().

int Geom::get_nested_vertices ( Thread current_thread = Thread::get_current_thread()) const

Returns the number of vertices rendered by all primitives within the Geom.

Definition at line 976 of file geom.cxx.

UpdateSeq Geom::get_next_modified ( ) [static]

Returns a monotonically increasing sequence.

Each time this is called, a new sequence number is returned, higher than the previous value.

This is used to ensure that GeomVertexArrayData::get_modified() and GeomPrimitive::get_modified() update from the same space, so that Geom::get_modified() returns a meaningful value.

Definition at line 1236 of file geom.cxx.

Referenced by GeomPrimitive::add_consecutive_vertices(), add_primitive(), GeomPrimitive::add_vertex(), GeomVertexData::clear_rows(), GeomPrimitive::clear_vertices(), GeomPrimitive::close_primitive(), GeomVertexArrayDataHandle::copy_data_from(), GeomVertexArrayDataHandle::copy_subdata_from(), decompose_in_place(), doubleside_in_place(), GeomVertexArrayDataHandle::get_write_pointer(), make_nonindexed(), make_points_in_place(), GeomPrimitive::modify_ends(), GeomPrimitive::offset_vertices(), offset_vertices(), GeomVertexData::operator=(), GeomVertexArrayData::operator=(), remove_primitive(), reverse_in_place(), rotate_in_place(), GeomVertexArrayDataHandle::set_data(), GeomPrimitive::set_ends(), GeomVertexData::set_format(), GeomPrimitive::set_minmax(), GeomPrimitive::set_nonindexed_vertices(), set_primitive(), GeomVertexData::set_slider_table(), GeomVertexArrayDataHandle::set_subdata(), GeomVertexData::set_transform_blend_table(), GeomVertexData::set_transform_table(), GeomVertexArrayData::set_usage_hint(), GeomPrimitive::set_usage_hint(), set_usage_hint(), GeomVertexData::set_usage_hint(), GeomPrimitive::set_vertices(), and unify_in_place().

int Geom::get_num_bytes ( ) const

Returns the number of bytes consumed by the geom and its primitives (but not including its vertex table).

Definition at line 835 of file geom.cxx.

int Geom::get_num_primitives ( ) const [inline]

Returns the number of GeomPrimitive objects stored within the Geom, each of which represents a number of primitives of a particular type.

Definition at line 111 of file geom.I.

Referenced by SpriteParticleRenderer::add_from_node(), copy_primitives_from(), PhysxSoftBodyNode::set_from_geom(), and unify_in_place().

Geom::PrimitiveType Geom::get_primitive_type ( ) const [inline]

Returns the fundamental primitive type that is common to all GeomPrimitives added within the Geom.

All nested primitives within a particular Geom must be the same type (that is, you can mix triangles and tristrips, because they are both the same fundamental type PT_polygons, but you cannot mix triangles and points withn the same Geom).

Definition at line 28 of file geom.I.

Referenced by copy_primitives_from().

int ReferenceCount::get_ref_count ( ) const [inline, inherited]
Geom::ShadeModel Geom::get_shade_model ( ) const [inline]

Returns the shade model common to all of the individual GeomPrimitives that have been added to the geom.

Definition at line 41 of file geom.I.

Referenced by copy_primitives_from().

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().

Geom::UsageHint Geom::get_usage_hint ( ) const [inline]

Returns the minimum (i.e.

most dynamic) usage_hint among all of the individual GeomPrimitives that have been added to the geom.

Definition at line 67 of file geom.I.

Referenced by SceneGraphReducer::r_make_nonindexed().

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 Geom::is_empty ( ) const [inline]

Returns true if there appear to be no vertices to be rendered by this Geom, false if has some actual data.

Definition at line 97 of file geom.I.

Referenced by GeomNode::add_for_draw().

bool TypedObject::is_exact_type ( TypeHandle  handle) const [inline, inherited]
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 Geom::is_prepared ( PreparedGraphicsObjects prepared_objects) const

Returns true if the geom has already been prepared or enqueued for preparation on the indicated GSG, false otherwise.

Definition at line 1104 of file geom.cxx.

References PreparedGraphicsObjects::is_geom_queued().

Referenced by PreparedGraphicsObjects::is_geom_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().

Geom * Geom::make_copy ( ) const [virtual]

Returns a newly-allocated Geom that is a shallow copy of this one.

It will be a different Geom pointer, but its internal data may or may not be shared with that of the original Geom.

Definition at line 118 of file geom.cxx.

Referenced by StandardMunger::munge_geom_impl(), and StandardMunger::premunge_geom_impl().

TypedWritable * Geom::make_from_bam ( const FactoryParams params) [static, protected]

This function is called by the BamReader's factory when a new object of type Geom is encountered in the Bam file.

It should create the Geom and extract its information from the file.

Definition at line 1527 of file geom.cxx.

References BamReader::register_finalize().

Referenced by register_with_read_factory().

int Geom::make_nonindexed ( bool  composite_only)

Converts the geom from indexed to nonindexed by duplicating vertices as necessary.

If composite_only is true, then only composite primitives such as trifans and tristrips are converted. Returns the number of GeomPrimitive objects converted.

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 252 of file geom.cxx.

References clear_cache_stage(), Thread::get_current_thread(), and get_next_modified().

Referenced by SceneGraphReducer::r_make_nonindexed().

void Geom::make_points_in_place ( )

Replaces the GeomPrimitives within this Geom with corresponding GeomPoints.

See GeomPrimitive::make_points().

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 752 of file geom.cxx.

References clear_cache_stage(), Thread::get_current_thread(), and get_next_modified().

void TypedWritable::mark_bam_modified ( ) [inline, inherited]
void Geom::mark_bounds_stale ( ) const [inline]

Marks the bounding volume of the Geom as stale so that it should be recomputed.

Usually it is not necessary to call this explicitly.

Definition at line 270 of file geom.I.

void Geom::offset_vertices ( const GeomVertexData data,
int  offset 
)

Replaces a Geom's vertex table with a new table, and simultaneously adds the indicated offset to all vertex references within the Geom's primitives.

This is intended to be used to combine multiple GeomVertexDatas from different Geoms into a single big buffer, with each Geom referencing a subset of the vertices in the buffer.

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 209 of file geom.cxx.

References clear_cache_stage(), Thread::get_current_thread(), and get_next_modified().

void Geom::operator= ( const Geom 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 Geom that is actively being used for rendering.

Definition at line 84 of file geom.cxx.

References clear_cache().

void Geom::prepare ( PreparedGraphicsObjects prepared_objects)

Indicates that the geom should be enqueued to be prepared in the indicated prepared_objects at the beginning of the next frame.

This will ensure the geom is already loaded into geom memory if it is expected to be rendered soon.

Use this function instead of prepare_now() to preload geoms from a user interface standpoint.

Definition at line 1092 of file geom.cxx.

References PreparedGraphicsObjects::enqueue_geom().

GeomContext * Geom::prepare_now ( PreparedGraphicsObjects prepared_objects,
GraphicsStateGuardianBase gsg 
)

Creates a context for the geom on the particular GSG, if it does not already exist.

Returns the new (or old) GeomContext. This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new geoms. If this is not necessarily the case, you should use prepare() instead.

Normally, this is not called directly except by the GraphicsStateGuardian; a geom does not need to be explicitly prepared by the user before it may be rendered.

Definition at line 1181 of file geom.cxx.

References PreparedGraphicsObjects::prepare_geom_now().

Referenced by PreparedGraphicsObjects::begin_frame().

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 Geom::register_with_read_factory ( ) [static]

Tells the BamReader how to create objects of type Geom.

Definition at line 1501 of file geom.cxx.

References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().

bool Geom::release ( PreparedGraphicsObjects prepared_objects)

Frees the geom 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 1121 of file geom.cxx.

References PreparedGraphicsObjects::dequeue_geom(), and PreparedGraphicsObjects::release_geom().

int Geom::release_all ( )

Frees the context allocated on all objects for which the geom has been declared.

Returns the number of contexts which have been freed.

Definition at line 1142 of file geom.cxx.

References PreparedGraphicsObjects::release_geom().

void Geom::remove_primitive ( int  i)

Removes the ith primitive from the list.

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 409 of file geom.cxx.

References clear_cache_stage(), Thread::get_current_thread(), and get_next_modified().

bool Geom::request_resident ( ) const

Returns true if all the primitive arrays are currently resident in memory.

If this returns false, the data will be brought back into memory shortly; try again later.

This does not also test the Geom's associated GeomVertexData. That must be tested separately.

Definition at line 861 of file geom.cxx.

Referenced by GeomMunger::munge_geom().

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 Geom::reverse_in_place ( )

Reverses all of the primitives within this Geom, leaving the results in place.

See GeomPrimitive::reverse().

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 537 of file geom.cxx.

References clear_cache_stage(), Thread::get_current_thread(), and get_next_modified().

void Geom::rotate_in_place ( )

Rotates all of the primitives within this Geom, leaving the results in place.

See GeomPrimitive::rotate().

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 575 of file geom.cxx.

References clear_cache_stage(), Thread::get_current_thread(), and get_next_modified().

void Geom::set_bounds ( const BoundingVolume volume) [inline]

Resets the bounding volume so that it is the indicated volume.

When it is explicitly set, the bounding volume will no longer be automatically computed; call clear_bounds() if you would like to return the bounding volume to its default behavior.

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 326 of file geom.I.

void Geom::set_bounds_type ( BoundingVolume::BoundsType  bounds_type) [inline]

Specifies the desired type of bounding volume that will be created for this Geom.

This is normally BoundingVolume::BT_default, which means to set the type according to the config variable "bounds-type".

If this is BT_sphere or BT_box, a BoundingSphere or BoundingBox is explicitly created. If it is BT_best, a BoundingBox is created.

This affects the implicit bounding volume only. If an explicit bounding volume is set on the Geom with set_bounds(), that bounding volume type is used. (This is different behavior from the similar method on PandaNode.)

Definition at line 294 of file geom.I.

void Geom::set_primitive ( int  i,
const GeomPrimitive primitive 
)

Replaces the ith GeomPrimitive object stored within the Geom with the new object.

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 320 of file geom.cxx.

References GeomPrimitive::check_valid(), clear_cache_stage(), Thread::get_current_thread(), and get_next_modified().

void Geom::set_usage_hint ( Geom::UsageHint  usage_hint)

Changes the UsageHint hint for all of the primitives on this Geom to the same value.

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 134 of file geom.cxx.

References clear_cache_stage(), Thread::get_current_thread(), and get_next_modified().

void Geom::set_vertex_data ( const GeomVertexData data)

Replaces the Geom's underlying vertex data table with a completely new table.

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 183 of file geom.cxx.

References clear_cache_stage(), and Thread::get_current_thread().

Referenced by GeomTransformer::apply_texture_colors(), StandardMunger::munge_geom_impl(), StandardMunger::premunge_geom_impl(), GeomTransformer::reverse_normals(), GeomTransformer::set_color(), GeomTransformer::set_format(), GeomTransformer::transform_colors(), GeomTransformer::transform_texcoords(), and GeomTransformer::transform_vertices().

bool CachedTypedWritableReferenceCount::test_ref_count_integrity ( ) const [inline, inherited]
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().

void Geom::transform_vertices ( const LMatrix4f mat)

Applies the indicated transform to all of the vertices in the Geom.

If the Geom happens to share a vertex table with another Geom, this operation will duplicate the vertex table instead of breaking the other Geom; however, if multiple Geoms with shared tables are transformed by the same matrix, they will no longer share tables after the operation. Consider using the GeomTransformer if you will be applying the same transform to multiple Geoms.

Definition at line 892 of file geom.cxx.

void Geom::unify_in_place ( int  max_indices,
bool  preserve_order 
)

Unifies all of the primitives contained within this Geom into a single (or as few as possible, within the constraints of max_indices) primitive objects.

This may require decomposing the primitives if, for instance, the Geom contains both triangle strips and triangle fans.

max_indices represents the maximum number of indices that will be put in any one GeomPrimitive. If preserve_order is true, then the primitives will not be reordered during the operation, even if this results in a suboptimal result.

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 621 of file geom.cxx.

References GeomPrimitive::check_valid(), clear_cache_stage(), GeomPrimitive::clear_vertices(), Thread::get_current_thread(), get_next_modified(), get_num_primitives(), GeomPrimitive::get_num_vertices(), GeomPrimitive::get_primitive_end(), GeomPrimitive::get_primitive_num_vertices(), GeomPrimitive::get_primitive_start(), GeomPrimitive::get_vertex(), and GeomPrimitive::set_shade_model().

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().

void Geom::write_datagram ( BamWriter manager,
Datagram dg 
) [virtual]

Writes the contents of this object to the datagram for shipping out to a Bam file.

Reimplemented from TypedWritable.

Definition at line 1512 of file geom.cxx.

References BamWriter::write_cdata().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations