Back to index

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

List of all members.

Public Member Functions

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

Public Attributes

 SMProperty
 Proxy

Properties

 Name

Detailed Description

Definition at line 803 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)

Returns attribute type for index 0, array name for index 1

Reimplemented from paravisSM.VectorProperty.

Definition at line 826 of file paravisSM.py.

00826 
00827     def __getitem__(self, idx):
00828         """Returns attribute type for index 0, array name for index 1"""
00829         if isinstance(idx, slice):
00830             indices = idx.indices(len(self))
00831             retVal = []
00832             for i in range(*indices):
00833                 if i >= 2 or i < 0:
00834                     raise IndexError
00835                 if i == 0:
00836                     retVal.append(self.GetAssociation())
00837                 else:
00838                     retVal.append(self.GetArrayName())
00839             return retVal
00840         elif idx >= 2 or idx < 0:
00841             raise IndexError
00842 
00843         if i == 0:
00844             return self.GetAssociation()
00845         else:
00846             return self.GetArrayName()

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:

Returns the number of elements.

Reimplemented from paravisSM.VectorProperty.

Definition at line 819 of file paravisSM.py.

00819 
00820     def __len__(self):
00821         """Returns the number of elements."""
00822         return 2

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

Reimplemented from paravisSM.VectorProperty.

Definition at line 823 of file paravisSM.py.

00823 
00824     def __setitem__(self, idx, value):
00825         raise RuntimeError, "This property cannot be accessed using __setitem__"

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:

Definition at line 816 of file paravisSM.py.

00816 
00817     def GetArrayName(self):
00818         return self.GetElement(4)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 806 of file paravisSM.py.

00806 
00807     def GetAssociation(self):
00808         val = self.GetElement(3)
00809         if val == "":
00810             return None
00811         for key, value in ASSOCIATIONS.iteritems():
00812             if value == int(val):
00813                 return key
00814 
00815         return None

Here is the call graph for this function:

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.ArraySelectionProperty.SetData (   self,
  values 
)
Allows setting of all values at once. Requires a single value,
a tuple or list.

Reimplemented from paravisSM.VectorProperty.

Definition at line 847 of file paravisSM.py.

00847 
00848     def SetData(self, values):
00849         """Allows setting of all values at once. Requires a single value,
00850         a tuple or list."""
00851         if not isinstance(values, tuple) and \
00852            not isinstance(values, list):
00853             values = (values,)
00854         if len(values) == 1:
00855             self.SMProperty.SetElement(4, values[0])
00856         elif len(values) == 2:
00857             if isinstance(values[0], str):
00858                 val = str(ASSOCIATIONS[values[0]])
00859             else:
00860                 # In case user didn't specify valid association,
00861                 # just pick POINTS.
00862                 val = str(ASSOCIATIONS['POINTS'])
00863             self.SMProperty.SetElement(3,  str(val))
00864             self.SMProperty.SetElement(4, values[1])
00865         else:
00866             raise RuntimeError, "Expected 1 or 2 values."
00867         self._UpdateProperty()

Here is the call graph for this function:

Definition at line 868 of file paravisSM.py.

00868 
00869     def UpdateDefault(self):
00870         "Helper method to set default values."
00871         if self.SMProperty.GetNumberOfElements() != 5:
00872             return
00873         if self.GetElement(4) != '' or \
00874             self.GetElement(3) != '':
00875             return
00876 
00877         for i in range(0,3):
00878             if self.GetElement(i) == '':
00879                 self.SMProperty.SetElement(i, '0')
00880         al = self.SMProperty.GetDomain("array_list")
00881         al.Update(self.SMProperty)
00882         al.SetDefaultValues(self.SMProperty)

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.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: