Hi Owen,<div><br></div><div>You will need to declare the whole extent in request information. See this post: <a href="http://markmail.org/message/af6n3hutrbnxjowf">http://markmail.org/message/af6n3hutrbnxjowf</a></div><div>
<br></div><div>Regards,<br>Paul<br><br><div class="gmail_quote">On 20 July 2010 16:02,  <span dir="ltr">&lt;<a href="mailto:owen.arnold@stfc.ac.uk">owen.arnold@stfc.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">









<div lang="EN-GB" link="blue" vlink="purple">

<div>

<p class="MsoNormal"><span lang="EN-US" style="color:#595959">Hi,</span></p>

<p class="MsoNormal"><span lang="EN-US" style="color:#595959"> </span></p>

<p class="MsoNormal"><span lang="EN-US" style="color:#595959">I am attempting to
create a data source based on a </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">vtkStructuredGridAlgorithm</span><span lang="EN-US" style="color:#595959">.  Eventually I would like to represent the grid in
a hexahedron format <a href="http://vtk.1045678.n5.nabble.com/Creating-a-structured-grid-of-250x250-cells-is-causing-MS-runtime-to-throw-an-exception-td1250336.html" target="_blank">http://vtk.1045678.n5.nabble.com/Creating-a-structured-grid-of-250x250-cells-is-causing-MS-runtime-to-throw-an-exception-td1250336.html</a>.
While I have been able to get this example running in vtk using the python API,
my Paraview plugin source does not work. </span></p>

<p class="MsoNormal"><span lang="EN-US" style="color:#595959"> </span></p>

<p class="MsoNormal"><span lang="EN-US" style="color:#595959">I have the same
problem attempting to write a plugin source using a simpler example from the
vtk guide:  <a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/DataManipulation/Cxx/SGrid.cxx?root=VTK&amp;content-type=text/plain" target="_blank">http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/DataManipulation/Cxx/SGrid.cxx?root=VTK&amp;content-type=text/plain</a>.
According to the information tab in Paraview, I have zero points and zero
cells, although debugging the datasource shows that for my vtkStructuredGrid
output, the points and cells have been created.</span></p>

<p class="MsoNormal"><span lang="EN-US" style="color:#595959"> </span></p>

<p class="MsoNormal"><span lang="EN-US" style="color:#595959">Can anyone spot what
I might be doing, and suggest how I might fix the problem (see below).</span></p>

<p class="MsoNormal"><span lang="EN-US" style="color:#595959"> </span></p>

<p class="MsoNormal"><span lang="EN-US" style="color:#595959">Thanks in advance,</span></p>

<p class="MsoNormal"><span lang="EN-US" style="color:#595959"> </span></p>

<p class="MsoNormal"><span lang="EN-US" style="color:#595959">Owen</span></p>

<p class="MsoNormal"><span lang="EN-US" style="color:#595959"> </span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue">int</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">
vtkStructuredHexahedronSource::RequestData(vtkInformation *request,
vtkInformationVector **inputVector, vtkInformationVector *outputVector)</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">{</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      vtkInformation
*outInfo = outputVector-&gt;GetInformationObject(0);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      vtkStructuredGrid
*output =
vtkStructuredGrid::SafeDownCast(outInfo-&gt;Get(vtkDataObject::DATA_OBJECT()));</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      <span style="color:blue">int</span> i, j, k, kOffset, jOffset, offset;</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      <span style="color:blue">float</span> x[3], v[3], rMin=0.5, rMax=1.0, deltaRad,
deltaZ;</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      <span style="color:blue">float</span> radius, theta;</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      <span style="color:blue">static</span> <span style="color:blue">int</span>
dims[3]={13,11,11};</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      <span style="color:green">// Create the structured grid.</span></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green"> </span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      output-&gt;SetDimensions(dims);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      <span style="color:green">// We also create the points and vectors. The points</span></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      <span style="color:green">// form a hemi-cylinder of data.</span></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      vtkFloatArray
*vectors = vtkFloatArray::New();</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      vectors-&gt;SetNumberOfComponents(3);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      vectors-&gt;SetNumberOfTuples(dims[0]*dims[1]*dims[2]);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      vtkPoints *points =
vtkPoints::New();</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      points-&gt;Allocate(dims[0]*dims[1]*dims[2]);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      deltaZ = 2.0 /
(dims[2]-1);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      deltaRad =
(rMax-rMin) / (dims[1]-1);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      v[2]=0.0;</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      <span style="color:blue">for</span> ( k=0; k&lt;dims[2]; k++)</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      {</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">            x[2]
= -1.0 + k*deltaZ;</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">            kOffset
= k * dims[0] * dims[1];</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">            <span style="color:blue">for</span> (j=0; j&lt;dims[1]; j++) </span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">            {</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                  radius
= rMin + j*deltaRad;</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                  jOffset
= j * dims[0];</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                  <span style="color:blue">for</span> (i=0; i&lt;dims[0]; i++) </span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                  {</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        theta
= i * vtkMath::RadiansFromDegrees(15.0);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        x[0]
= radius * cos(theta);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        x[1]
= radius * sin(theta);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        v[0]
= -x[1];</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        v[1]
= x[0];</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        offset
= i + jOffset + kOffset;</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        points-&gt;InsertPoint(offset,x);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                        vectors-&gt;InsertTuple(offset,v);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                  }</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">            }</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      }</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      output-&gt;SetPoints(points);</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      points-&gt;Delete();</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      output-&gt;GetPointData()-&gt;SetVectors(vectors);</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      vectors-&gt;Delete();</span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">      <span style="color:blue">return</span> 1;</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">}</span></p>

</div>


<br><p>-- 
<br>Scanned by iCritical.
</p>
<br></div>


<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 ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>