[Paraview] Ordered xml inputs?
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Tue Nov 3 11:31:12 EST 2009
There are two ways:
1> Use attribute "port_index" on the InputProperty to specify which
input port it's going to eg.
<InputProperty name="Source" port_index="0" command="AddInputConnection" ... />
<InputProperty name="Target" port_index="1" command="AddInputConnection" ... />
2> Use helper methods defined on the filter eg.
void AddSource(vtkAlgorithmOutput* input) {
this->AddInputConnection(0, input); }
void AddTarget(vtkAlgorithmOutput* input) {
this->AddInputConnection(1, input); }
And use these as the command's for your two input properties.
Utkarsh
On Tue, Nov 3, 2009 at 11:16 AM, David Doria <daviddoria at gmail.com> wrote:
> Are the InputProperties specified in the XML file ordered?
>
> That is, if I do something like this in the VTK filter's RequestData
>
> vtkPolyData * Source = static_cast<vtkPolyData
> *>(this->GetExecutive()->GetInputData(0, 0));
> vtkPolyData * Target = static_cast<vtkPolyData
> *>(this->GetExecutive()->GetInputData(1, 0));
>
> Then in the XML I have this:
>
> <InputProperty
> name="Source"
> command="AddSourceConnection"
> clean_command="RemoveAllSources">
> <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="Target"
> command="AddInputConnection"
> clean_command="RemoveAllInputs">
> <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>
>
> but no where was it specified that Source is input 0 and Target is
> input 1. Is the order implied? If so, maybe this is not such a good
> idea as it could get confusing if there are other types of properties
> (IntVectorProperty, for example) thrown in the mix. I'm assuming the
> placement of something like IntVector property does not matter (i.e.
> they could be listed before, after, or in between input properties?)
> and does not increment the InputProperty counter?
>
> Can anyone comment on this / confirm it is all correct?
>
> 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
>
More information about the ParaView
mailing list