[vtk-developers] No api for vtkAlgorithm::SetInputData()

Robert Michael O'Bara bob.obara at kitware.com
Thu Apr 12 20:09:43 EDT 2012


I guess you can always make a trivial producer and set its input to aDataCopy.  This is exactly what SetInputDataInternal does.  But if it is always ok to build a trivial producer then it seems it should be ok to make this method public but probably it should then be made virtual as well as it can be overridden.

Just my 2 cents :)

Bob

Robert M. O'Bara, MEng.
Technical Leader

Kitware Inc.
28 Corporate Drive
Suite 101
Clifton Park, NY 12065

Phone: (518) 881- 4931

On Apr 12, 2012, at 7:32 PM, Bill Lorensen wrote:

> I agree that this is a problem...
> 
> On Thu, Apr 12, 2012 at 6:29 PM, Pat Marion <pat.marion at kitware.com> wrote:
>> Here is a example, which may not be very common, but I had it in my code...
>> 
>> void foo(vtkAlgorithm* aFilter, vtkDataObject* aData)
>> {
>>   vtkDataObject* aDataCopy = copyData(aData);
>>   aFilter->SetInputConnection(aDataCopy->GetProducerPort());
>>   ...
>> }
>> 
>> In VTK 6, I can't find a generic way to connect a data object to an
>> algorithm.
>> I have to create a trivial producer (reimplement
>> vtkAlgorithm::SetInputDataInternal)
>> 
>> I'm curious if there is a reason not to change protected
>> SetInputDataInternal to public SetInputData?
>> 
>> Most subclasses define SetInputData as:
>> 
>> void vtkPolyDataAlgorithm::SetInputData(int index, vtkDataObject* input)
>> {
>>   this->SetInputDataInternal(index, input);
>> }
>> 
>> 
>> Pat
>> 
>> _______________________________________________
>> 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
>> 
>> 
> 
> 
> 
> -- 
> Unpaid intern in BillsBasement at noware dot com
> _______________________________________________
> 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