Back to index

salome-paravis  6.5.0
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
paravisSM.ProxyManager Class Reference

List of all members.

Public Member Functions

def __init__
def RegisterProxy
def NewProxy
def GetProxy
def GetPrototypeProxy
def GetProxiesInGroup
def UnRegisterProxy
def GetProxies
def __iter__
def NewGroupIterator
def NewDefinitionIterator
def __getattr__
def LoadState
def SaveState

Public Attributes

 SMProxyManager

Private Member Functions

def __ConvertArgumentsAndCall

Private Attributes

 __LastAttrName

Detailed Description

When running scripts from the python shell in the ParaView application,
registering proxies with the proxy manager is the only mechanism to
notify the graphical user interface (GUI) that a proxy
exists. Therefore, unless a proxy is registered, it will not show up in
the user interface. Also, the proxy manager is the only way to get
access to proxies created using the GUI. Proxies created using the GUI
are automatically registered under an appropriate group (sources,
filters, representations and views). To get access to these objects,
you can use proxyManager.GetProxy(group, name). The name is the same
as the name shown in the pipeline browser.

This class is a python wrapper for vtkSMProxyManager. Note that the
underlying vtkSMProxyManager is a singleton. All instances of this
class will refer to the same object. In addition to all methods provided by
vtkSMProxyManager (all unknown attribute requests are forwarded
to the vtkSMProxyManager), this class provides several convenience
methods.

Please note that some of the methods accessible through the ProxyManager
class are not listed by help() because the ProxyManager objects forwards
unresolved attributes to the underlying object. To get the full list,
see also dir(proxy.SMProxyManager). See also the doxygen based documentation
of the vtkSMProxyManager C++ class.

Definition at line 1474 of file paravisSM.py.


Constructor & Destructor Documentation

def paravisSM.ProxyManager.__init__ (   self,
  session = None 
)
Constructor. Assigned self.SMProxyManager to
vtkSMProxyManager.GetProxyManager().

Definition at line 1500 of file paravisSM.py.

01500 
01501     def __init__(self, session=None):
01502         """Constructor. Assigned self.SMProxyManager to
01503         vtkSMProxyManager.GetProxyManager()."""
01504         global ActiveConnection
01505         if not session:
01506             session = ActiveConnection.Session
01507         self.SMProxyManager = session.GetSessionProxyManager()


Member Function Documentation

def paravisSM.ProxyManager.__ConvertArgumentsAndCall (   self,
  args 
) [private]

Definition at line 1612 of file paravisSM.py.

01612 
01613     def __ConvertArgumentsAndCall(self, *args):
01614       newArgs = []
01615       for arg in args:
01616           if issubclass(type(arg), Proxy) or isinstance(arg, Proxy):
01617               newArgs.append(arg.SMProxy)
01618           else:
01619               newArgs.append(arg)
01620       func = getattr(self.SMProxyManager, self.__LastAttrName)
01621       retVal = func(*newArgs)
01622       if type(retVal) is type(self.SMProxyManager) and retVal.IsA("vtkSMProxy"):
01623           return _getPyProxy(retVal)
01624       else:
01625           return retVal

Here is the call graph for this function:

def paravisSM.ProxyManager.__getattr__ (   self,
  name 
)
Returns attribute from the ProxyManager

Definition at line 1626 of file paravisSM.py.

01626 
01627     def __getattr__(self, name):
01628         """Returns attribute from the ProxyManager"""
01629         try:
01630             pmAttr = getattr(self.SMProxyManager, name)
01631             self.__LastAttrName = name
01632             return self.__ConvertArgumentsAndCall
01633         except:
01634             pass
01635         return getattr(self.SMProxyManager, name)

Returns a new ProxyIterator.

Definition at line 1585 of file paravisSM.py.

01585 
01586     def __iter__(self):
01587         """Returns a new ProxyIterator."""
01588         iter = ProxyIterator()
01589         iter.Begin()
01590         return iter

Here is the caller graph for this function:

def paravisSM.ProxyManager.GetPrototypeProxy (   self,
  group,
  name 
)
Returns a prototype proxy given a group and name. This is an
SMProxy. This is a low-level method. You should not normally
have to call it.

Definition at line 1538 of file paravisSM.py.

01538 
01539     def GetPrototypeProxy(self, group, name):
01540         """Returns a prototype proxy given a group and name. This is an
01541         SMProxy. This is a low-level method. You should not normally
01542         have to call it."""
01543         if not self.SMProxyManager:
01544             return None
01545         aProxy = self.SMProxyManager.GetPrototypeProxy(group, name)
01546         if not aProxy:
01547             return None
01548         return aProxy

def paravisSM.ProxyManager.GetProxies (   self,
  groupname,
  proxyname 
)
Returns all proxies registered under the given group with the
given name. Note that it is possible to register more than one
proxy with the same name in the same group. Because the proxies
are different, there is no conflict. Use this method instead of
GetProxy() if you know that there are more than one proxy registered
with this name.

Definition at line 1566 of file paravisSM.py.

01566 
01567     def GetProxies(self, groupname, proxyname):
01568         """Returns all proxies registered under the given group with the
01569         given name. Note that it is possible to register more than one
01570         proxy with the same name in the same group. Because the proxies
01571         are different, there is no conflict. Use this method instead of
01572         GetProxy() if you know that there are more than one proxy registered
01573         with this name."""
01574         if not self.SMProxyManager:
01575             return []
01576         collection = vtk.vtkCollection()
01577         result = []
01578         self.SMProxyManager.GetProxies(groupname, proxyname, collection)
01579         for i in range(0, collection.GetNumberOfItems()):
01580             aProxy = _getPyProxy(collection.GetItemAsObject(i))
01581             if aProxy:
01582                 result.append(aProxy)
01583 
01584         return result

