[vtkusers] error when rendering treemapview in minimal example code
David
dk402538 at googlemail.com
Wed Apr 30 07:21:29 EDT 2014
Hi,
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();:
ERROR: In
C:\temp\source\VTK-6.1.0\Common\ExecutionModel\vtkDemandDrivenPipeline.cxx,
line 715
vtkCompositeDataPipeline (0000007D7D15F3A0): Input port 0 of algorithm
vtkTreeLevelsFilter(0000007D7AAD5DB0) has 0 connections but is not optional.
ERROR: In C:\temp\source\VTK-6.1.0\Common\ExecutionModel\vtkAlgorithm.cxx,
line 538
vtkPointSetToLabelHierarchy (0000007D7CF19840): Attempt to get vertex or
edge data from a non-graph
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?
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.
I tried playing with all kinds of things including additional vertex data
etc. without success.
Here is the minimal code which I used together with vtk6.1.0 and qt4.8.5:
#include <QApplication>
#include <vtkMutableDirectedGraph.h>
#include <vtkTree.h>
#include <QVTKWidget.h>
#include <vtkRenderWindow.h>
#include <vtkTreeMapView.h>
int main( int argc, char** argv )
{
QApplication app(argc, argv);
// create graph and propagate it with vertices and edges ----
vtkMutableDirectedGraph* graph = vtkMutableDirectedGraph::New();
// add vertices/edges
vtkIdType rootNode = graph->AddVertex();
vtkIdType childNode1 = graph->AddChild(rootNode);
// convert graph to tree ----
vtkTree* tree = vtkTree::New();
bool result = tree->CheckedShallowCopy(graph);
if(!result)
{
std::cerr << "conversion failed!\n";
return -1;
}
// setup treeview and qt widget ---
vtkTreeMapView* view = vtkTreeMapView::New();
view->SetRepresentationFromInput(tree);
view->GetRenderWindow()->Render();
QVTKWidget widget;
widget.resize(256,256);
widget.SetRenderWindow(view->GetRenderWindow());
widget.show();
return app.exec();
}
Any help or hint is much appreciated. Thanks.
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140430/8ccef3ca/attachment.html>
More information about the vtkusers
mailing list