[vtkusers] Infovis: Changing layout strategy parameters

Jeff Baumes jeff.baumes at kitware.com
Thu Dec 18 12:30:58 EST 2008


vtkGraphLayout has the following check before "starting over"

  if (this->StrategyChanged ||
      input != this->LastInput ||
      input->GetMTime() > this->LastInputMTime)

It will start from randomly jittered positions from the input (in your
case the input to vtkGraphLayout probably has all vertex locations at
the origin) if this test passes. Otherwise it will use the current
positions in the *output*, without jittering them. So if you want to
totally start over, you can call Modified() on layout->GetInput().

Jeff

On Thu, Dec 18, 2008 at 11:42 AM, Eric E. Monson <emonson at cs.duke.edu> wrote:
> Hey Jeff,
>
> When I call Modified() on the GraphLayout and update the pipeline it
> continues from where it was in the layout process, just with more
> iterations. If I also call Initialize() for the LayoutStrategy it resets to
> the initial temp and decay, but still starts with the current positions of
> the vertices, which is what I wanted -- thanks for getting me on the right
> track!
>
> How does the LayoutStrategy (in these density grid based schemes) decide
> whether to start with random points or not? Will it detect whether the graph
> has non-zero coordinates assigned already, or is there some flag that can be
> set?
>
> Thanks,
> -Eric
>
>
> On Dec 18, 2008, at 9:48 AM, Jeff Baumes wrote:
>
>>> Why do the docs say "The strong recommendation is that you do not change
>>> this parameter" for things like initial temperature and cool down rate on
>>> layout strategies like Fast2D?
>>
>> You certainly may play around with these parameters. Those values were
>> just found to be "good" in practice, where the layout is part of an
>> interactive application and you want the layout to complete relatively
>> quickly.
>>
>>> Instead of changing these parameters, is there a way to tell the layout
>>> strategy to give the graph another "kick" from the current state (rather
>>> than from the initial random layout) once it thinks the layout is
>>> complete?
>>
>> Try this: call Modified() on the vtkGraphLayout instance, then update
>> the pipeline again. It should not start from scratch, but should
>> instead start with the current positions of the graph.
>>
>> Jeff
>
>



-- 
Jeff Baumes, Ph.D.
R&D Engineer, Kitware Inc.
(518) 371-3971 x132
jeff.baumes at kitware.com



More information about the vtkusers mailing list