<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div>All,</div>
<div> I am a new to vtk and the Titan extensions I am having trouble producing a tree visualization. Specifically, I am trying to use vtkGroupLeafVertices based upon a table of data. Much like the example shown in the slides from Information_Visualization_in_VTK.ppt
(A Titan presentation) I have 3 columns in a table and I want the first level of the tree (past the root) to be drawn from one column of the table and the next level to be drawn from another column. As far as I can find there are no examples on how to set up
and use vtkGroupLeafVertices so I am at a bit of loss on how to start. I am using the java wrappers for VTK and here is what I have so far.</div>
<div> </div>
<div>//snip</div>
<div> // read in the csv file</div>
<div> <font face="Courier New, monospace" size="2">vtkDelimitedTextReader reader = </font><font face="Courier New, monospace" size="2" color="#7F0055"><b>new</b></font><font face="Courier New, monospace" size="2"> vtkDelimitedTextReader();</font></div>
<div> <font face="Courier New, monospace" size="2">reader.DetectNumericColumnsOn();</font></div>
<div> <font face="Courier New, monospace" size="2">reader.SetFieldDelimiterCharacters(</font><font face="Courier New, monospace" size="2" color="#2A00FF">","</font><font face="Courier New, monospace" size="2">);</font></div>
<div> <font face="Courier New, monospace" size="2">reader.SetFileName(</font><font face="Courier New, monospace" size="2" color="#0000C0"><i>OutputConnectionCountGraphCSVFileName</i></font><font face="Courier New, monospace" size="2">);</font></div>
<div> <font face="Courier New, monospace" size="2">reader.SetHaveHeaders(</font><font face="Courier New, monospace" size="2" color="#7F0055"><b>true</b></font><font face="Courier New, monospace" size="2">)</font><font face="Courier New, monospace" size="2">;</font></div>
<div> <font face="Courier New, monospace" size="2">reader.Update();</font></div>
<div> </div>
<div> <font face="Courier New, monospace" size="2">// create a table</font></div>
<div> <font face="Courier New, monospace" size="2">vtkTable table = reader.GetOutput();</font></div>
<div> <font face="Courier New, monospace" size="2" color="#7F0055"><b>int</b></font><font face="Courier New, monospace" size="2"> numCols = table.GetNumberOfColumns();</font></div>
<div> <font face="Courier New, monospace" size="2">System.</font><font face="Courier New, monospace" size="2" color="#0000C0"><i>out</i></font><font face="Courier New, monospace" size="2">.println(</font><font face="Courier New, monospace" size="2" color="#2A00FF">"number
of columns: "</font><font face="Courier New, monospace" size="2"> + numCols);</font></div>
<div> <font face="Courier New, monospace" size="2">// turn it into a tree </font></div>
<div> <font face="Courier New, monospace" size="2">vtkTableToTreeFilter treeFilter = </font><font face="Courier New, monospace" size="2" color="#7F0055"><b>new</b></font><font face="Courier New, monospace" size="2"> vtkTableToTreeFilter(); </font></div>
<div> <font face="Courier New, monospace" size="2">treeFilter.SetInputConnection(reader.</font><font face="Courier New, monospace" size="2"><span style="background-color:#C0C0C0">GetOutputPort</span></font><font face="Courier New, monospace" size="2">());</font></div>
<div> <font face="Courier New, monospace" size="2">treeFilter.Update(); </font></div>
<div> <font face="Courier New, monospace" size="2">vtkTree tree = </font><font face="Courier New, monospace" size="2" color="#7F0055"><b>new</b></font><font face="Courier New, monospace" size="2"> vtkTree();</font></div>
<div> <font face="Courier New, monospace" size="2">tree = treeFilter.GetOutput(); </font></div>
<div> </div>
<div> <font face="Courier New, monospace" size="2" color="#7F0055"><b>int</b></font><font face="Courier New, monospace" size="2"> vertCount = tree.GetNumberOfVertices();</font></div>
<div> <font face="Courier New, monospace" size="2" color="#7F0055"><b>int</b></font><font face="Courier New, monospace" size="2"> edgeCount = tree.GetNumberOfEdges();</font></div>
<div> </div>
<div> <font face="Courier New, monospace" size="2">// group the vertices here</font></div>
<div> <font face="Courier New, monospace" size="2">//don</font><font face="Courier New, monospace" size="2">’</font><font face="Courier New, monospace" size="2">t have actually any idea how to set this up.</font></div>
<div> <font face="Courier New, monospace" size="2">// code below produces error</font><font face="Courier New, monospace" size="2"> </font><font face="Courier New, monospace" size="2">"Pedigree ids not assigned to vertices on input graph."</font><font face="Courier New, monospace" size="2">
</font></div>
<div> <font face="Courier New, monospace" size="2">// must be missing something</font><font face="Courier New, monospace" size="2">…</font><font face="Courier New, monospace" size="2"> </font></div>
<div> <font face="Courier New, monospace" size="2" color="#3F7F5F">vtkGroupLeafVertices vertices = new </font><font face="Courier New, monospace" size="2" color="#3F7F5F"><u>vtk</u></font><font face="Courier New, monospace" size="2" color="#3F7F5F">.vtkGroupLeafVertices();</font></div>
<div><font color="#3F7F5F"> <font face="Courier New, monospace" size="2">vertices.SetInputConnection(treeFilter.GetOutputPort());</font><font face="Courier New, monospace" size="2"> //input the tree</font></font></div>
<div><font color="#3F7F5F"> <font face="Courier New, monospace" size="2">vertices.SetInputArrayToProcess(0,0,0,0, "Session Count");</font><font face="Courier New, monospace" size="2">//group by number of connections</font></font></div>
<div><font color="#3F7F5F"> <font face="Courier New, monospace" size="2">vertices.SetInputArrayToProcess(1,0,0,0, "Source");</font><font face="Courier New, monospace" size="2"> // then by source</font></font></div>
<div><font color="#3F7F5F"> <font face="Courier New, monospace" size="2">vertices.SetInputArrayToProcess(1,0,0,0, "Destination");</font><font face="Courier New, monospace" size="2"> then by destination</font></font></div>
<div><font color="#3F7F5F"> <font face="Courier New, monospace" size="2">vertices.Update();</font></font></div>
<div><font color="#3F7F5F"> </font></div>
<div><font color="#3F7F5F"> <font face="Courier New, monospace" size="2">//</font><font face="Courier New, monospace" size="2">…</font><font face="Courier New, monospace" size="2">. Put the vertices into the layout or view or ??</font></font></div>
<div><font face="Courier New, monospace" size="2" color="#3F7F5F">// end snip </font></div>
<div><font color="#3F7F5F"> </font></div>
<div><font color="#3F7F5F"> <font face="Courier New, monospace" size="2" color="#000000">Any help or any example to follow would be greatly appreciated.</font></font></div>
<div><font face="Courier New, monospace" size="2"> </font></div>
<div><font face="Courier New, monospace" size="2"> Thanks…</font></div>
<div> </div>
<div> <font face="Courier New, monospace" size="2">Anthony </font></div>
<div> </div>
</font>
</body>
</html>