[vtkusers] Why are all the GetXXX functions in vtkPolyData class not const?

SY Chen sychen52 at gmail.com
Fri Jun 3 20:38:23 EDT 2016


Thank you for your explanation, David.
On Jun 3, 2016 17:30, "David Gobbi" <david.gobbi at gmail.com> wrote:

> On Fri, Jun 3, 2016 at 5:34 PM, SY Chen <sychen52 at gmail.com> wrote:
>
>> Does anyone know the reason why all the GetXXX functions in vtkPolyData
>> class are not const?
>>
> In the VTK code, all objects derived from vtkObjectBase are always accessed
> though non-const pointers, and have only non-const methods.  Twenty-some
> years ago when VTK began, the use of "const" was much less common than
> it is now.  And compilers often had const-related bugs -- for example, MSVC
> would often choke if "const" was used with templates.
>
> Changing all these methods would be a huge task, especially considering
> all of the other projects that use VTK and derive classes from VTK classes.
> I think the general consensus is that, in terms of improving VTK code
> quality,
> time would be better spent on chasing bugs and writing more unit tests for
> VTK.
>
> I'm sure this change will come eventually.
>
>  - David
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160603/3b51f817/attachment.html>


More information about the vtkusers mailing list