<br>I am posting some more code here. I use this in order to display the trees I generate in 2D.<br>The vertex array, ChannelColors, and Edge Weights are defined somewhere else. This code displays the bfs tree. But if I replace the code under LINE X below in order to display Kruskal&#39;s MST with:<br>
<br>view-&gt;AddRepresentationFromInput(mst-&gt;GetOutput());<br><br>I am getting the following error message:<br>&quot;Need input data to render labels (2)&quot;<br><br>But I am not getting any error messages for the same labels while displaying the bfs tree.<br>
<br>I tried other ways of displaying too.<br>Please help.<br>Thanks alot.<br><br>---- Display Code ---<br><br>&nbsp;&nbsp; VTK_CREATE(vtkBoostBreadthFirstSearchTree, bfsTree);<br>&nbsp;&nbsp;&nbsp; bfsTree-&gt;SetInput(g);<br><br>&nbsp;&nbsp;&nbsp; //Create a graph layout view<br>
&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; vtkGraphLayoutView* view = vtkGraphLayoutView::New();<br>&nbsp;&nbsp;&nbsp; view-&gt;SetLayoutStrategyToPassThrough();<br><br>&nbsp; &nbsp; //LINE X<br>-----&gt; &nbsp;&nbsp; view-&gt;AddRepresentationFromInput(bfsTree-&gt;GetOutput());<br>&nbsp;&nbsp;&nbsp; view-&gt;SetVertexLabelArrayName(&quot;Label&quot;);<br>
&nbsp;&nbsp;&nbsp; view-&gt;SetVertexLabelVisibility(true);<br>&nbsp;&nbsp;&nbsp; view-&gt;SetVertexColorArrayName(&quot;ChannelColors&quot;);<br>&nbsp;&nbsp;&nbsp; view-&gt;SetColorVertices(true);<br>&nbsp;&nbsp;&nbsp; view-&gt;SetEdgeColorArrayName(&quot;ChannelColors&quot;);<br>
&nbsp;&nbsp;&nbsp; view-&gt;SetColorEdges(true);<br>&nbsp;&nbsp;&nbsp; //view-&gt;SetLayoutStrategyToSimple2D();<br><br>&nbsp;&nbsp;&nbsp; VTK_CREATE(vtkRenderWindow, window);<br>&nbsp;&nbsp;&nbsp; window-&gt;SetSize(1000, 1000);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; view-&gt;SetupRenderWindow(window);<br>
&nbsp;&nbsp;&nbsp; view-&gt;GetRenderer()-&gt;ResetCamera();<br>&nbsp;&nbsp;&nbsp; window-&gt;GetInteractor()-&gt;Start();<br><br><br><br><div class="gmail_quote">On Tue, Dec 30, 2008 at 10:42 AM, Aytekin Vargun <span dir="ltr">&lt;<a href="mailto:varguna@gmail.com">varguna@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks a lot Jeff,<br>It looks like I had several versions of VTK and this was causing problems.<br>
<br>Now I have another problem. I am trying to use minimum spanning tree programs. I first tried to use vtkBoostPrimMinimumSpanningTree but I am getting the following error message:<br>
<br>&quot;The Prim minimal spanning tree filter is still under development...&nbsp; Use at your own risk.&quot; <br><br>I checked where the error message is and then assumed that I was getting this message since the implementation is not complete yet. But should I still see some output on the screen?<br>

<br>I then tried to use vtkKruskalMinimumSpanningTree which looks like in better shape (whose output is a vtkSelectionAlgorithm). But I am failed to display its output since its output is not a tree but a forest whereas Prim&#39;s version produces a vtkTree . Then how can I display each subtree? One way of doing this probably is to cast the result to a graph and then display the resulting graph.<br>

<br>I will greatly appreciate if anyone shares his/her experiences.<br>Thanks a lot.<br><br>Here is a simplified piece of code I am trying to run:<br><br>&nbsp; vtkMutableUndirectedGraph* g=vtkMutableUndirectedGraph::New();<br>

&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; // This is used for finding minimum-spanning trees<br>&nbsp;&nbsp;&nbsp; vtkIntArray* edgeWeightsArr = vtkIntArray::New();<br>&nbsp;&nbsp;&nbsp; edgeWeightsArr-&gt;SetName(&quot;EdgeWeights&quot;);<br>&nbsp;&nbsp; <br>&nbsp; VTK_CREATE(vtkRenderer, ren);<br>

<br>&nbsp; VTK_CREATE(vtkPoints, pts);<br>&nbsp; g-&gt;AddVertex();<br>&nbsp; pts-&gt;InsertNextPoint(0, 1, 0);<br>&nbsp; g-&gt;AddVertex();<br>&nbsp; pts-&gt;InsertNextPoint(0.5, 1, 0);<br>&nbsp; g-&gt;AddVertex();<br>&nbsp; pts-&gt;InsertNextPoint(0.25, 0.5, 0);<br>

&nbsp; g-&gt;AddVertex();<br>&nbsp; pts-&gt;InsertNextPoint(0, 0, 0);<br>&nbsp; g-&gt;AddVertex();<br>&nbsp; pts-&gt;InsertNextPoint(0.5, 0, 0);<br>&nbsp; g-&gt;AddVertex();<br>&nbsp; pts-&gt;InsertNextPoint(1, 0, 0);<br>&nbsp; g-&gt;AddVertex();<br>&nbsp; pts-&gt;InsertNextPoint(0.75, 0.5, 0);<br>

&nbsp; g-&gt;SetPoints(pts);<br><br>&nbsp; g-&gt;AddEdge(0, 1);<br>&nbsp; edgeWeightsArr-&gt;InsertNextValue(1);<br>&nbsp; g-&gt;AddEdge(0, 2);<br>&nbsp; edgeWeightsArr-&gt;InsertNextValue(1);<br>&nbsp; g-&gt;AddEdge(1, 2);<br>&nbsp; edgeWeightsArr-&gt;InsertNextValue(1);<br>

&nbsp; g-&gt;AddEdge(2, 3);<br>&nbsp; edgeWeightsArr-&gt;InsertNextValue(1);<br>&nbsp; g-&gt;AddEdge(2, 4);<br>&nbsp; edgeWeightsArr-&gt;InsertNextValue(1);<br>&nbsp; g-&gt;AddEdge(3, 4);<br>&nbsp; edgeWeightsArr-&gt;InsertNextValue(1);<br><br>&nbsp; g-&gt;GetEdgeData()-&gt;AddArray(edgeWeightsArr);<br>

<br>&nbsp; //VTK_CREATE(vtkBoostPrimMinimumSpanningTree,mst);<br>&nbsp; VTK_CREATE(vtkBoostKruskalMinimumSpanningTree,mst);<br>&nbsp; mst-&gt;SetInput(g);<br>&nbsp; mst-&gt;SetEdgeWeightArrayName(&quot;EdgeWeights&quot;);<br>&nbsp; mst-&gt;Update();<br>

<br>&nbsp; // HOW TO DISPLAY<br><br><br><br><div class="gmail_quote">On Tue, Dec 23, 2008 at 3:14 PM, Jeff Baumes <span dir="ltr">&lt;<a href="mailto:jeff.baumes@kitware.com" target="_blank">jeff.baumes@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>&gt; When I compile the sample file, I get the first error for the following<br>
&gt; line:<br>
&gt; &nbsp; VTK_CREATE(vtkBoostBiconnectedComponents, biconn);<br>
&gt;<br>
&gt; (On CMake, I had set VTK_USE_BOOST set to ON when building VTK)<br>
<br>
</div>First, make sure that your app is linking against vtkInfovis. If it<br>
is, it appears that the Boost algorithms are not being compiled into<br>
the vtkInfovis library you are using. Ensure that the vtkInfovis you<br>
are linking against is the one in the build where you turned<br>
VTK_USE_BOOST on. In Visual Studio, you can check your VTK build by<br>
looking at the source files under vtkInfovis. Make sure the vtkBoost*<br>
files are there.<br>
<font color="#888888"><br>
Jeff<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>My web page: <a href="http://www.cs.rpi.edu/%7Evargua" target="_blank">http://www.cs.rpi.edu/~vargua</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>My web page: <a href="http://www.cs.rpi.edu/~vargua">http://www.cs.rpi.edu/~vargua</a><br>