# vispy.visuals.collections.collection module

A collection is a container for several items having the same data structure (dtype). Each data type can be declared as local (it specific to a vertex), shared (it is shared among an item vertices) or global (it is shared by all vertices). It is based on the BaseCollection but offers a more intuitive interface.

class vispy.visuals.collections.collection.Collection(dtype, itype, mode, vertex, fragment, program=None, **kwargs)

  Bases: `BaseCollection`

  A collection is a container for several items having the same data structure (dtype). Each data type can be declared as local (it is specific to a vertex), shared (it is shared among item vertices) or global (it is shared by all items). It is based on the BaseCollection but offers a more intuitive interface.

  Parameters:
    dtype: list

      Data individual types as (name, dtype, scope, default)

    itype: np.dtype or None

      Indices data type

    mode GL_ENUM

      GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN

    vertex: str or tuple of str

      Vertex shader to use to draw this collection

    fragment: str or tuple of str

      Fragment shader to use to draw this collection

    kwargs: str

      Scope can also be specified using keyword argument, where parameter name must be one of the dtype.

  draw(mode=None)

    Draw collection

  view(transform, viewport=None)

    Return a view on the collection using provided transform

class vispy.visuals.collections.collection.CollectionView(collection, transform=None, viewport=None)

  Bases: `object`

  draw()

previous

vispy.visuals.collections.base_collection module

next

vispy.visuals.collections.path_collection module