[vtkusers] Titan and graph/tree Infoviz

Jeff Baumes jeff.baumes at kitware.com
Wed Mar 31 10:05:48 EDT 2010


Take a look at the examples in

VTK-git/Examples/Infovis/Java

Jeff

On Tue, Mar 30, 2010 at 6:36 PM, Bladek, Anthony <Anthony.Bladek at pnl.gov> wrote:
> Jeff,
>  Thanks for the help.  That worked great.  Now I have several other questions, if you don't mind.  Is it possible to display a graph in a vtkPanel?  I've got some great views using vtkGraphLayoutView but I need to integrate them along with some other components into an application and I can't find an example with vtkPanel that doesn't just add an image or shape to a panel. Do I need to use another method to display my graph in a vtkPanel? (vtkGraphToPolyData?)
>
> Along those same lines, I have also read that vtkPanel wrapper has some bugs which make the SWING applications they are in crash during interaction. As far as I can tell from the users group, they are in the process of fixing them.
>
> On the other hand, I don't see any wrappers (or at least it is not in my vtk.jar) for the QT to VTK methods. Are there any and I just didn't check the right box in CMake?  If they exist, I thought I could use Jambi (QT in java) to get my interface up and running.
>
> I guess the bottom-line is what do recommend for integrating vtk and java into a real application with multiple controls and panels as opposed to just creating a graph and interacting with it in a single view (which is what I have done so far)?
>
> Thanks...
>
> Anthony
>
>
>
> -----Original Message-----
> From: Jeff Baumes [mailto:jeff.baumes at kitware.com]
> Sent: Saturday, March 27, 2010 4:26 PM
> To: Bladek, Anthony
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] Titan and graph/tree Infoviz
>
> Try adding the lines
>
> reader.OutputPedigreeIdsOn();
> reader.GeneratePedigreeIdsOn();
>
> This will add pedigree ids to your table, and the error should go
> away. GroupLeafVertices needs an array with ids in it to help in
> bookkeeping.
>
> Jeff
>
> On Fri, Mar 26, 2010 at 4:36 PM, Bladek, Anthony <Anthony.Bladek at pnl.gov> wrote:
>> All,
>>     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.
>>
>> //snip
>>                 // read in the csv file
>>                 vtkDelimitedTextReader reader = new
>> vtkDelimitedTextReader();
>>                 reader.DetectNumericColumnsOn();
>>                 reader.SetFieldDelimiterCharacters(",");
>>                 reader.SetFileName(OutputConnectionCountGraphCSVFileName);
>>                 reader.SetHaveHeaders(true);
>>                 reader.Update();
>>
>>                 // create a table
>>                 vtkTable table = reader.GetOutput();
>>                 int numCols = table.GetNumberOfColumns();
>>                 System.out.println("number of columns: " + numCols);
>>                 // turn it into a tree
>>                 vtkTableToTreeFilter treeFilter = new
>> vtkTableToTreeFilter();
>>                 treeFilter.SetInputConnection(reader.GetOutputPort());
>>                 treeFilter.Update();
>>                 vtkTree tree = new vtkTree();
>>                 tree = treeFilter.GetOutput();
>>
>>                 int vertCount = tree.GetNumberOfVertices();
>>                 int edgeCount = tree.GetNumberOfEdges();
>>
>>                 // group the vertices here
>>                 //don't have actually any idea how to set this up.
>>                 // code below produces error "Pedigree ids not assigned to
>> vertices on input graph."
>>                 // must be missing something.
>>                 vtkGroupLeafVertices vertices = new
>> vtk.vtkGroupLeafVertices();
>>                 vertices.SetInputConnection(treeFilter.GetOutputPort());
>> //input the tree
>>                 vertices.SetInputArrayToProcess(0,0,0,0, "Session
>> Count");//group by number of connections
>>                 vertices.SetInputArrayToProcess(1,0,0,0, "Source"); // then
>> by source
>>                 vertices.SetInputArrayToProcess(1,0,0,0, "Destination");
>> then by destination
>>                 vertices.Update();
>>
>>                 //.. Put the vertices into the layout or view or ??
>> // end snip
>>
>>         Any help or any example to follow would be greatly appreciated.
>>
>>         Thanks.
>>
>>         Anthony
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>



More information about the vtkusers mailing list