rwlogo

Rogue Wave Views
Grapher Package API Reference Guide

Product Documentation:

Rogue Wave 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 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 ( 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

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 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
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 IlvArcLinkImage, IlvDoubleLinkImage, IlvOneSplineLinkImage, IlvOneLinkImage, 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
fThe 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
orientedIlTrue 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
tThe 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 in IlvLinkLabel, and IlvLinkHandle.


© Copyright 2014, 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.