[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtk-developers
Subject:    Re: [vtk-developers] Streaming data from vtkMatrix4x4 and vtkMatrix3x3
From:       David Gobbi <david.gobbi () gmail ! com>
Date:       2016-09-08 18:35:19
Message-ID: CANwS1=GWMvAWAqf3raYTorehU4RZJBNZv6HBQwTNQE-tHsRv8g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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@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@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@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
>>
>>
>>
>>
>>
>
>

[Attachment #5 (text/html)]

<div dir="ltr"><div>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 \
&quot;matrix[i][j]&quot;.   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&#39;t winning any popularity contests :)</div><div><br></div><div>  - \
David</div><div><br></div></div><div class="gmail_extra"><br><div \
class="gmail_quote">On Thu, Sep 8, 2016 at 12:08 PM, Bob Obara <span dir="ltr">&lt;<a \
href="mailto:bob.obara@kitware.com" \
target="_blank">bob.obara@kitware.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div style="word-wrap:break-word">Hi \
David,<div><br></div><div>Thanks - what is the reason these interfaces are being \
deprecated?</div><span class="HOEnZb"><font \
color="#888888"><div><br></div><div>Bob</div></font></span><div><span \
class=""><br><div> <div \
style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;fo \
nt-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text \
-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div>Robert \
M. O&#39;Bara, MEng.<br>Assistant Director of Scientific Computing<br><br>Kitware \
Inc.<br>28 Corporate Drive<br>Suite 101<br>Clifton Park, NY 12065<br><br>Phone: <a \
href="tel:%28518%29%20881-%204931" value="+15188814931" target="_blank">(518) 881- \
4931</a></div><div><br></div></div><br><br> </div>
<br></span><div><div class="h5"><div><blockquote type="cite"><div>On Sep 8, 2016, at \
1:59 PMEDT, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com" \
target="_blank">david.gobbi@gmail.com</a>&gt; wrote:</div><br><div><div dir="ltr">Hi \
Bob,<div><br></div><div>I use a DeepCopy to stream in both \
directions:</div><div><br></div><div>vtkNew&lt;vtkMatrix4x4&gt; \
matrix;</div><div>double elements[16];</div><div>// stream from matrix to POD \
pointer</div><div>vtkMatrix4x4::DeepCopy(<wbr>elements, matrix);</div><div>// stream \
from POD pointer to matrix</div><div>matrix-&gt;DeepCopy(elements);</div><div><br></div><div> \
- David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep \
8, 2016 at 11:46 AM, Bob Obara <span dir="ltr">&lt;<a \
href="mailto:bob.obara@kitware.com" \
target="_blank">bob.obara@kitware.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div style="word-wrap:break-word">Hi \
David,<div><br></div><div>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.</div><div><br></div><div>Thanks in advance for \
your time and help!</div><div><br></div><div>Bob</div><div>  <br><div> <div \
style="font-family:Helvetica;font-style:normal;font-weight:normal;letter-spacing:norma \
l;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div>Robert \
M. O&#39;Bara, MEng.<br>Assistant Director of Scientific Computing<br><br>Kitware \
Inc.<br>28 Corporate Drive<br>Suite 101<br>Clifton Park, NY 12065<br><br>Phone: <a \
href="tel:%28518%29%20881-%204931" value="+15188814931" target="_blank">(518) 881- \
4931</a></div><div><br></div></div><br><br> </div>
<br></div></div></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></div></blockquote></div><br></div>



_______________________________________________
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



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic