Back to index

salome-paravis  6.5.0
Public Member Functions | Public Attributes | Properties | Private Member Functions
paravisSM.InputProperty Class Reference
Inheritance diagram for paravisSM.InputProperty:
Inheritance graph
[legend]
Collaboration diagram for paravisSM.InputProperty:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __setitem__
def __getitem__
def append
def GetData
def SetData
def GetAvailable
def __iter__
def __len__
def remove
def __delitem__
def __getattr__
def index
def Clear
def __repr__
def __call__

Public Attributes

 SMProperty
 Proxy

Properties

 Available
 Name

Private Member Functions

def _UpdateProperty

Detailed Description

An InputProperty allows making pipeline connections. You can set either
a source proxy or an OutputProperty to an input property:

> property[0] = proxy
or
> property[0] = OuputPort(proxy, 1)

> property.append(proxy)
or
> property.append(OutputPort(proxy, 0))

Definition at line 1158 of file paravisSM.py.


Member Function Documentation

def paravisSM.Property.__call__ (   self) [inherited]
Forces a property update using InvokeCommand.

Definition at line 563 of file paravisSM.py.

00563 
00564     def __call__(self):
00565         """Forces a property update using InvokeCommand."""
00566         if type(self) is Property:
00567             self.Proxy.SMProxy.InvokeCommand(self._FindPropertyName())
00568         else:
00569             raise RuntimeError, "Cannot invoke this property"

Here is the call graph for this function:

def paravisSM.ProxyProperty.__delitem__ (   self,
  idx 
) [inherited]
Removes the element idx

Definition at line 1071 of file paravisSM.py.

01071 
01072     def __delitem__(self,idx):
01073       """Removes the element idx"""
01074       if isinstance(idx, slice):
01075         indices = idx.indices(len(self))
01076         # Collect the elements to delete to a new list first.
01077         # Otherwise indices are screwed up during the actual
01078         # remove loop.
01079         toremove = []
01080         for i in range(*indices):
01081           toremove.append(self[i])
01082         for i in toremove:
01083           self.SMProperty.RemoveProxy(i.SMProxy)
01084         self._UpdateProperty()
01085       elif idx >= len(self) or idx < 0:
01086         raise IndexError
01087       else:
01088         self.SMProperty.RemoveProxy(self[idx].SMProxy)
01089         self._UpdateProperty()

Here is the call graph for this function:

def paravisSM.ProxyProperty.__getattr__ (   self,
  name 
) [inherited]

Reimplemented from paravisSM.Property.

Definition at line 1103 of file paravisSM.py.

01103 
01104     def __getattr__(self, name):
01105         "Unknown attribute requests get forwarded to SMProperty."
01106         return getattr(self.SMProperty, name)

def paravisSM.InputProperty.__getitem__ (   self,
  idx 
)
Returns the range [min, max) of elements. Raises an IndexError
exception if an argument is out of bounds.

Reimplemented from paravisSM.ProxyProperty.

Definition at line 1184 of file paravisSM.py.

01184 
01185     def __getitem__(self, idx):
01186       """Returns the range [min, max) of elements. Raises an IndexError
01187       exception if an argument is out of bounds."""
01188       if isinstance(idx, slice):
01189         indices = idx.indices(len(self))
01190         retVal = []
01191         for i in range(*indices):
01192             port = None
01193             if self.SMProperty.GetProxy(i):
01194                 port = OutputPort(_getPyProxy(self.SMProperty.GetProxy(i)),\
01195                                   self.SMProperty.GetOutputPortForConnection(i))
01196             retVal.append(port)
01197         return retVal
01198       elif idx >= len(self) or idx < 0:
01199         raise IndexError
01200       return OutputPort(_getPyProxy(self.SMProperty.GetProxy(idx)),\
01201                         self.SMProperty.GetOutputPortForConnection(idx))

Here is the call graph for this function:

def paravisSM.ProxyProperty.__iter__ (   self) [inherited]
Implementation of the sequence API

Definition at line 1045 of file paravisSM.py.

01045 
01046     def __iter__(self):
01047         """Implementation of the sequence API"""
01048         return GenericIterator(self)

Here is the caller graph for this function:

def paravisSM.ProxyProperty.__len__ (   self) [inherited]
Returns the number of elements.

Definition at line 1049 of file paravisSM.py.

01049 
01050     def __len__(self):
01051         """Returns the number of elements."""
01052         return self.SMProperty.GetNumberOfProxies()

def paravisSM.Property.__repr__ (   self) [inherited]
Returns a string representation containing property name
and value

Definition at line 545 of file paravisSM.py.

00545 
00546     def __repr__(self):
00547         """Returns a string representation containing property name
00548         and value"""
00549         if not type(self) is Property:
00550             if self.GetData() is not None:
00551                 repr = self.GetData().__repr__()
00552             else:
00553                 repr = "None"
00554         else:
00555             repr = "Property name= "
00556             name = self.Proxy.GetPropertyName(self.SMProperty)
00557             if name:
00558                 repr += name
00559             else:
00560                 repr += "Unknown"
00561 
00562         return repr

Here is the call graph for this function:

def paravisSM.InputProperty.__setitem__ (   self,
  idx,
  value 
)
Given a list or tuple of values, sets a slice of values [min, max)

Reimplemented from paravisSM.ProxyProperty.

Definition at line 1170 of file paravisSM.py.

