# GeomVertexArrayFormat

from pandac.PandaModules import GeomVertexArrayFormat

Class : GeomVertexArrayFormat
Description : This describes the structure of a single array within a Geom data. See GeomVertexFormat for the parent class which collects together all of the individual GeomVertexArrayFormat objects.
A particular array may include any number of standard or user-defined columns. All columns consist of a sequence of one or more numeric values, packed in any of a variety of formats; the semantic meaning of each column is defined in general with its contents member, and in particular by its name. The standard array types used most often are named "vertex", "normal", "texcoord", and "color"; other kinds of data may be piggybacked into the data record simply by choosing a unique name.

## Inheritance:

GeomVertexArrayFormat: TypedWritableReferenceCount GeomEnums
TypedWritableReferenceCount: TypedWritable ReferenceCount
TypedWritable: TypedObject
TypedObject: MemoryBase
MemoryBase:
ReferenceCount: MemoryBase
GeomEnums:

## Methods of GeomVertexArrayFormat:

addColumn
clearColumns
countUnusedSpace
getClassType
getColumn
getNumColumns
getPadTo
getStride
getTotalBytes
hasColumn
isDataSubsetOf
isRegistered
operator =
output
packColumns
registerFormat
removeColumn
setStride
unref
write
writeWithData

## Methods of TypedWritableReferenceCount:

getClassType

## Methods of TypedWritable:

getClassType

## Methods of TypedObject:

getClassType
getType
getTypeIndex
isExactType
isOfType

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

## Constants in GeomEnums:

UHClient | (UsageHint)
UHStream | (UsageHint)
UHDynamic | (UsageHint)
UHStatic | (UsageHint)
UHUnspecified | (UsageHint)
GRIndexedPoint | (GeomRendering)
GRIndexedOther | (GeomRendering)
GRIndexedBits | (GeomRendering)
GRPoint | (GeomRendering)
GRPointUniformSize | (GeomRendering)
GRPerPointSize | (GeomRendering)
GRPointPerspective | (GeomRendering)
GRPointAspectRatio | (GeomRendering)
GRPointScale | (GeomRendering)
GRPointRotate | (GeomRendering)
GRPointSprite | (GeomRendering)
GRPointSpriteTexMatrix | (GeomRendering)
GRPointBits | (GeomRendering)
GRTriangleStrip | (GeomRendering)
GRTriangleFan | (GeomRendering)
GRLineStrip | (GeomRendering)
GRCompositeBits | (GeomRendering)
GRFlatFirstVertex | (GeomRendering)
GRFlatLastVertex | (GeomRendering)
GRShadeModelBits | (GeomRendering)
GRTexcoordLightVector | (GeomRendering)
SMUniform | (ShadeModel)
SMSmooth | (ShadeModel)
SMFlatFirstVertex | (ShadeModel)
SMFlatLastVertex | (ShadeModel)
PTNone | (PrimitiveType)
PTPolygons | (PrimitiveType)
PTLines | (PrimitiveType)
PTPoints | (PrimitiveType)
NTUint8 | (NumericType)
NTUint16 | (NumericType)
NTUint32 | (NumericType)
NTPackedDcba | (NumericType)
NTPackedDabc | (NumericType)
NTFloat32 | (NumericType)
COther | (Contents)
CPoint | (Contents)
CClipPoint | (Contents)
CVector | (Contents)
CTexcoord | (Contents)
CColor | (Contents)
CIndex | (Contents)
CMorphDelta | (Contents)
ATNone | (AnimationType)
ATPanda | (AnimationType)
ATHardware | (AnimationType)

addColumn int GeomVertexArrayFormat::add_column(InternalName *name, int num_components, GeomEnums::NumericType numeric_type, GeomEnums::Contents contents, int start = (-1)); Description: Adds a new column to the specification. This is a table of per-vertex floating-point numbers such as "vertex" or "normal"; you must specify where in each record the table starts, and how many components (dimensions) exist per vertex. The return value is the index number of the new data type. Adding a column with the same name as a previous type, or that overlaps with one or more previous types, quietly removes the previous type(s).

clearColumns void GeomVertexArrayFormat::clear_columns(void); Description: Removes all columns previously added, sets the stride to zero, and prepares to start over.

countUnusedSpace int GeomVertexArrayFormat::count_unused_space(void) const; Description: Returns the number of bytes per row that are not assigned to any column.

getClassType static TypeHandle GeomVertexArrayFormat::get_class_type(void); Undocumented function.

getColumn GeomVertexColumn const *GeomVertexArrayFormat::get_column(int i) const; Description: Returns the ith column of the array. Description: Returns the specification with the indicated name, or NULL if the name is not used. Description: Returns the first specification that overlaps with any of the indicated bytes in the range, or NULL if none do.

getNumColumns int GeomVertexArrayFormat::get_num_columns(void) const; Description: Returns the number of different columns in the array.

getPadTo int GeomVertexArrayFormat::get_pad_to(void) const; Description: Returns the byte divisor to which the data record must be padded to meet hardware limitations. For instance, if this is 4, the stride will be automatically rounded up to the next multiple of 4 bytes.

getStride int GeomVertexArrayFormat::get_stride(void) const; Description: Returns the total number of bytes reserved in the array for each vertex.

getTotalBytes int GeomVertexArrayFormat::get_total_bytes(void) const; Description: Returns the total number of bytes used by the data types within the format, including gaps between elements.

hasColumn bool GeomVertexArrayFormat::has_column(InternalName const *name) const; Description: Returns true if the array has the named column, false otherwise.

isDataSubsetOf bool GeomVertexArrayFormat::is_data_subset_of(GeomVertexArrayFormat const &other) const; Description: Returns true if all of the fields in this array format are also present and equivalent in the other array format, and in the same byte positions, and the stride is the same. That is, true if this format can share the same data pointer as the other format (with possibly some unused gaps).

isRegistered bool GeomVertexArrayFormat::is_registered(void) const; Filename: geomVertexArrayFormat.I Created by: drose (06Mar05) PANDA 3D SOFTWARE Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved All use of this software is subject to the terms of the Panda 3d Software license. You should have received a copy of this license along with this source code; you will also find a current copy of the license at http://etc.cmu.edu/panda3d/docs/license/ . To contact the maintainers of this program write to panda3d-general@lists.sourceforge.net . Description: 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.

operator = void GeomVertexArrayFormat::operator =(GeomVertexArrayFormat const &copy); Description:

output void GeomVertexArrayFormat::output(ostream &out) const; Description:

packColumns void GeomVertexArrayFormat::pack_columns(void); Description: Removes wasted space between columns.

registerFormat static ConstPointerTo< GeomVertexArrayFormat > GeomVertexArrayFormat::register_format(GeomVertexArrayFormat const *format); Description: Adds the indicated format to the registry, if there is not an equivalent format already there; in either case, returns the pointer to the equivalent format now in the registry. This is similar to GeomVertexFormat::register_format(), except that you generally need not call it explicitly. Calling GeomVertexFormat::register_format() automatically registers all of the nested array formats.

removeColumn void GeomVertexArrayFormat::remove_column(InternalName const *name); Description: Removes the column with the indicated name, if any. This leaves a gap in the byte structure.

setStride void GeomVertexArrayFormat::set_stride(int stride); Description: Changes the total number of bytes reserved in the array for each vertex.

unref bool GeomVertexArrayFormat::unref(void) const; Description: This method overrides ReferenceCount::unref() to unregister the object when its reference count goes to zero.

write void GeomVertexArrayFormat::write(ostream &out, int indent_level = (0)) const; Description:

writeWithData void GeomVertexArrayFormat::write_with_data(ostream &out, int indent_level, GeomVertexArrayData const *array_data) const; Description:

getClassType static TypeHandle TypedWritableReferenceCount::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedWritable::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedObject::get_class_type(void); Undocumented function.

getType virtual TypeHandle TypedObject::get_type(void) const = 0; Derived classes should override this function to return get_class_type().

getTypeIndex int TypedObject::get_type_index(void) const; Description: Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index().

isExactType bool TypedObject::is_exact_type(TypeHandle handle) const; Description: Returns true if the current object is the indicated type exactly.

isOfType bool TypedObject::is_of_type(TypeHandle handle) const; Description: Returns true if the current object is or derives from the indicated type.

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is true if the new reference count is nonzero, false if it is zero.