[vtkusers] How to find point ID?

Jim Peterson jimcp at cox.net
Wed Sep 22 08:27:22 EDT 2010


rakesh patil wrote:
> Hi,
>
> I have an unstructured grid.. and i have a point in it. i mean i have, 
> point values (xyz) form,
>
> With the help of this point, is there any way to get the point ID of 
> that point in the grid?
>
> Example, i have point say, p=(83.2346, 18.2615, 1235.0)
>
> This point exists in my grid also.. Thus, i need to find out th ID of 
> that point in grid. 
If you look at the Class Members link on the vtk class documentation you 
will find a number of classes that implement the FindPoint() method, 
this method takes the point coordinates as input and returns the ID 
(vtkIDType). It is implemented in these classes:
FindPoint() : vtkGenericDataSet 
<a00676.html#8b37ed061a94fa9d3befb28bd6656912> , vtkImageData 
<a00844.html#f5bb66af44074412b64b3058b09a2f87> , vtkKdTree 
<a01038.html#f078cd8b85b98f1ba4297343d1e85b28> , vtkRectilinearGrid 
<a01682.html#6b5fda94b984f0db3f76f9f4cea6e0ce> , vtkPointSet 
<a01432.html#a752212d5f6334f42dfcfd7d5ba10977> , vtkDataSet 
<a00429.html#d01fb4f295210a2c707801cb7c3da5ce> , vtkHyperOctree 
<a00792.html#ae09da0db0081bec1ca73570dfbbb919> , vtkImageData 
<a00844.html#734f015f8b8e24b291b53859a62f3336> , vtkKdTree 
<a01038.html#1afce419e23cffb80f9ccef3499934dc> , vtkRectilinearGrid 
<a01682.html#f728a0c2a2213bed34fbf4b445e98433> , vtkBridgeDataSet 
<a00231.html#8a9c4e7e9e211a7309767396a79b19ff>

the typical code will  be something.GetPoints().FindPoint(x,y,z).

hth,
Jim



More information about the vtkusers mailing list