Panda3D
Public Member Functions | List of all members
GeomVertexColumn Class Reference

This defines how a single column is interleaved within a vertex array stored within a Geom. More...

Inheritance diagram for GeomVertexColumn:
GeomEnums

Public Member Functions

 __init__ (const InternalName name, int num_components, GeomEnums::NumericType numeric_type, GeomEnums::Contents contents, int start, int column_alignment, int num_elements, int element_stride)
 
 __init__ (const GeomVertexColumn copy)
 
int getColumnAlignment ()
 Returns the alignment requirements for this column. More...
 
int getComponentBytes ()
 Returns the number of bytes used by each component (that is, by one element of the numeric type). More...
 
GeomEnums::Contents getContents ()
 Returns the token representing the semantic meaning of the stored value. More...
 
int getElementStride ()
 This value is only relevant for matrix types. More...
 
const InternalName getName ()
 Returns the name of this particular data field, e.g. More...
 
int getNumComponents ()
 Returns the number of components of the column: the number of instances of the NumericType in each element. More...
 
int getNumElements ()
 Returns the number of times this column is repeated. More...
 
GeomEnums::NumericType getNumericType ()
 Returns the token representing the numeric type of the data storage. More...
 
int getNumValues ()
 Returns the number of numeric values of the column: the number of distinct numeric values that go into each element. More...
 
int getStart ()
 Returns the byte within the array record at which this column starts. More...
 
int getTotalBytes ()
 Returns the number of bytes used by each element of the column: component_bytes * num_components. More...
 
bool hasHomogeneousCoord ()
 Returns true if this Contents type is one that includes a homogeneous coordinate in the fourth component, or false otherwise. More...
 
bool isBytewiseEquivalent (const GeomVertexColumn other)
 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. More...
 
GeomVertexColumn operator= (const GeomVertexColumn copy)
 
 output (Ostream out)
 
bool overlapsWith (int start_byte, int num_bytes)
 Returns true if this column overlaps with any of the bytes in the indicated range, false if it does not. More...
 
 setColumnAlignment (int column_alignment)
 Changes the column alignment of an existing column. More...
 
 setContents (GeomEnums::Contents contents)
 Changes the semantic meaning of an existing column. More...
 
 setName (InternalName name)
 Replaces the name of an existing column. More...
 
 setNumComponents (int num_components)
 Changes the number of components of an existing column. More...
 
 setNumericType (GeomEnums::NumericType numeric_type)
 Changes the numeric type an existing column. More...
 
 setStart (int start)
 Changes the start byte of an existing column. More...
 
- Public Member Functions inherited from GeomEnums
 __init__ ()
 
 __init__ (const GeomEnums)
 

Additional Inherited Members

- Public Types inherited from GeomEnums
enum  AnimationType { AT_none = 0, AT_panda = 1, AT_hardware = 2 }
 
enum  Contents {
  C_other = 0, C_point = 1, C_clip_point = 2, C_vector = 3,
  C_texcoord = 4, C_color = 5, C_index = 6, C_morph_delta = 7,
  C_matrix = 8, C_normal = 9
}
 
enum  GeomRendering {
  GR_indexed_point = 1, GR_indexed_other = 65536, GR_indexed_bits = 65537, GR_point = 2,
  GR_point_uniform_size = 4, GR_per_point_size = 8, GR_point_perspective = 16, GR_point_aspect_ratio = 32,
  GR_point_scale = 64, GR_point_rotate = 128, GR_point_sprite = 256, GR_point_sprite_tex_matrix = 512,
  GR_point_bits = 1022, GR_triangle_strip = 1024, GR_triangle_fan = 2048, GR_line_strip = 4096,
  GR_composite_bits = 7168, GR_strip_cut_index = 131072, GR_flat_first_vertex = 8192, GR_flat_last_vertex = 16384,
  GR_shade_model_bits = 24576, GR_render_mode_wireframe = 262144, GR_render_mode_point = 524288, GR_adjacency = 1048576
}
 
