[vtkusers] could you help me to find the wrong place?
Jim Peterson
jimcp at cox.net
Mon Nov 15 07:07:53 EST 2010
when you say the program "will end up when I run it" does that mean it
does not display a window? Do you get an error message or termination
reason? Is the data actually XML? also, what version of vtk are you
running, and what OS are you running on?
Jim
ºú½¡09060017 wrote:
> thank you jim! I want to the code rendering streamlines,but the program will end up when I run it. my data is too big, I have to wait the manager of the maillist giving approve for it.
> At 2010-11-15 19:40:11£¬"Jim Peterson" <jimcp at cox.net> wrote:
>
>> Could you please explain what you where hoping this code would do, and
>> what you feel is broken about it?
>>
>> The problem identified with the previous code seemed pretty apparent. We
>> have no idea what you would like this code to do.
>> The data this program is reading is not from the vtk data distribution,
>> the file type is .vtu, so if it is correctly generated, it might be XML.
>>
>> thanks,
>> Jim
>>
>> ºú½¡09060017 wrote:
>>
>>> 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ÓʼþÊÕ·¢
>>> <http://help.163.com/10/1108/18/6L03I4G500753VB8.html>
>>>
>>> ------------------------------------------------------------------------
>>> ÍøÒ×163/126ÓÊÏä°Ù·Ö°Ù¼æÈÝiphone ipadÓʼþÊÕ·¢
>>> <http://help.163.com/10/1108/18/6L03I4G500753VB8.html>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>>
>
>
>
More information about the vtkusers
mailing list