rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Graph Layout Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvRandomLayout Class Reference

The main class for the Random Layout algorithm. More...

#include <ilviews/layout/random.h>

Inheritance diagram for IlvRandomLayout:
IlvGraphLayout

List of all members.

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.

Detailed Description

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:

17-cycles-before.gif

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:


Constructor & Destructor Documentation

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.

See also:
IlvGraphLayout::attach(IlvGrapher*)
IlvGraphLayout::attach(IlvGraphModel*)
IlvGraphLayout::performLayout()

Member Function Documentation

IlvLayoutLinkStyle IlvRandomLayout::getLinkStyle (  )  const

Returns the current option for the style of the shape of the links.

Returns:
The style of the shape of the links.
See also:
setLinkStyle
void IlvRandomLayout::layout (  )  [protected, virtual]

Computes the layout using the Random Layout algorithm.

To start the layout, call the IlvGraphLayout::performLayout method.

See also:
IlvGraphLayout::performLayout()
IlvGraphLayout::getLayoutRegion(IlvRect&)

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.

Parameters:
linkStyle The style of the shape of the links.
See also:
getLinkStyle
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.

Returns:
Always IlTrue.
See also:
IlvGraphLayout::setLayoutRegion(IlvView*)
IlvGraphLayout::setLayoutRegion(IlvView*, const IlvRect&)
IlvGraphLayout::setLayoutRegion(const IlvRect&)
IlvGraphLayout::getLayoutRegion(IlvRect&)

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.

Returns:
Always IlTrue.
See also:
IlvGraphLayout::setPreserveFixedNodes(IlBoolean)
IlvGraphLayout::isPreserveFixedNodes

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.

Returns:
Always IlTrue.
See also:
setSeedValueForRandomGenerator(IlUShort)
getSeedValueForRandomGenerator
setUseSeedValueForRandomGenerator(IlBoolean)
isUseSeedValueForRandomGenerator

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.