Graph Layout > Layout Algorithms > Random Layout > Parameters
 
Parameters
The Random Layout uses generic parameters, common to other graph layouts, and specific parameters applicable in random layouts only. Refer to the following sections for general information on parameters among the graph layouts:
*Generic Parameters Support
*Layout Characteristics
The Random Layout parameters are described in detail in this topic under:
*Generic Parameters
*Specific Parameters
Generic Parameters
The IlvRandomLayout class supports generic parameters defined in the IlvGraphLayout class. The following comments describe the particular way in which these parameters are used by this subclass:
*Layout Region
*Preserve Fixed Links
*Preserve Fixed Nodes
*Random Generator Seed Value
Layout Region
The layout algorithm uses the layout region setting (either your own or the default setting) to control the size and the position of the graph drawing. All three ways to specify the layout region are available for this subclass. (For a description of this parameter in the IlvGraphLayout class, see Layout Region.)
Remember that if you are using the default settings, there must be a view (an instance of IlvView) attached to the grapher. If no view is attached, and no layout region is explicitly specified, the layout algorithm cannot produce reasonable results.
If a layout region is specified, this region is used. If no layout region is specified but a view is attached, the size and position of the graph drawing is computed to approximately fill the view.
Preserve Fixed Links
The layout algorithm does not reshape the links that are specified as fixed. (For more information on link parameters in the IlvGraphLayout class, see Preserve Fixed Links.)
Preserve Fixed Nodes
The layout algorithm does not move the nodes that are specified as fixed. (For more information on node parameters in the IlvGraphLayout class, see Preserve Fixed Nodes.)
Random Generator Seed Value
The Random Layout uses a random number generator to compute the coordinates. You can specify a particular value to be used as a seed value. (For more information on this parameter in the IlvGraphLayout class, see Random Generator Seed Value.) For the default behavior, the random generator is initialized using the current system clock. Therefore, different layouts are obtained if you perform the layout repeatedly on the same graph.
Specific Parameters
Information on the Link Style parameter specific to the IlvRandomLayout class is as follows.
Link Style
When the layout algorithm moves the nodes, straight-line links, such as instances of IlvLinkImage, will automatically “follow” the new positions of their end nodes. If the grapher contains other types of links (for example, IlvPolylineLinkImage or IlvSplineLinkImage), the shape of the link may not be appropriate because the intermediate points of the link will not be moved. In this case, you can ask the layout algorithm to automatically remove all the intermediate points of the links (if any). To do this, the following method is provided:
void setLinkStyle(IlvLayoutLinkStyle style);
The valid values are:
*IlvLayoutNoReshapeLinkStyle
None of the links is reshaped in any manner.
*IlvLayoutStraightLineLinkStyle
All the intermediate points of the links (if any) are removed. This is the default value.
Note: If the IlvLayoutStraightLineLinkStyle style is selected, the layout algorithm calls the method ensureStraightLineLinks() on the attached graph model to ensure that all the links can have a straight-line shape. With an IlvGrapher, this method may replace links with new type of links. For details on this method, see the Reference Manual. For details on the graph model, see the section Using the Graph Model.
To obtain the current choice, use the following method:
IlvLayoutLinkStyle getLinkStyle() const;

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