<div>Godd morning, </div>
<div> </div>
<div>I think you should probe one block after the other, and add the probe results. </div>
<div>That is the solution I've found in order to probe a point in a MultiBlockDataSet. <br><br>Aurélien </div>
<div> </div>
<div class="gmail_quote">2011/10/14 Hamilton Woods <span dir="ltr"><<a href="mailto:ghw@accutrol.com">ghw@accutrol.com</a>></span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">I'm not sure how this mailing list works. There were several<br>"responses" to my earlier post of this message, none related<br>
to my question.<br><br>I basically want to know how to probe points for data at locations<br>that are in other than block 1 of a PLOT3D file.<br><br>I have a pair of PLOT3D files (.xyz and .q) that has more than<br>one block of data. Paraview displays the data nicely. I can<br>
even do a PlotOverLine through block 1 and block 2.<br><br>When I try to probe data using VTK in C++ the data in block<br>2 are missing. If I delete the block 1 coordinates and data<br>and re-fire, I am able to probe data.<br>
<br>Is there a trick to probing data in multiblock PLOT3D data<br>that is necessary in VTK that is not necessary in Paraview?<br><br>Here is a code snippet:<br><br> vtkPLOT3DReader* reader = vtkPLOT3DReader::New();<br>
reader->SetBinaryFile(0);<br> reader->SetMultiGrid(1);<br> reader->SetXYZFileName(geometryFile.c_str());<br> reader->SetQFileName(qFile.c_str());<br> reader->SetScalarFunctionNumber(100);<br>
reader->Update();<br><br> vtkSmartPointer<vtkPolyData> probePolyData =<br> vtkSmartPointer<vtkPolyData>::New();<br> vtkSmartPointer<vtkProbeFilter> probe =<br> vtkSmartPointer<vtkProbeFilter>::New();<br>
//probe->SetSource(image);<br> probe->SetSourceConnection(reader->GetOutputPort());<br><br> probePoints = vtkSmartPointer<vtkPoints>::New();<br><br> for (iLine=0; iLine<nLines; ++iLine)<br>
{<br><br> probePoints->Initialize();<br> // Add some points to interpolate<br> fracx = (StopPoints[iLine].x-StartPoints[iLine].x)/double(NPoints-1);<br> fracy = (StopPoints[iLine].y-StartPoints[iLine].y)/double(NPoints-1);<br>
fracz = (StopPoints[iLine].z-StartPoints[iLine].z)/double(NPoints-1);<br> for (iPoint=0; iPoint<NPoints; ++iPoint)<br> {<br> di = double(iPoint);<br> x = StartPoints[iLine].x + di*fracx;<br>
y = StartPoints[iLine].y + di*fracy;<br> z = StartPoints[iLine].z + di*fracz;<br> probePoints->InsertNextPoint(x, y, z);<br> }<br><br> probePolyData->Initialize();<br>
probePolyData->SetPoints(probePoints);<br><br> probe->SetInput(probePolyData);<br> probe->Update();<br><br> vtkDataArray* data = probe->GetOutput()->GetPointData()->GetScalars();<br>
vtkDoubleArray* doubleData = vtkDoubleArray::SafeDownCast (data);<br><br> NumDataPoints = data->GetDataSize();<br> integratedDensity = 0.0;<br> //outData << iLine << endl;<br>
ds = sqrt(pow(fracx,2)+pow(fracy,2)+pow(fracz,2));<br> s = sqrt(pow(StartPoints[iLine].x-StopPoints[iLine].x,2)<br> +pow(StartPoints[iLine].y-StopPoints[iLine].y,2)<br> +pow(StartPoints[iLine].z-StopPoints[iLine].z,2));<br>
data->GetTuple(0, val);<br> rhom1 = val[0];<br> for(int i = 1; i < NumDataPoints; ++i)<br> {<br> data->GetTuple(i, val);<br> // cout << "Interpolation using ProbeFilter ";<br>
// cout << "doubleData->GetValue(" << i << "): " << val[0] << endl;<br> //outData << i << "\t" << val[0] << endl;<br>
rho = val[0];<br> integratedDensity += (rho+rhom1)*ds/2.0;<br> rhom1 = rho;<br> }<br> }<br><br>Thanks for your help,<br>Hamilton Woods<br>
<br><br>_______________________________________________<br>Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br>