[vtkusers] save Reeb Graph & c++ & vtk

Jochen K. jochen.kling at email.de
Sun Jun 10 12:47:15 EDT 2012


Hi,

I assume you use vtkGraphLayoutView to visualize your graph. This view has
two renderers. The actors of your scene are rendered into the first
renderer. What the second renderer is for I did not examine.

After some testing I found a way to get the vtkOBJExporter to work.
I just removed the _second_ renderer from the collection returned by
renderwindow()->GetRenderers(). Any negative side effects of this rude
approach I didn't examine yet. :-)

Have a look at this codesnippet, how I've done it:

  vtkRendererCollection* coll =
graphLayoutView->GetRenderWindow()->GetRenderers();
  cout << "no. of renderer: " << coll->GetNumberOfItems();
  coll->InitTraversal();
  vtkRenderer* renderer01 = coll->GetNextItem();
  vtkRenderer* renderer02 = coll->GetNextItem();
  graphLayoutView->GetRenderWindow()->RemoveRenderer(renderer02);

  vtkOBJExporter* exporter = vtkOBJExporter::New();
  exporter->SetInput(graphLayoutView->GetRenderWindow());
 
exporter->SetFilePrefix("c:\\VTK\\vtkdata-5.8.0\\Data\\TestReebGraph\\myreebgraph");
  exporter->Write();



with best regards

Jochen


--
View this message in context: http://vtk.1045678.n5.nabble.com/save-Reeb-Graph-c-vtk-tp5713708p5713716.html
Sent from the VTK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120610/24309a54/attachment.htm>


More information about the vtkusers mailing list