David,

Looking at the xml, you have added a "clean_command" to all the
properties which is "RemoveAllInputs". CleanCommand is called before a
property is pushed. So before each property value is pushed all other
inputs are removed. And hence the error.

If your filter only takes 1 connection per input port, then simply
replace all AddInputConnection commands by SetInputConnection and
remove the clean_command attribute all together. I've attached a
modified xml.


Utkarsh

On Wed, Nov 4, 2009 at 10:42 AM, David Doria <[email protected]> wrote:
> On Wed, Nov 4, 2009 at 10:31 AM, Sven Buijssen
> <[email protected]> wrote:
>> David,
>>
>> I had a short glance at your code and there are two things I find intriging:
>>
>> 1) Your XML mixes the port_index="." and helper method approach for property
>> SourceDataSet:
>>
>>      <InputProperty
>>         name="SourceDataSet"
>>         port_index="2"
>>         command="AddSourceConnection"
>>         clean_command="RemoveAllSources">
>>
>> You'll have to change the command to "AddInputConnection", in particular 
>> because
>> method AddSourceConnection is merely declared in your *.h file, but there is
>> nowhere any corresponding code for it. (It's not inherited from class
>> vtkPolyDataAlgorithm.)
>>
>> 2) Same holds for the clean command: RemoveAllSources() is referenced in the
>> XML, declared in the header file, but not defined. Whereas RemoveAllInputs() 
>> is
>> inherited from class vtkAlgorithm.
>>
>> Sven
>>
>>
>
> Ah, sorry, you are correct - those were copy/paste errors!
>
> However, now that those things are fixed
> (http://www.rpi.edu/~doriad/Paraview_List/LandmarkFilter/LandmarkTransformFilter.xml)
> when I apply the filter in Paraview and set the inputs using the Input
> Editor, I get a whole bunch of these errors:
>
> vtkCompositeDataPipeline (0xa82e288): Input port 0 of algorithm
> vtkLandmarkTransformFilter(0xa82e240) has 0 connections but is not
> optional.
> vtkCompositeDataPipeline (0xa82e288): Input port 1 of algorithm
> vtkLandmarkTransformFilter(0xa82e240) has 2 connections but is not
> repeatable.
> etc, etc.
>
> Why would this be?
>
> Thanks,
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: 
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
<ServerManagerConfiguration>
<ProxyGroup name="filters"> 
    <!-- ================================================================== --> 
    <SourceProxy name="LandmarkTransformFilter"
      class="vtkLandmarkTransformFilter"
      label="LandmarkTransformFilter"> 
      <Documentation
         long_help="Align two point sets using vtkLandmarkTransform to compute the best transformation between the two point sets."
         short_help="vtkLandmarkTransformFilter."> 
      </Documentation> 
 
      <InputProperty
         name="SourceLandmarks"
	 port_index="0"
         command="SetInputConnection">
        <ProxyGroupDomain name="groups"> 
          <Group name="sources"/> 
          <Group name="filters"/> 
        </ProxyGroupDomain> 
        <DataTypeDomain name="input_type"> 
          <DataType value="vtkPolyData"/> 
        </DataTypeDomain> 
        <Documentation> 
          Set the source data set. This data set that will move towards the target data set.
        </Documentation> 
      </InputProperty> 
 
      <InputProperty
         name="TargetLandmarks"
	 port_index="1"
         command="SetInputConnection">
        <ProxyGroupDomain name="groups"> 
          <Group name="sources"/> 
          <Group name="filters"/> 
        </ProxyGroupDomain> 
        <DataTypeDomain name="input_type"> 
          <DataType value="vtkPolyData"/> 
        </DataTypeDomain> 
        <Documentation> 
          Set the target data set. This data set will stay stationary.
        </Documentation> 
      </InputProperty> 
 
      <InputProperty
         name="SourceDataSet"
	 port_index="2"
         command="SetInputConnection">
        <ProxyGroupDomain name="groups"> 
          <Group name="sources"/> 
          <Group name="filters"/> 
        </ProxyGroupDomain> 
        <DataTypeDomain name="input_type"> 
          <DataType value="vtkPolyData"/> 
        </DataTypeDomain> 
        <Documentation> 
          Set the source data set landmark points.
        </Documentation> 
      </InputProperty> 
 
    </SourceProxy> 
    <!-- End LandmarkTransformFilter --> 
  </ProxyGroup> 
  <!-- End Filters Group --> 
</ServerManagerConfiguration> 
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to