Back to index

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

List of all members.

Public Member Functions

def SplitViewHorizontal
def SplitViewVertical
def AssignView
def GetViewLocation
def __setattr__
def add_attribute
def InitializeFromProxy
def Initialize
def __eq__
def __ne__
def __iter__
def SetPropertyWithName
def GetPropertyValue
def GetProperty
def ListProperties

Public Attributes

 Port
 Observed
 ObserverTag
 SMProxy

Detailed Description

Special class to define convenience methods for View Layout

Definition at line 474 of file paravisSM.py.


Member Function Documentation

def paravisSM.Proxy.__eq__ (   self,
  other 
) [inherited]

Definition at line 243 of file paravisSM.py.

00243 
00244     def __eq__(self, other):
00245         "Returns true if the underlying SMProxies are the same."
00246         if isinstance(other, Proxy):
00247             try:
00248                 if self.Port != other.Port:
00249                     return False
00250             except:
00251                 pass
00252             ## VSV using IsSame instead ==
00253             return self.SMProxy.IsSame(other.SMProxy)
00254         return self.SMProxy.IsSame(other)

Here is the caller graph for this function:

def paravisSM.Proxy.__iter__ (   self) [inherited]

Definition at line 259 of file paravisSM.py.

00259 
00260     def __iter__(self):
00261         "Creates an iterator for the properties."
00262         return PropertyIterator(self)

Here is the caller graph for this function:

def paravisSM.Proxy.__ne__ (   self,
  other 
) [inherited]

Definition at line 255 of file paravisSM.py.

00255 
00256     def __ne__(self, other):
00257         "Returns false if the underlying SMProxies are the same."
00258         return not self.__eq__(other)

Here is the call graph for this function:

def paravisSM.Proxy.__setattr__ (   self,
  name,
  value 
) [inherited]

Definition at line 200 of file paravisSM.py.

00200 
00201     def __setattr__(self, name, value):
00202         try:
00203             setter = getattr(self.__class__, name)
00204             setter = setter.__set__
00205         except AttributeError:
00206             if not hasattr(self, name):
00207                 raise AttributeError("Attribute %s does not exist. " % name +
00208                   " This class does not allow addition of new attributes to avoid " +
00209                   "mistakes due to typos. Use add_attribute() if you really want " +
00210                   "to add this attribute.")
00211             self.__dict__[name] = value
00212         else:
00213             setter(self, value)

def paravisSM.Proxy.add_attribute (   self,
  name,
  value 
) [inherited]

Definition at line 214 of file paravisSM.py.

00214 
00215     def add_attribute(self, name, value):
00216         self.__dict__[name] = value

Here is the caller graph for this function:

def paravisSM.ViewLayoutProxy.AssignView (   self,
  location,
  view 
)
Assign a view at a particular location. Note that the view's position may
be changed by subsequent Split() calls. Returns true on success.

Definition at line 504 of file paravisSM.py.

00504 
00505     def AssignView(self, location, view):
00506         """Assign a view at a particular location. Note that the view's position may
00507         be changed by subsequent Split() calls. Returns true on success."""
00508         viewproxy = None
00509         if isinstance(view, Proxy):
00510             view = view.SMProxy
00511         return self.SMProxy.AssignView(location, view)

def paravisSM.Proxy.GetProperty (   self,
  name 
) [inherited]
Given a property name, returns the property object.

Definition at line 292 of file paravisSM.py.

00292 
00293     def GetProperty(self, name):
00294         """Given a property name, returns the property object."""
00295         if name in self.__Properties and self.__Properties[name]():
00296             return self.__Properties[name]()
00297         smproperty = self.SMProxy.GetProperty(name)
00298         # Maybe they are looking by the label. Try to match that.
00299         if not smproperty:
00300             iter = PropertyIterator(self)
00301             for prop in iter:
00302                 if name == _make_name_valid(iter.PropertyLabel):
00303                     smproperty = prop.SMProperty
00304                     break
00305         if smproperty:
00306             property = _wrap_property(self, smproperty)
00307             if property is not None:
00308                 import weakref
00309                 self.__Properties[name] = weakref.ref(property)
00310             return property
00311         return None

Here is the call graph for this function:

Here is the caller graph for this function:

def paravisSM.Proxy.GetPropertyValue (   self,
  name 
) [inherited]
Returns a scalar for properties with 1 elements, the property
itself for vectors.

Definition at line 270 of file paravisSM.py.

00270 
00271     def GetPropertyValue(self, name):
00272         """Returns a scalar for properties with 1 elements, the property
00273         itself for vectors."""
00274         p = self.GetProperty(name)
00275         if isinstance(p, VectorProperty):
00276             if p.GetNumberOfElements() == 1 and not p.GetRepeatable():
00277                 if p.SMProperty.IsA("vtkSMStringVectorProperty") or not p.GetArgumentIsArray():
00278                     return p[0]
00279         elif isinstance(p, InputProperty):
00280             if not p.GetMultipleInput():
00281                 if len(p) > 0:
00282                     return p[0]
00283                 else:
00284                     return None
00285         elif isinstance(p, ProxyProperty):
00286             if not p.GetRepeatable():
00287                 if len(p) > 0:
00288                     return p[0]
00289                 else:
00290                     return None
00291         return p

