EggVertexPool

from panda3d.egg import EggVertexPool
class EggVertexPool

Bases: EggNode

A collection of vertices. There may be any number of vertex pools in a single egg structure. The vertices in a single pool need not necessarily have any connection to each other, but it is necessary that any one primitive (e.g. a polygon) must pull all its vertices from the same pool.

An EggVertexPool is an STL-style container of pointers to EggVertex’s. Functions add_vertex() and remove_vertex() are provided to manipulate the list. The list may also be operated on (read-only) via iterators and begin()/end().

Inheritance diagram

Inheritance diagram of EggVertexPool

__init__(*args, **kwargs)
addUnusedVerticesToPrim()

C++ Interface: add_unused_vertices_to_prim(const EggVertexPool self, EggPrimitive prim)

/**
  • Adds all of the unused vertices in this vertex pool to the indicated

  • primitive, in ascending order.

*/

addVertex()

C++ Interface: add_vertex(const EggVertexPool self, EggVertex vertex, int index)

// add_vertex() adds a freshly-allocated vertex. It is up to the user to // allocate the vertex.

/**
  • Adds the indicated vertex to the pool. It is an error if the vertex is

  • already a member of this or any other pool. The vertex must have been

  • allocated from the free store; its pointer will now be owned by the vertex

  • pool. If the index number is supplied, tries to assign that index number;

  • it is an error if the index number is already in use.

  • It is possible that a forward reference to this vertex was requested in the

  • past; if so, the data from the supplied vertex is copied onto the forward

  • reference, which becomes the actual vertex. In this case, a different

  • pointer is saved (and returned) than the one actually passed in. In the

  • usual case, however, the vertex pointer passed in is the one that is saved

  • in the vertex pool and returned from this method.

*/

add_unused_vertices_to_prim()

C++ Interface: add_unused_vertices_to_prim(const EggVertexPool self, EggPrimitive prim)

/**
  • Adds all of the unused vertices in this vertex pool to the indicated

  • primitive, in ascending order.

*/

add_vertex()

C++ Interface: add_vertex(const EggVertexPool self, EggVertex vertex, int index)

// add_vertex() adds a freshly-allocated vertex. It is up to the user to // allocate the vertex.

/**
  • Adds the indicated vertex to the pool. It is an error if the vertex is

  • already a member of this or any other pool. The vertex must have been

  • allocated from the free store; its pointer will now be owned by the vertex

  • pool. If the index number is supplied, tries to assign that index number;

  • it is an error if the index number is already in use.

  • It is possible that a forward reference to this vertex was requested in the

  • past; if so, the data from the supplied vertex is copied onto the forward

  • reference, which becomes the actual vertex. In this case, a different

  • pointer is saved (and returned) than the one actually passed in. In the

  • usual case, however, the vertex pointer passed in is the one that is saved

  • in the vertex pool and returned from this method.

*/

createUniqueVertex()

C++ Interface: create_unique_vertex(const EggVertexPool self, const EggVertex copy)

// create_unique_vertex() creates a new vertex if there is not already one // identical to the indicated vertex, or returns the existing one if there // is.

/**
  • Creates a new vertex in the pool that is a copy of the indicated one and

  • returns it. If there is already a vertex in the pool like the indicated

  • one, simply returns that one.

*/

create_unique_vertex()

C++ Interface: create_unique_vertex(const EggVertexPool self, const EggVertex copy)

// create_unique_vertex() creates a new vertex if there is not already one // identical to the indicated vertex, or returns the existing one if there // is.

/**
  • Creates a new vertex in the pool that is a copy of the indicated one and

  • returns it. If there is already a vertex in the pool like the indicated

  • one, simply returns that one.

*/

findMatchingVertex()

C++ Interface: find_matching_vertex(const EggVertexPool self, const EggVertex copy)

/**
  • If the EggVertexPool already has a vertex matching the indicated vertex,

  • returns it; otherwise, returns NULL. This is similar to

  • create_unique_vertex() except that a new vertex is never created.

*/

find_matching_vertex()

C++ Interface: find_matching_vertex(const EggVertexPool self, const EggVertex copy)

/**
  • If the EggVertexPool already has a vertex matching the indicated vertex,

  • returns it; otherwise, returns NULL. This is similar to

  • create_unique_vertex() except that a new vertex is never created.

*/

getClassType()

C++ Interface: get_class_type()

getForwardVertex()

C++ Interface: get_forward_vertex(const EggVertexPool self, int index)

// Returns a forward reference if there is no such vertex.

/**
  • Returns the vertex in the pool with the indicated index number. If there

  • is not a vertex in the pool with the indicated index number, creates a

  • special forward-reference EggVertex that has no data, on the assumption

  • that the vertex pool has not yet been fully read and more data will be

  • available later.

*/

getHighestIndex()

C++ Interface: get_highest_index(EggVertexPool self)

// Returns 0 if the pool is empty.

/**
  • Returns the highest index number used by any vertex in the pool (except

  • forward references). Returns -1 if the pool is empty.

*/

getNumDimensions()

C++ Interface: get_num_dimensions(EggVertexPool self)

/**
  • Returns the maximum number of dimensions used by any vertex in the pool.

*/

getVertex()

C++ Interface: get_vertex(EggVertexPool self, int index)

// Returns NULL if there is no such vertex.

/**
  • Returns the vertex in the pool with the indicated index number, or NULL if

  • no vertices have that index number.

*/

get_class_type()

C++ Interface: get_class_type()

get_forward_vertex()

C++ Interface: get_forward_vertex(const EggVertexPool self, int index)

// Returns a forward reference if there is no such vertex.

/**
  • Returns the vertex in the pool with the indicated index number. If there

  • is not a vertex in the pool with the indicated index number, creates a

  • special forward-reference EggVertex that has no data, on the assumption

  • that the vertex pool has not yet been fully read and more data will be

  • available later.

*/

get_highest_index()

C++ Interface: get_highest_index(EggVertexPool self)

// Returns 0 if the pool is empty.

/**
  • Returns the highest index number used by any vertex in the pool (except

  • forward references). Returns -1 if the pool is empty.

*/

get_num_dimensions()

C++ Interface: get_num_dimensions(EggVertexPool self)

/**
  • Returns the maximum number of dimensions used by any vertex in the pool.

*/

get_vertex()

C++ Interface: get_vertex(EggVertexPool self, int index)

// Returns NULL if there is no such vertex.

/**
  • Returns the vertex in the pool with the indicated index number, or NULL if

  • no vertices have that index number.

*/

hasAux()

C++ Interface: has_aux(EggVertexPool self)

/**
  • Returns true if any vertex in the pool has auxiliary data defined, false if

  • none of them do.

*/

hasColors()

C++ Interface: has_colors(EggVertexPool self)

/**
  • Returns true if any vertex in the pool has a color defined, false if none

  • of them do.

*/

hasDefinedVertices()

C++ Interface: has_defined_vertices(EggVertexPool self)

/**
  • Returns true if any vertices in the pool are fully defined vertices, false

  • if all vertices are forward references.

*/

hasForwardVertices()

C++ Interface: has_forward_vertices(EggVertexPool self)

/**
  • Returns true if any vertices in the pool are undefined forward-reference

  • vertices, false if all vertices are defined.

*/

hasNonwhiteColors()

C++ Interface: has_nonwhite_colors(EggVertexPool self)

/**
  • Returns true if any vertex in the pool has a color defined other than

  • white, false if no vertices have colors, or if all colors are white.

*/

hasNormals()

C++ Interface: has_normals(EggVertexPool self)

/**
  • Returns true if any vertex in the pool has a normal defined, false if none

  • of them do.

*/

hasUvs()

C++ Interface: has_uvs(EggVertexPool self)

/**
  • Returns true if any vertex in the pool has a uv defined, false if none of

  • them do.

*/

hasVertex()

C++ Interface: has_vertex(EggVertexPool self, int index)

/**
  • Returns true if the indicated vertex has been defined in the vertex pool,

  • false otherwise. This does not include forward references.

*/

has_aux()

C++ Interface: has_aux(EggVertexPool self)

/**
  • Returns true if any vertex in the pool has auxiliary data defined, false if

  • none of them do.

*/

has_colors()

C++ Interface: has_colors(EggVertexPool self)

/**
  • Returns true if any vertex in the pool has a color defined, false if none

  • of them do.

*/

has_defined_vertices()

C++ Interface: has_defined_vertices(EggVertexPool self)

/**
  • Returns true if any vertices in the pool are fully defined vertices, false

  • if all vertices are forward references.

*/

has_forward_vertices()

C++ Interface: has_forward_vertices(EggVertexPool self)

/**
  • Returns true if any vertices in the pool are undefined forward-reference

  • vertices, false if all vertices are defined.

*/

has_nonwhite_colors()

C++ Interface: has_nonwhite_colors(EggVertexPool self)

/**
  • Returns true if any vertex in the pool has a color defined other than

  • white, false if no vertices have colors, or if all colors are white.

*/

has_normals()

C++ Interface: has_normals(EggVertexPool self)

/**
  • Returns true if any vertex in the pool has a normal defined, false if none

  • of them do.

*/

has_uvs()

C++ Interface: has_uvs(EggVertexPool self)

/**
  • Returns true if any vertex in the pool has a uv defined, false if none of

  • them do.

*/

has_vertex()

C++ Interface: has_vertex(EggVertexPool self, int index)

/**
  • Returns true if the indicated vertex has been defined in the vertex pool,

  • false otherwise. This does not include forward references.

*/

makeNewVertex()

C++ Interface: make_new_vertex(const EggVertexPool self) make_new_vertex(const EggVertexPool self, const LPoint4d pos) make_new_vertex(const EggVertexPool self, const LPoint2d pos) make_new_vertex(const EggVertexPool self, const LPoint3d pos) make_new_vertex(const EggVertexPool self, double pos)

// make_new_vertex() allocates and returns a new vertex from the pool.

/**
  • Allocates and returns a new vertex from the pool. This is one of three

  • ways to add new vertices to a vertex pool.

*/

/**
  • Allocates and returns a new vertex from the pool. This is one of three

  • ways to add new vertices to a vertex pool.

  • This flavor of make_new_vertex() explicitly sets the vertex position as it

  • is allocated. It does not attempt to share vertices.

*/

/**
  • Allocates and returns a new vertex from the pool. This is one of three

  • ways to add new vertices to a vertex pool.

  • This flavor of make_new_vertex() explicitly sets the vertex position as it

  • is allocated. It does not attempt to share vertices.

*/

/**
  • Allocates and returns a new vertex from the pool. This is one of three

  • ways to add new vertices to a vertex pool.

  • This flavor of make_new_vertex() explicitly sets the vertex position as it

  • is allocated. It does not attempt to share vertices.

*/

/**
  • Allocates and returns a new vertex from the pool. This is one of three

  • ways to add new vertices to a vertex pool.

  • This flavor of make_new_vertex() explicitly sets the vertex position as it

  • is allocated. It does not attempt to share vertices.

*/

make_new_vertex()

C++ Interface: make_new_vertex(const EggVertexPool self) make_new_vertex(const EggVertexPool self, const LPoint4d pos) make_new_vertex(const EggVertexPool self, const LPoint2d pos) make_new_vertex(const EggVertexPool self, const LPoint3d pos) make_new_vertex(const EggVertexPool self, double pos)

// make_new_vertex() allocates and returns a new vertex from the pool.

