[vtk-developers] About the vtkDataArray::InsertTuple() method

Simon ESNEAULT simon.esneault at gmail.com
Thu Mar 24 12:04:44 EDT 2016


Hello,

As a user, I believe that kind of change makes perfect sense, these
functions are just confusing.
Simon

2016-03-24 16:53 GMT+01:00 Sean McBride <sean at rogue-research.com>:

> On Thu, 24 Mar 2016 08:11:40 -0600, David Gobbi said:
>
> >On Thu, Mar 24, 2016 at 8:03 AM, Sean McBride <sean at rogue-research.com>
> >wrote:
> >
> >> On Wed, 23 Mar 2016 22:09:55 -0600, David Gobbi said:
> >>
> >> >Also related to data arrays: I'd love to see the deprecation of
> >> >InsertValue() and InsertTuple().  The problems with them are:
> >> >
> >> >1) They are redundant.  As far as I'm concerned, their usage can
> >> >always be replaced with SetTuple() or InsertNextTuple() and the
> >> >resulting code will become easier to read.
> >> >
> >> >2) They don't actually "insert" tuples except at the end of the
> >> >array, and we have InsertNextTuple() or that purpose.  Anywhere
> >> >else in the array, they perform a replacement operation.
> >> >
> >> >Any thoughts?  Are these methods widely used anywhere except
> >> >for VTK's own source tree?
> >>
> >> No opinion per se, but as to your last question: it's impossible for us
> to
> >> know, and polling this list is too small a sample size.  I just grepped
> our
> >> codebase and found 2 uses of InsertValue().
> >>
> >
> >Yes, I prefer to get the opinions of other developers before opening it up
> >to everyone :)
> >
> >But since you took the time to answer: for those two uses you found, was
> >the usage of InsertValue() easy to understand, and was it a good match for
> >the intent of the code?
>
> In my 2 cases, it's always appending to the end of the data array.  I
> guess I could use InsertNextValue() instead, if I understand it correctly.
>
> I think your point #2 is quite valid.  Since it's not *inserting*, but
> rather *replacing*, then the API name is very confusing.  A deprecate and
> rename is in order IMHO.
>
> Cheers,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>


-- 
------------------------------------------------------------------
Simon Esneault
Rennes, France
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160324/4e3a6dba/attachment.html>


More information about the vtk-developers mailing list