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>"The Prim minimal spanning tree filter is still under development... Use at your own risk." <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'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> vtkMutableUndirectedGraph* g=vtkMutableUndirectedGraph::New();<br>
<br> // This is used for finding minimum-spanning trees<br> vtkIntArray* edgeWeightsArr = vtkIntArray::New();<br> edgeWeightsArr->SetName("EdgeWeights");<br> <br> VTK_CREATE(vtkRenderer, ren);<br>
<br> VTK_CREATE(vtkPoints, pts);<br> g->AddVertex();<br> pts->InsertNextPoint(0, 1, 0);<br> g->AddVertex();<br> pts->InsertNextPoint(0.5, 1, 0);<br> g->AddVertex();<br> pts->InsertNextPoint(0.25, 0.5, 0);<br>
g->AddVertex();<br> pts->InsertNextPoint(0, 0, 0);<br> g->AddVertex();<br> pts->InsertNextPoint(0.5, 0, 0);<br> g->AddVertex();<br> pts->InsertNextPoint(1, 0, 0);<br> g->AddVertex();<br> pts->InsertNextPoint(0.75, 0.5, 0);<br>
g->SetPoints(pts);<br><br> g->AddEdge(0, 1);<br> edgeWeightsArr->InsertNextValue(1);<br> g->AddEdge(0, 2);<br> edgeWeightsArr->InsertNextValue(1);<br> g->AddEdge(1, 2);<br> edgeWeightsArr->InsertNextValue(1);<br>
g->AddEdge(2, 3);<br> edgeWeightsArr->InsertNextValue(1);<br> g->AddEdge(2, 4);<br> edgeWeightsArr->InsertNextValue(1);<br> g->AddEdge(3, 4);<br> edgeWeightsArr->InsertNextValue(1);<br><br> g->GetEdgeData()->AddArray(edgeWeightsArr);<br>
<br> //VTK_CREATE(vtkBoostPrimMinimumSpanningTree,mst);<br> VTK_CREATE(vtkBoostKruskalMinimumSpanningTree,mst);<br> mst->SetInput(g);<br> mst->SetEdgeWeightArrayName("EdgeWeights");<br> mst->Update();<br>
<br> // 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"><<a href="mailto:jeff.baumes@kitware.com">jeff.baumes@kitware.com</a>></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 class="Ih2E3d">> When I compile the sample file, I get the first error for the following<br>
> line:<br>
> VTK_CREATE(vtkBoostBiconnectedComponents, biconn);<br>
><br>
> (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/~vargua">http://www.cs.rpi.edu/~vargua</a><br>