[vtkusers] Questions about vtkGraphLayoutView

Jeff Baumes jeff.baumes at kitware.com
Thu Jun 28 13:09:40 EDT 2012


Endre,

On Thu, Jun 28, 2012 at 8:28 AM, emlidal <emlidal at broadpark.no> wrote:

> 1. Is it possible to use my own "glyph" for the graph nodes? Today I'm
> using
> my own vtkRenderedGraphRepresentation and there I set the glyph type (using
> SetGlyphType(...)), in my case I use glyph type 2. However, what really I
> want is to be able to specify my own glyph type, in my case an shrunken
> image of the image stored at each graph node. Is this possible, and if so
> any hints of how do I go about to accomplish this?
>

This is not directly supported. One approach would be to look into
vtkRenderedGraphRepresentation and replace the glyph filter with your own
filter that will produce a textured image at each desired location.

2. Is it possible to specify uneven distance between the nodes in the graph
> layout? Say for instance that my tree has only two branches and one branch
> as double the amount of nodes than the other branch, something like this:
>       O
>      / \
>     O  O
>     |   |
>     O  O
>     |
>     O
>     |
>     O
>
> Is it possible to render the graph so that the leaf nodes of the two
> branches are on the same "depth-level"? Something like this:
>       O
>      / \
>     O  O
>     |   |
>     O  |
>     |   |
>     O  |
>     |   |
>     O  O
>

The tree layout does not support this. You are free to run
vtkTreeLayoutStrategy manually, get the output, and tweak the positions, or
create a subclass of vtkTreeLayoutStrategy that performs how you want it
to. If you run the graph layout yourself, make sure to set the layout
strategy to PassThrough on the representation, which will not run any
additional layout.

3. The interaction/selection style I'm using is based on
> vtkInteractorStyleRubberBand2D and this is nice for making a rectangular
> selection in the graph. However, I want to make a freeform lasso selection,
> i.e., draw a closed curve around the nodes I want to select (and, thus, not
> be limited to rectangular selection only). Is there a lasso
> interaction/selection style I have missed or are there any examples of how
> to implement this myself?
>

I am not aware of lasso selection implemented in VTK.

Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120628/5e125f17/attachment.htm>


More information about the vtkusers mailing list