Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Base class for grapher links. More...
#include <ilviews/grapher/links.h>
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. | |
IlvGraphic * | getFrom () const |
Returns the start node. | |
virtual IlvPoint * | getLinkPoints (IlUInt &nPoints, const IlvTransformer *t=0) const |
Returns the points defining the shape of the link. | |
IlvGraphic * | getTo () 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. |
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 -
IlvGrapher
, IlvGrapherPin
, IlvMakeLinkInteractor
. 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:
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. |
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:
This method is called by the default implementation of the IlvLinkImage::getLinkPoints
method.
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.
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.
nPoints | The number of points in the returned array. | |
t | The transformer applied to the link. |
Reimplemented in IlvOneLinkImage, IlvOneSplineLinkImage, IlvDoubleLinkImage, IlvArcLinkImage, and IlvPolylineLinkImage.
IlvGraphic* IlvLinkImage::getTo | ( | ) | const |
Returns the end node.
IlBoolean IlvLinkImage::isOriented | ( | ) | const |
Indicates whether the link is oriented.
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.
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
.
IlvManager::applyToObject
if the link is stored in a grapher.oriented | IlTrue if the link is drawn with an arrowhead and IlTrue otherwise. |
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.
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.
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.