Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
This is the main class for the Hierarchical Layout algorithm. More...
#include <ilviews/layout/hierarchical.h>
Public Member Functions | |
IlvHierarchicalLayout () | |
Creates a new instance of the Hierarchical Layout algorithm. More... | |
virtual | ~IlvHierarchicalLayout () |
Destroys this instance of class IlvHierarchicalLayout . More... | |
virtual void | cleanObjectProperties (IlAny nodeOrLink) |
Overridden version of the method cleanObjectProperties . More... | |
virtual void | detach () |
Detaches the graph model from the layout instance. More... | |
IlInt | getCalcNodeLevelIndex (IlAny node) const |
Returns the calculated level index of a node after performing a layout. More... | |
IlInt | getCalcNodePositionIndex (IlAny node) const |
Returns the calculated index of the node position within a level after performing a layout. More... | |
IlvLayoutConnectorStyle | getConnectorStyle () const |
Returns the current option for the style of the connectors. More... | |
IlvDirection | getFlowDirection () const |
Returns the current direction of the link flow. More... | |
IlvLayoutLinkStyle | getGlobalLinkStyle () const |
Returns the current option for the global style of the shapes of links. More... | |
IlvPos | getHorizontalLinkOffset () const |
Returns the horizontal offset between parallel segments of links. More... | |
IlvPos | getHorizontalNodeLinkOffset () const |
Returns the horizontal offset between a node and a link segment that is parallel to the node border. More... | |
IlvPos | getHorizontalNodeOffset () const |
Returns the horizontal offset between nodes. More... | |
IlvDirection | getLevelJustification () const |
Returns the current justification within the levels. More... | |
IlDouble | getLinkPriority (IlAny link) const |
Returns the priority of a link. More... | |
IlvLayoutLinkStyle | getLinkStyle (IlAny link) const |
Returns the current option for the style of the shape of an individual link. More... | |
IlInt | getSpecNodeLevelIndex (IlAny node) const |
Returns the index of the specified level for a node. More... | |
IlInt | getSpecNodePositionIndex (IlAny node) const |
Returns the index of the specified position of a node within a level. More... | |
IlvPos | getVerticalLinkOffset () const |
Returns the vertical offset between parallel segments of links. More... | |
IlvPos | getVerticalNodeLinkOffset () const |
Returns the vertical offset between a node and a link segment that is parallel to the node border. More... | |
IlvPos | getVerticalNodeOffset () const |
Returns the vertical offset between nodes. More... | |
void | setConnectorStyle (IlvLayoutConnectorStyle style) |
Sets the option for the style of connectors. More... | |
void | setFlowDirection (IlvDirection flowDirection) |
Sets the option for direction of the link flow. More... | |
void | setGlobalLinkStyle (IlvLayoutLinkStyle style) |
Sets the option for the global style of the shapes of links. More... | |
void | setHorizontalLinkOffset (IlvPos offset) |
Sets the horizontal offset between parallel segments of links. More... | |
void | setHorizontalNodeLinkOffset (IlvPos offset) |
Sets the horizontal offset between a node and a link segment that is parallel to the node border. More... | |
void | setHorizontalNodeOffset (IlvPos offset) |
Sets the horizontal offset between nodes. More... | |
void | setLevelJustification (IlvDirection justification) |
Sets the option for the justification within the levels. More... | |
void | setLinkPriority (IlAny link, IlDouble priority) |
Sets the priority of a link. More... | |
void | setLinkStyle (IlAny link, IlvLayoutLinkStyle style) |
Sets the option for the style of the shape of an individual link. More... | |
void | setSpecNodeLevelIndex (IlAny node, IlInt index) |
Sets the index of the specified level for a node. More... | |
void | setSpecNodePositionIndex (IlAny node, IlInt index) |
Sets the index of the specified position of a node within a level. More... | |
void | setVerticalLinkOffset (IlvPos offset) |
Sets the vertical offset between parallel segments of links. More... | |
void | setVerticalNodeLinkOffset (IlvPos offset) |
Sets the vertical offset between a node and a link segment that is parallel to the node border. More... | |
void | setVerticalNodeOffset (IlvPos offset) |
Sets the vertical offset between nodes. More... | |
virtual IlBoolean | supportsAllowedTime () const |
Indicates that this layout class can stop the layout computation in a proper manner when the user-defined allowed time is exceeded. More... | |
virtual IlBoolean | supportsPreserveFixedLinks () const |
Indicates that this layout class allows the user to specify fixed links. More... | |
virtual IlBoolean | supportsPreserveFixedNodes () const |
Indicates that this layout class allows the user to specify fixed nodes. More... | |
Public Member Functions inherited from IlvGraphLayout | |
IlvGraphLayout () | |
Constructor. | |
virtual void | attach (IlvGrapher *grapher) |
Allows you to specify the grapher you want to lay out. More... | |
virtual void | attach (IlvGraphModel *graphModel) |
Allows you to specify the graph model you want to lay out. More... | |
virtual IlvRunTimeType | getAllowedTime () const |
Returns the currently allowed time for the layout algorithm in milliseconds. More... | |
IlvMgrView * | getFirstManagerView () const |
Returns the first manager view attached to the graph model if any, and 0 otherwise. | |
IlvGrapher * | getGrapher () const |
Returns the grapher to lay out. More... | |
IlvGraphModel * | getGraphModel () const |
Returns the graph model to lay out if a graph model is attached. More... | |
IlUInt | getInstanceId () const |
A utility method that returns a unique integer value for each layout instance inside the same program. | |
void | getLayoutRegion (IlvRect &rect) const |
Updates the rectangle rect passed as argument with the region that the drawing of the graph model must fit (exactly or approximately). More... | |
IlvGraphLayoutReport * | getLayoutReport () const |
Returns the layout report, that is, an object containing information about the behavior of the layout algorithm for the previous run of layout. More... | |
virtual IlUShort | getSeedValueForRandomGenerator () |
Returns the user-defined seed value for the random generator. More... | |
IlBoolean | isAnimate () const |
Returns IlTrue if the layout can perform a redraw of the graph model after each iteration or step of the layout algorithm. More... | |
IlBoolean | isFitToView () const |
Returns IlTrue if the size of the graph drawing must fit (exactly or approximately) the size of a given manager view. More... | |
IlBoolean | isFixed (IlAny nodeOrLink) const |
Returns IlTrue if the node or link nodeOrLink is specified as fixed. More... | |
IlBoolean | isGeometryUpToDate () const |
Returns IlFalse if at least one node or link was moved or reshaped since the last time the layout was successfully performed on the same graph model or if the layout has never been performed successfully on the same graph model. More... | |
IlBoolean | isIlvGrapherAttached () const |
Convenience method. More... | |
IlBoolean | isLayoutRunning () const |
Specifies whether the layout algorithm is running. More... | |
virtual IlBoolean | isLayoutTimeElapsed () const |
Returns IlTrue if, at the moment the method is called, the allowed layout time is exceeded; returns IlFalse otherwise. More... | |
IlBoolean | isLinkConnectorReplacementAllowed () const |
Returns IlTrue if the replacement of the link connectors is allowed. More... | |
virtual IlBoolean | isLinkReplacementAllowed () const |
Returns IlTrue if the replacement of the links is allowed. More... | |
virtual IlBoolean | isMemorySavings () const |
Returns the current setting specifying whether priority is given to speed or memory usage. | |
virtual IlBoolean | isParametersUpToDate () const |
Returns IlFalse if at least one parameter was modified since the last time the layout was successfully performed on the same graph or if the layout has never been performed successfully on the same graph. More... | |
virtual IlBoolean | isPreserveFixedLinks () const |
Returns IlTrue if the layout is not allowed to reshape the links indicated as fixed by the user. More... | |
virtual IlBoolean | isPreserveFixedNodes () const |
Returns IlTrue if the layout is not allowed to move the nodes indicated as fixed by the user. More... | |
IlBoolean | isStructureUpToDate () const |
Indicates whether the graph model structure has been modified since the last layout was performed. More... | |
virtual IlBoolean | isUseDefaultParameters () const |
Returns the current options for the parameters. More... | |
virtual IlBoolean | isUseSeedValueForRandomGenerator () |
Returns IlTrue if the user-defined seed value is used for the random generator and IlFalse otherwise. More... | |
void | layoutRunning (IlBoolean) |
Updates the field _isLayoutRunning . | |
virtual void | layoutStepPerformed () |
This method can be called by the layout classes when a step (or iteration) of the layout algorithm has been performed. More... | |
IlvGraphLayoutReport * | performLayout () |
Starts the layout algorithm using the currently attached graph model and the current settings for the layout parameters. More... | |
void | setAllowedTime (IlvRunTimeType time) |
Allows you to specify an upper bound for the duration of the layout algorithm. More... | |
void | setAnimate (IlBoolean arg) |
If arg is IlTrue , all manager views attached to the graph model are redrawn after each iteration or step of the layout algorithm. More... | |
virtual void | setFixed (IlAny nodeOrLink, IlBoolean val) |
Allows you to specify whether a node or a link is fixed. More... | |
void | setGeometryUpToDate (IlBoolean) |
If the argument is IlFalse , notifies the layout instance that the geometry of the graph was changed since the last time the layout was successfully performed. More... | |
void | setGrapher (IlvGrapher *grapher) |
Allows you to specify the grapher you want to lay out. More... | |
void | setLayoutRegion (IlvMgrView *view) |
Allows you to specify that the size of the graph drawing must fit (exactly or approximately) the size of a given manager view. More... | |
void | setLayoutRegion (IlvMgrView *view, const IlvRect &rect) |
Allows you to specify a region (the rectangle rect) that the layout must fit (exactly or approximately) with the dimensions of the rectangle rect being given in the manager view coordinates. More... | |
void | setLayoutRegion (const IlvRect &rect) |
Allows you to specify a rectangle that the layout must fit (exactly or approximately). More... | |
void | setLinkConnectorReplacementAllowed (IlBoolean allow) |
Enables or disables the link connector replacement. More... | |
virtual void | setLinkReplacementAllowed (IlBoolean) |
Enables or disables the link replacement. More... | |
virtual void | setMemorySavings (IlBoolean arg) |
If arg is IlTrue , the layout algorithm uses the implementation that consumes less memory. More... | |
void | setParametersUpToDate (IlBoolean) |
If the argument is IlFalse , notifies the layout instance that a parameter value was changed. More... | |
virtual void | setPreserveFixedLinks (IlBoolean arg) |
If arg is IlTrue , the layout is not allowed to reshape the links indicated as fixed by the user. More... | |
virtual void | setPreserveFixedNodes (IlBoolean arg) |
If the argument is IlTrue , the layout is not allowed to move the nodes indicated as fixed by the user. More... | |
virtual void | setSeedValueForRandomGenerator (IlUShort seedValue) |
Allows you to specify a seed value for the random generator. More... | |
void | setStructureUpToDate (IlBoolean) |
If the argument is IlFalse , notifies the layout instance that the structure of the graph was changed since the last time the layout was successfully performed. More... | |
virtual void | setUseDefaultParameters (IlBoolean arg) |
If the argument is IlTrue , the layout uses the default values of all the parameters, that is, the "get..." and "is..." methods return the default values. More... | |
virtual void | setUseSeedValueForRandomGenerator (IlBoolean) |
Allows you to specify whether the user-defined seed value should be used for the random generator. More... | |
virtual IlBoolean | supportsAnimation () const |
Indicates whether the layout class performs a redraw of the graph model after each step or iteration. More... | |
virtual IlBoolean | supportsLayoutRegion () const |
Indicates whether the layout class can control the size of the graph drawing to fit (exactly or approximately) a user-defined region (a rectangle) or a user-defined manager view. More... | |
virtual IlBoolean | supportsMemorySavings () const |
Indicates whether the layout class can perform the layout using two partially different implementations. More... | |
virtual IlBoolean | supportsRandomGenerator () const |
Indicates whether the layout class uses randomly-generated numbers (or randomly-chosen parameters) for which it can accept a user-defined seed value. More... | |
void | unfixAllLinks () |
Removes the fixed attributes from all links in the graph model. More... | |
void | unfixAllNodes () |
Removes the fixed attribute from all nodes in the graph model. More... | |
Protected Member Functions | |
virtual void | layout () |
Computes the layout using the Hierarchical Layout algorithm. More... | |
Protected Member Functions inherited from IlvGraphLayout | |
virtual IlvGraphLayoutReport * | createLayoutReport () |
Returns a new instance of the layout report. More... | |
virtual IlBoolean | isLayoutNeeded () const |
Verifies that it is necessary to perform the layout. More... | |
This is the main class for the Hierarchical Layout algorithm.
Library: ilvhierarchical
The Hierarchical Layout arranges the nodes in horizontal or vertical levels, such that the majority of the links point in the same direction and the number of link crossings is small.
A sample drawing produced by the Hierarchical Layout algorithm, with two levels of nodes that are top justified within each level:
Another sample drawing with eight levels. This graph contains a cycle and a self-loop. The direction of the flow is from top to bottom. The nodes are organized in horizontal levels.
The Hierarchical Layout algorithm supports different styles of links in the same drawing. The following sample drawing shows orthogonal, straight, and polyline links: The direction of the flow is to the right, and the node levels are vertical.
See the corresponding chapter of the User's Manual for details on the algorithm, the types of graphs for which this algorithm can be used, the features and limitations, code samples, and so on.
Note the following points:
IlvHierarchicalLayout::IlvHierarchicalLayout | ( | ) |
Creates a new instance of the Hierarchical Layout algorithm.
To indicate the grapher you want to lay out, use the method attach(IlvGrapher*)
.
To indicate the graph model you want to lay out, use the method attach(IlvGraphModel*)
.
To perform the layout, use the method performLayout()
.
To modify the layout parameters, use the different methods provided in this class and its superclass.
|
virtual |
Destroys this instance of class IlvHierarchicalLayout
.
If necessary, it detaches this instance from the graph model or the grapher, respectively, before destroying this layout instance.
|
virtual |
Overridden version of the method cleanObjectProperties
.
Reimplemented from IlvGraphLayout.
|
virtual |
Detaches the graph model from the layout instance.
When you attach a new graph model to the layout instance, it is not necessary to detach the old graph model because this is done automatically when you call attach
. The detach
method performs cleaning operations on the graph model or the grapher. Additional to the cleaning operations in the base class, Hierarchical Layout removes the layout specification per node and link as well as the calculated level index and calculated position index from the nodes.
Reimplemented from IlvGraphLayout.
Returns the calculated level index of a node after performing a layout.
If there was no call of performLayout
before, it returns -1. Nodes are organized in horizontal or vertical levels numbered from 0 to "n". If the link flow direction is from top to bottom, the nodes with level index 0 are placed in the top-most level, and the nodes with higher level indices are placed in the levels below. If the link flow direction is from left to right, the nodes with level index 0 are placed in the left-most level, and the nodes with higher level indices are placed in the levels more to the right.
Note the difference between calculated and specified level index: The layout algorithm assigns level indices to all nodes, even if no level index is specified. Therefore, the method getSpecNodeLevelIndex
returns -1 for nodes that have no level index specified, but the method getCalcNodeLevelIndex
returns a non-negative number, that is, the real index of the level after layout.
node | A node of the attached grapher or graph model. |
Returns the calculated index of the node position within a level after performing a layout.
If there was no call of performLayout
before, it returns -1. Nodes are organized in horizontal or vertical levels. Within each level, the nodes are placed sequentially at relative positions numbered from 0 to "n". If the link flow direction is from top to bottom, the node with position index 0 is placed left-most within its level, and the nodes with higher position indices are placed more to the right. If the link flow direction is from left to right, the node with position index 0 is placed top-most within its level, and the nodes with higher position indices are placed below.
Note the difference between calculated and specified position index: The layout algorithm assigns position indices to all nodes, even if no position index is specified. Therefore, the method getSpecNodePositionIndex
returns -1 for nodes that have no position index specified, but the method getCalcNodePositionIndex
returns a non-negative number, that is, the real index of the position within its level after layout.
node | A node of the attached grapher or graph model. |
IlvLayoutConnectorStyle IlvHierarchicalLayout::getConnectorStyle | ( | ) | const |
Returns the current option for the style of the connectors.
IlvDirection IlvHierarchicalLayout::getFlowDirection | ( | ) | const |
Returns the current direction of the link flow.
IlvLayoutLinkStyle IlvHierarchicalLayout::getGlobalLinkStyle | ( | ) | const |
Returns the current option for the global style of the shapes of links.
IlvPos IlvHierarchicalLayout::getHorizontalLinkOffset | ( | ) | const |
Returns the horizontal offset between parallel segments of links.
IlvPos IlvHierarchicalLayout::getHorizontalNodeLinkOffset | ( | ) | const |
Returns the horizontal offset between a node and a link segment that is parallel to the node border.
IlvPos IlvHierarchicalLayout::getHorizontalNodeOffset | ( | ) | const |
Returns the horizontal offset between nodes.
IlvDirection IlvHierarchicalLayout::getLevelJustification | ( | ) | const |
Returns the current justification within the levels.
Returns the priority of a link.
link | A link of the attached grapher or graph model. |
IlvLayoutLinkStyle IlvHierarchicalLayout::getLinkStyle | ( | IlAny | link | ) | const |
Returns the current option for the style of the shape of an individual link.
link | A link of the attached grapher or graph model. |
Returns the index of the specified level for a node.
If no level index is specified for the node, it returns a negative number.
node | A node of the attached grapher or graph model. |
Returns the index of the specified position of a node within a level.
If no position index is specified for the node, it returns a negative number.
node | A node of the attached grapher or graph model. |
IlvPos IlvHierarchicalLayout::getVerticalLinkOffset | ( | ) | const |
Returns the vertical offset between parallel segments of links.
IlvPos IlvHierarchicalLayout::getVerticalNodeLinkOffset | ( | ) | const |
Returns the vertical offset between a node and a link segment that is parallel to the node border.
IlvPos IlvHierarchicalLayout::getVerticalNodeOffset | ( | ) | const |
Returns the vertical offset between nodes.
|
protectedvirtual |
Computes the layout using the Hierarchical Layout algorithm.
To start the layout, call the method performLayout
.
Implements IlvGraphLayout.
void IlvHierarchicalLayout::setConnectorStyle | ( | IlvLayoutConnectorStyle | style | ) |
Sets the option for the style of connectors.
Valid values are:
IlvLayoutCenteredPins
- the link connector pins are placed in the center of the border the link is attached to. IlvLayoutClippedPins
- each link pointing to the center of the node is clipped at the node border. IlvLayoutEvenlySpacedPins
- the link connector pins are evenly spaced along the node border. IlvLayoutAutomaticPins
- the connector style is selected depending on the link style. The default value is IlvLayoutAutomaticPins
.
Note that, when the graph attached to the layout is of type IlvGrapher
, the connector style only has an effect if a pin is installed at the nodes.
If the method isLinkReplacementAllowed
returns IlTrue
, the layout algorithm calls the method ensureReshapeableLinks
to ensure that the connector pins of all the links can be repositioned. It installs a subclass of IlvGrapherPin
at the nodes.
style | The style of the placement of connector pins for links. |
void IlvHierarchicalLayout::setFlowDirection | ( | IlvDirection | flowDirection | ) |
Sets the option for direction of the link flow.
Valid values are:
IlvRight
- the majority of the links flow to the right. IlvLeft
- the majority of the links flow to the left. IlvBottom
- the majority of the links flow to the bottom. IlvTop
- the majority of the links flow to the top. This method sets the direction of the flow for the majority of the links in a directed graph. The layout algorithm may need to direct some links in the opposite direction of the general link flow. If the links flow to the left or right, the nodes are placed in vertical levels. If the links flow to the top or bottom, the nodes are placed in horizontal levels.
The default value is IlvRight
.
flowDirection | The direction the majority of the links flow into. |
void IlvHierarchicalLayout::setGlobalLinkStyle | ( | IlvLayoutLinkStyle | style | ) |
Sets the option for the global style of the shapes of links.
Valid values are:
IlvLayoutPolylineLinkStyle
- all links get a polyline shape, that is, a shape consisting of a sequence of line segments. IlvLayoutOrthogonalLinkStyle
- all links get an orthogonal shape, that is, a shape consisting of a sequence of orthogonal line segments. IlvLayoutStraightLineLinkStyle
- all links get a straight-line shape. IlvLayoutNoReshapeLinkStyle
- no reshape is performed on any link. IlvLayoutMixedLinkStyle
- each link can have a different link style. In this case, the style of each individual link can be set by the method setLinkStyle(IlAny, IlvLayoutLinkStyle)
, such that different link shapes can occur in the same graph. This feature can be useful if the graph contains links that can have intermediate points and are not straight-line links, for instance links of type IlvPolylineLinkImage
. Unless the global link style is IlvLayoutMixedLinkStyle
, all links have the same style of shape.
The default value is IlvLayoutPolylineLinkStyle
.
Note that, when the graph attached to the layout is of type IlvGrapher
, the effect of the link reshaping depends on the type of link. For the following link types, the reshaping has no effect:
If the method isLinkReplacementAllowed
returns IlTrue
, the layout algorithm calls the method ensureReshapeableLinks
to ensure that all the links can be reshaped. It replaces the non-reshapeable links by links of type IlvPolylineLinkImage
.
style | The global style of the shape of all links. |
void IlvHierarchicalLayout::setHorizontalLinkOffset | ( | IlvPos | offset | ) |
Sets the horizontal offset between parallel segments of links.
In the orthogonal link style, the segments attached directly to the node may have a smaller offset if the node is too small or the number of incident links is too large to satisfy the specified offset.
The default value is 15
.
offset | The horizontal offset between links. |
void IlvHierarchicalLayout::setHorizontalNodeLinkOffset | ( | IlvPos | offset | ) |
Sets the horizontal offset between a node and a link segment that is parallel to the node border.
The default value is 20
.
offset | The horizontal offset between a node and a link. |
void IlvHierarchicalLayout::setHorizontalNodeOffset | ( | IlvPos | offset | ) |
Sets the horizontal offset between nodes.
If the levels are horizontal, this is the minimum distance between the nodes of the same level. If the levels are vertical, this is the minimum distance between the nodes of different levels.
The default value is 40
.
offset | The horizontal offset between nodes. |
void IlvHierarchicalLayout::setLevelJustification | ( | IlvDirection | justification | ) |
Sets the option for the justification within the levels.
Valid values are:
IlvCenter
IlvLeft
IlvRight
IlvTop
IlvBottom
This method sets the justification of the nodes within each level. If the nodes are center justified, all nodes of the same level are placed with their centers along a line. Otherwise, all nodes of the same level are placed with the specified border justified to a line. If the link flow direction is to the left or right, the nodes can be justified to the left, center, or right. If the link flow direction is to the top or bottom, the nodes can be justified to the top, center, or bottom.
The default value is CENTER
.
justification | The justification of the nodes within each level. |
Sets the priority of a link.
The layout algorithm tries to place the links in a way such that the majority of the links are short and point in the same direction. However, this is not always possible for all links. Low priority links are more likely to be longer or point in the opposite direction than the high priority links.
link | A link of the attached grapher or graph model. |
priority | The priority of this link. |
void IlvHierarchicalLayout::setLinkStyle | ( | IlAny | link, |
IlvLayoutLinkStyle | style | ||
) |
Sets the option for the style of the shape of an individual link.
This link style is only used if the global link style is set to IlvLayoutMixedLinkStyle
. Otherwise, all links have the style that is specified as the global link style.
Valid values are:
IlvLayoutPolylineLinkStyle
- the link gets a polyline shape, that is, a shape consisting of a sequence of line segments. IlvLayoutOrthogonalLinkStyle
- the link gets an orthogonal shape, that is, a shape consisting of a sequence of orthogonal line segments. IlvLayoutStraightLineLinkStyle
- the link gets a straight-line shape. IlvLayoutNoReshapeLinkStyle
- no reshape is performed on the link. This feature can be useful if the link can have intermediate points and is not a straight-line link, for instance a link of type IlvPolylineLinkImage
.
The default value is IlvLayoutPolylineLinkStyle
.
Note that, when the graph attached to the layout is of type IlvGrapher
, the effect of the link reshaping depends on the type of link. For the following link types, the reshaping has no effect:
If the method isLinkReplacementAllowed
returns IlTrue
, the layout algorithm calls the method ensureReshapeableLinks
to ensure that all the links can be reshaped. It replaces the non-reshapeable links by links of type IlvPolylineLinkImage
.
link | A link of the attached grapher or graph model. |
style | The style of the shape of this link. |
Sets the index of the specified level for a node.
Nodes are organized in horizontal or vertical levels numbered from 0 to "n". If the link flow direction is from top to bottom, the nodes with level index 0 are placed in the top-most level, and the nodes with higher level indices are placed in the levels below. If the link flow direction is from left to right, the nodes with level index 0 are placed in the left-most level, and the nodes with higher level indices are placed in the levels more to the right.
This method allows you to specify the level where a node should be placed. If the level index of a node is set to a negative value, it means that there is no preference for the level of the node. In this case, the layout algorithm calculates an appropriate level index.
The default level index of a node is -1, that is, the layout algorithm determines the appropriate level automatically.
node | A node of the attached grapher or graph model. |
index | The level index desired for this node. |
Sets the index of the specified position of a node within a level.
Nodes are organized in horizontal or vertical levels. Within each level, the nodes are placed sequentially at relative positions numbered from 0 to "n". If the link flow direction is from top to bottom, the node with position index 0 is placed left-most within its level, and the nodes with higher position indices are placed more to the right. If the link flow direction is from left to right, the node with position index 0 is placed top-most within its level, and the nodes with higher position indices are placed below.
This method allows you to specify the relative position where a node should be placed within its level. If the position index of a node is set to a negative value, it means that there is no preference for the position of the node. In this case, the layout algorithm calculates an appropriate position index. If the position index is higher than the number of nodes in the level, the position index is ignored. If two nodes of the same level have the same position index, one of the indices is ignored. The layout algorithm calculates an appropriate position index for the nodes that have inappropriate or conflicting position indices.
The default position index of a node is -1, that is, the layout algorithm determines the appropriate position automatically.
node | A node of the attached grapher or graph model. |
index | The position index desired for this node. |
void IlvHierarchicalLayout::setVerticalLinkOffset | ( | IlvPos | offset | ) |
Sets the vertical offset between parallel segments of links.
In the orthogonal link style, the segments attached directly to the node may have a smaller offset if the node is too small or the number of incident links is too large to satisfy the specified offset.
The default value is 15
.
offset | The vertical offset between links. |
void IlvHierarchicalLayout::setVerticalNodeLinkOffset | ( | IlvPos | offset | ) |
Sets the vertical offset between a node and a link segment that is parallel to the node border.
The default value is 20
.
offset | The vertical offset between a node and a link. |
void IlvHierarchicalLayout::setVerticalNodeOffset | ( | IlvPos | offset | ) |
Sets the vertical offset between nodes.
If the levels are vertical, this is the minimum distance between the nodes of the same level. If the levels are horizontal, this is the minimum distance between the nodes of different levels.
The default value is 40
.
offset | The vertical offset between nodes. |
|
virtual |
Indicates that this layout class can stop the layout computation in a proper manner when the user-defined allowed time is exceeded.
If the allowed time elapses before termination of the Hierarchical Layout algorithm, the nodes and links are not moved and remain at the same position as before the start of the algorithm.
IlTrue
. Reimplemented from IlvGraphLayout.
|
virtual |
Indicates that this layout class allows the user to specify fixed links.
Fixed links are not reshaped during the layout if IlTrue
is passed as the argument to the method setPreserveFixedLinks(IlBoolean)
.
IlTrue
. Reimplemented from IlvGraphLayout.
|
virtual |
Indicates that this layout class allows the user to specify fixed nodes.
Fixed nodes are not moved during the layout if IlTrue
is passed as the argument to the method setPreserveFixedNodes(IlBoolean)
. Links that are incident to fixed nodes are not reshaped during the layout. Fixed nodes are ignored by the Hierarchical Layout algorithm, which may lead to node overlapping.
IlTrue
. Reimplemented from IlvGraphLayout.
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.