01170 
01171     def __setitem__(self, idx, value):
01172       """Given a list or tuple of values, sets a slice of values [min, max)"""
01173       if isinstance(idx, slice):
01174         indices = idx.indices(len(self))
01175         for i, j in zip(range(*indices), value):
01176           op = value[i-min]
01177           self.SMProperty.SetInputConnection(i, op.SMProxy, op.Port)
01178         self._UpdateProperty()
01179       elif idx >= len(self) or idx < 0:
01180         raise IndexError
01181       else:
01182         self.SMProperty.SetInputConnection(idx, value.SMProxy, value.Port)
01183         self._UpdateProperty()

Here is the call graph for this function:

def paravisSM.InputProperty._UpdateProperty (   self) [private]

Reimplemented from paravisSM.Property.

Definition at line 1235 of file paravisSM.py.

01235 
01236     def _UpdateProperty(self):
01237         "Pushes the value of this property to the server."
01238         ProxyProperty._UpdateProperty(self)
01239         iter = PropertyIterator(self.Proxy)
01240         for prop in iter:
01241             if isinstance(prop, ArraySelectionProperty):
01242                 prop.UpdateDefault()
01243 

def paravisSM.InputProperty.append (   self,
  value 
)
Appends the given proxy to the property values.
Accepts Proxy or OutputPort objects.

Reimplemented from paravisSM.ProxyProperty.

Definition at line 1202 of file paravisSM.py.

01202 
01203     def append(self, value):
01204         """Appends the given proxy to the property values.
01205         Accepts Proxy or OutputPort objects."""
01206         self.SMProperty.AddInputConnection(value.SMProxy, value.Port)
01207         self._UpdateProperty()

Here is the call graph for this function:

def paravisSM.ProxyProperty.Clear (   self) [inherited]

Definition at line 1153 of file paravisSM.py.

01153 
01154     def Clear(self):
01155         "Removes all elements."
01156         self.SMProperty.RemoveAllProxies()
01157         self._UpdateProperty()

Here is the call graph for this function:

def paravisSM.ProxyProperty.GetAvailable (   self) [inherited]
If this proxy has a list domain, then this function returns the
strings you can use to select from the domain.  If there is no such
list domain, the returned list is empty.

Definition at line 1028 of file paravisSM.py.

01028 
01029     def GetAvailable(self):
01030         """If this proxy has a list domain, then this function returns the
01031         strings you can use to select from the domain.  If there is no such
01032         list domain, the returned list is empty."""
01033         listdomain = self.GetDomain('proxy_list')
01034         retval = []
01035         if listdomain:
01036             for i in xrange(listdomain.GetNumberOfProxies()):
01037                 proxy = listdomain.GetProxy(i)
01038                 retval.append(proxy.GetXMLLabel())
01039         return retval

Returns all elements as either a list of OutputPort objects or
a single OutputPort object.

Reimplemented from paravisSM.ProxyProperty.

Definition at line 1208 of file paravisSM.py.

01208 
01209     def GetData(self):
01210         """Returns all elements as either a list of OutputPort objects or
01211         a single OutputPort object."""
01212         property = self.SMProperty
01213         if property.GetRepeatable() or property.GetNumberOfProxies() > 1:
01214             return self[0:len(self)]
01215         else:
01216             if property.GetNumberOfProxies() > 0:
01217                 return OutputPort(_getPyProxy(property.GetProxy(0)),\
01218                                   self.SMProperty.GetOutputPortForConnection(0))
01219         return None

Here is the call graph for this function:

Here is the caller graph for this function:

def paravisSM.ProxyProperty.index (   self,
  proxy 
) [inherited]

Definition at line 1107 of file paravisSM.py.

01107 
01108     def index(self, proxy):
01109         idx = 0
01110         for px in self:
01111             ## VSV: ==
01112             if proxy.IsSame(px):
01113                 return idx
01114             idx += 1
01115         raise ValueError("proxy is not in the list.")

def paravisSM.ProxyProperty.remove (   self,
  proxy 
) [inherited]
Removes the first occurence of the proxy from the property.

Definition at line 1053 of file paravisSM.py.

01053 
01054     def remove(self, proxy):
01055         """Removes the first occurence of the proxy from the property."""
01056         self.SMProperty.RemoveProxy(proxy.SMProxy)
01057         self._UpdateProperty()
        

Here is the call graph for this function:

def paravisSM.InputProperty.SetData (   self,
  values 
)
Allows setting of all values at once. Requires a single value,
a tuple or list. Accepts Proxy or OutputPort objects.

Reimplemented from paravisSM.ProxyProperty.

Definition at line 1220 of file paravisSM.py.

01220 
01221     def SetData(self, values):
01222         """Allows setting of all values at once. Requires a single value,
01223         a tuple or list. Accepts Proxy or OutputPort objects."""
01224         if isinstance(values, str):
01225             ProxyProperty.SetData(self, values)
01226             return
01227         if not isinstance(values, tuple) and \
01228            not isinstance(values, list):
01229             values = (values,)
01230         self.SMProperty.RemoveAllProxies()
01231         for value in values:
01232             if value:
01233                 self.SMProperty.AddInputConnection(value.SMProxy, value.Port)
01234         self._UpdateProperty()

Here is the call graph for this function:


Member Data Documentation

Definition at line 543 of file paravisSM.py.

Definition at line 542 of file paravisSM.py.


Property Documentation

paravisSM.ProxyProperty.Available [static, inherited]
Initial value:
property(GetAvailable, None, None,
                         """This read only property is a list of strings you canuse to select from the list domain.  If there is nosuch list domain, the array is empty.""")

Definition at line 1040 of file paravisSM.py.

paravisSM.Property.Name [static, inherited]
Initial value:
property(_FindPropertyName, None, None,
           "Returns the name for the property")

Definition at line 589 of file paravisSM.py.


The documentation for this class was generated from the following file: