[vtkusers] Generic vtkMatrix

Jeff Baumes jeff.baumes at kitware.com
Wed Nov 25 11:08:51 EST 2009


>>>> I really think it would be nice to have something in VTK to allow users
>>>> to do simple matrix/vector multiplication/addition/transpose/etc without
>>>> much effort and fighting ** type variables.  It will also greatly improve
>>>> the interface to many of the vtkMath functions.
>>>>
>>>> I have started working on vtkMatrix here:
>>>> http://www.rpi.edu/~doriad/VTK_List/vtkMatrix/

I don't think we need another data structure for storing a matrix of
numbers of general size. vtkArray already does this (and
vtkAbstractArray subclasses can do this too with tuples and
components). What we should consider is simple operators added as
methods on vtkArray.

If the use case is simply being able to perform operations on vectors
of size 3, vtkMath already contains some of these (Dot, Outer, Cross,
Norm). We could easily make new ones for Add, Subtract, etc. to reduce
code size somewhat.

I am agreement that the ideal case is to have light, intuitive classes
for all of this with overloaded operators. Perhaps there is a place
for a well-designed vtkPoint class. We just need to be careful that we
don't make 5 ways to do the same thing in VTK, or else people will get
even more confused.

Jeff



More information about the vtkusers mailing list