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

Pat Marion pat.marion at kitware.com
Fri Apr 13 11:09:29 EDT 2012


In my opinion, it would not pollute the api, since the method is already
defined by most (all?) subclasses of vtkAlgorithm.


$ grep "void SetInputData(int" Common/ExecutionModel/*h

Common/ExecutionModel/vtkAnnotationLayersAlgorithm.h:  void
SetInputData(int index, vtkDataObject* obj);
Common/ExecutionModel/vtkArrayDataAlgorithm.h:  void SetInputData(int
index, vtkDataObject* obj);
Common/ExecutionModel/vtkCompositeDataSetAlgorithm.h:  void
SetInputData(int, vtkDataObject*);
Common/ExecutionModel/vtkDataObjectAlgorithm.h:  void SetInputData(int,
vtkDataObject*);
Common/ExecutionModel/vtkDataSetAlgorithm.h:  void SetInputData(int,
vtkDataObject*);
Common/ExecutionModel/vtkDataSetAlgorithm.h:  void SetInputData(int,
vtkDataSet*);
Common/ExecutionModel/vtkDirectedGraphAlgorithm.h:  void SetInputData(int
index, vtkDataObject* obj);
Common/ExecutionModel/vtkGraphAlgorithm.h:  void SetInputData(int index,
vtkDataObject* obj);
Common/ExecutionModel/vtkHierarchicalBoxDataSetAlgorithm.h:  void
SetInputData(int, vtkDataObject*);
Common/ExecutionModel/vtkHyperOctreeAlgorithm.h:  void SetInputData(int,
vtkDataObject*);
Common/ExecutionModel/vtkImageAlgorithm.h:  void SetInputData(int,
vtkDataObject*);
Common/ExecutionModel/vtkMultiBlockDataSetAlgorithm.h:  void
SetInputData(int, vtkDataObject*);
Common/ExecutionModel/vtkPassInputTypeAlgorithm.h:  void SetInputData(int,
vtkDataObject*);
Common/ExecutionModel/vtkPiecewiseFunctionAlgorithm.h:  void
SetInputData(int, vtkDataObject*);
Common/ExecutionModel/vtkPointSetAlgorithm.h:  void SetInputData(int,
vtkDataObject*);
Common/ExecutionModel/vtkPointSetAlgorithm.h:  void SetInputData(int,
vtkPointSet*);
Common/ExecutionModel/vtkPolyDataAlgorithm.h:  void SetInputData(int,
vtkDataObject*);
Common/ExecutionModel/vtkRectilinearGridAlgorithm.h:  void
SetInputData(int, vtkDataObject*);
Common/ExecutionModel/vtkSelectionAlgorithm.h:  void SetInputData(int
index, vtkDataObject* obj);
Common/ExecutionModel/vtkStructuredGridAlgorithm.h:  void SetInputData(int,
vtkDataObject*);
Common/ExecutionModel/vtkTableAlgorithm.h:  void SetInputData(int index,
vtkDataObject* obj);
Common/ExecutionModel/vtkTemporalDataSetAlgorithm.h:  void
SetInputData(int, vtkDataObject*);
Common/ExecutionModel/vtkTreeAlgorithm.h:  void SetInputData(int index,
vtkDataObject* obj);
Common/ExecutionModel/vtkUndirectedGraphAlgorithm.h:  void SetInputData(int
index, vtkDataObject* obj);
Common/ExecutionModel/vtkUnstructuredGridAlgorithm.h:  void
SetInputData(int, vtkDataObject*);



Pat

On Fri, Apr 13, 2012 at 10:45 AM, Chris Harris <chris.harris at kitware.com>wrote:

> Sorry Bill, I should have replied to Berk's message. This was in
> response to add another method SetInputDataXXX(....)
>
> Chris
>
> On Fri, Apr 13, 2012 at 10:40 AM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
> > GetProducerPort() has been there for a long time and I have seen it
> > used frequently. Foe example in the VTK Wiki Examples it is used 165
> > times.
> >
> > On Fri, Apr 13, 2012 at 10:29 AM, Chris Harris <chris.harris at kitware.com>
> wrote:
> >> I am of the opinion that if this is a pretty uncommon use case lets
> >> not pollute the API with another method ( that we may struggle to find
> >> a decent name for ). We should just document the trivial producer
> >> approach.
> >>
> >> My 2 cents
> >>
> >> Chris
> >>
> >> On Fri, Apr 13, 2012 at 10:22 AM, Bill Lorensen <
> bill.lorensen at gmail.com> wrote:
> >>> Why not reactivate GetProducerPort()? And do not add a new Set method.
> >>>
> >>> On Fri, Apr 13, 2012 at 9:18 AM, Berk Geveci <berk.geveci at kitware.com>
> wrote:
> >>>> I am fine with making this change with the exception of calling it
> >>>> "SetInputData". The moment you did that, you will start seeing hidden
> method
> >>>> warning in all subclasses that define SetInputData with another type
> as
> >>>> input. SetInputDataObject? SetInputDataAsDataObject?
> >>>>
> >>>> -berk
> >>>>
> >>>> 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
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> 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
> >>>
> >
> >
> >
> > --
> > 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20120413/428b670e/attachment.html>


More information about the vtk-developers mailing list