enum  NumericType {
  NT_uint8 = 0, NT_uint16 = 1, NT_uint32 = 2, NT_packed_dcba = 3,
  NT_packed_dabc = 4, NT_float32 = 5, NT_float64 = 6, NT_stdfloat = 7,
  NT_int8 = 8, NT_int16 = 9, NT_int32 = 10, NT_packed_ufloat = 11
}
 
enum  PrimitiveType {
  PT_none = 0, PT_polygons = 1, PT_lines = 2, PT_points = 3,
  PT_patches = 4
}
 
enum  ShadeModel { SM_uniform = 0, SM_smooth = 1, SM_flat_first_vertex = 2, SM_flat_last_vertex = 3 }
 
enum  UsageHint {
  UH_client = 0, UH_stream = 1, UH_dynamic = 2, UH_static = 3,
  UH_unspecified = 4
}
 

Detailed Description

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.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( const InternalName  name,
int  num_components,
GeomEnums::NumericType  numeric_type,
GeomEnums::Contents  contents,
int  start,
int  column_alignment,
int  num_elements,
int  element_stride 
)

◆ __init__() [2/2]

__init__ ( const GeomVertexColumn  copy)

◆ getColumnAlignment()

int getColumnAlignment ( )

Returns the alignment requirements for this column.

If this is greater than 1, it restricts the column to appear only on memory addresses that are integer multiples of this value; this has implications for this column's start value, as well as the stride of the resulting array.

◆ getComponentBytes()

int getComponentBytes ( )

Returns the number of bytes used by each component (that is, by one element of the numeric type).

◆ getContents()

GeomEnums::Contents getContents ( )

Returns the token representing the semantic meaning of the stored value.

◆ getElementStride()

int getElementStride ( )

This value is only relevant for matrix types.

Returns the number of bytes to add to access the next row of the matrix.

◆ getName()

const InternalName getName ( )

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.

◆ getNumComponents()

int getNumComponents ( )

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

◆ getNumElements()

int getNumElements ( )

Returns the number of times this column is repeated.

This is usually 1, except for matrices.

◆ getNumericType()

GeomEnums::NumericType getNumericType ( )

Returns the token representing the numeric type of the data storage.

◆ getNumValues()

int getNumValues ( )

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.

◆ getStart()

int getStart ( )

Returns the byte within the array record at which this column starts.

This can be set to non-zero to implement interleaved arrays.

◆ getTotalBytes()

int getTotalBytes ( )

Returns the number of bytes used by each element of the column: component_bytes * num_components.

◆ hasHomogeneousCoord()

bool hasHomogeneousCoord ( )

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

◆ isBytewiseEquivalent()

bool isBytewiseEquivalent ( const GeomVertexColumn  other)

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.

◆ operator=()

GeomVertexColumn operator= ( const GeomVertexColumn  copy)

◆ output()

output ( Ostream  out)

◆ overlapsWith()

bool overlapsWith ( int  start_byte,
int  num_bytes 
)

Returns true if this column overlaps with any of the bytes in the indicated range, false if it does not.

◆ setColumnAlignment()

setColumnAlignment ( int  column_alignment)

Changes the column alignment of an existing column.

This is only legal on an unregistered format (i.e. when constructing the format initially).

◆ setContents()

setContents ( GeomEnums::Contents  contents)

Changes the semantic meaning of an existing column.

This is only legal on an unregistered format (i.e. when constructing the format initially).

◆ setName()

setName ( InternalName  name)

Replaces the name of an existing column.

This is only legal on an unregistered format (i.e. when constructing the format initially).

◆ setNumComponents()

setNumComponents ( int  num_components)

Changes the number of components of an existing column.

This is only legal on an unregistered format (i.e. when constructing the format initially).

◆ setNumericType()

setNumericType ( GeomEnums::NumericType  numeric_type)

Changes the numeric type an existing column.

This is only legal on an unregistered format (i.e. when constructing the format initially).

◆ setStart()

setStart ( int  start)

Changes the start byte of an existing column.

This is only legal on an unregistered format (i.e. when constructing the format initially).