[vtk-developers] vtkMath::Dot2D

David Gobbi david.gobbi at gmail.com
Wed Dec 9 19:13:52 EST 2009


Assuming that your points lie in the "z=0" plane.  But in any case,
yes, it's better to either explicitly set z=0 before doing calling
Dot, or to explicitly convert to 2-tuples and call Dot2D.  Otherwise
the code would just be confusing.

   David


On Wed, Dec 9, 2009 at 5:10 PM, Dean Inglis <dean.inglis at camris.ca> wrote:
> sorry for the noise, I should just use vtkMath::Dot in that case ;)
>
> Dean
>
>
>
>> sorry, possible objection here.  Use case scenario: I might be
>> using vtkContourWidget with 2D contours defined in an
>> x-y plane.  The widget stores all its node coords as
>> 3 tuples accessable via a vtkPolyData's vtkPoints.
>> I might want to compute the dot product on sequential
>> point pairs in a tangent vector calculation and it
>> would be nice to not have to convert every point to a
>> 2 tuple.
>>
>> Dean
>>
>> ----- Original Message ----- From: "David Doria"
>> <daviddoria+vtk at gmail.com>
>> Cc: "VTK Developers" <vtk-developers at vtk.org>
>> Sent: Wednesday, December 09, 2009 6:35 PM
>> Subject: Re: [vtk-developers] vtkMath::Dot2D
>>
>>
>> On Wed, Dec 9, 2009 at 6:11 PM, Moreland, Kenneth <kmorel at sandia.gov>
>> wrote:
>>>
>>> My guess would be that that is a copy-paste error. Change it to 2-vectors
>>> is probably the right thing to do.
>>>
>>> AFAIK, the array declaration in a function/method argument is treated
>>> just
>>> like a pointer. C++ does not do any range checking. I think it just
>>> serves
>>> to help document what size array you expect.
>>>
>>> -Ken
>>
>> This actually seems to be the case with almost all of the 2D vtkMath
>> functions. I'm going to change them all as Ken suggested. Any
>> objections?
>>
>> Thanks,
>>
>> David
>> _______________________________________________
>> 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
>>
>
> _______________________________________________
> 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
>
>



More information about the vtk-developers mailing list