rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Grapher Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvArcLinkImage Class Reference

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

#include <ilviews/grapher/links.h>

Inheritance diagram for IlvArcLinkImage:
IlvLinkImage IlvSimpleGraphic IlvGraphic

List of all members.

Public Member Functions

 IlvArcLinkImage (IlvDisplay *display, IlBoolean oriented, IlvGraphic *from, IlvGraphic *to, IlDouble offsetRatio=.20, IlvPos fixedOffset=0, IlvPalette *palette=0)
 Constructor.
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.
virtual IlvPos getArcOffset (const IlvPoint &from, const IlvPoint &to) const
 Computes the arc offset.
IlvPos getFixedOffSet () const
 Returns the fixed value for the arc offset.
virtual IlvPointgetLinkPoints (IlUInt &nPoints, const IlvTransformer *t=0) const
 Returns the points defining the shape of the link.
IlDouble getOffsetRatio () const
 Returns the ratio defining the arc offset.
IlBoolean isOffsetFixed () const
 Indicates whether the arc offset is fixed.
void setFixedOffset (IlvPos offset)
 Sets the arc offset to a fixed value.
void setOffsetRatio (IlDouble ratio)
 Sets the ratio defining the arc offset.

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

- 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:
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.
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:
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 IlvPos IlvArcLinkImage::getArcOffset ( const IlvPoint from,
const IlvPoint to 
) const [virtual]

Computes the arc offset.

Parameters:
from The starting point of the link.
to The 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:
nPoints The number of points in the returned array.
t The 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:
offset The 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:
ratio The new arc offset ratio.
See also:
isOffsetFixed, setOffsetRatio.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends

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