| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
dict --+
|
AnyArrayType
Base class for defining types of Ports which can handle single values
or arrays of arbitrary shape.
this class must be herited only !!!! get inspired by class IntType below
the construcor arguments are:
name: string used to identify an instance of a AnyArrayType object
ex: float
you can add the datashape to the name
ex: float(0,>=3,4,0)'
Multi dimensional arrays can be specified by passing
a datashape in parenthesis in the form of a string of comma separated
expressions. The number of expressions is the number of dimensions.
Valid expressions are :
0 : meaning there is no condition on this dimension.
(in addition, the leading 0 dimensions are optional)
x : length of this dimension must be x
>x : length of this dimension must be > x
<x : length of this dimension must be < x
>=x: length of this dimension must be >= x
<=x: length of this dimension must be <= x
for instance a list of vertices can be represented by float(0,3)
float: describe the smalest elementary datum (one coordinate).
you can introduce your own elementary type
(generaly inheriting basic types), this allow you to easily
define color and shape for this type (see InstancematType below)
3: because there are 3 coordinates per vertex.
0: because we don't have any limitation on the number of vertices.
It is a leading 0, therefore this dimension is optionnal
(meaning: if you're passing a single vertex [x,y,z],
your are not oblige to put it in a list.
ex: you can give [x,y,z] or [[x,y,z]])
|
|||
|
__init__(self,
name='None',
datashape=None,
klass=None,
dataDescr=None,
color=None,
shape='diamond',
width=None,
height=None) x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
||
|
validateDims(self,
data) data comes in as a numeric array, and returns True if required shapes pass tests, returns False is tests fail, or returns number of missing dimensions if test pass but optional dims are missing |
||
|
_shape(self,
datashape) This function is called by the constructor to return the number of edges used to draw the port icon based on the number of dimensions of the type. |
||
| cast(self, data) | ||
| validate(self, data) | ||
|
Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
|
|
|
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0alpha3 on Fri Nov 2 14:08:29 2007 | http://epydoc.sourceforge.net |