[vtkusers] Find coordinates of points inside vtkPolyData Model

Sam Istephan sistephan at gmail.com
Sun Nov 21 18:43:31 EST 2010


I'm using C#.

If I change the pipeline to take the same polydata object as both the input
and the surface and then get an Array Count, I get 0. Therefore, I can't
even get to the SelectedPoints array.

            vtkSelectEnclosedPoints vtkModelRegion = new
vtkSelectEnclosedPoints();
            vtkModelRegion.SetInput(model);
            vtkModelRegion.SetCheckSurface(1);
            vtkModelRegion.SetSurface(model);
            vtkModelRegion.Update();
  This returns 0:  int count =
vtkModelRegion.GetOutput().GetPointData().GetNumberOfArrays();



On Sun, Nov 21, 2010 at 6:38 PM, David Doria <daviddoria at gmail.com> wrote:

> On Sun, Nov 21, 2010 at 6:29 PM, Sam Istephan <sistephan at gmail.com> wrote:
> > I can't get the array of points that are inside, here is my pipeline:
> >
> >
> > vtkSelectEnclosedPoints vtkModelRegion = new vtkSelectEnclosedPoints();
> > //vtkModelRegion.SetInput(model);
> > vtkModelRegion.Initialize(model);
> > vtkModelRegion.SetCheckSurface(1);
> > //vtkModelRegion.SetSurface(model);
> > vtkModelRegion.Update();
> >
> >  vtkDataArray insideArray =
> > vtkModelRegion.GetOutput().GetPointData().GetArray("SelectedPoints");
> > //Could not create class vtkDataSet from null native pointer.
> >
> > In fact, event this throws that error:  vtkDataSet ds =
> > vtkModelRegion.GetOutput();
>
> (Please keep the discussion on the list so everyone can help and benefit)
>
> Which language are you using?
>
> vtkSelectEnclosedPoints vtkModelRegion = new vtkSelectEnclosedPoints();
>
> is not valid syntax in c++ as far as I know.
>
> Also, in the example I have SafeDownCasted the array from the
> vtkDataSet to a vtkDataArray, where you have simply tried to assign
> one to the other:
>
> vtkDataArray* insideArray =
>
> vtkDataArray::SafeDownCast(selectEnclosedPoints->GetOutput()->GetPointData()->GetArray("SelectedPoints"));
>
> vs
>
> vtkDataArray insideArray =
> vtkModelRegion.GetOutput().GetPointData().GetArray("SelectedPoints");
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101121/ffad4f9c/attachment.htm>


More information about the vtkusers mailing list