#include <vtkSmartPointer.h><br>#include <vtkHAVSVolumeMapper.h><br>#include <vtkRenderer.h><br>#include <vtkRenderWindow.h><br>#include <vtkUnstructuredGridReader.h><br>#include <vtkRenderWindowInteractor.h><br>#include <vtkStructuredPointsReader.h><br>#include <vtkSLCReader.h><br>#include <vtkStructuredPoints.h><br>#include <vtkUnstructuredGrid.h><br>#include <vtkDataSetTriangleFilter.h><br>#include <vtkPiecewiseFunction.h><br>#include <vtkColorTransferFunction.h><br>#include <vtkVolumeProperty.h><br>#include <vtkVolume.h><br>#include <vtkContourFilter.h><br>#include <vtkPolyDataMapper.h><br>#include <vtkActor.h><br>#include <vtkStdString.h><br>#include <vtkTesting.h><br>#include <vtkPLOT3DReader.h><br>#include <vtkXMLUnstructuredGridReader.h><br>#include <vtkStructuredGridOutlineFilter.h><br>#include <vtkPlaneSource.h><br>#include <vtkStreamLine.h><br>#include <vtkProperty.h><br>#include <vtkXMLRectilinearGridReader.h><br>#include <vtkRectilinearGridReader.h><br>#include <vtkAssignAttribute.h><br>#include <vtkPointSource.h><br><br><br>int main(int, char*[])<br>{<br> vtkSmartPointer<vtkRenderer> ren1 =vtkSmartPointer<vtkRenderer>::New();<br> vtkSmartPointer<vtkRenderWindow> renWin = vtkSmartPointer<vtkRenderWindow>::New();<br> renWin->AddRenderer(ren1);<br><br> vtkSmartPointer<vtkRenderWindowInteractor> iren = vtkSmartPointer<vtkRenderWindowInteractor>::New();<br> iren->SetRenderWindow(renWin);<br><br> std::string dataRoot = "E:\\vtkdata-5.4.2\\VTKData";<br> /*std::string xyzFile = dataRoot + "/Data/" + "combxyz.bin";<br> std::string qFile = dataRoot + "/Data/" + "combq.bin";<br> vtkSmartPointer<vtkPLOT3DReader> pl3d = vtkSmartPointer<vtkPLOT3DReader>::New();<br> pl3d->SetXYZFileName(xyzFile.c_str());<br> pl3d->SetQFileName(qFile.c_str());<br> pl3d->SetScalarFunctionNumber(100);<br> pl3d->SetVectorFunctionNumber(202);<br> pl3d->Update();*/<br><br> std::string filename = dataRoot + "/Data/bore.vtk";<br> vtkSmartPointer<vtkXMLUnstructuredGridReader> reader = vtkSmartPointer<vtkXMLUnstructuredGridReader>::New();<br> reader->SetFileName(filename.c_str());<br> reader->Update();<br><br> vtkSmartPointer<vtkPlaneSource> seeds = vtkSmartPointer<vtkPlaneSource>::New();<br> seeds->SetXResolution(4);<br> seeds->SetYResolution(4);<br> seeds->SetOrigin(2,-2,4);<br> seeds->SetPoint1(2,2,6);<br> seeds->SetPoint2(2,-2,8);<br><br> vtkSmartPointer<vtkStreamLine> streamLine = vtkSmartPointer<vtkStreamLine>::New();<br> streamLine->SetInputConnection(reader->GetOutputPort());<br> streamLine->SetSource(seeds->GetOutput());<br><br> streamLine->SetMaximumPropagationTime(200);<br> streamLine->SetIntegrationStepLength(.2);<br> streamLine->SetStepLength(.001);<br> streamLine->SetNumberOfThreads(1);<br> streamLine->SetIntegrationDirectionToForward();<br> streamLine->VorticityOn();<br><br> vtkSmartPointer<vtkPolyDataMapper> streamLineMapper = vtkSmartPointer<vtkPolyDataMapper>::New();<br> streamLineMapper->SetInputConnection(streamLine->GetOutputPort());<br> //建立actor<br> vtkSmartPointer<vtkActor> streamLineActor = vtkSmartPointer<vtkActor>::New();<br> streamLineActor->SetMapper(streamLineMapper);<br> streamLineActor->VisibilityOn();<br><br> ren1->AddViewProp(streamLineActor);<br><br> renWin->Render();<br><br> iren->Start();<br><br> 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>