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

Generic class to specify any graphic object as a grapher link. More...

#include <ilviews/grapher/linkhand.h>

Inheritance diagram for IlvLinkHandle:
IlvLinkImage IlvSimpleGraphic IlvGraphic IlvValueInterface

Public Member Functions

 IlvLinkHandle (IlvDisplay *display, IlvGraphic *object, IlvGraphic *from, IlvGraphic *to, IlvDim width=0, IlBoolean owner=IlTrue, IlvPalette *palette=0)
 Constructor. More...
 
IlvGraphicgetObject () const
 Returns the referenced object. More...
 
IlvDim getWidth () const
 Returns the width of the link. More...
 
IlBoolean isOwner () const
 Indicates whether the handle owns its referenced object. More...
 
IlBoolean isUsingLinkPalette () const
 Indicates whether the referenced object is drawn with the palette of the link. More...
 
void setObject (IlvGraphic *object)
 Changes the referenced object. More...
 
void setOwner (IlBoolean owner)
 Changes the ownership of the handle. More...
 
void setWidth (IlvDim width)
 Sets the width of the link. More...
 
void useLinkPalette (IlBoolean use)
 Changes the drawing mode of the referenced object. More...
 
virtual IlBoolean zoomable () const
 Returns the zoomable property of the link. More...
 
- Public Member Functions inherited from IlvLinkImage
 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...
 

Detailed Description

Generic class to specify any graphic object as a grapher link.

Library: ilvgrapher

An IlvLinkHandle object is used to reference an IlvGraphic object as a link. The object will be drawn as a link using:

The IlvLinkHandle object is called the handle object. The other object is called the referenced object. Several IlvLinkHandle objects may reference the same IlvGraphic object. An IlvLinkHandle instance may be the owner of the referenced object. In this case, deleting the handle also deletes the referenced object. In the other case, the referenced object is left intact.

See also
IlvGrapher, IlvGrapher::makeLink().

Constructor & Destructor Documentation

◆ IlvLinkHandle()

IlvLinkHandle::IlvLinkHandle ( IlvDisplay display,
IlvGraphic object,
IlvGraphic from,
IlvGraphic to,
IlvDim  width = 0,
IlBoolean  owner = IlTrue,
IlvPalette palette = 0 
)

Constructor.

The constructor initializes an instance of the IlvLinkHandle class. This instantiation references the object object so that it behaves like a link between node from and node to.

Setting width to a value other than 0 forces the width of the link, whereas a null value allows the link to compute its width according to the width of the faces of the nodes to which it is attached.

Set owner to IlTrue to make the handle object the owner of the referenced object.

The palette palette will be the one used to draw the referenced object if IlvLinkHandle::isLinkPaletteUsed() returns IlTrue.

Parameters
displayThe display connection that will handle the drawing of the object.
objectThe graphic object used to represent the link.
fromThe IlvGraphic object representing the start node of the link.
toThe IlvGraphic object representing the end node of the link.
widthThe width of the link (0 if the width must be automatically computed).
ownerA Boolean value indicating whether the handle owns its referenced object.
paletteThe palette used to draw the link.

Member Function Documentation

◆ getObject()

IlvGraphic* IlvLinkHandle::getObject ( ) const

Returns the referenced object.

Returns
The referenced object.

◆ getWidth()

IlvDim IlvLinkHandle::getWidth ( ) const

Returns the width of the link.

A null width means that it is computed dynamically according to the width of the faces of the nodes this link is attached to.

Returns
The width of the link.

◆ isOwner()

IlBoolean IlvLinkHandle::isOwner ( ) const

Indicates whether the handle owns its referenced object.

Returns
IlTrue if the handle owns the referenced object, and IlFalse otherwise.

◆ isUsingLinkPalette()

IlBoolean IlvLinkHandle::isUsingLinkPalette ( ) const

Indicates whether the referenced object is drawn with the palette of the link.

Indicates which palette is used to draw the referenced object. It can be one of the following:

  • The palette of the link, in which case the referenced object is drawn using the method IlvSimpleGraphic::drawPalette()
  • The palette of the referenced object itself, in which case it is drawn using the method IlvGraphic::draw()
Returns
IlTrue if the referenced object is drawn with the palette of the link and IlFalse if it is drawn with its own palette.
See also
useLinkPalette().

◆ setObject()

void IlvLinkHandle::setObject ( IlvGraphic object)

Changes the referenced object.

Note
You can share a referenced object as long as it is not owned by any of its handles.
Parameters
objectThe new referenced object.

◆ setOwner()

void IlvLinkHandle::setOwner ( IlBoolean  owner)

Changes the ownership of the handle.

If owner is set to IlTrue, then the handle owns its referenced object and will delete it when it is itself destroyed.

Parameters
ownerA Boolean value indicating whether the handle owns its referenced object.

◆ setWidth()

void IlvLinkHandle::setWidth ( IlvDim  width)

Sets the width of the link.

Sets the value of the width of the link to width. If it is null, then the width is dynamically computed according to the width of the faces of the nodes this link is attached to.

Parameters
widthThe current width.

◆ useLinkPalette()

void IlvLinkHandle::useLinkPalette ( IlBoolean  use)

Changes the drawing mode of the referenced object.

Parameters
useA Boolean value indicating whether the referenced object should be drawn with the palette of the link (IlTrue), or with its own palette (IlFalse).
See also
isUsingLinkPalette().

◆ zoomable()

virtual IlBoolean IlvLinkHandle::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 IlvLinkImage.