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. The GeomVertexArrayFormat class maintains a list of these to completely define a particular array structure. 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)
 
 __init__ (const GeomVertexColumn copy)
 
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. 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. Returns the number of bytes to add to access the next row of the matrix. More...
 
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. More...
 
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(). More...
 
int getNumElements ()
 Returns the number of times this column is repeated. This is usually 1, except for matrices. 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. 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. More...
 
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. 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. 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()). 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. This is only legal on an unregistered format (i.e. when constructing the format initially). More...
 
 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). More...
 
 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). More...
 
 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). More...
 
 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). More...
 
 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). More...
 

Additional Inherited Members

- Public Types inherited from GeomEnums
enum  AnimationType { AT_none = 0, AT_panda = 1, AT_hardware = 2 }
 The type of animation data that is represented by a particular GeomVertexFormat. More...
 
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
}
 The contents determine the semantic meaning of a numeric value within the vertex data. This is also used to determine what automatic transforms might be applied to the various columns. More...
 
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
}
 This type specifies a number of bits that are used to represent the rendering requirements of a particular Geom, as well as the rendering capabilities of the GSG. The difference between the two indicates whether the Geom needs to be munged for the GSG. More...
 
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
}
 The numeric type determines what physical representation is used to encode a numeric value within the vertex data. More...
 
enum  PrimitiveType {
  PT_none = 0, PT_polygons = 1, PT_lines = 2, PT_points = 3,
  PT_patches = 4
}
 The primitive type represents the core primitive type of a particular GeomPrimitive. It's used for determining what kind of antialiasing should be enabled. More...
 
enum  ShadeModel { SM_uniform = 0, SM_smooth = 1, SM_flat_first_vertex = 2, SM_flat_last_vertex = 3 }
 The shade model specifies whether the per-vertex colors and normals indexed by a given primitive truly represent per-vertex colors and normals, or whether they actually represent per-triangle flat-shaded colors and normals. More...
 
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 
)

◆ __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).