rwlogo

Rogue Wave Views
Grapher Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions
IlvArcLinkImage Class Reference

Implementation of links drawn as an arc. More...

#include <ilviews/grapher/links.h>

Inheritance diagram for IlvArcLinkImage:
IlvLinkImage IlvSimpleGraphic IlvGraphic

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 IlvPointgetLinkPoints (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...
 
IlvGraphicgetFrom () const
 Returns the start node. 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

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:

Constructor & Destructor Documentation

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.

Parameters
displayThe display connection that handles the drawing of the 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.
offsetRatioThe ratio of the arc offset to the length of the segment joining the endpoints of the link.
fixedOffsetA fixed value for the arc offset. This value is meaningful only if offsetRatio is equal to 0.
paletteThe palette used to draw the link.
See Also
setFixedOffset, setOffsetRatio.

Member Function Documentation

virtual void IlvArcLinkImage::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 from IlvLinkImage.

virtual IlvPos IlvArcLinkImage::getArcOffset ( const IlvPoint from,
const IlvPoint to 
) const
virtual

Computes the arc offset.

Parameters
fromThe starting point of the link.
toThe ending point of the link.
Returns
The distance between the two control points and the segment joining from and to.
See Also
isOffsetFixed, getOffsetRatio, getFixedOffset.
IlvPos IlvArcLinkImage::getFixedOffSet ( ) const

Returns the fixed value for the arc offset.

Returns
The fixed value for the arc offset.
See Also
isOffsetFixed, setFixedOffset.
virtual IlvPoint* IlvArcLinkImage::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 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.

Returns
The arc offset ratio.
See Also
isOffsetFixed, setOffsetRatio.
IlBoolean IlvArcLinkImage::isOffsetFixed ( ) const

Indicates whether the arc offset is fixed.

Returns
IlTrue if the distance is fixed, and IlFalse if it is proportional to the length of the segment joining the endpoints of the link.
See Also
setFixedOffset, setOffsetRatio.
void IlvArcLinkImage::setFixedOffset ( IlvPos  offset)

Sets the arc offset to a fixed value.

Parameters
offsetThe new arc offset.
See Also
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.

Parameters
ratioThe new arc offset ratio.
See Also
isOffsetFixed, setOffsetRatio.

© 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.