Views
Grapher Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions
IlvLinkImage Class Reference

Base class for grapher links. More...

#include <ilviews/grapher/links.h>

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

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...
 
IlvGraphicgetFrom () const
 Returns the start node. More...
 
virtual IlvPointgetLinkPoints (IlUInt &nPoints, const IlvTransformer *t=0) const
 Returns the points defining the shape of the link. More...
 
IlvGraphicgetTo () 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...
 

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 -

See also
IlvGrapher, IlvGrapherPin, IlvMakeLinkInteractor.

Constructor & Destructor Documentation

◆ IlvLinkImage()

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:

Parameters
displayThe display connection that handles the drawing of this object.
orientedA Boolean indicating whether an arrowhead is to be drawn at the end of the link.
fromThe IlvGraphic object representing the start node of the link.
toThe IlvGraphic object representing the end node of the link.
paletteThe palette used to draw the link.

Member Function Documentation

◆ computePoints()

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
srcThe starting point of the link.
dstThe ending point of the link.
tThe transformer applied to the link.

Reimplemented in IlvPolylineLinkImage, and IlvArcLinkImage.

◆ getFrom()

IlvGraphic* IlvLinkImage::getFrom ( ) const

Returns the start node.

Returns
The start node.

◆ getLinkPoints()

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
nPointsThe number of points in the returned array.
tThe transformer applied to the link.
Returns
The points defining the shape of the link.

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

◆ getTo()

IlvGraphic* IlvLinkImage::getTo ( ) const

Returns the end node.

Returns
The ending node.

◆ isOriented()

IlBoolean IlvLinkImage::isOriented ( ) const

Indicates whether the link is oriented.

Returns
IlTrue if the link is oriented (drawn with an arrowhead) and IlFalse otherwise.

◆ setFrom()

void IlvLinkImage::setFrom ( IlvGraphic f)

Sets the start node.

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

Parameters
fThe new starting node.

◆ setOriented()

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
orientedIlTrue if the link is drawn with an arrowhead and IlTrue otherwise.
See also
IlvGrapher::applyLinks.

◆ setTo()

void IlvLinkImage::setTo ( IlvGraphic t)

Sets the end node.

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

Parameters
tThe new ending node.

◆ zoomable()

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 IlvLinkLabel, and IlvLinkHandle.