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. More... | |
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. More... | |
IlvGraphic * | getFrom () const |
Returns the start node. More... | |
virtual IlvPoint * | getLinkPoints (IlUInt &nPoints, const IlvTransformer *t=0) const |
Returns the points defining the shape of the link. More... | |
IlvGraphic * | getTo () const |
Returns the end node. More... | |
IlBoolean | isOriented () const |
Indicates whether the link is oriented. More... | |
void | setFrom (IlvGraphic *f) |
Sets the start node. More... | |
void | setOriented (IlBoolean oriented) |
Changes the oriented mode. More... | |
void | setTo (IlvGraphic *t) |
Sets the end node. More... | |
virtual IlBoolean | zoomable () const |
Returns the zoomable property of the link. More... | |
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 |
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 IlvPolylineLinkImage, and IlvArcLinkImage.
IlvGraphic* IlvLinkImage::getFrom | ( | ) | const |
Returns the start node.
|
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 IlvPolylineLinkImage, IlvArcLinkImage, IlvDoubleLinkImage, IlvOneSplineLinkImage, and IlvOneLinkImage.
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 |
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 IlvLinkLabel, and IlvLinkHandle.