Back to index

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

List of all members.

Public Member Functions

def ConvertValue
def __len__
def __iter__
def __setitem__
def GetElement
def __getitem__
def GetData
def SetData
def Clear
def __repr__
def __call__
def __getattr__

Public Attributes

 SMProperty
 Proxy

Properties

 Name

Private Member Functions

def _UpdateProperty

Detailed Description

Property to set/get one or more file names.
This property updates the pipeline information everytime its value changes.
This is used to keep the array lists up to date.

Definition at line 793 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.Property.__getattr__ (   self,
  name 
) [inherited]

Reimplemented in paravisSM.ProxyProperty.

Definition at line 585 of file paravisSM.py.

00585 
00586     def __getattr__(self, name):
00587         "Unknown attribute requests get forwarded to SMProperty."
00588         return getattr(self.SMProperty, name)

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

Reimplemented in paravisSM.ArrayListProperty, and paravisSM.ArraySelectionProperty.

Definition at line 648 of file paravisSM.py.

00648 
00649     def __getitem__(self, idx):
00650         """Returns the range [min, max) of elements. Raises an IndexError
00651         exception if an argument is out of bounds."""
00652         ls = len(self)
00653         if isinstance(idx, slice):
00654             indices = idx.indices(ls)
00655             retVal = []
00656             for i in range(*indices):
00657                retVal.append(self.GetElement(i))
00658             return retVal
00659         elif idx >= ls:
00660             raise IndexError
00661         elif idx < 0:
00662             idx = ls + idx
00663             if idx < 0:
00664                 raise IndexError
00665 
00666         return self.GetElement(idx)

Here is the call graph for this function:

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

Reimplemented in paravisSM.ArrayListProperty.

Definition at line 628 of file paravisSM.py.

00628 
00629     def __iter__(self):
00630         """Implementation of the sequence API"""
00631         return GenericIterator(self)

Here is the caller graph for this function:

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

Reimplemented in paravisSM.ArrayListProperty, and paravisSM.ArraySelectionProperty.

Definition at line 624 of file paravisSM.py.

00624 
00625     def __len__(self):
00626         """Returns the number of elements."""
00627         return self.SMProperty.GetNumberOfElements()

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.VectorProperty.__setitem__ (   self,
  idx,
  value 
) [inherited]
Given a list or tuple of values, sets a slice of values [min, max)

Reimplemented in paravisSM.ArrayListProperty, and paravisSM.ArraySelectionProperty.

Definition at line 632 of file paravisSM.py.

00632 
00633     def __setitem__(self, idx, value):
00634         """Given a list or tuple of values, sets a slice of values [min, max)"""
00635         if isinstance(idx, slice):
00636             indices = idx.indices(len(self))
00637             for i, j in zip(range(*indices), value):
00638                 self.SMProperty.SetElement(i, self.ConvertValue(j))
00639             self._UpdateProperty()
00640         elif idx >= len(self) or idx < 0:
00641             raise IndexError
00642         else:
00643             self.SMProperty.SetElement(idx, self.ConvertValue(value))
00644             self._UpdateProperty()

Here is the call graph for this function:

Reimplemented from paravisSM.Property.

Definition at line 798 of file paravisSM.py.

00798 
00799     def _UpdateProperty(self):
00800         "Pushes the value of this property to the server."
00801         VectorProperty._UpdateProperty(self)
00802         self.Proxy.FileNameChanged()

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

Definition at line 692 of file paravisSM.py.

00692 
00693     def Clear(self):
00694         "Removes all elements."
00695         self.SMProperty().SetNumberOfElements(0)
00696         self._UpdateProperty()

Here is the call graph for this function:

def paravisSM.VectorProperty.ConvertValue (   self,
  value 
) [inherited]

Reimplemented in paravisSM.EnumerationProperty.

Definition at line 621 of file paravisSM.py.

00621 
00622     def ConvertValue(self, value):
00623         return value

Here is the caller graph for this function:

def paravisSM.VectorProperty.GetData (   self) [inherited]

Reimplemented in paravisSM.ArrayListProperty.

Definition at line 667 of file paravisSM.py.

00667 
00668     def GetData(self):
00669         "Returns all elements as either a list or a single value."
00670         property = self.SMProperty
00671         if property.GetRepeatable() or \
00672            property.GetNumberOfElements() > 1:
00673             return self[0:len(self)]
00674         elif property.GetNumberOfElements() == 1:
00675             return self.GetElement(0)

Here is the call graph for this function:

Here is the caller graph for this function:

def paravisSM.VectorProperty.GetElement (   self,
  index 
) [inherited]

Reimplemented in paravisSM.EnumerationProperty.

Definition at line 645 of file paravisSM.py.

00645 
00646     def GetElement(self, index):
00647         return self.SMProperty.GetElement(index)

Here is the caller graph for this function:

def paravisSM.VectorProperty.SetData (   self,
  values 
) [inherited]
Allows setting of all values at once. Requires a single value or
a iterable object.

Reimplemented in paravisSM.ArrayListProperty, paravisSM.ArraySelectionProperty, and paravisSM.ColorArrayProperty.

Definition at line 676 of file paravisSM.py.

00676 
00677     def SetData(self, values):
00678         """Allows setting of all values at once. Requires a single value or
00679         a iterable object."""
00680         if not hasattr(values, "__iter__"):
00681             values = (values,)
00682         if not self.GetRepeatable() and len(values) != self.GetNumberOfElements():
00683             raise RuntimeError("This property requires %d values." % self.GetNumberOfElements())
00684         if self.GetRepeatable():
00685             # Clean up first
00686             self.SMProperty.SetNumberOfElements(0)
00687         idx = 0
00688         for val in values:
00689             self.SMProperty.SetElement(idx, self.ConvertValue(val))
00690             idx += 1
00691         self._UpdateProperty()

Here is the call graph for this function:

Here is the caller 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.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: