rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Graph Layout Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvOrthogonalLinkLayout Class Reference

This class is the base class for the Orthogonal Link Layout algorithm. More...

#include <ilviews/layout/orthlink.h>

Inheritance diagram for IlvOrthogonalLinkLayout:
IlvGraphLayout

List of all members.

Public Member Functions

 IlvOrthogonalLinkLayout ()
 Creates a new instance of the Orthogonal Link Layout algorithm.
void cleanObjectProperties (IlAny nodeOrLink)
 Overridden version of the method cleanObjectProperties.
void detach ()
 Detaches the graph model from the layout instance.
virtual IlUInt getAllowedNumberOfIterations () const
 Returns the maximum number of allowed optimization iterations.
IlvOrthogonalLinkBundleMode getLinkBundlesMode () const
 Returns the current value of the link bundles mode.
IlvNodeBoxInterface * getLinkConnectionRectangle () const
 Returns the object that provides the rectangle on which the connection points of its adjacent links must be located.
virtual IlUInt getLinkOffset () const
 Returns the minimum length of the final segment of the links.
virtual IlvLayoutLinkStyle getLinkStyle () const
 Returns the style of the links shape.
IlUInt getLinkToLinkCrossingPenalty () const
 Returns the link-to-link crossing penalty factor.
IlUInt getLinkToNodeCrossingPenalty () const
 Returns the link-to-node crossing penalty factor.
virtual IlUInt getMinFinalSegmentLength () const
 Returns the minimum length of the final segment of the links.
IlvNodeSideFiltergetNodeSideFilter () const
 Returns the object that allows or prohibits the connection of the links on a given side of the nodes.
IlBoolean isAutoLayout () const
 Indicates whether the auto layout mode is enabled or not.
IlBoolean isSameShapeForMultipleLinks () const
 Specifies whether the algorithm ensures that multiple links are reshaped in the same manner.
void setAllowedNumberOfIterations (IlUInt)
 Allows you to specify the maximum number of iterations of the layout algorithm.
void setAutoLayout (IlBoolean enable)
 Enables or disables the auto layout mode.
void setLinkBundlesMode (IlvOrthogonalLinkBundleMode)
 Allows you to specify the link bundles mode.
void setLinkConnectionRectangle (IlvNodeBoxInterface *)
 Allows you to specify an object that provides, for each node, the rectangle on which the connection points of its adjacent links must be located.
virtual void setLinkOffset (IlUInt offset)
 Allows you to specify the offset between links connected on the same side of the node.
virtual void setLinkStyle (IlvLayoutLinkStyle style)
 Sets the style of the links shape.
void setLinkToLinkCrossingPenalty (IlUInt)
 Sets the link-to-link crossing penalty factor.
void setLinkToNodeCrossingPenalty (IlUInt)
 Sets the link-to-node crossing penalty factor.
virtual void setMinFinalSegmentLength (IlUInt)
 Allows you to specify the minimum length of the final segment of the links.
void setNodeSideFilter (IlvNodeSideFilter *)
 Allows you to specify an object that allows or prohibits the connection of the links on a given side of the nodes.
void setSameShapeForMultipleLinks (IlBoolean)
 Allows you to specify whether the layout algorithm must ensure that all multiple links have the same shape.
IlBoolean supportsAllowedTime () const
 Indicates that this layout class can stop the layout computation in the proper manner when the user-defined allowed time is exceeded.
IlBoolean supportsAnimation () const
 Indicates that this layout class supports the animation mechanism.
IlBoolean supportsPreserveFixedLinks () const
 Indicates that this layout class allows the user to specify fixed links.

Protected Member Functions

virtual void layout ()
 Computes the layout using the Orthogonal Layout algorithm.

Detailed Description

This class is the base class for the Orthogonal Link Layout algorithm.

Library: ilvorthlink

This algorithm reshapes the links of a graph without moving the nodes. By default, the algorithm computes orthogonal links (that is, links composed of alternating horizontal and vertical segments). Optionally, direct links can be computed (see the method setLinkStyle(IlvLayoutLinkStyle)).

Sample drawings produced by the Orthogonal Link Layout algorithm:

Ortho-Ortho-small.gif
Ortho-Direct-small.gif
Ortho-Java2D.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 the following points:


Constructor & Destructor Documentation

IlvOrthogonalLinkLayout::IlvOrthogonalLinkLayout (  ) 

Creates a new instance of the Orthogonal Link 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

void IlvOrthogonalLinkLayout::cleanObjectProperties ( IlAny  nodeOrLink  )  [virtual]

Overridden version of the method cleanObjectProperties.

See also:
IlvGraphLayout::cleanObjectProperties.

Reimplemented from IlvGraphLayout.

void IlvOrthogonalLinkLayout::detach (  )  [virtual]

Detaches the graph model from the layout instance.

When a new graph model is attached to the layout instance, it is not necessary to detach the previously attached graph model because this is done automatically when the methods attach(IlvGrapher*) or attach(IlvGraphModel*) are called.

This method performs cleaning operations on the graph model (for example, properties added to the graph model objects are removed) and reinitializes the parameters related to animation and the layout region.

Subclasses can override this method to remove additional information stored in the graph model.

See also:
setAnimate(IlBoolean))
setLayoutRegion(const IlvRect&)
attach(IlvGrapher*)
attach(IlvGraphModel*).
Warning:
[note] You must call this method when you no longer need the layout instance; otherwise some objects may not be deleted.

Reimplemented from IlvGraphLayout.

virtual IlUInt IlvOrthogonalLinkLayout::getAllowedNumberOfIterations (  )  const [virtual]

Returns the maximum number of allowed optimization iterations.

See also:
setAllowedNumberOfIterations.
IlvOrthogonalLinkBundleMode IlvOrthogonalLinkLayout::getLinkBundlesMode (  )  const

Returns the current value of the link bundles mode.

See also:
setLinkBundlesMode(IlvLayoutLinkStyle).
IlvNodeBoxInterface* IlvOrthogonalLinkLayout::getLinkConnectionRectangle (  )  const

Returns the object that provides the rectangle on which the connection points of its adjacent links must be located.

Returns the object that provides, for each node, the rectangle on which the connection points of its adjacent links must be located, if one is specified using the method setLinkConnectionPointsRectangle(IlvNodeBoxInterface*). Returns 0 otherwise.

See also:
setLinkConnectionRectangle(IlvNodeBoxInterface*).
virtual IlUInt IlvOrthogonalLinkLayout::getLinkOffset (  )  const [virtual]

Returns the minimum length of the final segment of the links.

The default value is 2.

See also:
setLinkOffset.
virtual IlvLayoutLinkStyle IlvOrthogonalLinkLayout::getLinkStyle (  )  const [virtual]

Returns the style of the links shape.

See also:
setLinkStyle(IlvLayoutLinkStyle).
IlUInt IlvOrthogonalLinkLayout::getLinkToLinkCrossingPenalty (  )  const

Returns the link-to-link crossing penalty factor.

When choosing the optimal shape for the links, the algorithm computes a penalty function expressed in the following manner:
Link_to_Link_Penalty * Link_to_Link_Crossings + Link_to_Node_Penalty * Link_to_Node_Crossings

The default value is 1.

See also:
setLinkToLinkCrossingPenalty.
IlUInt IlvOrthogonalLinkLayout::getLinkToNodeCrossingPenalty (  )  const

Returns the link-to-node crossing penalty factor.

When choosing the optimal shape for the links, the algorithm computes a penalty function expressed in the following manner:
Link_to_Link_Penalty * Link_to_Link_Crossings + Link_to_Node_Penalty * Link_to_Node_Crossings

The default value is 1.

See also:
setLinkToNodeCrossingPenalty.
virtual IlUInt IlvOrthogonalLinkLayout::getMinFinalSegmentLength (  )  const [virtual]

Returns the minimum length of the final segment of the links.

See also:
setMinFinalSegmentLength(IlUInt).
IlvNodeSideFilter* IlvOrthogonalLinkLayout::getNodeSideFilter (  )  const

Returns the object that allows or prohibits the connection of the links on a given side of the nodes.

Returns the object that allows or prohibits the connection of the links on a given side of the nodes, if one is specified using the method setNodeSideFilter(IlvNodeSideFilter*). Returns 0 otherwise.

See also:
setNodeSideFilter.
IlBoolean IlvOrthogonalLinkLayout::isAutoLayout (  )  const

Indicates whether the auto layout mode is enabled or not.

Returns IlTrue if the auto layout mode is enabled. Returns IlFalse otherwise.

See also:
setAutoLayout(IlBoolean).
IlBoolean IlvOrthogonalLinkLayout::isSameShapeForMultipleLinks (  )  const

Specifies whether the algorithm ensures that multiple links are reshaped in the same manner.

Returns IlTrue if it is enabled, and IlFalse otherwise.

See also:
setSameShapeForMultipleLinks(IlBoolean).
virtual void IlvOrthogonalLinkLayout::layout (  )  [protected, virtual]

Computes the layout using the Orthogonal Layout algorithm.

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

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

Implements IlvGraphLayout.

void IlvOrthogonalLinkLayout::setAllowedNumberOfIterations ( IlUInt   ) 

Allows you to specify the maximum number of iterations of the layout algorithm.

See also:
getAllowedNumberOfIterations.
void IlvOrthogonalLinkLayout::setAutoLayout ( IlBoolean  enable  ) 

Enables or disables the auto layout mode.

If the argument is IlTrue, the layout is automatically reperformed each time the layout instance is notified that the geometry or the structure of the graph have changed.

The default value is IlTrue.

See also:
contentsChanged(GraphModelEvent).
void IlvOrthogonalLinkLayout::setLinkBundlesMode ( IlvOrthogonalLinkBundleMode   ) 

Allows you to specify the link bundles mode.

The valid values of the argument style are the following:

  • IlvOrthogonalLinkNoBundle: Several links connected to the same side of a node share the same connection point, that is, the middle of the node side. The final segments of the links overlap. No bundles are created and the link offset parameter is ignored.

  • IlvOrthogonalLinkFirstLastSegment: The connection points of several links connected to the same side of a node are distributed according to the link offset value. With the orthogonal link style, the algorithm also ensures that the first and last segments of the links are always orthogonal to the side of the node to which they are connected.

  • IlvOrthogonalLinkImprovedFirstLastSegment: The algorithm also tries to avoid overlapping the second segment and the segment before the last.

Note that with the direct link style, this option is equivalent to IlvOrthogonalLinkFirstLastSegment.

IlvOrthogonalLinkImprovedFirstLastSegment is the default value.

See also:
getLinkBundlesMode.
void IlvOrthogonalLinkLayout::setLinkConnectionRectangle ( IlvNodeBoxInterface *   ) 

Allows you to specify an object that provides, for each node, the rectangle on which the connection points of its adjacent links must be located.

If you do not call this method, the layout algorithm locates the connection points on the bounding box of the node (see IlvGraphModel::boundingBox(IlvRect&)).

You can call this method with 0 as parameter in order to revert to the default behavior.

See also:
getLinkConnectionRectangle.
virtual void IlvOrthogonalLinkLayout::setLinkOffset ( IlUInt  offset  )  [virtual]

Allows you to specify the offset between links connected on the same side of the node.

The default value is 2.

See also:
getLinkOffset.
virtual void IlvOrthogonalLinkLayout::setLinkStyle ( IlvLayoutLinkStyle  style  )  [virtual]

Sets the style of the links shape.

Valid values are the following:

  • IlvLayoutDirectLinkStyle: The shape of the links is a polyline composed of a straight-line segment between the end nodes with two horizontal or vertical segments at its extremities (their length is controlled by the setMinFinalSegmentLength(IlUInt) method and may be 0).
  • IlvLayoutOrthogonalLinkStyle: The shape of the links is a polyline composed of alternating horizontal and vertical segments.

If the method isLinkReplacementAllowed returns IlTrue, the layout calls the method IlvGraphModel::ensureReshapeableLinks(IlvGraphLayout*) with to ensure that all the links can be reshaped as needed. Note that, in this case, the links that cannot be reshaped can be replaced with new links of a different type. For details, see the documentation of the method IlvGraphModel::ensureReshapeableLinks(IlvGraphLayout*).

The default value is IlvLayoutOrthogonalLinkStyle.

See also:
getLinkStyle.
void IlvOrthogonalLinkLayout::setLinkToLinkCrossingPenalty ( IlUInt   ) 

Sets the link-to-link crossing penalty factor.

The default value is 1.

See also:
getLinkToLinkCrossingPenalty.
void IlvOrthogonalLinkLayout::setLinkToNodeCrossingPenalty ( IlUInt   ) 

Sets the link-to-node crossing penalty factor.

The default value is 1.

See also:
getLinkToNodeCrossingPenalty.
virtual void IlvOrthogonalLinkLayout::setMinFinalSegmentLength ( IlUInt   )  [virtual]

Allows you to specify the minimum length of the final segment of the links.

See also:
getMinFinalSegmentLength.
void IlvOrthogonalLinkLayout::setNodeSideFilter ( IlvNodeSideFilter  ) 

Allows you to specify an object that allows or prohibits the connection of the links on a given side of the nodes.

If you do not call this method, the layout algorithm is free to choose any side of the nodes.

When a filter is specified, the layout algorithm tries to choose for the links only shapes connected to node sides that are allowed by the filter.

Note that the layout algorithm cannot always strictly respect the prescriptions of the filter, especially for the IlvLayoutDirectLinkStyle link style.

You can call this method with 0 as parameter in order to revert to the default behavior.

See also:
getNodeSideFilter.
void IlvOrthogonalLinkLayout::setSameShapeForMultipleLinks ( IlBoolean   ) 

Allows you to specify whether the layout algorithm must ensure that all multiple links have the same shape.

Multiple links are links that have the same origin and destination nodes.

If the argument is IlTrue, additional work is done to ensure that all multiple links will be reshaped in the same manner.

The default value is IlTrue.

See also:
isSameShapeForMultipleLinks.
IlBoolean IlvOrthogonalLinkLayout::supportsAllowedTime (  )  const [virtual]

Indicates that this layout class can stop the layout computation in the proper manner when the user-defined allowed time is exceeded.

If a subclass does not support this parameter, it must override this method in order to return IlFalse.

See also:
IlvGraphLayout::setAllowedTime(IlvRunTimeType)
IlvGraphLayout::getAllowedTime.
Returns:
Always IlTrue.

Reimplemented from IlvGraphLayout.

IlBoolean IlvOrthogonalLinkLayout::supportsAnimation (  )  const [virtual]

Indicates that this layout class supports the animation mechanism.

It performs a redraw of the grapher after each iteration if the method setAnimate(IlBoolean) is called with an IlTrue argument.

See also:
IlvGraphLayout::setAnimate(IlBoolean)
IlvGraphLayout::isAnimate.
Returns:
Always IlTrue.

Reimplemented from IlvGraphLayout.

IlBoolean IlvOrthogonalLinkLayout::supportsPreserveFixedLinks (  )  const [virtual]

Indicates that this layout class allows the user to specify fixed links.

Fixed links are not reshaped during the layout if the method setPreserveFixedLinks(IlBoolean) is called with an IlTrue argument.

See also:
IlvGraphLayout::setPreserveFixedLinks(IlBoolean)
IlvGraphLayout::isPreserveFixedLinks.
Returns:
Always IlTrue.

Reimplemented from IlvGraphLayout.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends

© 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.