[Paraview] Does servermanager.sources.TextSource Work?

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Apr 1 12:58:57 EDT 2008


Kent,

There was a bug in vtkSMTextSourceRepresentationProxy. I've committed a 
fix to CVS (patch follows).

Utkarsh

============================================
/cvsroot/ParaView3/ParaView3/Servers/ServerManager/vtkSMTextSourceRepresentationProxy.cxx,v 
  <--  Servers/ServerManager/vtkSMTextSourceRepresentationProxy.cxx
new revision: 1.6; previous revision: 1.5
============================================
Index: Servers/ServerManager/vtkSMTextSourceRepresentationProxy.cxx
===================================================================
RCS file: 
/cvsroot/ParaView3/ParaView3/Servers/ServerManager/vtkSMTextSourceRepresentationProxy.cxx,v
retrieving revision 1.5
diff -u -3 -p -r1.5 vtkSMTextSourceRepresentationProxy.cxx
--- Servers/ServerManager/vtkSMTextSourceRepresentationProxy.cxx 
18 Jul 2007 15:20:21 -0000      1.5
+++ Servers/ServerManager/vtkSMTextSourceRepresentationProxy.cxx 
1 Apr 2008 16:51:40 -0000
@@ -153,16 +153,17 @@ void vtkSMTextSourceRepresentationProxy:
    ip->RemoveAllProxies();
    ip->AddInputConnection(input, outputPort);

+  vtkSMIntVectorProperty* ivp = vtkSMIntVectorProperty::SafeDownCast(
+    this->CollectProxy->GetProperty("OutputDataType"));
+  ivp->SetElement(0, VTK_TABLE);
+  this->CollectProxy->UpdateVTKObjects();
+
    ip = vtkSMInputProperty::SafeDownCast(
      this->UpdateSuppressorProxy->GetProperty("Input"));
    ip->RemoveAllProxies();
    ip->AddProxy(this->CollectProxy);
    this->UpdateSuppressorProxy->UpdateVTKObjects();
-
-  vtkSMIntVectorProperty* ivp = vtkSMIntVectorProperty::SafeDownCast(
-    this->CollectProxy->GetProperty("OutputDataType"));
-  ivp->SetElement(0, VTK_TABLE);
-  this->CollectProxy->UpdateVTKObjects();
+

    this->Dirty = true;
  }
============================================

Kent Eschenberg wrote:
> After applying Utkarsh's patch the text displays as expected when using 
> pvpython, and when using pvbatch in serial mode. However, when pvbatch 
> is run in parallel mode, the program crashes. The error seems to come 
> from vtkOrderedCompositeDistributor which is of course only used in 
> parallel mode.
> 
> The system is CentOS 5 and I was running 3.2.1 with the patch plus a few 
> local additions.
> A fix or workaround would be very much appreciated.
> 
> Kent
> Pittsburgh Supercomputing Center
> 
> =======================================
> $ mpiexec -np 2 pvbatch cut.py
> vtkPVDReader : [ ...........]
> ===> more stuff
> vtkCutter : [ ...........]
> vtkCutter : [ ...........]
> vtkPVGeometryFilter : [ ...........]
> vtkPVGeometryFilter : [ ...........]
> vtkMPIMoveData : [ ...........]
> vtkPVUpdateSuppressor : [ ...........]
> vtkOrderedCompositeDistributor : [ ...........]
> Process id: 1 >> ERROR: In 
> /usr/local/packages/paraview/3.2.1/src/VTK/Filtering/
> vtkDemandDrivenPipeline.cxx, line 811
> vtkCompositeDataPipeline (0x16dc8b0): Input for connection index 0 on 
> input port
> index 0 for algorithm vtkTransmitPolyDataPiece(0x16b76f0) is of type 
> vtkTable, but a vtkPolyData is required.
> ===> more of the same
> =======================================
> 
> Utkarsh Ayachit wrote:
>> Kent,
>>
>> I've just commited a fix to the CVS (patch for the same is also 
>> attached).
>>
>> With this fix, you can optionally  specify which representation proxy 
>> to create for the source.
>>
>> Hence for text source the script will become:
>> ...
>>  > text = servermanager.sources.TextSource()
>>  > text.Text = "Hello World"
>>  > textRep = servermanager.CreateRepresentation( text, view, \
>>        proxyName="TextSourceRepresentation")
>>  > view.StillRender()
>> ...
>>
>>
>> PATCH <<<===========================================================
>>
>>
>> Index: Utilities/VTKPythonWrapping/paraview/servermanager.py
>> ===================================================================
>> RCS file: 
>> /cvsroot/ParaView3/ParaView3/Utilities/VTKPythonWrapping/paraview/servermanager.py,v 
>>
>> retrieving revision 1.26
>> diff -u -3 -p -r1.26 servermanager.py
>> --- Utilities/VTKPythonWrapping/paraview/servermanager.py       29 Feb 
>> 2008 20:55:32 -00001.26
>> +++ Utilities/VTKPythonWrapping/paraview/servermanager.py       24 Mar 
>> 2008 19:32:08 -0000
>> @@ -1250,18 +1250,27 @@ def CreateRepresentation(aProxy, view, *
>>      keyword arguments where the key is the name of the property.In 
>> addition
>>      registrationGroup and registrationName (optional) can be 
>> specified (as
>>      keyword arguments) to automatically register the proxy with the 
>> proxy
>> -    manager."""
>> +    manager.
>> +
>> +    This method tries to create the best possible representation for 
>> the given
>> +    proxy in the given view. Additionally, the user can specify 
>> proxyName
>> +    (optional) to create a representation of a particular type."""
>>
>>      global rendering
>>      if not aProxy:
>>          raise exceptions.RuntimeError, "proxy argument cannot be None."
>>      if not view:
>>          raise exceptions.RuntimeError, "render module argument cannot 
>> be None."
>> -    display = 
>> view.SMProxy.CreateDefaultRepresentation(aProxy.SMProxy, 0)
>> +    if "proxyName" in extraArgs:
>> +      display = CreateProxy("representations", 
>> extraArgs['proxyName'], None)
>> +      del extraArgs['proxyName']
>> +    else:
>> +      display = 
>> view.SMProxy.CreateDefaultRepresentation(aProxy.SMProxy, 0)
>> +      if display:
>> +        display.UnRegister(None)
>>      if not display:
>>          return None
>>      display.SetConnectionID(aProxy.GetConnectionID())
>> -    display.UnRegister(None)
>>      extraArgs['proxy'] = display
>>      proxy = rendering.__dict__[display.GetXMLName()](**extraArgs)
>>      proxy.Input = aProxy
>>
>>
>> ============================================================>>>>
> 


More information about the ParaView mailing list