[vtk-developers] Started on VTK 4 compatibility removal

tom fogal tfogal at sci.utah.edu
Mon May 16 17:29:25 EDT 2011


Digging deep into this now that I'm in the thick of some code which hits 
a SetInput issue.

I very strongly favor creating compile-time errors for code that will 
not work at runtime.  Leisurely upgrades (of anything) really aren't all 
that useful, and especially so in the case of VisIt's use of VTK.

-tom

On 05/05/2011 08:45 AM, Berk Geveci wrote:
> 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
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>




More information about the vtk-developers mailing list