scistag.shapestag.shape_list.ShapeList

class ShapeList[source]

Bases: Shape

Initializer

Parameters
  • class_name – The class name

  • hashable_properties – The properties which can automatically get hashed by value to string conversion.

Methods

draw

Draws the shape into the defined canvas

get_hash

A unique hash of the data in this shape.

to_image

Renders the shape to an image.

Attributes

HASHABLE_PROPERTIES

__annotations__

__dataclass_fields__

__dataclass_params__

__dict__

__doc__

__hash__

__module__

__weakref__

list of weak references to the object (if defined)

bounding

The region to be covered overall

shape_class

The shape's class

draw(target, options=None)[source]

Draws the shape into the defined canvas

Parameters
  • target (Canvas) – The canvas to render onto

  • options (Optional[dict]) – Advanced options, such as the cache in which the shape might be cached.

get_hash()

A unique hash of the data in this shape. Is used to cache the shape’s renderings when it has not been modified.

Return type

str

Returns

The hash value

to_image(background_color=Color(r=0.0, g=0.0, b=0.0, a=0.0, _rgba=(0.0, 0.0, 0.0, 0.0), _int_rgba=(0, 0, 0, 0)))

Renders the shape to an image.

The shape needs to either specify it’s bounding or it’s size as member variable to be convertible.

Parameters

background_color – The background color

Return type

Image

bounding: Bounding2D = Bounding2D(0.0,0.0,0.0,0.0)

The region to be covered overall

shape_class: str = ''

The shape’s class