[vtk-developers] Streaming data from vtkMatrix4x4 and vtkMatrix3x3

David Gobbi david.gobbi at gmail.com
Thu Sep 8 14:35:19 EDT 2016


My own opinion is that the use of these operators results in obfuscation.
They were added to VTK waay back when VTK objects were passed by reference
rather than by pointer, and back then one could write "matrix[i][j]".  In
comparison, (*matrix)[i][j] is hard to read.  When I deprecated operator[],
only one class in all of VTK was using it, so it definitely wasn't winning
any popularity contests :)

 - David


On Thu, Sep 8, 2016 at 12:08 PM, Bob Obara <bob.obara at kitware.com> wrote:

> Hi David,
>
> Thanks - what is the reason these interfaces are being deprecated?
>
> Bob
>
> Robert M. O'Bara, MEng.
> Assistant Director of Scientific Computing
>
> Kitware Inc.
> 28 Corporate Drive
> Suite 101
> Clifton Park, NY 12065
>
> Phone: (518) 881- 4931
>
>
>
>
> On Sep 8, 2016, at 1:59 PMEDT, David Gobbi <david.gobbi at gmail.com> wrote:
>
> Hi Bob,
>
> I use a DeepCopy to stream in both directions:
>
> vtkNew<vtkMatrix4x4> matrix;
> double elements[16];
> // stream from matrix to POD pointer
> vtkMatrix4x4::DeepCopy(elements, matrix);
> // stream from POD pointer to matrix
> matrix->DeepCopy(elements);
>
>  - David
>
> On Thu, Sep 8, 2016 at 11:46 AM, Bob Obara <bob.obara at kitware.com> wrote:
>
>> Hi David,
>>
>> I’ve been meaning to ask you about the depreciation of [] operator in
>> both classes and and the comment not to use the public Element data member
>> in the 4x4 class).  How are you suppose to be able to stream the data out
>> of the matrix with these interfaces removed?  Obviously you can you the
>> DeepCopy methods to “stream” data into them.
>>
>> Thanks in advance for your time and help!
>>
>> Bob
>>
>> Robert M. O'Bara, MEng.
>> Assistant Director of Scientific Computing
>>
>> Kitware Inc.
>> 28 Corporate Drive
>> Suite 101
>> Clifton Park, NY 12065
>>
>> Phone: (518) 881- 4931
>>
>>
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160908/6033c484/attachment.html>


More information about the vtk-developers mailing list