Exemplo n.º 1
0
 def __convert_proxy(self, px):
     "Internal method."
     if not px:
         return None
     if px.IsA("vtkSMSourceProxy"):
         return servermanager._getPyProxy(px)
     else:
         return servermanager.OutputPort(servermanager._getPyProxy(px.GetSourceProxy()), px.GetPortIndex())
Exemplo n.º 2
0
 def __convert_proxy(self, px):
     "Internal method."
     if not px:
         return None
     if px.IsA("vtkSMSourceProxy"):
         return servermanager._getPyProxy(px)
     else:
         return servermanager.OutputPort(
             servermanager._getPyProxy(px.GetSourceProxy()),
             px.GetPortIndex())
Exemplo n.º 3
0
def CreateWriter(filename, proxy=None, **extraArgs):
    """Creates a writer that can write the data produced by the source proxy in
       the given file format (identified by the extension). If no source is
       provided, then the active source is used. This doesn't actually write the
       data, it simply creates the writer and returns it."""
    if not filename:
       raise RuntimeError, "filename must be specified"
    writer_factory = servermanager.ProxyManager().GetWriterFactory()
    if writer_factory.GetNumberOfRegisteredPrototypes() == 0:
        writer_factory.RegisterPrototypes("writers")
    if not proxy:
        proxy = GetActiveSource()
    if not proxy:
        raise RuntimeError, "Could not locate source to write"
    writer_proxy = writer_factory.CreateWriter(filename, proxy.SMProxy, proxy.Port)
    return servermanager._getPyProxy(writer_proxy)
Exemplo n.º 4
0
def CreateWriter(filename, proxy=None, **extraArgs):
    """Creates a writer that can write the data produced by the source proxy in
       the given file format (identified by the extension). If no source is
       provided, then the active source is used. This doesn't actually write the
       data, it simply creates the writer and returns it."""
    if not filename:
        raise RuntimeError, "filename must be specified"
    writer_factory = servermanager.ProxyManager().GetWriterFactory()
    if writer_factory.GetNumberOfRegisteredPrototypes() == 0:
        writer_factory.RegisterPrototypes("writers")
    if not proxy:
        proxy = GetActiveSource()
    if not proxy:
        raise RuntimeError, "Could not locate source to write"
    writer_proxy = writer_factory.CreateWriter(filename, proxy.SMProxy,
                                               proxy.Port)
    return servermanager._getPyProxy(writer_proxy)
Exemplo n.º 5
0
 def get_view(self):
     "Returns the active view."
     return servermanager._getPyProxy(
         self.__get_selection_model("ActiveView").GetCurrentProxy())
Exemplo n.º 6
0
 def get_view(self):
     "Returns the active view."
     return servermanager._getPyProxy(
         self.__get_selection_model("ActiveView").GetCurrentProxy())