Here is the call graph for this function:

def paravisSM.ViewLayoutProxy.GetViewLocation (   self,
  view 
)

Definition at line 512 of file paravisSM.py.

00512 
00513     def GetViewLocation(self, view):
00514         if isinstance(view, Proxy):
00515             view = view.SMProxy
00516         return self.SMProxy.GetViewLocation(view)

Here is the caller graph for this function:

def paravisSM.Proxy.Initialize (   self) [inherited]

Definition at line 239 of file paravisSM.py.

00239 
00240     def Initialize(self):
00241         "Overridden by the subclass created automatically"
00242         pass

def paravisSM.Proxy.InitializeFromProxy (   self,
  aProxy,
  update = True 
) [inherited]
Constructor. Assigns proxy to self.SMProxy, updates the server
object as well as register the proxy in _pyproxies dictionary.

Definition at line 230 of file paravisSM.py.

00230 
00231     def InitializeFromProxy(self, aProxy, update=True):
00232         """Constructor. Assigns proxy to self.SMProxy, updates the server
00233         object as well as register the proxy in _pyproxies dictionary."""
00234         import weakref
00235         self.SMProxy = aProxy
00236         if update:
00237             self.SMProxy.UpdateVTKObjects()
00238         _pyproxies[(self.SMProxy, self.Port)] = weakref.ref(self)

def paravisSM.Proxy.ListProperties (   self) [inherited]
Returns a list of all property names on this proxy.

Definition at line 312 of file paravisSM.py.

00312 
00313     def ListProperties(self):
00314         """Returns a list of all property names on this proxy."""
00315         property_list = []
00316         iter = self.__iter__()
00317         for property in iter:
00318             name = _make_name_valid(iter.PropertyLabel)
00319             if name:
00320                 property_list.append(name)
00321         return property_list

Here is the call graph for this function:

def paravisSM.Proxy.SetPropertyWithName (   self,
  pname,
  arg 
) [inherited]
Generic method for setting the value of a property.

Definition at line 263 of file paravisSM.py.

00263 
00264     def SetPropertyWithName(self, pname, arg):
00265         """Generic method for setting the value of a property."""
00266         prop = self.GetProperty(pname)
00267         if prop is None:
00268             raise RuntimeError, "Property %s does not exist. Please check the property name for typos." % pname
00269         prop.SetData(arg)

Here is the call graph for this function:

def paravisSM.ViewLayoutProxy.SplitViewHorizontal (   self,
  view,
  fraction = 0.5 
)
Split the cell containing the specified view horizontally.
If no fraction is specified, the frame is split into equal parts.
On success returns a positve number that identifying the new cell
location that can be used to assign view to, or split further.
Return -1 on failure.

Definition at line 477 of file paravisSM.py.

00477 
00478     def SplitViewHorizontal(self, view, fraction=0.5):
00479         """Split the cell containing the specified view horizontally.
00480         If no fraction is specified, the frame is split into equal parts.
00481         On success returns a positve number that identifying the new cell
00482         location that can be used to assign view to, or split further.
00483         Return -1 on failure."""
00484         location = self.GetViewLocation(view)
00485         if location == -1:
00486             raise RuntimeError, "View is not present in this layout."
00487         if fraction < 0.0 or fraction > 1.0:
00488             raise RuntimeError, "'fraction' must be in the range [0.0, 1.0]"
00489         return self.SMProxy.SplitHorizontal(location, fraction)

Here is the call graph for this function:

def paravisSM.ViewLayoutProxy.SplitViewVertical (   self,
  view = None,
  fraction = 0.5 
)
Split the cell containing the specified view horizontally.
If no view is specified, active view is used.
If no fraction is specified, the frame is split into equal parts.
On success returns a positve number that identifying the new cell
location that can be used to assign view to, or split further.
Return -1 on failure.

Definition at line 490 of file paravisSM.py.

00490 
00491     def SplitViewVertical(self, view=None, fraction=0.5):
00492         """Split the cell containing the specified view horizontally.
00493         If no view is specified, active view is used.
00494         If no fraction is specified, the frame is split into equal parts.
00495         On success returns a positve number that identifying the new cell
00496         location that can be used to assign view to, or split further.
00497         Return -1 on failure."""
00498         location = self.GetViewLocation(view)
00499         if location == -1:
00500             raise RuntimeError, "View is not present in this layout."
00501         if fraction < 0.0 or fraction > 1.0:
00502             raise RuntimeError, "'fraction' must be in the range [0.0, 1.0]"
00503         return self.SMProxy.SplitVertical(location, fraction)

Here is the call graph for this function:


Member Data Documentation

Definition at line 224 of file paravisSM.py.

Definition at line 225 of file paravisSM.py.

paravisSM.Proxy.Port [inherited]

Definition at line 169 of file paravisSM.py.

Definition at line 234 of file paravisSM.py.


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