Panda3D
|
This class defines the physical layout of the vertex data stored within a Geom. More...
#include "geomVertexFormat.h"
Public Member Functions | |
GeomVertexFormat (const GeomVertexArrayFormat *array_format) | |
GeomVertexFormat (const GeomVertexFormat ©) | |
size_t | add_array (const GeomVertexArrayFormat *array_format) |
Adds the indicated array definition to the list of arrays included within this vertex format definition. | |
void | align_columns_for_animation () |
Reprocesses the columns in the format to align the C_point and C_vector columns to 16-byte boundaries to allow for the more efficient SSE2 operations (assuming SSE2 is enabled in the build). | |
void | clear_arrays () |
Removes all of the array definitions from the format and starts over. | |
int | compare_to (const GeomVertexFormat &other) const |
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 (GeomVertexFormat) get_post_animated_format() const | |
CPT (GeomVertexFormat) get_union_format(const GeomVertexFormat *other) const | |
virtual TypeHandle | force_init_type () |
const GeomVertexAnimationSpec & | get_animation () const |
const GeomVertexArrayFormat * | get_array (size_t array) const |
bool | get_array_info (const InternalName *name, int &array_index, const GeomVertexColumn *&column) const |
Quickly looks up the indicated column within all of the nested arrays and sets array_index and column appropriately. | |
int | get_array_with (const InternalName *name) const |
Returns the index number of the array with the indicated column, or -1 if no arrays contained that name. | |
int | get_array_with (size_t i) const |
Returns the index number of the array with the ith column. | |
int | get_color_array_index () const |
Returns the array index of the array including the "color" column, or -1 if there is no such array. | |
const GeomVertexColumn * | get_color_column () const |
Returns the column definition of the "color" column, or NULL if there is no such column. | |
const GeomVertexColumn * | get_column (const InternalName *name) const |
const GeomVertexColumn * | get_column (size_t i) const |
const InternalName * | get_column_name (size_t i) const |
const InternalName * | get_morph_base (size_t n) const |
const InternalName * | get_morph_delta (size_t n) const |
const InternalName * | get_morph_slider (size_t n) const |
int | get_normal_array_index () const |
Returns the array index of the array including the "normal" column, or -1 if there is no such array. | |
const GeomVertexColumn * | get_normal_column () const |
Returns the column definition of the "normal" column, or NULL if there is no such column. | |
size_t | get_num_arrays () const |
size_t | get_num_columns () const |
size_t | get_num_morphs () const |
size_t | get_num_points () const |
size_t | get_num_texcoords () const |
size_t | get_num_vectors () const |
const InternalName * | get_point (size_t n) const |
const InternalName * | get_texcoord (size_t n) const |
virtual TypeHandle | get_type () const |
const InternalName * | get_vector (size_t n) const |
int | get_vertex_array_index () const |
Returns the array index of the array including the "vertex" column, or -1 if there is no such array. | |
const GeomVertexColumn * | get_vertex_column () const |
Returns the column definition of the "vertex" column, or NULL if there is no such column. | |
bool | has_column (const InternalName *name) const |
void | insert_array (size_t array, const GeomVertexArrayFormat *array_format) |
bool | is_registered () const |
void | maybe_align_columns_for_animation () |
Calls align_columns_for_animation() if this format's AnimationSpec indicates that it contains animated vertices, and if vertex-animation- align-16 is true. | |
GeomVertexArrayFormat * | modify_array (size_t array) |
void | operator= (const GeomVertexFormat ©) |
void | output (std::ostream &out) const |
void | pack_columns () |
Removes wasted space between columns. | |
void | remove_array (size_t array) |
void | remove_column (const InternalName *name, bool keep_empty_array=false) |
Removes the named column from the format, from whichever array it exists in. | |
void | remove_empty_arrays () |
Removes the arrays that define no columns. | |
void | set_animation (const GeomVertexAnimationSpec &animation) |
void | set_array (size_t array, const GeomVertexArrayFormat *format) |
virtual bool | unref () const |
This method overrides ReferenceCount::unref() to unregister the object when its reference count goes to zero. | |
void | write (std::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. | |
void | write_with_data (std::ostream &out, int indent_level, const GeomVertexData *data) const |
![]() | |
TypedWritableReferenceCount (const TypedWritableReferenceCount ©) | |
virtual ReferenceCount * | as_reference_count () |
Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. | |
void | operator= (const TypedWritableReferenceCount ©) |
![]() | |
TypedWritable (const TypedWritable ©) | |
vector_uchar | encode_to_bam_stream () const |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a bytes object. | |
bool | encode_to_bam_stream (vector_uchar &data, BamWriter *writer=nullptr) 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. | |
UpdateSeq | get_bam_modified () const |
Returns the current bam_modified counter. | |
void | mark_bam_modified () |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. | |
void | operator= (const TypedWritable ©) |
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. | |
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. | |
![]() | |
TypedObject (const TypedObject ©)=default | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
int | get_best_parent_from_Set (const std::set< int > &) const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
bool | is_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. | |
TypedObject & | operator= (const TypedObject ©)=default |
![]() | |
void | operator delete (void *, void *) |
void | operator delete (void *ptr) |
void | operator delete[] (void *, void *) |
void | operator delete[] (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) |
![]() | |
int | get_ref_count () const |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. | |
void | ref () const |
Explicitly increments the reference count. | |
bool | ref_if_nonzero () const |
Atomically increases the reference count of this object if it is not zero. | |
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 | unref_if_one () const |
Atomically decreases the reference count of this object if it is one. | |
WeakReferenceList * | weak_ref () |
Adds the indicated PointerToVoid as a weak reference to this object. | |
void | weak_unref () |
Removes the indicated PointerToVoid as a weak reference to this object. | |
Static Public Member Functions | |
static | CPT (GeomVertexFormat) register_format(const GeomVertexArrayFormat *format) |
static | CPT (GeomVertexFormat) register_format(const GeomVertexFormat *format) |
static TypeHandle | get_class_type () |
static const GeomVertexFormat * | get_empty () |
Returns a standard vertex format containing no arrays at all, useful for pull-style vertex rendering. | |
static const GeomVertexFormat * | get_v3 () |
Returns a standard vertex format with just a 3-component vertex position. | |
static const GeomVertexFormat * | get_v3c4 () |
Returns a standard vertex format with a 4-component color and a 3-component vertex position. | |
static const GeomVertexFormat * | get_v3c4t2 () |
Returns a standard vertex format with a 2-component texture coordinate pair, a 4-component color, and a 3-component vertex position. | |
static const GeomVertexFormat * | get_v3cp () |
Returns a standard vertex format with a packed color and a 3-component vertex position. | |
static const GeomVertexFormat * | get_v3cpt2 () |
Returns a standard vertex format with a 2-component texture coordinate pair, a packed color, and a 3-component vertex position. | |
static const GeomVertexFormat * | get_v3n3 () |
Returns a standard vertex format with a 3-component normal and a 3-component vertex position. | |
static const GeomVertexFormat * | get_v3n3c4 () |
Returns a standard vertex format with a 4-component color, a 3-component normal, and a 3-component vertex position. | |
static const GeomVertexFormat * | get_v3n3c4t2 () |
Returns a standard vertex format with a 2-component texture coordinate pair, a 4-component color, a 3-component normal, and a 3-component vertex position. | |
static const GeomVertexFormat * | get_v3n3cp () |
Returns a standard vertex format with a packed color, a 3-component normal, and a 3-component vertex position. | |
static const GeomVertexFormat * | get_v3n3cpt2 () |
Returns a standard vertex format with a 2-component texture coordinate pair, a packed color, a 3-component normal, and a 3-component vertex position. | |
static const GeomVertexFormat * | get_v3n3t2 () |
Returns a standard vertex format with a 2-component texture coordinate pair, a 3-component normal, and a 3-component vertex position. | |
static const GeomVertexFormat * | get_v3t2 () |
Returns a standard vertex format with a 2-component texture coordinate pair and a 3-component vertex position. | |
static void | init_type () |
static void | register_with_read_factory () |
Tells the BamReader how to create objects of type GeomVertexFormat. | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
static | PT (TypedWritableReferenceCount) decode_from_bam_stream(vector_uchar data |
![]() | |
static bool | decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, vector_uchar data, BamReader *reader=nullptr) |
Reads the bytes created by a previous call to encode_to_bam_stream(), and extracts the single object on those bytes. | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
Public Attributes | |
get_animation | |
Returns the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation. | |
get_array | |
Returns the description of the nth array used by the format. | |
get_column | |
Returns the ith column of the specification, across all arrays. | |
get_column_name | |
Returns the name of the ith column, across all arrays. | |
get_morph_base | |
Returns the name of the base column that the nth morph modifies. | |
get_morph_delta | |
Returns the name of the column that defines the nth morph. | |
get_morph_slider | |
Returns the slider name associated with the nth morph column. | |
get_num_arrays | |
Returns the number of individual arrays required by the format. | |
get_num_columns | |
Returns the total number of different columns in the specification, across all arrays. | |
get_num_morphs | |
Returns the number of columns within the format that represent morph deltas. | |
get_num_points | |
Returns the number of columns within the format that represent points in space. | |
get_num_texcoords | |
Returns the number of columns within the format that represent texture coordinates. | |
get_num_vectors | |
Returns the number of columns within the format that represent directional vectors. | |
get_point | |
Returns the name of the nth point column. | |
get_texcoord | |
Returns the name of the nth texcoord column. | |
get_vector | |
Returns the name of the nth vector column. | |
has_column | |
Returns true if the format has the named column, false otherwise. | |
insert_array | |
Adds the indicated array definition to the list of arrays at the indicated position. | |
is_registered | |
Returns true if this format has been registered, false if it has not. | |
remove_array | |
Removes the nth array from the format. | |
set_animation | |
Resets the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation. | |
set_array | |
Replaces the definition of the indicated array. | |
![]() | |
static BamReader * | reader = nullptr) |
![]() | |
get_type | |
![]() | |
get_ref_count | |
Returns the current reference count. | |
Friends | |
class | GeomMunger |
class | GeomVertexFormat::Registry |
Additional Inherited Members | |
![]() | |
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 , C_matrix , C_normal } |
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_strip_cut_index = 0x20000 , GR_flat_first_vertex = 0x02000 , GR_flat_last_vertex = 0x04000 , GR_shade_model_bits = 0x06000 , GR_render_mode_wireframe = 0x40000 , GR_render_mode_point = 0x80000 , GR_adjacency = 0x100000 } |
enum | NumericType { NT_uint8 , NT_uint16 , NT_uint32 , NT_packed_dcba , NT_packed_dabc , NT_float32 , NT_float64 , NT_stdfloat , NT_int8 , NT_int16 , NT_int32 , NT_packed_ufloat } |
enum | PrimitiveType { PT_none , PT_polygons , PT_lines , PT_points , PT_patches } |
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 } |
![]() | |
static TypedWritable *const | Null = nullptr |
This class defines the physical layout of the vertex data stored within a Geom.
The layout consists of a list of named columns, each of which has a numeric type and a size.
The columns are typically interleaved within a single array, but they may also be distributed among multiple different arrays; at the extreme, each column may be alone within its own array (which amounts to a parallel-array definition).
Thus, a GeomVertexFormat is really a list of GeomVertexArrayFormats, each of which contains a list of columns. However, a particular column name should not appear more than once in the format, even between different arrays.
There are a handful of standard pre-defined GeomVertexFormat objects, or you may define your own as needed. You may record any combination of standard and/or user-defined columns in your custom GeomVertexFormat constructions.
Definition at line 55 of file geomVertexFormat.h.
GeomVertexFormat::GeomVertexFormat | ( | ) |
Definition at line 28 of file geomVertexFormat.cxx.
GeomVertexFormat::GeomVertexFormat | ( | const GeomVertexArrayFormat * | array_format | ) |
Definition at line 38 of file geomVertexFormat.cxx.
GeomVertexFormat::GeomVertexFormat | ( | const GeomVertexFormat & | copy | ) |
Definition at line 49 of file geomVertexFormat.cxx.
|
virtual |
Definition at line 72 of file geomVertexFormat.cxx.
size_t GeomVertexFormat::add_array | ( | const GeomVertexArrayFormat * | array_format | ) |
Adds the indicated array definition to the list of arrays included within this vertex format definition.
The return value is the index number of the new array.
This may not be called once the format has been registered.
Definition at line 294 of file geomVertexFormat.cxx.
References is_registered.
void GeomVertexFormat::align_columns_for_animation | ( | ) |
Reprocesses the columns in the format to align the C_point and C_vector columns to 16-byte boundaries to allow for the more efficient SSE2 operations (assuming SSE2 is enabled in the build).
Also see maybe_align_columns_for_animation().
Definition at line 540 of file geomVertexFormat.cxx.
Referenced by maybe_align_columns_for_animation().
void GeomVertexFormat::clear_arrays | ( | ) |
Removes all of the array definitions from the format and starts over.
This may not be called once the format has been registered.
Definition at line 325 of file geomVertexFormat.cxx.
References is_registered.
int GeomVertexFormat::compare_to | ( | const GeomVertexFormat & | other | ) | const |
Definition at line 653 of file geomVertexFormat.cxx.
|
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 852 of file geomVertexFormat.cxx.
References TypedWritable::complete_pointers().
|
inlinevirtual |
Reimplemented from TypedWritableReferenceCount.
Definition at line 283 of file geomVertexFormat.h.
bool GeomVertexFormat::get_array_info | ( | const InternalName * | name, |
int & | array_index, | ||
const GeomVertexColumn *& | column ) const |
Quickly looks up the indicated column within all of the nested arrays and sets array_index and column appropriately.
Returns true if the data type exists in this format, false if it does not. If it returns false, array_index is set to -1, and column is set to NULL.
This may only be called after the format has been registered.
Definition at line 631 of file geomVertexFormat.cxx.
int GeomVertexFormat::get_array_with | ( | const InternalName * | name | ) | const |
Returns the index number of the array with the indicated column, or -1 if no arrays contained that name.
The return value can be passed to get_array_format() to get the format of the array. It may also be passed to GeomVertexData::get_array_data() or get_data() or set_data() to manipulate the actual array data.
This may only be called after the format has been registered.
Definition at line 428 of file geomVertexFormat.cxx.
int GeomVertexFormat::get_array_with | ( | size_t | i | ) | const |
Returns the index number of the array with the ith column.
The return value can be passed to get_array_format() to get the format of the array. It may also be passed to GeomVertexData::get_array_data() or get_data() or set_data() to manipulate the actual array data.
Definition at line 405 of file geomVertexFormat.cxx.
Referenced by GeomVertexReader::GeomVertexReader(), GeomVertexWriter::GeomVertexWriter(), GeomVertexData::copy_from(), GeomVertexReader::set_column(), GeomVertexWriter::set_column(), GeomVertexReader::set_column(), and GeomVertexWriter::set_column().
|
inlinestatic |
Definition at line 272 of file geomVertexFormat.h.
|
inline |
Returns the array index of the array including the "color" column, or -1 if there is no such array.
This may only be called after the format has been registered.
Definition at line 410 of file geomVertexFormat.I.
|
inline |
Returns the column definition of the "color" column, or NULL if there is no such column.
This may only be called after the format has been registered.
Definition at line 422 of file geomVertexFormat.I.
Referenced by CPT().
|
inlinestatic |
Returns a standard vertex format containing no arrays at all, useful for pull-style vertex rendering.
Definition at line 242 of file geomVertexFormat.I.
|
inline |
Returns the array index of the array including the "normal" column, or -1 if there is no such array.
This may only be called after the format has been registered.
Definition at line 386 of file geomVertexFormat.I.
|
inline |
Returns the column definition of the "normal" column, or NULL if there is no such column.
This may only be called after the format has been registered.
Definition at line 398 of file geomVertexFormat.I.
Referenced by CPT().
|
inlinevirtual |
Reimplemented from TypedWritableReferenceCount.
Definition at line 280 of file geomVertexFormat.h.
|
inlinestatic |
Returns a standard vertex format with just a 3-component vertex position.
Definition at line 250 of file geomVertexFormat.I.
|
inlinestatic |
Returns a standard vertex format with a 4-component color and a 3-component vertex position.
Definition at line 323 of file geomVertexFormat.I.
Referenced by BulletDebugNode::add_for_draw().
|
inlinestatic |
Returns a standard vertex format with a 2-component texture coordinate pair, a 4-component color, and a 3-component vertex position.
Definition at line 341 of file geomVertexFormat.I.
Referenced by PT().
|
inlinestatic |
Returns a standard vertex format with a packed color and a 3-component vertex position.
Definition at line 286 of file geomVertexFormat.I.
Referenced by LineSegs::create(), PortalClipper::draw_lines(), and PT().
|
inlinestatic |
Returns a standard vertex format with a 2-component texture coordinate pair, a packed color, and a 3-component vertex position.
Definition at line 304 of file geomVertexFormat.I.
|
inlinestatic |
Returns a standard vertex format with a 3-component normal and a 3-component vertex position.
Definition at line 259 of file geomVertexFormat.I.
|
inlinestatic |
Returns a standard vertex format with a 4-component color, a 3-component normal, and a 3-component vertex position.
Definition at line 332 of file geomVertexFormat.I.
|
inlinestatic |
Returns a standard vertex format with a 2-component texture coordinate pair, a 4-component color, a 3-component normal, and a 3-component vertex position.
Definition at line 351 of file geomVertexFormat.I.
|
inlinestatic |
Returns a standard vertex format with a packed color, a 3-component normal, and a 3-component vertex position.
Definition at line 295 of file geomVertexFormat.I.
|
inlinestatic |
Returns a standard vertex format with a 2-component texture coordinate pair, a packed color, a 3-component normal, and a 3-component vertex position.
Definition at line 314 of file geomVertexFormat.I.
Referenced by WindowFramework::load_default_model().
|
inlinestatic |
Returns a standard vertex format with a 2-component texture coordinate pair, a 3-component normal, and a 3-component vertex position.
Definition at line 277 of file geomVertexFormat.I.
|
inlinestatic |
Returns a standard vertex format with a 2-component texture coordinate pair and a 3-component vertex position.
Definition at line 268 of file geomVertexFormat.I.
Referenced by PfmVizzer::generate_vis_points(), PT(), PT(), and PT().
|
inline |
Returns the array index of the array including the "vertex" column, or -1 if there is no such array.
This may only be called after the format has been registered.
Definition at line 362 of file geomVertexFormat.I.
|
inline |
Returns the column definition of the "vertex" column, or NULL if there is no such column.
This may only be called after the format has been registered.
Definition at line 374 of file geomVertexFormat.I.
Referenced by CPT().
|
inlinestatic |
Definition at line 275 of file geomVertexFormat.h.
void GeomVertexFormat::maybe_align_columns_for_animation | ( | ) |
Calls align_columns_for_animation() if this format's AnimationSpec indicates that it contains animated vertices, and if vertex-animation- align-16 is true.
Definition at line 557 of file geomVertexFormat.cxx.
References align_columns_for_animation(), and GeomVertexAnimationSpec::get_animation_type.
void GeomVertexFormat::operator= | ( | const GeomVertexFormat & | copy | ) |
Definition at line 61 of file geomVertexFormat.cxx.
void GeomVertexFormat::output | ( | std::ostream & | out | ) | const |
Definition at line 567 of file geomVertexFormat.cxx.
void GeomVertexFormat::pack_columns | ( | ) |
Removes wasted space between columns.
Definition at line 521 of file geomVertexFormat.cxx.
|
static |
Tells the BamReader how to create objects of type GeomVertexFormat.
Definition at line 826 of file geomVertexFormat.cxx.
References BamReader::get_factory(), and Factory< Type >::register_factory().
void GeomVertexFormat::remove_column | ( | const InternalName * | name, |
bool | keep_empty_array = false ) |
Removes the named column from the format, from whichever array it exists in.
If there are other columns remaining in the array, the array is left with a gap where the column used to be; if this was the only column in the array, the array is removed (unless keep_empty_array is true).
This may not be called once the format has been registered.
Definition at line 484 of file geomVertexFormat.cxx.
References GeomVertexArrayFormat::get_column, GeomVertexArrayFormat::get_num_columns, ReferenceCount::get_ref_count, GeomVertexArrayFormat::is_registered, remove_array, and GeomVertexArrayFormat::remove_column().
Referenced by CPT().
void GeomVertexFormat::remove_empty_arrays | ( | ) |
Removes the arrays that define no columns.
This may not be called once the format has been registered.
Definition at line 337 of file geomVertexFormat.cxx.
References GeomVertexArrayFormat::get_num_columns, and is_registered.
|
virtual |
This method overrides ReferenceCount::unref() to unregister the object when its reference count goes to zero.
Reimplemented from ReferenceCount.
Definition at line 82 of file geomVertexFormat.cxx.
References is_registered, and ReferenceCount::unref().
void GeomVertexFormat::write | ( | std::ostream & | out, |
int | indent_level = 0 ) const |
Definition at line 591 of file geomVertexFormat.cxx.
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from TypedWritable.
Definition at line 835 of file geomVertexFormat.cxx.
References Datagram::add_uint16(), GeomVertexAnimationSpec::write_datagram(), TypedWritable::write_datagram(), and BamWriter::write_pointer().
void GeomVertexFormat::write_with_data | ( | std::ostream & | out, |
int | indent_level, | ||
const GeomVertexData * | data ) const |
Definition at line 608 of file geomVertexFormat.cxx.
|
friend |
Definition at line 289 of file geomVertexFormat.h.
|
friend |
Definition at line 288 of file geomVertexFormat.h.
|
inline |
Returns the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation.
Definition at line 72 of file geomVertexFormat.h.
Referenced by DXGraphicsStateGuardian9::begin_draw_primitives(), GeomVertexData::copy_from(), and CullableObject::munge_geom().
|
inline |
Returns the description of the nth array used by the format.
Definition at line 79 of file geomVertexFormat.h.
Referenced by GeomVertexData::GeomVertexData(), GeomVertexData::copy_from(), GeomVertexDataPipelineWriter::copy_row_from(), PT(), and GeomVertexData::unclean_set_format().
const GeomVertexColumn * GeomVertexFormat::get_column |
Returns the ith column of the specification, across all arrays.
Returns the specification with the indicated name, or NULL if the name is not used.
Use get_array_with() to determine which array this column is associated with.
Definition at line 97 of file geomVertexFormat.h.
Referenced by GeomVertexReader::GeomVertexReader(), GeomVertexWriter::GeomVertexWriter(), CPT(), GeomVertexReader::set_column(), GeomVertexWriter::set_column(), GeomVertexReader::set_column(), and GeomVertexWriter::set_column().
const InternalName * GeomVertexFormat::get_column_name |
Returns the name of the ith column, across all arrays.
Definition at line 130 of file geomVertexFormat.h.
|
inline |
Returns the name of the base column that the nth morph modifies.
This column will also be defined within the format, and can be retrieved via get_array_with() and/or get_column().
This may only be called after the format has been registered.
Definition at line 121 of file geomVertexFormat.h.
|
inline |
Returns the name of the column that defines the nth morph.
This contains the delta offsets that are to be applied to the column defined by get_morph_base(). This column will be defined within the format, and can be retrieved via get_array_with() and/or get_column().
This may only be called after the format has been registered.
Definition at line 122 of file geomVertexFormat.h.
Referenced by CPT().
|
inline |
Returns the slider name associated with the nth morph column.
This is the name of the slider that will control the morph, and should be defined within the SliderTable associated with the GeomVertexData.
This may only be called after the format has been registered.
Definition at line 120 of file geomVertexFormat.h.
|
inline |
Returns the number of individual arrays required by the format.
If the array data is completely interleaved, this will be 1; if it is completely parallel, this will be the same as the number of data types.
Definition at line 79 of file geomVertexFormat.h.
Referenced by GeomVertexData::GeomVertexData(), GeomVertexData::copy_from(), GeomVertexDataPipelineWriter::copy_row_from(), and GeomVertexData::unclean_set_format().
size_t GeomVertexFormat::get_num_columns |
Returns the total number of different columns in the specification, across all arrays.
Definition at line 97 of file geomVertexFormat.h.
|
inline |
Returns the number of columns within the format that represent morph deltas.
This may only be called after the format has been registered.
Definition at line 120 of file geomVertexFormat.h.
Referenced by CPT().
|
inline |
Returns the number of columns within the format that represent points in space.
This may only be called after the format has been registered.
Definition at line 106 of file geomVertexFormat.h.
Referenced by GeomVertexData::transform_vertices(), and GeomVertexData::transform_vertices().
|
inline |
Returns the number of columns within the format that represent texture coordinates.
This may only be called after the format has been registered.
Definition at line 114 of file geomVertexFormat.h.
|
inline |
Returns the number of columns within the format that represent directional vectors.
This may only be called after the format has been registered.
Definition at line 110 of file geomVertexFormat.h.
Referenced by GeomVertexData::transform_vertices(), and GeomVertexData::transform_vertices().
|
inline |
Returns the name of the nth point column.
This represents a point in space, which should be transformed by any spatial transform matrix.
This may only be called after the format has been registered.
Definition at line 106 of file geomVertexFormat.h.
Referenced by GeomVertexData::transform_vertices(), and GeomVertexData::transform_vertices().
|
inline |
Returns the name of the nth texcoord column.
This represents a texture coordinate.
This may only be called after the format has been registered.
Definition at line 114 of file geomVertexFormat.h.
|
inline |
Returns the name of the nth vector column.
This represents a directional vector, which should be transformed by any spatial transform matrix as a vector.
This may only be called after the format has been registered.
Definition at line 110 of file geomVertexFormat.h.
Referenced by GeomVertexData::transform_vertices(), and GeomVertexData::transform_vertices().
|
inline |
Returns true if the format has the named column, false otherwise.
Definition at line 129 of file geomVertexFormat.h.
Referenced by CPT().
void GeomVertexFormat::insert_array |
Adds the indicated array definition to the list of arrays at the indicated position.
This works just like add_array(), except that you can specify which array index the new array should have.
This may not be called once the format has been registered.
Definition at line 124 of file geomVertexFormat.h.
|
inline |
Returns true if this format has been registered, false if it has not.
It may not be used for a Geom until it has been registered, but once registered, it may no longer be modified.
Definition at line 68 of file geomVertexFormat.h.
Referenced by GeomVertexData::GeomVertexData(), add_array(), clear_arrays(), CPT(), CPT(), remove_empty_arrays(), GeomVertexData::unclean_set_format(), and unref().
void GeomVertexFormat::remove_array |
Removes the nth array from the format.
This may not be called once the format has been registered.
Definition at line 124 of file geomVertexFormat.h.
Referenced by remove_column().
|
inline |
Resets the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation.
You should also, of course, change the columns in the tables accordingly.
This may not be called once the format has been registered.
Definition at line 72 of file geomVertexFormat.h.
void GeomVertexFormat::set_array |
Replaces the definition of the indicated array.
This may not be called once the format has been registered.
Definition at line 124 of file geomVertexFormat.h.