Here is the call graph for this function:

def paravisSM.ProxyManager.GetProxiesInGroup (   self,
  groupname 
)
Returns a map of proxies in a particular group.

Definition at line 1549 of file paravisSM.py.

01549 
01550     def GetProxiesInGroup(self, groupname):
01551         """Returns a map of proxies in a particular group."""
01552         proxies = {}
01553         iter = self.NewGroupIterator(groupname)
01554         for aProxy in iter:
01555             proxies[(iter.GetKey(), aProxy.GetGlobalIDAsString())] = aProxy
01556         return proxies

Here is the call graph for this function:

def paravisSM.ProxyManager.GetProxy (   self,
  group,
  name 
)
Returns a Proxy registered under a group and name

Definition at line 1529 of file paravisSM.py.

01529 
01530     def GetProxy(self, group, name):
01531         """Returns a Proxy registered under a group and name"""
01532         if not self.SMProxyManager:
01533             return None
01534         aProxy = self.SMProxyManager.GetProxy(group, name)
01535         if not aProxy:
01536             return None
01537         return _getPyProxy(aProxy)

Here is the call graph for this function:

def paravisSM.ProxyManager.LoadState (   self,
  filename,
  loader = None 
)

Definition at line 1636 of file paravisSM.py.

01636 
01637     def LoadState(self, filename, loader = None):
01638         self.SMProxyManager.LoadXMLState(filename, loader)

def paravisSM.ProxyManager.NewDefinitionIterator (   self,
  groupname = None 
)
Returns an iterator that can be used to iterate over
   all groups and types of proxies that the proxy manager
   can create.

Definition at line 1600 of file paravisSM.py.

01600 
01601     def NewDefinitionIterator(self, groupname=None):
01602         """Returns an iterator that can be used to iterate over
01603            all groups and types of proxies that the proxy manager
01604            can create."""
01605         iter = None
01606         if groupname != None:
01607             iter = ProxyDefinitionIterator(self.GetProxyDefinitionManager().NewSingleGroupIterator(groupname,0))
01608         else:
01609             iter = ProxyDefinitionIterator(self.GetProxyDefinitionManager().NewIterator(0))
01610 
01611         return iter

def paravisSM.ProxyManager.NewGroupIterator (   self,
  group_name 
)
Returns a ProxyIterator for a group. The resulting object
can be used to traverse the proxies that are in the given
group.

Definition at line 1591 of file paravisSM.py.

01591 
01592     def NewGroupIterator(self, group_name):
01593         """Returns a ProxyIterator for a group. The resulting object
01594         can be used to traverse the proxies that are in the given
01595         group."""
01596         iter = self.__iter__()
01597         iter.SetModeToOneGroup()
01598         iter.Begin(group_name)
01599         return iter

Here is the call graph for this function:

Here is the caller graph for this function:

def paravisSM.ProxyManager.NewProxy (   self,
  group,
  name 
)
Creates a new proxy of given group and name and returns an SMProxy.
Note that this is a server manager object. You should normally create
proxies using the class objects. For example:
obj = servermanager.sources.SphereSource()

Definition at line 1516 of file paravisSM.py.

01516 
01517     def NewProxy(self, group, name):
01518         """Creates a new proxy of given group and name and returns an SMProxy.
01519         Note that this is a server manager object. You should normally create
01520         proxies using the class objects. For example:
01521         obj = servermanager.sources.SphereSource()"""
01522         if not self.SMProxyManager:
01523             return None
01524         aProxy = self.SMProxyManager.NewProxy(group, name, "NULL")
01525         if not aProxy:
01526             return None
01527         aProxy.UnRegister(None)
01528         return aProxy

def paravisSM.ProxyManager.RegisterProxy (   self,
  group,
  name,
  aProxy 
)
Registers a proxy (either SMProxy or proxy) with the
server manager

Definition at line 1508 of file paravisSM.py.

01508 
01509     def RegisterProxy(self, group, name, aProxy):
01510         """Registers a proxy (either SMProxy or proxy) with the
01511         server manager"""
01512         if isinstance(aProxy, Proxy):
01513             self.SMProxyManager.RegisterProxy(group, name, aProxy.SMProxy)
01514         else:
01515             self.SMProxyManager.RegisterProxy(group, name, aProxy)

def paravisSM.ProxyManager.SaveState (   self,
  filename 
)

Definition at line 1639 of file paravisSM.py.

01639 
01640     def SaveState(self, filename):
01641         self.SMProxyManager.SaveXMLState(filename)

def paravisSM.ProxyManager.UnRegisterProxy (   self,
  groupname,
  proxyname,
  aProxy 
)
Unregisters a proxy.

Definition at line 1557 of file paravisSM.py.

01557 
01558     def UnRegisterProxy(self, groupname, proxyname, aProxy):
01559         """Unregisters a proxy."""
01560         if not self.SMProxyManager:
01561             return
01562         if aProxy != None and isinstance(aProxy,Proxy):
01563             aProxy = aProxy.SMProxy
01564         if aProxy:
01565             self.SMProxyManager.UnRegisterProxy(groupname, proxyname, aProxy)


Member Data Documentation

Definition at line 1630 of file paravisSM.py.

Definition at line 1506 of file paravisSM.py.


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