Graph Layout > Basic Concepts > Layout Parameters in IlvGraphLayout > Preserve Fixed Nodes
 
Preserve Fixed Nodes
At times, you may want some nodes of the graph to be “pinned” (that is, to stay in their current position when the layout is performed). You need a way to indicate the nodes that the layout algorithm cannot move. This makes sense especially when using a Semi-automatic layout (the method where the user fine tunes the layout by hand after the layout is completed) or when using an Incremental layout (the method where the graph and/or the position of the nodes is modified after the layout has been performed and then the layout is performed again).
Rogue Wave Views allows you to specify that a node is fixed using the method:
void IlvGraphLayout::setFixed(IlAny node, IlBoolean fixed)
If fixed is IlTrue, it means that the node is fixed. To obtain the current setting for a node:
IlBoolean IlvGraphLayout::isFixed(IlAny node) const
The default value is IlFalse.
To remove the fixed attribute from all nodes in the grapher, use the method:
void IlvGraphLayout::unfixAllNodes()
Note: The fixed attributes you may have set will be taken into consideration only if you call the method void IlvGraphLayout::setPreserveFixedNodes(IlBoolean option) with an IlTrue argument.
You can read the current option using the method:
IlBoolean IlvGraphLayout::isPreserveFixedNodes() const
To indicate whether a subclass of IlvGraphLayout supports this mechanism, the following method is provided:
IlBoolean supportsPreserveFixedNodes() const
The default implementation returns IlFalse. A subclass can override this method in order to return IlTrue to indicate that this mechanism is supported.

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.