rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Grapher Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvLinkImage Class Reference

Base class for grapher links. More...

#include <ilviews/grapher/links.h>

Inheritance diagram for IlvLinkImage:
IlvSimpleGraphic IlvGraphic IlvArcLinkImage IlvDoubleLinkImage IlvLinkHandle IlvLinkLabel IlvOneLinkImage IlvPolylineLinkImage IlvDoubleSplineLinkImage IlvOneSplineLinkImage

List of all members.

Public Member Functions

 IlvLinkImage (IlvDisplay *display, IlBoolean oriented, IlvGraphic *from, IlvGraphic *to, IlvPalette *palette=0)
 Constructor.
virtual void computePoints (IlvPoint &src, IlvPoint &dst, const IlvTransformer *t=0) const
 Computes the endpoints of the link when it is drawn as a straight line.
IlvGraphicgetFrom () const
 Returns the start node.
virtual IlvPointgetLinkPoints (IlUInt &nPoints, const IlvTransformer *t=0) const
 Returns the points defining the shape of the link.
IlvGraphicgetTo () const
 Returns the end node.
IlBoolean isOriented () const
 Indicates whether the link is oriented.
void setFrom (IlvGraphic *f)
 Sets the start node.
void setOriented (IlBoolean oriented)
 Changes the oriented mode.
void setTo (IlvGraphic *t)
 Sets the end node.
virtual IlBoolean zoomable () const
 Returns the zoomable property of the link.

Detailed Description

Base class for grapher links.

Library: ilvgrapher

IlvLinkImage is the base class for graphic objects that represent a connection between two nodes. By default, link instances appear as a straight line between the two nodes, as shown by the following figure:

IlvLinkImage.gif


- IlvLinkImage -

See also:
IlvGrapher, IlvGrapherPin, IlvMakeLinkInteractor.

Constructor & Destructor Documentation

IlvLinkImage::IlvLinkImage ( IlvDisplay display,
IlBoolean  oriented,
IlvGraphic from,
IlvGraphic to,
IlvPalette palette = 0 
)

Constructor.

Initializes a new instance of IlvLinkImage that draws a straight line (with or without an arrowhead) between the start and end nodes of the link. When oriented has a value of IlTrue, the link appears as in the following figure:

IlvLinkImage2.gif
Parameters:
display The display connection that handles the drawing of this object.
oriented A Boolean indicating whether an arrowhead is to be drawn at the end of the link.
from The IlvGraphic object representing the start node of the link.
to The IlvGraphic object representing the end node of the link.
palette The palette used to draw the link.

Member Function Documentation

virtual void IlvLinkImage::computePoints ( IlvPoint src,
IlvPoint dst,
const IlvTransformer t = 0 
) const [virtual]

Computes the endpoints of the link when it is drawn as a straight line.

The default implementation computes the endpoints from the bounding boxes of the starting and ending nodes:

  • If these rectangles do not intersect, the points are the middle of the sides of the rectangles to be joined.
  • If the bounding boxes intersect, the method returns the center of each box.

This method is called by the default implementation of the IlvLinkImage::getLinkPoints method.

Parameters:
src The starting point of the link.
dst The ending point of the link.
t The transformer applied to the link.

Reimplemented in IlvArcLinkImage, and IlvPolylineLinkImage.

IlvGraphic* IlvLinkImage::getFrom (  )  const

Returns the start node.

Returns:
The start node.
virtual IlvPoint* IlvLinkImage::getLinkPoints ( IlUInt nPoints,
const IlvTransformer t = 0 
) const [virtual]

Returns the points defining the shape of the link.

Returns an array of points defining the shape of the link when it is drawn with the transformer t. The size of the resulting array of points is returned in the nPoints parameter. The array is stored in an IlPoolOf(IlvPoint) and should not be deleted or modified.
This method is internally used by the methods draw, contains, and boundingBox. It is meant to replace various methods defined in subclasses in previous releases of Rogue Wave Views; like the obsolete IlvOneLinkImage::getPoints.
This function is overloaded by subclasses defining a specific shape for links. The default implementation returns an array of two points computed with the IlvLinkImage::computePoints method.

Parameters:
nPoints The number of points in the returned array.
t The transformer applied to the link.
Returns:
The points defining the shape of the link.

Reimplemented in IlvOneLinkImage, IlvOneSplineLinkImage, IlvDoubleLinkImage, IlvArcLinkImage, and IlvPolylineLinkImage.

IlvGraphic* IlvLinkImage::getTo (  )  const

Returns the end node.

Returns:
The ending node.
IlBoolean IlvLinkImage::isOriented (  )  const

Indicates whether the link is oriented.

Returns:
IlTrue if the link is oriented (drawn with an arrowhead) and IlFalse otherwise.
void IlvLinkImage::setFrom ( IlvGraphic f  ) 

Sets the start node.

If the link is already stored in a grapher, the drawing is automatically updated.

Parameters:
f The new starting node.
void IlvLinkImage::setOriented ( IlBoolean  oriented  ) 

Changes the oriented mode.

Changes the image of the link to oriented (that is, it will be drawn with an arrowhead) if the parameter oriented is IlTrue. It removes the arrowhead if oriented is IlFalse.

Warning:
Since this method changes the geometry of the link, it must be called using IlvManager::applyToObject if the link is stored in a grapher.
Parameters:
oriented IlTrue if the link is drawn with an arrowhead and IlTrue otherwise.
See also:
IlvGrapher::applyLinks.
void IlvLinkImage::setTo ( IlvGraphic t  ) 

Sets the end node.

If the link is already stored in a grapher, the drawing is automatically updated.

Parameters:
t The new ending node.
virtual IlBoolean IlvLinkImage::zoomable (  )  const [virtual]

Returns the zoomable property of the link.

A link is considered zoomable if both its start and end nodes are zoomable.

Returns:
IlTrue if the link is zoomable and IlFalse otherwise.

Reimplemented from IlvGraphic.

Reimplemented in IlvLinkHandle, and IlvLinkLabel.


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