[vtkusers] could you help me to find the wrong place?
胡健09060017
hujian198681 at 126.com
Mon Nov 15 04:54:33 EST 2010
firstly i want to say sorry. yesterday i send the same question, but i give the code which is not i want to give you. this is my code:
> #include <vtkSmartPointer.h>
> #include <vtkHAVSVolumeMapper.h>
> #include <vtkRenderer.h>
> #include <vtkRenderWindow.h>
> #include <vtkUnstructuredGridReader.h>
> #include <vtkRenderWindowInteractor.h>
> #include <vtkStructuredPointsReader.h>
> #include <vtkSLCReader.h>
> #include <vtkStructuredPoints.h>
> #include <vtkUnstructuredGrid.h>
> #include <vtkDataSetTriangleFilter.h>
> #include <vtkPiecewiseFunction.h>
> #include <vtkColorTransferFunction.h>
> #include <vtkVolumeProperty.h>
> #include <vtkVolume.h>
> #include <vtkContourFilter.h>
> #include <vtkPolyDataMapper.h>
> #include <vtkActor.h>
> #include <vtkStdString.h>
> #include <vtkTesting.h>
> #include <vtkPLOT3DReader.h>
> #include <vtkXMLUnstructuredGridReader.h>
> #include <vtkStructuredGridOutlineFilter.h>
> #include <vtkPlaneSource.h>
> #include <vtkStreamLine.h>
> #include <vtkProperty.h>
> #include <vtkXMLRectilinearGridReader.h>
> #include <vtkRectilinearGridReader.h>
> #include <vtkAssignAttribute.h>
> #include <vtkPointSource.h>
>
>
> int main(int, char*[])
> {
> vtkSmartPointer<vtkRenderer> ren1 =vtkSmartPointer<vtkRenderer>::New();
> vtkSmartPointer<vtkRenderWindow> renWin =
> vtkSmartPointer<vtkRenderWindow>::New();
> renWin->AddRenderer(ren1);
>
> vtkSmartPointer<vtkRenderWindowInteractor> iren =
> vtkSmartPointer<vtkRenderWindowInteractor>::New();
> iren->SetRenderWindow(renWin);
>
> std::string filename = dataRoot + "/Data/hj.vtu";
> vtkSmartPointer<vtkXMLUnstructuredGridReader> reader =
> vtkSmartPointer<vtkXMLUnstructuredGridReader>::New();
> reader->SetFileName(filename.c_str());
> reader->Update();
>
> vtkSmartPointer<vtkPlaneSource> seeds =
> vtkSmartPointer<vtkPlaneSource>::New();
> seeds->SetXResolution(4);
> seeds->SetYResolution(4);
> seeds->SetOrigin(2,-2,4);
> seeds->SetPoint1(2,2,6);
> seeds->SetPoint2(2,-2,8);
>
> vtkSmartPointer<vtkStreamLine> streamLine =
> vtkSmartPointer<vtkStreamLine>::New();
> streamLine->SetInputConnection(reader->GetOutputPort());
> streamLine->SetSource(seeds->GetOutput());
>
> streamLine->SetMaximumPropagationTime(200);
> streamLine->SetIntegrationStepLength(.2);
> streamLine->SetStepLength(.001);
> streamLine->SetNumberOfThreads(1);
> streamLine->SetIntegrationDirectionToForward();
> streamLine->VorticityOn();
>
> vtkSmartPointer<vtkPolyDataMapper> streamLineMapper =
> vtkSmartPointer<vtkPolyDataMapper>::New();
> streamLineMapper->SetInputConnection(streamLine->GetOutputPort());
>
> vtkSmartPointer<vtkActor> streamLineActor =
> vtkSmartPointer<vtkActor>::New();
> streamLineActor->SetMapper(streamLineMapper);
> streamLineActor->VisibilityOn();
>
> ren1->AddViewProp(streamLineActor);
>
> renWin->Render();
>
> iren->Start();
>
> return EXIT_SUCCESS;
> }
> the code above is my problem, my problem is that when i run the code, the program will be wrong! And i do not know why!
do you know where is wrong place? please tell
> me. thank you in advance!
网易163/126邮箱百分百兼容iphone ipad邮件收发
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101115/aaf304cb/attachment.htm>
More information about the vtkusers
mailing list