Panda3D
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
GeomVertexFormat Class Referencefinal

This class defines the physical layout of the vertex data stored within a Geom. More...

#include "geomVertexFormat.h"

Inheritance diagram for GeomVertexFormat:
TypedWritableReferenceCount GeomEnums TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

Public Member Functions

 GeomVertexFormat (const GeomVertexArrayFormat *array_format)
 
 GeomVertexFormat (const GeomVertexFormat &copy)
 
size_t add_array (const GeomVertexArrayFormat *array_format)
 Adds the indicated array definition to the list of arrays included within this vertex format definition. More...
 
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). More...
 
void clear_arrays ()
 Removes all of the array definitions from the format and starts over. More...
 
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(). More...
 
 CPT (GeomVertexFormat) get_post_animated_format() const
 
 CPT (GeomVertexFormat) get_union_format(const GeomVertexFormat *other) const
 
virtual TypeHandle force_init_type ()
 
const GeomVertexAnimationSpecget_animation () const
 
const GeomVertexArrayFormatget_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. More...
 
int get_array_with (size_t i) const
 Returns the index number of the array with the ith column. More...
 
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. More...
 
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. More...
 
const GeomVertexColumnget_color_column () const
 Returns the column definition of the "color" column, or NULL if there is no such column. More...
 
const GeomVertexColumnget_column (size_t i) const
 
const GeomVertexColumnget_column (const InternalName *name) const
 
const InternalNameget_column_name (size_t i) const
 
const InternalNameget_morph_base (size_t n) const
 
const InternalNameget_morph_delta (size_t n) const
 
const InternalNameget_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. More...
 
const GeomVertexColumnget_normal_column () const
 Returns the column definition of the "normal" column, or NULL if there is no such column. More...
 
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 InternalNameget_point (size_t n) const
 
const InternalNameget_texcoord (size_t n) const
 
virtual TypeHandle get_type () const
 
const InternalNameget_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. More...
 
const GeomVertexColumnget_vertex_column () const
 Returns the column definition of the "vertex" column, or NULL if there is no such column. More...
 
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. More...
 
GeomVertexArrayFormatmodify_array (size_t array)
 
void operator= (const GeomVertexFormat &copy)
 
void output (std::ostream &out) const
 
void pack_columns ()
 Removes wasted space between columns. More...
 
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. More...
 
void remove_empty_arrays ()
 Removes the arrays that define no columns. More...
 
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. More...
 
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. More...
 
void write_with_data (std::ostream &out, int indent_level, const GeomVertexData *data) const
 
- Public Member Functions inherited from TypedWritableReferenceCount
 TypedWritableReferenceCount (const TypedWritableReferenceCount &copy)
 
virtual ReferenceCountas_reference_count ()
 Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. More...
 
void operator= (const TypedWritableReferenceCount &copy)
 
- Public Member Functions inherited from TypedWritable
 TypedWritable (const TypedWritable &copy)
 
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. More...
 
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. More...
 
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. More...
 
UpdateSeq get_bam_modified () const
 Returns the current bam_modified counter. More...
 
void mark_bam_modified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More...
 
void operator= (const TypedWritable &copy)
 
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. More...
 
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. More...
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
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. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
TypedObjectoperator= (const TypedObject &copy)=default
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool ref_if_nonzero () const
 Atomically increases the reference count of this object if it is not zero. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
WeakReferenceListweak_ref ()
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref ()
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 

Static Public Member Functions

static CPT (GeomVertexFormat) register_format(const GeomVertexFormat *format)
 
static CPT (GeomVertexFormat) register_format(const GeomVertexArrayFormat *format)
 
static TypeHandle get_class_type ()
 
static const GeomVertexFormatget_empty ()
 Returns a standard vertex format containing no arrays at all, useful for pull-style vertex rendering. More...
 
static const GeomVertexFormatget_v3 ()
 Returns a standard vertex format with just a 3-component vertex position. More...
 
static const GeomVertexFormatget_v3c4 ()
 Returns a standard vertex format with a 4-component color and a 3-component vertex position. More...
 
static const GeomVertexFormatget_v3c4t2 ()
 Returns a standard vertex format with a 2-component texture coordinate pair, a 4-component color, and a 3-component vertex position. More...
 
static const GeomVertexFormatget_v3cp ()
 Returns a standard vertex format with a packed color and a 3-component vertex position. More...
 
static const GeomVertexFormatget_v3cpt2 ()
 Returns a standard vertex format with a 2-component texture coordinate pair, a packed color, and a 3-component vertex position. More...
 
static const GeomVertexFormatget_v3n3 ()
 Returns a standard vertex format with a 3-component normal and a 3-component vertex position. More...
 
static const GeomVertexFormatget_v3n3c4 ()
 Returns a standard vertex format with a 4-component color, a 3-component normal, and a 3-component vertex position. More...
 
static const GeomVertexFormatget_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. More...
 
static const GeomVertexFormatget_v3n3cp ()
 Returns a standard vertex format with a packed color, a 3-component normal, and a 3-component vertex position. More...
 
static const GeomVertexFormatget_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. More...
 
static const GeomVertexFormatget_v3n3t2 ()
 Returns a standard vertex format with a 2-component texture coordinate pair, a 3-component normal, and a 3-component vertex position. More...
 
static const GeomVertexFormatget_v3t2 ()
 Returns a standard vertex format with a 2-component texture coordinate pair and a 3-component vertex position. More...
 
static void init_type ()
 
static void register_with_read_factory ()
 Tells the BamReader how to create objects of type GeomVertexFormat. More...
 
- Static Public Member Functions inherited from TypedWritableReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
static PT (TypedWritableReferenceCount) decode_from_bam_stream(vector_uchar data
 
- Static Public Member Functions inherited from TypedWritable
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. More...
 
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
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. More...
 
- Static Public Member Functions inherited from ReferenceCount
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. More...
 
 get_array
 Returns the description of the nth array used by the format. More...
 
 get_column
 Returns the ith column of the specification, across all arrays. More...
 
 get_column_name
 Returns the name of the ith column, across all arrays. More...
 
 get_morph_base
 Returns the name of the base column that the nth morph modifies. More...
 
 get_morph_delta
 Returns the name of the column that defines the nth morph. More...
 
 get_morph_slider
 Returns the slider name associated with the nth morph column. More...
 
 get_num_arrays
 Returns the number of individual arrays required by the format. More...
 
 get_num_columns
 Returns the total number of different columns in the specification, across all arrays. More...
 
 get_num_morphs
 Returns the number of columns within the format that represent morph deltas. More...
 
 get_num_points
 Returns the number of columns within the format that represent points in space. More...
 
 get_num_texcoords
 Returns the number of columns within the format that represent texture coordinates. More...
 
 get_num_vectors
 Returns the number of columns within the format that represent directional vectors. More...
 
 get_point
 Returns the name of the nth point column. More...
 
 get_texcoord
 Returns the name of the nth texcoord column. More...
 
 get_vector
 Returns the name of the nth vector column. More...
 
 has_column
 Returns true if the format has the named column, false otherwise. More...
 
 insert_array
 Adds the indicated array definition to the list of arrays at the indicated position. More...
 
 is_registered
 Returns true if this format has been registered, false if it has not. More...
 
 remove_array
 Removes the nth array from the format. More...
 
 set_animation
 Resets the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation. More...
 
 set_array
 Replaces the definition of the indicated array. More...
 
- Public Attributes inherited from TypedWritableReferenceCount
static BamReaderreader = nullptr)
 
- Public Attributes inherited from TypedObject
 get_type
 
- Public Attributes inherited from ReferenceCount
 get_ref_count
 Returns the current reference count. More...
 

Friends

class GeomMunger
 
class GeomVertexFormat::Registry
 

Additional Inherited Members

- Public Types inherited from GeomEnums
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 Public Attributes inherited from TypedWritable
static TypedWritable *const Null = nullptr
 

Detailed Description

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.

Member Function Documentation

◆ add_array()

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 295 of file geomVertexFormat.cxx.

◆ align_columns_for_animation()

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 541 of file geomVertexFormat.cxx.

◆ clear_arrays()

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 326 of file geomVertexFormat.cxx.

◆ complete_pointers()

int GeomVertexFormat::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 853 of file geomVertexFormat.cxx.

◆ get_array_info()

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 632 of file geomVertexFormat.cxx.

◆ get_array_with() [1/2]

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 406 of file geomVertexFormat.cxx.

Referenced by GeomVertexData::copy_from(), GeomVertexReader::GeomVertexReader(), GeomVertexReader::set_column(), and GeomVertexWriter::set_column().

◆ get_array_with() [2/2]

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 429 of file geomVertexFormat.cxx.

◆ get_color_array_index()

int GeomVertexFormat::get_color_array_index ( ) const
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 411 of file geomVertexFormat.I.

◆ get_color_column()

const GeomVertexColumn * GeomVertexFormat::get_color_column ( ) const
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 423 of file geomVertexFormat.I.

◆ get_empty()

const GeomVertexFormat * GeomVertexFormat::get_empty ( )
inlinestatic

Returns a standard vertex format containing no arrays at all, useful for pull-style vertex rendering.

Definition at line 243 of file geomVertexFormat.I.

◆ get_normal_array_index()

int GeomVertexFormat::get_normal_array_index ( ) const
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 387 of file geomVertexFormat.I.

◆ get_normal_column()

const GeomVertexColumn * GeomVertexFormat::get_normal_column ( ) const
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 399 of file geomVertexFormat.I.

◆ get_v3()

const GeomVertexFormat * GeomVertexFormat::get_v3 ( )
inlinestatic

Returns a standard vertex format with just a 3-component vertex position.

Definition at line 251 of file geomVertexFormat.I.

◆ get_v3c4()

const GeomVertexFormat * GeomVertexFormat::get_v3c4 ( )
inlinestatic

Returns a standard vertex format with a 4-component color and a 3-component vertex position.

Definition at line 324 of file geomVertexFormat.I.

◆ get_v3c4t2()

const GeomVertexFormat * GeomVertexFormat::get_v3c4t2 ( )
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 342 of file geomVertexFormat.I.

Referenced by PT().

◆ get_v3cp()

const GeomVertexFormat * GeomVertexFormat::get_v3cp ( )
inlinestatic

Returns a standard vertex format with a packed color and a 3-component vertex position.

Definition at line 287 of file geomVertexFormat.I.

Referenced by PortalClipper::draw_lines().

◆ get_v3cpt2()

const GeomVertexFormat * GeomVertexFormat::get_v3cpt2 ( )
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 305 of file geomVertexFormat.I.

◆ get_v3n3()

const GeomVertexFormat * GeomVertexFormat::get_v3n3 ( )
inlinestatic

Returns a standard vertex format with a 3-component normal and a 3-component vertex position.

Definition at line 260 of file geomVertexFormat.I.

◆ get_v3n3c4()

const GeomVertexFormat * GeomVertexFormat::get_v3n3c4 ( )
inlinestatic

Returns a standard vertex format with a 4-component color, a 3-component normal, and a 3-component vertex position.

Definition at line 333 of file geomVertexFormat.I.

◆ get_v3n3c4t2()

const GeomVertexFormat * GeomVertexFormat::get_v3n3c4t2 ( )
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 352 of file geomVertexFormat.I.

◆ get_v3n3cp()

const GeomVertexFormat * GeomVertexFormat::get_v3n3cp ( )
inlinestatic

Returns a standard vertex format with a packed color, a 3-component normal, and a 3-component vertex position.

Definition at line 296 of file geomVertexFormat.I.

◆ get_v3n3cpt2()

const GeomVertexFormat * GeomVertexFormat::get_v3n3cpt2 ( )
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 315 of file geomVertexFormat.I.

◆ get_v3n3t2()

