[vtk-developers] Loading an External Graph to VTK

Saeed Mahdizadeh Bakhshmand saeedbakhshmand at gmail.com
Thu Aug 13 12:10:27 EDT 2015


You were right, External graphs are read to vtk as a table first and from
there table is translated to a graph,
I found out by looking at csv_to_graph.py file at
VTK-6.1.0\Examples\Infovis\Python  and this
<http://www.na-mic.org/Wiki/images/f/f8/Information_Visualization_In_VTK.pdf>
.

On Wed, Aug 12, 2015 at 6:41 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> I'm fairly certain that VertexData has nothing to do with the topology.
>
> If you already have 3D coordinates for the nodes in your graph, I suspect
> that what you need to do is set the Points along with adding all your
> vertices and edges.
>
>  - David
>
>
> On Wed, Aug 12, 2015 at 4:22 PM, Saeed Mahdizadeh Bakhshmand <
> saeedbakhshmand at gmail.com> wrote:
>
>> Right, what I am looking for is like this:
>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/InfoVis/XGMLReader
>> Here GML can load a full graph. But what I am looking for is to import
>> topology of the graph.
>> When I look into vtkGraphs that is what I see for VertexData and I assume
>> modirying topology of the graph depends on these variables:
>>
>>  VertexData:
>>
>> Debug: Off
>>
>> Modified Time: 826248
>>
>> Reference Count: 1
>>
>> Registered Events: (none)
>>
>> Number Of Arrays: 0
>>
>> Number Of Components: 0
>>
>> Number Of Tuples: 0
>>
>> Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
>>
>> Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
>>
>> Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
>>
>> Scalars: (none)
>>
>> Vectors: (none)
>>
>> Normals: (none)
>>
>> TCoords: (none)
>>
>> Tensors: (none)
>>
>> GlobalIds: (none)
>>
>> PedigreeIds: (none)
>>
>> EdgeFlag: (none)
>>
>>
>>
>> On Wed, Aug 12, 2015 at 6:01 PM, David Gobbi <david.gobbi at gmail.com>
>> wrote:
>>
>>> On Wed, Aug 12, 2015 at 3:32 PM, Saeed Mahdizadeh Bakhshmand <
>>> saeedbakhshmand at gmail.com> wrote:
>>>
>>>> Hello Experts,
>>>>
>>>> Is there a known way of loading a graph (3D node-link graph) that is
>>>> defined and saved outside of VTK(position of vertices and adjacency matrix
>>>> of the graph are stored in a text file e.g.) to be loaded to VTK and
>>>> visualized?
>>>> My guess is that GetEdgeData and GetVertexData are responsible for
>>>> accepting vtk arrays, but not sure how those arrays can perfectly contain
>>>> details of a graph and what happens if this graph is being imported from
>>>> elsewhere?
>>>>
>>>
>>> Let's back up a bit, because GetEdgeData() and GetVertexData() are not
>>> the first methods to look at.
>>>
>>> A VTK data set is always considered to be made of these:
>>>
>>> 1) Geometry (points (or vertices/nodes), and connectivity between points)
>>> 2) Attribute arrays (colors, scalars, etc. to associate with points,
>>> edges, faces, etc).
>>>
>>> The GetEdgeData() and GetVertexData() method are for dealing with
>>> attributes.  But from your question, it sounds like your main concern is
>>> loading the geometry.  In other words, first you have to set the geometry
>>> (the vertices, edges, and perhaps the points).  Only after that is done
>>> should you worry about setting the attributes to go along with them.
>>>
>>> Unfortunately, I really don't know anything specific about dealing with
>>> graphs in VTK, all I know is how VTK deals with data generically.
>>>
>>>  - David
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150813/c44c4c9f/attachment.html>


More information about the vtk-developers mailing list