Plotter.add_actor

Contents

Plotter.add_actor#

Plotter.add_actor(
actor: vtkProp | vtkMapper,
*,
reset_camera: bool | None = False,
name: str | None = None,
culling: str | bool = False,
pickable: bool = True,
render: bool = True,
remove_existing_actor: bool = True,
) tuple[vtkProp, vtkProperty | vtkVolumeProperty | None][source]#

Add an actor to render window.

Creates an actor if input is a mapper.

Parameters:
actorvtkProp | vtkMapper | Actor

The actor to be added. Can be any prop, or a mapper to wrap into an actor.

reset_camerabool, optional

Resets the camera when True. When None, the camera is reset only if it has not been set and no existing actor was replaced.

namestr, optional

Name to assign to the actor. Defaults to the memory address.

cullingstr | bool, default: False

Does not render faces that are culled. This can be helpful for dense surface meshes, especially when edges are visible, but can cause flat meshes to be partially displayed. One of the following:

  • True, 'b', 'back', 'backface' - Enable backface culling

  • 'f', 'front', 'frontface' - Enable frontface culling

  • False, 'none' - Leave culling as the actor already has it

pickablebool, default: True

Whether to allow this actor to be pickable within the render window.

renderbool, default: True

If the render window is being shown, trigger a render after adding the actor.

remove_existing_actorbool, default: True

Removes any existing actor if the named actor name is already present.

Returns:
actorvtkProp

The actor.

actor_propertiesvtkProperty | vtkVolumeProperty

The property of the actor, or None if it has none.