[vtkusers] vtkpoints versus vtkpointdata

David Doria daviddoria at gmail.com
Tue Oct 30 08:29:37 EDT 2012


On Tue, Oct 30, 2012 at 8:25 AM, Doug Hoppes <dhoppes at mbfbioscience.com> wrote:
> Hi all,
>
>
>
>                 Okay, I know that this is a simple question, but I can’t
> seem to figure out the answer for it.  I have situation where I need to
> store a point position (x, y, z location).  Now, I can store them as
> individual instance variables (X, Y, Z)  in my application, but thought that
> it would be cleaner to just store a vtkpoint or something for the position
> of my object.
>
>
>
>                 I could use the vtkpoints and add a single point to the
> array.  Or I could use the vtkpointdata (I didn’t see how you can set the
> point position, but it look like it’s another array set).
>
>
>
>                 What’s the best way to just store the point in my class?

Use vtkPoints:

  vtkSmartPointer<vtkPoints> points =
    vtkSmartPointer<vtkPoints>::New();
  const float p[3] = {1.0, 2.0, 3.0};
  points->InsertNextPoint(p);

David



More information about the vtkusers mailing list