const GeomVertexFormat * GeomVertexFormat::get_v3n3t2 ( )
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 278 of file geomVertexFormat.I.

◆ get_v3t2()

const GeomVertexFormat * GeomVertexFormat::get_v3t2 ( )
inlinestatic

Returns a standard vertex format with a 2-component texture coordinate pair and a 3-component vertex position.

Definition at line 269 of file geomVertexFormat.I.

◆ get_vertex_array_index()

int GeomVertexFormat::get_vertex_array_index ( ) const
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 363 of file geomVertexFormat.I.

◆ get_vertex_column()

const GeomVertexColumn * GeomVertexFormat::get_vertex_column ( ) const
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 375 of file geomVertexFormat.I.

◆ maybe_align_columns_for_animation()

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 558 of file geomVertexFormat.cxx.

◆ pack_columns()

void GeomVertexFormat::pack_columns ( )

Removes wasted space between columns.

Definition at line 522 of file geomVertexFormat.cxx.

◆ register_with_read_factory()

void GeomVertexFormat::register_with_read_factory ( )
static

Tells the BamReader how to create objects of type GeomVertexFormat.

Definition at line 827 of file geomVertexFormat.cxx.

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

◆ remove_column()

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 485 of file geomVertexFormat.cxx.

◆ remove_empty_arrays()

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 338 of file geomVertexFormat.cxx.

◆ unref()

bool GeomVertexFormat::unref ( ) const
virtual

This method overrides ReferenceCount::unref() to unregister the object when its reference count goes to zero.

Reimplemented from ReferenceCount.

Definition at line 83 of file geomVertexFormat.cxx.

References ReferenceCount::unref().

◆ write_datagram()

void GeomVertexFormat::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 836 of file geomVertexFormat.cxx.

References Datagram::add_uint16(), TypedWritable::write_datagram(), and BamWriter::write_pointer().

Member Data Documentation

◆ get_animation

const GeomVertexAnimationSpec & GeomVertexFormat::get_animation
inline

Returns the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation.

Definition at line 72 of file geomVertexFormat.h.

◆ get_array

const GeomVertexArrayFormat * GeomVertexFormat::get_array
inline

Returns the description of the nth array used by the format.

Definition at line 79 of file geomVertexFormat.h.

Referenced by GeomVertexData::copy_from().

◆ get_column

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(), GeomVertexReader::set_column(), and GeomVertexWriter::set_column().

◆ get_column_name

const InternalName * GeomVertexFormat::get_column_name

Returns the name of the ith column, across all arrays.

Definition at line 130 of file geomVertexFormat.h.

◆ get_morph_base

const InternalName * GeomVertexFormat::get_morph_base
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.

◆ get_morph_delta

const InternalName * GeomVertexFormat::get_morph_delta
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.

◆ get_morph_slider

const InternalName * GeomVertexFormat::get_morph_slider
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.

◆ get_num_arrays

size_t GeomVertexFormat::get_num_arrays
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::copy_from().

◆ get_num_columns

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.

◆ get_num_morphs

size_t GeomVertexFormat::get_num_morphs
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.

◆ get_num_points

size_t GeomVertexFormat::get_num_points
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.

◆ get_num_texcoords

size_t GeomVertexFormat::get_num_texcoords
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.

◆ get_num_vectors

size_t GeomVertexFormat::get_num_vectors
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.

◆ get_point

const InternalName * GeomVertexFormat::get_point
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.

◆ get_texcoord

const InternalName * GeomVertexFormat::get_texcoord
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.

◆ get_vector

const InternalName * GeomVertexFormat::get_vector
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.

◆ has_column

bool GeomVertexFormat::has_column
inline

Returns true if the format has the named column, false otherwise.

Definition at line 129 of file geomVertexFormat.h.

Referenced by CPT().

◆ insert_array

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.

◆ is_registered

bool GeomVertexFormat::is_registered
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.

◆ remove_array

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.

◆ set_animation

void GeomVertexFormat::set_animation
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.

◆ set_array

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.


The documentation for this class was generated from the following files: