Rogue Wave Views |
Rogue Wave Views Documentation Home |
Implementation of links drawn as an arc. More...
#include <ilviews/grapher/links.h>
Public Member Functions | |
IlvArcLinkImage (IlvDisplay *display, IlBoolean oriented, IlvGraphic *from, IlvGraphic *to, IlDouble offsetRatio=.20, IlvPos fixedOffset=0, 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... | |
virtual IlvPos | getArcOffset (const IlvPoint &from, const IlvPoint &to) const |
Computes the arc offset. More... | |
IlvPos | getFixedOffSet () const |
Returns the fixed value for the arc offset. More... | |
virtual IlvPoint * | getLinkPoints (IlUInt &nPoints, const IlvTransformer *t=0) const |
Returns the points defining the shape of the link. More... | |
IlDouble | getOffsetRatio () const |
Returns the ratio defining the arc offset. More... | |
IlBoolean | isOffsetFixed () const |
Indicates whether the arc offset is fixed. More... | |
void | setFixedOffset (IlvPos offset) |
Sets the arc offset to a fixed value. More... | |
void | setOffsetRatio (IlDouble ratio) |
Sets the ratio defining the arc offset. More... | |
Public Member Functions inherited from IlvLinkImage | |
IlvLinkImage (IlvDisplay *display, IlBoolean oriented, IlvGraphic *from, IlvGraphic *to, IlvPalette *palette=0) | |
Constructor. More... | |
IlvGraphic * | getFrom () const |
Returns the start node. 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... | |
Implementation of links drawn as an arc.
Library: ilvgrapher
A link of the IlvArcLinkImage
class is drawn as an arc, as shown in the following figure:
- IlvArcLinkImage -
The distance between the arc middle point and the segment joining the endpoints of the link (also called the arc offset) can be specified:
IlvArcLinkImage::setFixedOffset
method), IlvArcLinkImage::setOffsetRatio
method). IlvArcLinkImage::IlvArcLinkImage | ( | IlvDisplay * | display, |
IlBoolean | oriented, | ||
IlvGraphic * | from, | ||
IlvGraphic * | to, | ||
IlDouble | offsetRatio = .20 , |
||
IlvPos | fixedOffset = 0 , |
||
IlvPalette * | palette = 0 |
||
) |
Constructor.
The constructor initializes a new instance of the IlvArcLinkImage
class with an arc offset specified either by offsetRatio or fixedOffset.
display | The display connection that handles the drawing of the 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. |
offsetRatio | The ratio of the arc offset to the length of the segment joining the endpoints of the link. |
fixedOffset | A fixed value for the arc offset. This value is meaningful only if offsetRatio is equal to 0 . |
palette | The palette used to draw the link. |
setFixedOffset
, setOffsetRatio
.
|
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 from IlvLinkImage.
|
virtual |
Computes the arc offset.
from | The starting point of the link. |
to | The ending point of the link. |
isOffsetFixed
, getOffsetRatio
, getFixedOffset
. IlvPos IlvArcLinkImage::getFixedOffSet | ( | ) | const |
Returns the fixed value for the arc offset.
isOffsetFixed
, setFixedOffset
.
|
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 from IlvLinkImage.
IlDouble IlvArcLinkImage::getOffsetRatio | ( | ) | const |
Returns the ratio defining the arc offset.
Returns the ratio of the arc offset to the length of the segment joining the endpoints of the link. If the ratio is equal to 0, the arc offset is fixed to the value returned by the IlvArcLinkImage::getFixedOffSet
method.
isOffsetFixed
, setOffsetRatio
. IlBoolean IlvArcLinkImage::isOffsetFixed | ( | ) | const |
Indicates whether the arc offset is fixed.
IlTrue
if the distance is fixed, and IlFalse
if it is proportional to the length of the segment joining the endpoints of the link. setFixedOffset
, setOffsetRatio
. void IlvArcLinkImage::setFixedOffset | ( | IlvPos | offset | ) |
Sets the arc offset to a fixed value.
offset | The new arc offset. |
isOffsetFixed
, setOffsetRatio
. void IlvArcLinkImage::setOffsetRatio | ( | IlDouble | ratio | ) |
Sets the ratio defining the arc offset.
Sets the ratio of the arc offset to the length of the segment joining the endpoints of the link. If the ratio is equal to 0, the arc offset is fixed to the value returned by the IlvArcLinkImage::getFixedOffSet
method.
ratio | The new arc offset ratio. |
isOffsetFixed
, setOffsetRatio
. © Copyright 2015, 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.