[vtkusers] Interpolation of data..
Dean Inglis
dean.inglis at camris.ca
Fri Apr 23 10:46:04 EDT 2010
vtkProbeFlter will probe the scalar values at
each spatial location of your scattered points: you
need to have scalar, vector, or tensor data associated
with the grid's points:
scatterG->GetPointData()->SetScalars( some_vtkDataArray );
the vtkProbeFilter will not interpolate any coordinate
values like x , y, z locations. If you have depth values
in a vtkDataArray that correspond to the x, y, z locations
in your scatterG grid, then this should work. Does anyone know if
maybe the input to the probe filter needs to be a structured data set like
vtkPolyData? By the sound of your grid's name "mesh" , this sounds like
structured
data. Can it be converted to a vtkPolyData?
Also, you allocate a smart pointer as:
vtkSmartPointer<vtkProbeFilter> probe =
vtkSmartPointer<vtkProbeFilter>::New()
Dean
----- Original Message -----
From: "Rakesh Patil" <rakeshthp at in.com>
To: <dean.inglis at camris.ca>
Cc: <vtkusers at vtk.org>
Sent: Friday, April 23, 2010 9:40 AM
Subject: Re: Re:[vtkusers] Interpolation of data..
> Hi..I can independently view those grids... This is what I have done..
vtkUnstructuredGrid *scatterG = MyApp::getInstance()>getScatterGrid();
vtkUnstructuredGrid *meshG = MyApp::getInstance()>getMeshGrid();
vtkSmartPointer probe = vtkSmartPointer::New();
probe>SetSource(scatterG);
probe>SetInput(meshG);
probe>Update();
vtkDataArray *data = probe>GetOutput()>GetPointData()>GetScalar();
vtkDoubleArray *doubleArray = vtkDoubleArray::SafeDownCast(data);
MyContour::getInstance()>setDisplayArray(doubleArray);
After doing this, i click on contour display button, and the contour for
bathymetry gets displayed for meshG.Initially, meshG doesnt have
depth/elevation (z) value. z value is always 0 for every node point. x and y
corresponds to the lon and lat respectively.But the scatter data contains
lon, lat, and depth.. So, once the interpolation is done, i should get the
bathymetry (depth/elevation) for meshG also..'MyContour' in the above code
is the class which displays the contours for wh
> atever data is being passed.So, any suggestions or
> comments..??ThanksRegards Rakesh Patil Original message From:Dean Inglis<
> dean.inglis at camris.ca > Date: 23 Apr 10 16:49:50 Subject:Re:
> Re:[vtkusers]Interpolation of data.. To: "Rakesh Patil"
>
More information about the vtkusers
mailing list