[vtkusers] Generic vtkMatrix

David Doria daviddoria+vtk at gmail.com
Wed Nov 25 11:07:01 EST 2009


On Wed, Nov 25, 2009 at 10:44 AM, Aashish Chaudhary <
aashish.chaudhary at kitware.com> wrote:

> I think it will be really useful to have it. Last week I was looking for
> something similar...
>
> Also Passing array (pointers) is not the best thing without passing the
> size of the array which I think will be gone if we pass the vectors (or
> there references)
>
> Regards
>
>
That is a very good point. Also, you could then even return objects

vtkPoint GetPoint(int index);

instead of
void GetPoint(int index, double* point);

Another thing is that code readability is tremendously improved. From my
example above, the math equations map directly to the c++ code:

c = a-b;

rather than having to interpret what is going on when you see something like
this (or typically even much more complicated):

for(unsigned int i = 0; i < 3; i++)
{
c[i] = a[i] - b[i];
}

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091125/909fafeb/attachment.htm>


More information about the vtkusers mailing list