[vtk-developers] Started on VTK 4 compatibility removal

Berk Geveci berk.geveci at kitware.com
Thu May 5 10:45:14 EDT 2011


David is correct. You can and will be able use SetInput() to process a
dataset that you created manually.

IMPORTANT NOTE: The behavior of SetInput() will change:

vtkDataObject* output = source->GetOutput();
filter->SetInput(output);

Currently, this sets up a pipeline connection between the filter and
the source. After the change, it would have no effect because 1.
GetOutput() will return NULL unless the source is updated first 2.
SetInput() will no longer setup pipeline connections but set its
argument (the data object) as the input to the filter.

We (ARB) discussed the possibility of getting rid of SetInput() and
creating a new function called SetInputData() to flag such issues at
compile time rather than runtime. We decided against it because if we
did, it would be impossible to have the same code (that sets a data
object as input) compile for VTK 5 and 6. This would make it harder
for application folks to transition gradually. I'd be interested in
what the developers think about this.

Best,
-berk


On Wed, May 4, 2011 at 4:54 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> On Wed, May 4, 2011 at 2:37 PM, Timothy Shead <tshead at sandia.gov> wrote:
>> On 5/4/11 2:23 PM, Berk Geveci wrote:
>>>
>>> Hi folks,
>>>
>>> For those that are interested, I started working on removing the VTK 4
>>> backwards compatibility layer as described here:
>>>
>>> http://www.vtk.org/Wiki/VTK/Remove_VTK_4_Compatibility
>>
>> Just one question - the article mentions "Since data objects can no longer
>> know about their producers ..." - what is the impact on the use-case where a
>> data structure is created and populated in-place, then used as the input to
>> a pipeline?
>>
>>  filter->SetInputConnection(0, data_structure->GetProducerPort());
>>
>> ... I'd really hate to let this go.
>>
>> Cheers,
>> Tim
>
> It's my understanding that in that case, you would use
>
> filter->SetInput(0, data_object);
> or
> filter->SetInput(data_object);
>
> with the expectation that this will not create a pipeline connection,
> i.e. SetInputConnection() and SetInput() are no longer equivalent.
>
>  - David
>



More information about the vtk-developers mailing list