Panda3D
|
This defines how a single column is interleaved within a vertex array stored within a Geom. More...
#include "geomVertexColumn.h"
Classes | |
class | Packer |
class | Packer_argb_packed |
class | Packer_color |
class | Packer_float32_3 |
class | Packer_nativefloat_3 |
class | Packer_point |
class | Packer_point_float32_2 |
class | Packer_point_float32_3 |
class | Packer_point_float32_4 |
class | Packer_point_nativefloat_2 |
class | Packer_point_nativefloat_3 |
class | Packer_point_nativefloat_4 |
class | Packer_rgba_float32_4 |
class | Packer_rgba_nativefloat_4 |
class | Packer_rgba_uint8_4 |
class | Packer_uint16_1 |
Public Member Functions | |
GeomVertexColumn (InternalName *name, int num_components, NumericType numeric_type, Contents contents, int start) | |
GeomVertexColumn (const GeomVertexColumn ©) | |
int | compare_to (const GeomVertexColumn &other) const |
This is used to unquify columns, and hence formats, for the GeomVertexFormat registry. | |
int | complete_pointers (TypedWritable **plist, BamReader *manager) |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). | |
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 GeomVertexColumn. | |
int | get_component_bytes () const |
Returns the number of bytes used by each component (that is, by one element of the numeric type). | |
Contents | get_contents () const |
Returns the token representing the semantic meaning of the stored value. | |
InternalName * | get_name () const |
Returns the name of this particular data field, e.g. | |
int | get_num_components () const |
Returns the number of components of the column: the number of instances of the NumericType in each element. | |
int | get_num_values () const |
Returns the number of numeric values of the column: the number of distinct numeric values that go into each element. | |
NumericType | get_numeric_type () const |
Returns the token representing the numeric type of the data storage. | |
int | get_start () const |
Returns the byte within the array record at which this column starts. | |
int | get_total_bytes () const |
Returns the number of bytes used by each element of the column: component_bytes * num_components. | |
bool | has_homogeneous_coord () const |
Returns true if this Contents type is one that includes a homogeneous coordinate in the fourth component, or false otherwise. | |
bool | is_bytewise_equivalent (const GeomVertexColumn &other) const |
Returns true if the data store of this column is exactly the same as that of the other, irrespective of name or start position within the record. | |
bool | is_packed_argb () const |
Returns true if this column is the standard DirectX representation of 4-component color: C_color, in NT_packed_dabc, with 1 component (4 values). | |
bool | is_uint8_rgba () const |
Returns true if this column is the standard OpenGL representation of 4-component color: C_color, in NT_uint8, with 4 components. | |
bool | operator!= (const GeomVertexColumn &other) const |
bool | operator< (const GeomVertexColumn &other) const |
This is used to put columns in order within a particular GeomVertexArrayFormat. | |
void | operator= (const GeomVertexColumn ©) |
bool | operator== (const GeomVertexColumn &other) const |
Returns true if the two columns are exactly equivalent, false otherwise. | |
void | output (ostream &out) const |
bool | overlaps_with (int start_byte, int num_bytes) const |
Returns true if this column overlaps with any of the bytes in the indicated range, false if it does not. | |
void | write_datagram (BamWriter *manager, Datagram &dg) |
Writes the contents of this object to the datagram for shipping out to a Bam file. | |
Friends | |
class | GeomVertexArrayFormat |
class | GeomVertexReader |
class | GeomVertexWriter |
This defines how a single column is interleaved within a vertex array stored within a Geom.
The GeomVertexArrayFormat class maintains a list of these to completely define a particular array structure.
Definition at line 40 of file geomVertexColumn.h.
int GeomVertexColumn::compare_to | ( | const GeomVertexColumn & | other | ) | const [inline] |
This is used to unquify columns, and hence formats, for the GeomVertexFormat registry.
Definition at line 261 of file geomVertexColumn.I.
Referenced by operator==().
int GeomVertexColumn::complete_pointers | ( | TypedWritable ** | p_list, |
BamReader * | manager | ||
) |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
Returns the number of pointers processed.
Definition at line 248 of file geomVertexColumn.cxx.
Referenced by GeomVertexArrayFormat::complete_pointers().
void GeomVertexColumn::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 GeomVertexColumn.
Definition at line 264 of file geomVertexColumn.cxx.
References DatagramIterator::get_uint16(), DatagramIterator::get_uint8(), and BamReader::read_pointer().
Referenced by GeomVertexArrayFormat::fillin().
int GeomVertexColumn::get_component_bytes | ( | ) | const [inline] |
Returns the number of bytes used by each component (that is, by one element of the numeric type).
Definition at line 158 of file geomVertexColumn.I.
Referenced by GeomVertexArrayFormat::add_column().
GeomVertexColumn::Contents GeomVertexColumn::get_contents | ( | ) | const [inline] |
Returns the token representing the semantic meaning of the stored value.
Definition at line 135 of file geomVertexColumn.I.
Referenced by GeomVertexArrayFormat::pack_columns(), and GeomTransformer::transform_texcoords().
InternalName * GeomVertexColumn::get_name | ( | ) | const [inline] |
Returns the name of this particular data field, e.g.
"vertex" or "normal". The name may be a user-defined string, or it may be one of the standard system-defined field types. Only the system-defined field types are used for the actual rendering.
Definition at line 84 of file geomVertexColumn.I.
Referenced by GeomVertexArrayFormat::add_column(), GeomVertexData::copy_from(), GeomVertexData::describe_vertex(), GeomVertexArrayFormat::finalize(), and GeomVertexArrayFormat::pack_columns().
int GeomVertexColumn::get_num_components | ( | ) | const [inline] |
Returns the number of components of the column: the number of instances of the NumericType in each element.
This is usually, but not always, the same thing as get_num_values().
Definition at line 97 of file geomVertexColumn.I.
Referenced by GeomTransformer::apply_texture_colors(), GeomVertexArrayFormat::pack_columns(), and GeomTransformer::transform_texcoords().
int GeomVertexColumn::get_num_values | ( | ) | const [inline] |
Returns the number of numeric values of the column: the number of distinct numeric values that go into each element.
This is usually, but not always, the same thing as get_num_components(); the difference is in the case of a composite numeric type like NT_packed_dcba, which has four numeric values per component.
Definition at line 113 of file geomVertexColumn.I.
Referenced by GeomVertexData::describe_vertex().
GeomVertexColumn::NumericType GeomVertexColumn::get_numeric_type | ( | ) | const [inline] |
Returns the token representing the numeric type of the data storage.
Definition at line 124 of file geomVertexColumn.I.
Referenced by DXIndexBufferContext9::allocate_ibuffer(), DXIndexBufferContext8::create_ibuffer(), GeomVertexArrayFormat::pack_columns(), and GeomTransformer::transform_texcoords().
int GeomVertexColumn::get_start | ( | ) | const [inline] |
Returns the byte within the array record at which this column starts.
This can be set to non-zero to implement interleaved arrays.
Definition at line 147 of file geomVertexColumn.I.
Referenced by GeomVertexArrayFormat::add_column(), GeomVertexData::copy_from(), GeomVertexArrayFormat::count_unused_space(), and GeomVertexArrayFormat::remove_column().
int GeomVertexColumn::get_total_bytes | ( | ) | const [inline] |
Returns the number of bytes used by each element of the column: component_bytes * num_components.
Definition at line 169 of file geomVertexColumn.I.
Referenced by GeomVertexArrayFormat::add_column(), GeomVertexArrayFormat::count_unused_space(), and GeomVertexArrayFormat::remove_column().
bool GeomVertexColumn::has_homogeneous_coord | ( | ) | const [inline] |
Returns true if this Contents type is one that includes a homogeneous coordinate in the fourth component, or false otherwise.
If this is true, correct operation on the vertex data may require scaling by the homogeneous coordinate from time to time (but in general this is handled automatically if you use the 3-component or smaller forms of get_data() and set_data()).
Definition at line 186 of file geomVertexColumn.I.
bool GeomVertexColumn::is_bytewise_equivalent | ( | const GeomVertexColumn & | other | ) | const [inline] |
Returns true if the data store of this column is exactly the same as that of the other, irrespective of name or start position within the record.
Definition at line 218 of file geomVertexColumn.I.
Referenced by GeomVertexData::copy_from().
bool GeomVertexColumn::is_packed_argb | ( | ) | const [inline] |
Returns true if this column is the standard DirectX representation of 4-component color: C_color, in NT_packed_dabc, with 1 component (4 values).
Definition at line 234 of file geomVertexColumn.I.
Referenced by GeomVertexData::copy_from().
bool GeomVertexColumn::is_uint8_rgba | ( | ) | const [inline] |
Returns true if this column is the standard OpenGL representation of 4-component color: C_color, in NT_uint8, with 4 components.
Definition at line 248 of file geomVertexColumn.I.
Referenced by GeomVertexData::copy_from().
bool GeomVertexColumn::operator< | ( | const GeomVertexColumn & | other | ) | const [inline] |
This is used to put columns in order within a particular GeomVertexArrayFormat.
Note that it is not* in the same space as operator == and operator !=.
Definition at line 310 of file geomVertexColumn.I.
bool GeomVertexColumn::operator== | ( | const GeomVertexColumn & | other | ) | const [inline] |
Returns true if the two columns are exactly equivalent, false otherwise.
Definition at line 287 of file geomVertexColumn.I.
References compare_to().
bool GeomVertexColumn::overlaps_with | ( | int | start_byte, |
int | num_bytes | ||
) | const [inline] |
Returns true if this column overlaps with any of the bytes in the indicated range, false if it does not.
Definition at line 205 of file geomVertexColumn.I.
Referenced by GeomVertexArrayFormat::get_column().
Writes the contents of this object to the datagram for shipping out to a Bam file.
Definition at line 232 of file geomVertexColumn.cxx.
References Datagram::add_uint16(), Datagram::add_uint8(), and BamWriter::write_pointer().
Referenced by GeomVertexArrayFormat::write_datagram().