<div dir="ltr"><div>Hi,<br><br></div>I want to use the vtkTreeMapView for an infovis application I am working on. When I compile and run the very minimal code below, I get the following error messages during the call to view->GetRenderWindow()->Render();:<br>
<div><div><br>ERROR: In C:\temp\source\VTK-6.1.0\Common\ExecutionModel\vtkDemandDrivenPipeline.cxx, line 715<br>vtkCompositeDataPipeline (0000007D7D15F3A0): Input port 0 of algorithm vtkTreeLevelsFilter(0000007D7AAD5DB0) has 0 connections but is not optional.<br>
<br>ERROR: In C:\temp\source\VTK-6.1.0\Common\ExecutionModel\vtkAlgorithm.cxx, line 538<br>vtkPointSetToLabelHierarchy (0000007D7CF19840): Attempt to get vertex or edge data from a non-graph<br><br><br></div><div>I'm not really sure what the problem is. Does somebody here know what I am doing wrong in my minimal example? Any ideas what the problem could be that produces these error messages?<br>
</div><div><br></div><div>After the call to render I get a treemap visualization, but further use of the treemapview becomes very unstable and eventually crashes my application. I assume this related to the problem indicated by the error messages.<br>
<br></div><div>I tried playing with all kinds of things including additional vertex data etc. without success.<br></div><div><span style="color:rgb(0,0,128)"><br></span><br>Here is the minimal code which I used together with vtk6.1.0 and qt4.8.5:<br>
#include <QApplication><br>#include <vtkMutableDirectedGraph.h><br>#include <vtkTree.h><br>#include <QVTKWidget.h><br>#include <vtkRenderWindow.h><br>#include <vtkTreeMapView.h><br><br>
int main( int argc, char** argv )<br>{<br>       QApplication app(argc, argv);<br><br>            // create graph and propagate it with vertices and edges ----<br>      vtkMutableDirectedGraph* graph = vtkMutableDirectedGraph::New();<br>
<br>           // add vertices/edges<br>      vtkIdType rootNode = graph->AddVertex();<br>        vtkIdType childNode1 = graph->AddChild(rootNode);<br><br>     // convert graph to tree ----<br>      vtkTree* tree = vtkTree::New();<br>
<br>           bool result = tree->CheckedShallowCopy(graph);<br>          if(!result)<br>        {<br>                       std::cerr << "conversion failed!\n";<br>                    return -1;<br>         }<br><br>        // setup treeview and qt widget ---<br>
     vtkTreeMapView* view = vtkTreeMapView::New();<br>      view->SetRepresentationFromInput(tree);<br>         view->GetRenderWindow()->Render();<br><br>    QVTKWidget widget;<br>      widget.resize(256,256);<br>           widget.SetRenderWindow(view->GetRenderWindow());<br>
    widget.show();<br><br>    return app.exec();<br>}<br><br></div><div>Any help or hint is much appreciated. Thanks.<br>David<br></div></div></div>