/**
  • Allocates and returns a new vertex from the pool. This is one of three

  • ways to add new vertices to a vertex pool.

*/

/**
  • Allocates and returns a new vertex from the pool. This is one of three

  • ways to add new vertices to a vertex pool.

  • This flavor of make_new_vertex() explicitly sets the vertex position as it

  • is allocated. It does not attempt to share vertices.

*/

/**
  • Allocates and returns a new vertex from the pool. This is one of three

  • ways to add new vertices to a vertex pool.

  • This flavor of make_new_vertex() explicitly sets the vertex position as it

  • is allocated. It does not attempt to share vertices.

*/

/**
  • Allocates and returns a new vertex from the pool. This is one of three

  • ways to add new vertices to a vertex pool.

  • This flavor of make_new_vertex() explicitly sets the vertex position as it

  • is allocated. It does not attempt to share vertices.

*/

/**
  • Allocates and returns a new vertex from the pool. This is one of three

  • ways to add new vertices to a vertex pool.

  • This flavor of make_new_vertex() explicitly sets the vertex position as it

  • is allocated. It does not attempt to share vertices.

*/

removeUnusedVertices()

C++ Interface: remove_unused_vertices(const EggVertexPool self)

/**
  • Removes all vertices from the pool that are not referenced by at least one

  • primitive. Also collapses together equivalent vertices, and renumbers all

  • vertices after the operation so their indices are consecutive, beginning at

  • zero. Returns the number of vertices removed.

*/

removeVertex()

C++ Interface: remove_vertex(const EggVertexPool self, EggVertex vertex)

/**
  • Removes the vertex from the pool. It is an error if the vertex is not

  • already a member of the pool.

*/

remove_unused_vertices()

C++ Interface: remove_unused_vertices(const EggVertexPool self)

/**
  • Removes all vertices from the pool that are not referenced by at least one

  • primitive. Also collapses together equivalent vertices, and renumbers all

  • vertices after the operation so their indices are consecutive, beginning at

  • zero. Returns the number of vertices removed.

*/

remove_vertex()

C++ Interface: remove_vertex(const EggVertexPool self, EggVertex vertex)

/**
  • Removes the vertex from the pool. It is an error if the vertex is not

  • already a member of the pool.

*/

setHighestIndex()

C++ Interface: set_highest_index(const EggVertexPool self, int highest_index)

/**
  • Artificially changes the “highest index number”, so that a newly created

  • vertex will begin at this number plus 1. This can be used to default a

  • vertex pool to start counting at 1 (or any other index number), instead of

  • the default of 0. Use with caution.

*/

set_highest_index()

C++ Interface: set_highest_index(const EggVertexPool self, int highest_index)

/**
  • Artificially changes the “highest index number”, so that a newly created

  • vertex will begin at this number plus 1. This can be used to default a

  • vertex pool to start counting at 1 (or any other index number), instead of

  • the default of 0. Use with caution.

*/

sortByExternalIndex()

C++ Interface: sort_by_external_index(const EggVertexPool self)

/**
  • Re-orders (and re-numbers) the vertices in this vertex pool so that they

  • appear in increasing order by the optional external_index that has been

  • assigned to each vertex.

*/

sort_by_external_index()

C++ Interface: sort_by_external_index(const EggVertexPool self)

/**
  • Re-orders (and re-numbers) the vertices in this vertex pool so that they

  • appear in increasing order by the optional external_index that has been

  • assigned to each vertex.

*/

transform()

C++ Interface: transform(const EggVertexPool self, const LMatrix4d mat)

/**
  • Applies the indicated transformation matrix to all the vertices. However,

  • vertices that are attached to primitives that believe their vertices are in

  • a local coordinate system are transformed only by the scale and rotation

  • component. If a vertex happens to be attached both to a local and a global

  • primitive, and the transformation includes a translation component, the

  • vertex will be split.

*/