Hi, <br> thanks Andy, for the information about python and povray. Pvpython and pvbatch sound good. Maybe the matlab interface also provides what I need. Indeed, I need to automate the process to read in text files with coordinates and set then objects at these coordinates. I am now half-way through parsing the text file and setting the objects in C++ and I don't want to change again to a different language. Could somebody provide an example of how to write a povray file with the current camera view in C++? <br>
thanks, <br>Benjamin.<br><br clear="all">----<br>Benjamin Auffarth<br>KTH, Computational Biology and Neurocomputing (CBN), <br>Albanova Universitetscentrum, Roslagstullsbacken 35, <br>S-100 44 Stockholm, Sweden<br>room 162:021B, tel. +46 8 790 8699<br>
<br><br><div class="gmail_quote">On Sun, Feb 13, 2011 at 7:26 PM, Andy Bauer <span dir="ltr"><<a href="mailto:andy.bauer@kitware.com">andy.bauer@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br><br>Is there a reason you want to code up in C++? You can create spheres and cones (under the Source menu) in ParaView and set their parameters like center, resolution, size, etc. There are also other common geometries like cylinders, boxes, etc. You can save the results in a POV file by choosing Export and choosing POV as the file type. If you want to automate the process you can record a python script as well which can be modified to change the filter parameters and then run it with either pvpython or pvbatch.<br>
<br>Andy<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Sun, Feb 13, 2011 at 10:29 AM, Benjamin Auffarth <span dir="ltr"><<a href="mailto:auffarth@csc.kth.se" target="_blank">auffarth@csc.kth.se</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">
Hi, <br> I am new to using VTK and paraview, so excuse me if my question is too obvious. I've been looking into several manuals and the online VTK wiki, but couldn't find exactly what I was looking for. <br> I want to visualize abstract shapes, mainly spheres and cones. After looking into different formats, such as legacy VTK, and trying to create these shapes from polygons, I am now using VTK from C++ to create the shapes I want. However my problem is now that I don't know how to store them (except
for taking a screenshot). Is there a writer I can use for that? <br>
Also: once I am satisfied with my visualization, I would like to be
able to export to povray. It would be very convenient to be turn my
objects until I have a good viewpoint and then export with camera and
light sources accordingly to pov format. Could somebody give a simple
example how this is possible? <br>
Thanks a lot, <br>
Benjamin.<br>
<br> My template now looks like this and is based on examples in the wiki: <br><br>int main(int argc, char** argv[])<br>{<br> std::vector<vtkSmartPointer<vtkPolyDataAlgorithm> > geometricObjectSources;<br>
geometricObjectSources.push_back(vtkSmartPointer<vtkSphereSource>::New());<br> geometricObjectSources.push_back(vtkSmartPointer<vtkCylinderSource>::New());<br><br> std::vector<vtkSmartPointer<vtkRenderer> > renderers;<br>
std::vector<vtkSmartPointer<vtkPolyDataMapper> > mappers;<br> std::vector<vtkSmartPointer<vtkActor> > actors; <br> <br> // Visualize<br> vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();<br>
vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();<br> renderWindow->AddRenderer(renderer);<br> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();<br>
renderWindowInteractor->SetRenderWindow(renderWindow);<br><br> // Create a source, renderer, mapper, and actor<br> // for each object <br> for(unsigned int i = 0; i < geometricObjectSources.size(); i++){<br>
geometricObjectSources[i]->Update();<br> <br> mappers.push_back(vtkSmartPointer<vtkPolyDataMapper>::New());<br> mappers[i]->SetInputConnection(geometricObjectSources[i]->GetOutputPort()); <br>
<br> actors.push_back(vtkSmartPointer<vtkActor>::New());<br> actors[i]->SetMapper(mappers[i]);<br> <br> renderer->AddActor(actors[i]);<br> }<br> <br> renderWindow->Render();<br> renderWindowInteractor->Start();<br>
<br> //// Here I want to write my objects into a file<br> //// or: turn the object and then export to povray with camera according to viewpoint<br><br> return EXIT_SUCCESS;<br>}<br><br><br clear="all">----<br><font color="#888888">Benjamin Auffarth<br>
KTH, Computational Biology and Neurocomputing (CBN), <br>Albanova Universitetscentrum, Roslagstullsbacken 35, <br>S-100 44 Stockholm, Sweden<br>room 162:021B, tel. +46 8 790 8699<br>
</font><br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br>
</blockquote></div><br>