Compound Source Proxies

From ParaQ Wiki
Revision as of 16:27, 30 November 2007 by Utkarsh (talk | contribs)
Jump to navigationJump to search

This document replaces Compound proxies in SM. This discusses the new vtkSMCompoundSourceProxy which is a replacement for vtkSMCompoundProxy.


vtkSMCompoundSourceProxy is a source proxy encapsulating a pipeline of proxies. It can have multiple input ports i.e. input properties as well as multiple output ports. Input ports are simply exposed input properties from the contained proxies (subproxies) while, output ports are exposed output ports from the contained proxies.

Setup a Compound Proxy

This API is used to create a compound proxy. One sets up a pipeline using regular proxies (or other compound proxies). Then adds all the proxies that need to be encapsulated using AddProxy. Then we expose the properties from the added proxies that we want the user to be able to change/set including the input properties that act as the input to this compound proxy. Then, we expose the output ports from the added proxies that we want the user to be able to connect to. The API is as follows:

  // Description:
  // Add a proxy to be included in this compound proxy.
  // The name must be unique to each proxy added, otherwise the previously
  // added proxy will be replaced.
  void AddProxy(const char* name, vtkSMProxy* proxy);

  // Description:
  // Expose a property from the sub proxy (added using AddProxy).
  // Only exposed properties are accessible externally. Note that the sub proxy
  // whose property is being exposed must have been already added using
  // AddProxy().
  void ExposeProperty(const char* proxyName, 
                      const char* propertyName,
                      const char* exposedName);

  // Description:
  // Expose an output port from a subproxy. Exposed output ports are treated as
  // output ports of the vtkSMCompoundSourceProxy itself. 
  // This method does not may the output port available. One must call
  // CreateOutputPorts().
  void ExposeOutputPort(const char* proxyName, 
                        const char* portName,
                        const char* exposedName);

  // Description:
  // Expose an output port from a subproxy. Exposed output ports are treated as
  // output ports of the vtkSMCompoundSourceProxy itself. 
  // This method does not may the output port available. One must call
  // CreateOutputPorts().
  void ExposeOutputPort(const char* proxyName,
                        unsigned int portIndex,
                        const char* exposedName);