[vtkusers] vtkpoints versus vtkpointdata

Doug Hoppes dhoppes at mbfbioscience.com
Tue Oct 30 08:31:53 EDT 2012


Thanks, David... I just wanted to make sure. I was using vtkpoints for all of my array stuff, but didn't know if there was a better method for just a single point.

-----Original Message-----
From: David Doria [mailto:daviddoria at gmail.com] 
Sent: Tuesday, October 30, 2012 8:30 AM
To: Doug Hoppes
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] vtkpoints versus vtkpointdata

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