Hello all,<br><br>I have 5000 cosmo files that I need to visualize and save each as a .png file.<br><br>If I had one file, I'd <br>1. open it in paraview<br>2. choose glyph filter<br>3. choose <br> vector : velocity<br>
glyph type: arrow<br> color by: glyphVector<br>4. press "reset" button<br>5. adjust camera -> azimuth (XX)<br>6. File->Save ScreenShot<br>7. type "output_filename"<br><br>I need to automate this process, but I don't know how.<br>
I do know how to read cosmo file into unstructured grid,<br>how to create a window, but i don't know how to set<br>all these parameters and save an image.<br><br><br>int main ()<br>{<br> vtkUnstructuredGrid *data; <br>
vtkSmartPointer<vtkCosmoReader> reader = vtkSmartPointer<vtkCosmoReader>::New(); <br><br> reader->SetFileName("input_filename.cosmo");<br> reader->Update();<br> data = reader->GetOutput(0);<br>
<br> vtkSmartPointer<vtkUnstructuredGridGeometryFilter> geometryFilter = vtkSmartPointer<vtkUnstructuredGridGeometryFilter>::New();<br> geometryFilter->SetInputConnection(data->GetOutputPort());<br>
geometryFilter->Update(); <br><br> //Create a mapper and actor<br> vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New();<br> mapper->SetInputConnection(geometryFilter->GetOutputPort());<br>
vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();<br> actor->SetMapper(mapper); <br><br> // a renderer and render window<br> vtkRenderer *ren = vtkRenderer::New();<br> vtkRenderWindow *renWin = vtkRenderWindow::New();<br>
renWin->AddRenderer(ren);<br><br> // an interactor<br> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br> iren->SetRenderWindow(renWin);<br><br> // add the actor to the scene<br> ren->AddActor(actor);<br>
ren->SetBackground(1,1,1); // Background color white<br><br> renWin->Render();<br><br> // begin mouse interaction<br> iren->Start();<br><br> ren1->Delete();<br> renWin->Delete();<br> iren->Delete();<br>
return EXIT_SUCCESS;<br>} <br><br><br>Any ideas, suggestions, code examples are highly appreciated,<br>ula<br>