The class Scene

The class Scene is a container of items that can be RImage, Surface or Volume.

name.

class scene.Scene

A container of objects (RImage, Surface or Volume) used within the interface of image_viewer.

Instance attribute

current_item

Current item, the one being visualized or/and operated with.

Instance methods:

add_item(name)

Adds an item to the scene. If the scene already has an item with that name, it modifies the name of the item adding to it the suffx _n where n is the number of items of the scene with the same name minus 1.

number_items(item_cat)

Returns the number of items of the given category item_cat in the scene.

iter_cat()

Returns an iterator over the classes of the items of the scene

This class supports the following operations:

Operatiom

Result

s[name]

Returns the item of the scene s that has the name name.

name in s

Returns True if the scene has an item with name name.

The class is iterable over items.

The implementation of the class is given together other files in a zip file as described in The program image_viewer.