82. plugins.objects — Selection of objects from the global dictionary.

This is a support module for other pyFormex plugins.

82.1. Classes defined in module plugins.objects

class plugins.objects.Objects(clas=None, like=None, filter=None, namelist=[])[source]

A selection of objects from the pyFormex Globals().

The class provides facilities to filter the global objects by their type and select one or more objects by their name(s). The values of these objects can be changed and the changes can be undone.

Examples

>>> from pyformex.lazy import Mesh, TriSurface
>>> pf.PF.clear()
>>> M = Mesh()
>>> M1 = Mesh(eltype='tri3')
>>> S = M1.toSurface()
>>> F = S.toFormex()
>>> gs.export({'a':2, 'M':M, 'S':S, 'F':F, 'M1':M1})
>>> Objects(clas=Mesh).listAll()
['M', 'S', 'M1']
>>> Objects(clas=Mesh,
...     filter=lambda o: isinstance(pf.PF[o], TriSurface)).listAll()
['S']
class plugins.objects.DrawableObjects(**kargs)[source]

A selection of drawable objects from the globals().

This is a subclass of Objects. The constructor has the same arguments as the Objects class. THe difference is that when a selection is made in the DrawableObjects class, the selection is drawn automatically. This is therefore well suited to do interactive modeling. Furthermore it has provisions to add annotations to the rendering, like node and element numbers, or surface normals.