#include &lt;vtkSmartPointer.h&gt;<br>#include &lt;vtkHAVSVolumeMapper.h&gt;<br>#include &lt;vtkRenderer.h&gt;<br>#include &lt;vtkRenderWindow.h&gt;<br>#include &lt;vtkUnstructuredGridReader.h&gt;<br>#include &lt;vtkRenderWindowInteractor.h&gt;<br>#include &lt;vtkStructuredPointsReader.h&gt;<br>#include &lt;vtkSLCReader.h&gt;<br>#include &lt;vtkStructuredPoints.h&gt;<br>#include &lt;vtkUnstructuredGrid.h&gt;<br>#include &lt;vtkDataSetTriangleFilter.h&gt;<br>#include &lt;vtkPiecewiseFunction.h&gt;<br>#include &lt;vtkColorTransferFunction.h&gt;<br>#include &lt;vtkVolumeProperty.h&gt;<br>#include &lt;vtkVolume.h&gt;<br>#include &lt;vtkContourFilter.h&gt;<br>#include &lt;vtkPolyDataMapper.h&gt;<br>#include &lt;vtkActor.h&gt;<br>#include &lt;vtkStdString.h&gt;<br>#include &lt;vtkTesting.h&gt;<br>#include &lt;vtkPLOT3DReader.h&gt;<br>#include &lt;vtkXMLUnstructuredGridReader.h&gt;<br>#include &lt;vtkStructuredGridOutlineFilter.h&gt;<br>#include &lt;vtkPlaneSource.h&gt;<br>#include &lt;vtkStreamLine.h&gt;<br>#include &lt;vtkProperty.h&gt;<br>#include &lt;vtkXMLRectilinearGridReader.h&gt;<br>#include &lt;vtkRectilinearGridReader.h&gt;<br>#include &lt;vtkAssignAttribute.h&gt;<br>#include &lt;vtkPointSource.h&gt;<br><br><br>int main(int, char*[])<br>{<br>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkRenderer&gt; ren1 =vtkSmartPointer&lt;vtkRenderer&gt;::New();<br>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkRenderWindow&gt; renWin = vtkSmartPointer&lt;vtkRenderWindow&gt;::New();<br>&nbsp;&nbsp;&nbsp; renWin-&gt;AddRenderer(ren1);<br><br>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; iren = vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();<br>&nbsp;&nbsp;&nbsp; iren-&gt;SetRenderWindow(renWin);<br><br>&nbsp;&nbsp;&nbsp; std::string dataRoot = "E:\\vtkdata-5.4.2\\VTKData";<br>&nbsp;&nbsp;&nbsp; /*std::string xyzFile = dataRoot + "/Data/" + "combxyz.bin";<br>&nbsp;&nbsp;&nbsp; std::string qFile = dataRoot + "/Data/" + "combq.bin";<br>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkPLOT3DReader&gt; pl3d = vtkSmartPointer&lt;vtkPLOT3DReader&gt;::New();<br>&nbsp;&nbsp;&nbsp; pl3d-&gt;SetXYZFileName(xyzFile.c_str());<br>&nbsp;&nbsp;&nbsp; pl3d-&gt;SetQFileName(qFile.c_str());<br>&nbsp;&nbsp;&nbsp; pl3d-&gt;SetScalarFunctionNumber(100);<br>&nbsp;&nbsp;&nbsp; pl3d-&gt;SetVectorFunctionNumber(202);<br>&nbsp;&nbsp;&nbsp; pl3d-&gt;Update();*/<br><br>&nbsp;&nbsp;&nbsp; std::string filename = dataRoot + "/Data/bore.vtk";<br>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkXMLUnstructuredGridReader&gt; reader = vtkSmartPointer&lt;vtkXMLUnstructuredGridReader&gt;::New();<br>&nbsp;&nbsp;&nbsp; reader-&gt;SetFileName(filename.c_str());<br>&nbsp;&nbsp;&nbsp; reader-&gt;Update();<br><br>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkPlaneSource&gt; seeds = vtkSmartPointer&lt;vtkPlaneSource&gt;::New();<br>&nbsp;&nbsp;&nbsp; seeds-&gt;SetXResolution(4);<br>&nbsp;&nbsp;&nbsp; seeds-&gt;SetYResolution(4);<br>&nbsp;&nbsp;&nbsp; seeds-&gt;SetOrigin(2,-2,4);<br>&nbsp;&nbsp;&nbsp; seeds-&gt;SetPoint1(2,2,6);<br>&nbsp;&nbsp;&nbsp; seeds-&gt;SetPoint2(2,-2,8);<br><br>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkStreamLine&gt; streamLine = vtkSmartPointer&lt;vtkStreamLine&gt;::New();<br>&nbsp;&nbsp;&nbsp; streamLine-&gt;SetInputConnection(reader-&gt;GetOutputPort());<br>&nbsp;&nbsp;&nbsp; streamLine-&gt;SetSource(seeds-&gt;GetOutput());<br><br>&nbsp;&nbsp;&nbsp; streamLine-&gt;SetMaximumPropagationTime(200);<br>&nbsp;&nbsp;&nbsp; streamLine-&gt;SetIntegrationStepLength(.2);<br>&nbsp;&nbsp;&nbsp; streamLine-&gt;SetStepLength(.001);<br>&nbsp;&nbsp;&nbsp; streamLine-&gt;SetNumberOfThreads(1);<br>&nbsp;&nbsp;&nbsp; streamLine-&gt;SetIntegrationDirectionToForward();<br>&nbsp;&nbsp;&nbsp; streamLine-&gt;VorticityOn();<br><br>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkPolyDataMapper&gt; streamLineMapper = vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();<br>&nbsp;&nbsp;&nbsp; streamLineMapper-&gt;SetInputConnection(streamLine-&gt;GetOutputPort());<br>&nbsp;&nbsp;&nbsp; //建立actor<br>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkActor&gt; streamLineActor = vtkSmartPointer&lt;vtkActor&gt;::New();<br>&nbsp;&nbsp;&nbsp; streamLineActor-&gt;SetMapper(streamLineMapper);<br>&nbsp;&nbsp;&nbsp; streamLineActor-&gt;VisibilityOn();<br><br>&nbsp;&nbsp;&nbsp; ren1-&gt;AddViewProp(streamLineActor);<br><br>&nbsp;&nbsp;&nbsp; renWin-&gt;Render();<br><br>&nbsp;&nbsp;&nbsp; iren-&gt;Start();<br><br>&nbsp;&nbsp;&nbsp; return EXIT_SUCCESS;<br>}<br>the code above is my problem, do you know where is wrong place? please tell me. thank you in advance!<br>                
<br><br><span title="neteasefooter"><span id="netease_mail_footer"><hr/>
<a href="http://help.163.com/10/1108/18/6L03I4G500753VB8.html" target="_blank">网易163/126邮箱百分百兼容iphone ipad邮件收发</a>
</span></span>