Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
The main class for the Random Layout algorithm. More...
#include <ilviews/layout/random.h>
Public Member Functions | |
IlvRandomLayout () | |
Creates a new instance of the Random Layout algorithm. | |
IlvLayoutLinkStyle | getLinkStyle () const |
Returns the current option for the style of the shape of the links. | |
void | setLinkStyle (IlvLayoutLinkStyle linkStyle) |
Sets the option for the style of the shape of the links. | |
IlBoolean | supportsLayoutRegion () const |
Indicates that this layout class can control the size of the drawing of the grapher to fit (exactly or approximately) a user-defined region (a rectangle) or a user-defined manager view. | |
IlBoolean | supportsPreserveFixedNodes () const |
Indicates that this layout class allows the user to specify fixed nodes. | |
IlBoolean | supportsRandomGenerator () const |
Indicates that this layout class uses randomly-generated numbers that can be initialized with a user-defined seed value. | |
Protected Member Functions | |
void | layout () |
Computes the layout using the Random Layout algorithm. |
The main class for the Random Layout algorithm.
Library: ilvrandom
This is the simplest layout algorithm. The nodes are moved at randomly-computed positions inside a user-defined region.
Sample drawing produced by the Random Layout algorithm:
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 that the initial position of the nodes (at the moment you start the layout) does not affect the resulting layout. However, nodes specified as fixed are not moved if you call the method setPreserveFixedNodes(IlBoolean)
with an IlTrue
argument.
Note the following points:
setPreserveFixedNodes(IlBoolean)
with an IlTrue
argument. IlvRandomLayout::IlvRandomLayout | ( | ) |
Creates a new instance of the Random 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.
IlvLayoutLinkStyle IlvRandomLayout::getLinkStyle | ( | ) | const |
Returns the current option for the style of the shape of the links.
void IlvRandomLayout::layout | ( | ) | [protected, virtual] |
Computes the layout using the Random Layout algorithm.
To start the layout, call the IlvGraphLayout::performLayout
method.
Implements IlvGraphLayout.
void IlvRandomLayout::setLinkStyle | ( | IlvLayoutLinkStyle | linkStyle | ) |
Sets the option for the style of the shape of the links.
Valid values are IlvLayoutStraightLineLinkStyle
(the links are given a straight-line shape) and IlvLayoutNoReshapeLinkStyle
(no reshape is performed on the links).
This feature can be useful if the graph contains links that have intermediate points and are not straight-line links, for instance IlvPolylineLinkImage
} links with intermediate points. With the option IlvLayoutStraightLineLinkStyle
, if the method isLinkReplacementAllowed
returns IlTrue
, the layout calls the method IlvGraphModel::ensureStraightLineLinks()
to ensure that all the links have a straight-line shape. Note that in this case the links that cannot have a straight-line shape can be replaced with new links of a different type. For details, see the documentation of the method IlvGraphModel::ensureStraightLineLinks()
.
The default value is IlvLayoutStraightLineLinkStyle
.
linkStyle | The style of the shape of the links. |
IlBoolean IlvRandomLayout::supportsLayoutRegion | ( | ) | const [virtual] |
Indicates that this layout class can control the size of the drawing of the grapher to fit (exactly or approximately) a user-defined region (a rectangle) or a user-defined manager view.
IlTrue
. Reimplemented from IlvGraphLayout.
IlBoolean IlvRandomLayout::supportsPreserveFixedNodes | ( | ) | const [virtual] |
Indicates that this layout class allows the user to specify fixed nodes.
Fixed nodes are not moved during the layout if the method setPreserveFixedNodes(IlBoolean)
is called with an IlTrue
argument.
IlTrue
. Reimplemented from IlvGraphLayout.
IlBoolean IlvRandomLayout::supportsRandomGenerator | ( | ) | const [virtual] |
Indicates that this layout class uses randomly-generated numbers that can be initialized with a user-defined seed value.
When you perform the layout several times on the same graph and use the same user-defined seed value, you obtain the same drawing of the grapher. If you want different drawings each time you perform the layout, you should modify the seed value and call the method setUseSeedValueForRandomGenerator(IlBoolean)
with an IlTrue
argument.
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.