[vtkusers] vtkPoints and vector/matrix Operations like Eigen?

David Lonie david.lonie at kitware.com
Fri Mar 31 09:20:11 EDT 2017


See vtkVector. It's quite similar to Eigen's vectors, though not as
optimized. Note that you'll need to include both vtkVector.h and
vtkVectorOperators.h to get the multiplication etc operators.

You can use them with vtkPoints like:

vtkPoints *points = ...;
assert(points->GetData()->GetNumberOfComponents() == 3);
vtkVector3d point;
for (...)
{
  points->GetPoint(id, point.GetData());
  // Do work with point
}

HTH,
Dave


On Thu, Mar 30, 2017 at 4:10 PM, Cory Quammen <cory.quammen at kitware.com> wrote:
> Yordan,
>
> I think the closest thing to that kind of functionality in VTK is the
> vtkArrayCalculator [1], but it is limited to vector-type operations,
> not matrix-vector multiply, for instance.
>
> If you like Python and NumPy, there is a Python adapter module that
> lets you go between VTK data objects and NumPy with relative ease. See
> [2] for details.
>
> HTH,
> Cory
>
> [1] http://www.vtk.org/doc/nightly/html/classvtkArrayCalculator.html
> [2] https://blog.kitware.com/improved-vtk-numpy-integration/
>
> On Thu, Mar 30, 2017 at 3:41 PM, Kyosev, Yordan
> <Yordan.Kyosev at hs-niederrhein.de> wrote:
>> Hi,
>>
>>
>>
>> Is there any way or type vtkObject, which can perform vector/matrix
>> operations like addition/substraction, multiplication with scalar,
>> vector/scalar products,
>>
>> In the same way as Eigen do it?
>>
>>
>>
>> Now I am using vtkPoints->GetPoint     -> double[3]  -> Eigen::Vector3D
>>
>>
>>
>> Actually enough will be to have vtkPoint (single point) for this case.
>>
>> The vtkMath classes seems to be not nice for following complex equations…
>>
>>
>>
>> Best regards
>>
>>
>>
>> Yordan
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>
>
>
> --
> Cory Quammen
> Staff R&D Engineer
> Kitware, Inc.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers


More information about the vtkusers mailing list