Hi,<br><div class="gmail_quote"><div><br></div><div>I am very interested vtk.But a vtk problem bothering me for a long time.</div><div><br></div><div>My OS is centos6.3. vtk version 5.10,cmake version is 2.84,ccmake is 2.84. I have built vtk source successfully and get a vtk.jar.</div>

<div><br></div><div>I have a vtk file(ASCII, UNSTRUCTURED_GRID),I want to cut a part of the file.The vtk file&#39;s information is:</div><div><br></div><div>-------------------------------------------------------------------------------------------------</div>

<div> vtk DataFile Version 2.0</div><div> Result of a test</div><div> ASCII</div><div> DATASET UNSTRUCTURED_GRID</div><div><br></div><div>POINTS 2897304 float</div><div>...</div><div><br></div><div>CELLS 2720061 24480549</div>

<div>...</div><div><br></div><div>CELL_TYPES 2720061</div><div>...</div><div><br></div><div>CELL_DATA 2720061</div><div>SCALARS matnumber long</div><div>LOOKUP_TABLE default</div><div>...</div><div><br></div><div>POINT_DATA 2897304</div>

<div>SCALARS srr float</div><div>LOOKUP_TABLE default</div><div>...</div><div><br></div><div>SCALARS stt float</div><div>LOOKUP_TABLE default</div><div>...</div><div><br></div><div><div>SCALARS spp float</div><div>LOOKUP_TABLE default</div>

<div>...</div><div><br></div><div><div>SCALARS stp float</div><div>LOOKUP_TABLE default</div><div>...</div><div><br></div></div></div><div><div>SCALARS srp float</div><div>LOOKUP_TABLE default</div><div>...</div><div><br>

</div></div><div><div>SCALARS srt float</div><div>LOOKUP_TABLE default</div><div>...</div><div><br></div></div><div>VECTORS desplacement float</div><div>...</div><div><br></div><div>--------------------------------------------------------------------------------------------------</div>

<div>On the top,it is the vtk file data structure.</div><div><br></div><div>My source is following:</div><div><br></div><div><b># step 1: read file</b></div><div><div>vtkUnstructuredGridReader reader = new vtkUnstructuredGridReader();</div>

<div>reader.SetFileName(fileName);</div></div><div>reader.Update();</div><div>vtkUnstructuredGrid output = reader.GetOutput();</div><div><br></div><div><b>#step 2: create a clipper</b></div><div>vtkClipDataSet clipper = new vtkClipDataSet();</div>

<div>vtkImplicitBoolean cut = new vtkImplicitBoolean();</div><div>cut.SetOperationTypeToIntersection();</div><div>/*</div><div>new vtkPlane (vtkPlane1,vtkPlane2,vtkPlane3)</div><div>*/</div><div>cut.AddFunction(vtkPlane1);</div>

<div>cut.AddFunction(vtkPlane2);</div><div>cut.AddFunction(vtkPlane3);</div><div><br></div><div>clipper.SetInput(output);</div><div>clipper.SetClipFunction(cut);</div><div><div>clipper.GenerateClipScalarsOn();</div><div>
clipper.GenerateClippedOutputOn();</div>
<div>clipper.SetInsideOut(-1);</div></div><div><br></div><div><b>#step 3:save clipper data</b></div><div><div>vtkUnstructuredGridWriter writer = new vtkUnstructuredGridWriter();</div><div>String fileNameWriter = &quot;cutter.vtk&quot;;</div>

<div>writer.SetFileName(&quot;/work/data/vtk/&quot;+fileNameWriter);</div><div>writer.SetInput(clipper.GetOutput());</div><div>writer.SetFileTypeToASCII();</div><div>writer.Write();</div></div><div><br></div><div>Now I can get the cutter.vtk file,when I open the &quot;cutter.vtk&quot; file by ParaView,I only find &quot;Solid Color, cellNormals, matnumber, ClipDataSetScalars displacement&quot; scalars,but in orignal vtk file I </div>

<div><br></div><div>can find &quot;Solid Color, cellNormals, displacement, matnumber, spp, srr, stt, srp, srt, stp&quot; scalars.So in cutter.vtk file,it added &quot;ClipDataSetScalars&quot; scalars and removed &quot;spp, stt, srr, srp, srt, </div>

<div><br></div><div>stp&quot; 6 scalars.Why did cutter.vtk remove the 6 scalars and add &quot;ClipDataSetScalars&quot;?</div><div><br></div><div>I want to keep the &quot;spp, stt, srr, srp, srt, stp &quot; scalars,but I don&#39;t know how to do it. Is my source code wrong?</div>

<div><br></div><div>Please advice. The problem is very import for me.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Chen Zhao </div><div><b><br></b></div>
</font></span></div><br>