GraphicCollection#

GraphicCollection#

Constructor#

GraphicCollection(data, **kwargs)

A collection of graphics of the same type.

Properties#

GraphicCollection.alpha

The opacity of the graphic

GraphicCollection.alpha_mode

How the alpha is handled by the renderer

GraphicCollection.axes

GraphicCollection.block_events

Used to block events for a graphic and prevent recursion.

GraphicCollection.block_handlers

Used to block event handlers for a graphic and prevent recursion.

GraphicCollection.deleted

used to emit an event after the graphic is deleted

GraphicCollection.event_handlers

Registered event handlers.

GraphicCollection.graphics

the graphics in the collection

GraphicCollection.imgui_right_click

The imgui popup of each graphic of this collection, in order.

GraphicCollection.legend_item

The legend item of this graphic, created with create_legend_item().

GraphicCollection.name

Graphic name

GraphicCollection.offset

[x, y, z]

GraphicCollection.rotation

Orientation of the graphic as a quaternion

GraphicCollection.scale

(x, y, z) scaling factor

GraphicCollection.supported_events

events supported by this graphic

GraphicCollection.tooltip_format

set a custom tooltip format function which takes a pick_info dict and returns a str to be displayed in the tooltip

GraphicCollection.visible

Whether the graphic is visible

GraphicCollection.world_object

Associated pygfx WorldObject.

Methods#

GraphicCollection.add_axes()

Add axes onto this Graphic

GraphicCollection.add_event_handler(*args)

Register an event handler.

GraphicCollection.add_graphic(graphic)

Add a graphic to the collection.

GraphicCollection.append_imgui_right_click([gui])

Append imgui elements to the popup of every graphic of this collection.

GraphicCollection.clear_event_handlers()

clear all event handlers added to this graphic

GraphicCollection.format_pick_info(ev)

Takes a pygfx.PointerEvent and returns formatted pick info.

GraphicCollection.map_model_to_world(position)

map position from model (data) space to world space, basically applies the world affine transform

GraphicCollection.map_world_to_model(position)

map position from world space to model (data) space, basically applies the inverse world affine transform

GraphicCollection.remove_event_handler(...)

remove a registered event handler

GraphicCollection.remove_graphic(graphic)

Remove a graphic from the collection.

GraphicCollection.remove_imgui_right_click(popup)

Remove popup from every graphic of this collection that has it set.

GraphicCollection.rotate(alpha[, axis])

Rotate the Graphic with respect to the world.

GraphicCollection.set_imgui_right_click([...])

Set the imgui popup opened by a right-click on any graphic of this collection.