Rogue Wave Views
Grapher Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlvGrapherPin Class Reference

Grapher pins management class. More...

#include <ilviews/grapher/pin.h>

Inheritance diagram for IlvGrapherPin:
IlvNamedProperty IlvValueInterface IlvGenericPin

Public Member Functions

 IlvGrapherPin ()
 Constructor. More...
 
virtual ~IlvGrapherPin ()
 Destructor. More...
 
virtual void drawGhost (IlvPort *dst, IlvPalette *palette, const IlvGraphic *node, const IlvTransformer *t) const
 Displays a ghost image of the connection pins. More...
 
virtual IlUInt getCardinal (const IlvGraphic *node, const IlvTransformer *t) const
 Returns the number of connection pins handled by the instance. More...
 
virtual IlBoolean getClosest (const IlvGraphic *node, const IlvPoint &p, const IlvTransformer *t, IlvPoint &returnPoint, IlUInt &pinIndex) const
 Returns the closest connection pin from a given point. More...
 
virtual IlBoolean getLinkLocation (const IlvGraphic *node, const IlvGraphic *link, const IlvTransformer *t, IlvPoint &returnPoint) const
 Returns the connection point of a given link. More...
 
IlvGraphic *const * getLinks (const IlvGraphic *node, IlUInt pinIndex, IlBoolean from, IlUInt &count) const
 Returns all the links attached to a given connection pin. More...
 
virtual IlBoolean getLocation (IlUInt pinIndex, const IlvGraphic *node, const IlvTransformer *t, IlvPoint &returnPoint) const
 Returns the coordinates of a connection pin. More...
 
virtual IlUInt getPinIndex (const IlvGraphic *link, IlBoolean from)
 Returns the index of the connection pin for a given link. More...
 
void removeLink (const IlvGraphic *node, const IlvGraphic *link, IlBoolean from)
 Removes a link connected to a pin. More...
 
IlvGrapherPinset (IlvGraphic *node)
 Associates the instance with a graphic node. More...
 
virtual void setPinIndex (const IlvGraphic *link, IlUInt pinIndex, IlBoolean from)
 Sets the connection pin for a given link. More...
 

Static Public Member Functions

static IlvGrapherPinGet (const IlvGraphic *node)
 Returns the IlvGrapherPin instance associated with a given node. More...
 
static IlvGrapherPinRemove (IlvGraphic *node)
 Removes the IlvGrapherPin instance associated with a given node. More...
 

Detailed Description

Grapher pins management class.

Library: ilvgrapher

The IlvGrapherPin class handles the exact location of link connections on nodes in a grapher. These link connections are referred to as "connection pins".

To add a grapher pin to a node, add the following code:

MyGrapherPinClass* myPin = new MyGrapherPinClass(myParameters);
myPin->set(myNode);
Note
Because IlvGrapherPin is a subclass of IlvNamedProperty, add the following two lines to your class declaration when creating your own classes that manage grapher pins:
DeclarePropertyInfo();
DeclarePropertyIOConstructors(MyGrapherPinClass);
Then, in order to automatically make this class clonable and persistent, add the following line to the implementation code:
IlvRegisterPropertyClass(MyGrapherPinClass, IlvGrapherPin);
See also
IlvGrapher, IlvMakeLinkInteractor.

Constructor & Destructor Documentation

§ IlvGrapherPin()

IlvGrapherPin::IlvGrapherPin ( )

Constructor.

Initializes a new empty instance of IlvGrapherPin.

§ ~IlvGrapherPin()

virtual IlvGrapherPin::~IlvGrapherPin ( )
virtual

Destructor.

The destructor releases all the resources used by the instance.

Member Function Documentation

§ drawGhost()

virtual void IlvGrapherPin::drawGhost ( IlvPort dst,
IlvPalette palette,
const IlvGraphic node,
const IlvTransformer t 
) const
virtual

Displays a ghost image of the connection pins.

Displays a ghost image of the grapher pin in the destination port dst, using the palette palette, for the node node displayed using the transformer t.

Parameters
dstThe destination port.
paletteThe palette used to perform the drawing.
nodeThe node this instance is associated with.
tThe transformer applied to the node.

§ Get()

static IlvGrapherPin* IlvGrapherPin::Get ( const IlvGraphic node)
static

Returns the IlvGrapherPin instance associated with a given node.

Parameters
nodeThe considered node.
Returns
The associated grapher pin if it exists and 0 otherwise.

§ getCardinal()

virtual IlUInt IlvGrapherPin::getCardinal ( const IlvGraphic node,
const IlvTransformer t 
) const
virtual

Returns the number of connection pins handled by the instance.

Returns the number of connection pins available for the node node, when displayed with the transformer t. This method has to be defined in subclasses.

Parameters
nodeThe node this instance is associated with.
tThe transformer applied to the node.
Returns
The number of connection pins handled by the instance.

Reimplemented in IlvGenericPin.

§ getClosest()

virtual IlBoolean IlvGrapherPin::getClosest ( const IlvGraphic node,
const IlvPoint p,
const IlvTransformer t,
IlvPoint returnPoint,
IlUInt pinIndex 
) const
virtual

Returns the closest connection pin from a given point.

Returns, in the parameter returnPoint, the coordinates of the connection pin closest to the point p when node is displayed after transformer t is applied. The corresponding pin index is stored in pinIndex. The default implementation uses the IlvGrapherPin::getLocation() method for all connection pins and returns the closest point found.

Parameters
nodeThe node this instance is associated with.
pThe reference point.
tThe transformer applied to the node.
returnPointThe coordinate of the closest connection pin.
pinIndexThe index of the closest connection pin.
Returns
IlTrue if a connection pin was found, IlFalse otherwise.

Reimplemented in IlvGenericPin.

§ getLinkLocation()

virtual IlBoolean IlvGrapherPin::getLinkLocation ( const IlvGraphic node,
const IlvGraphic link,
const IlvTransformer t,
IlvPoint returnPoint 
) const
virtual

Returns the connection point of a given link.

Returns, in the parameter returnPoint, the coordinates of the connection pin where link connects to node, when displayed after transformer t is applied. The default implementation uses the IlvGrapherPin::getPinIndex() method to fetch the index of the connection pin associated to link, and then calls the IlvGrapherPin::getLocation() method.

Parameters
nodeThe node this instance is associated with.
linkThe considered link.
tThe transformer applied to the node and the link.
returnPointThe coordinates of the link connection point.
Returns
IlTrue if there is a connecting pin for the link and the node, and IlFalse otherwise.

§ getLinks()

IlvGraphic* const* IlvGrapherPin::getLinks ( const IlvGraphic node,
IlUInt  pinIndex,
IlBoolean  from,
IlUInt count 
) const

Returns all the links attached to a given connection pin.

The returned array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

Parameters
nodeThe node this instance is associated with.
pinIndexThe index of the considered connection pin.
fromA Boolean value indicating whether the link starts (IlTrue) or ends (IlFalse) at the corresponding node.
countThe number of returned links.
Returns
The links.

§ getLocation()

virtual IlBoolean IlvGrapherPin::getLocation ( IlUInt  pinIndex,
const IlvGraphic node,
const IlvTransformer t,
IlvPoint returnPoint 
) const
virtual

Returns the coordinates of a connection pin.

Returns, in the parameter returnPoint, the coordinates of the connection pin that has the index pinIndex on the node node, when displayed after transformer t is applied. This method has to be defined in subclasses.

Parameters
pinIndexThe index of the considered pin.
nodeThe node this instance is associated with.
tThe transformer applied to the node.
returnPointThe coordinates of the connection point.
Returns
IlTrue if there is a connecting pin at the index pinIndex for the node node, and IlFalse otherwise.

Reimplemented in IlvGenericPin.

§ getPinIndex()

virtual IlUInt IlvGrapherPin::getPinIndex ( const IlvGraphic link,
IlBoolean  from 
)
virtual

Returns the index of the connection pin for a given link.

Returns the index of the connection pin handled by the object where the link link is connected.

Parameters
linkThe considered link.
fromA Boolean value indicating whether the connection is made on the start point of the link (IlTrue) or on its end point (IlFalse).
Returns
The index of the connection pin, or IlvBadIndex if none was found.

§ Remove()

static IlvGrapherPin* IlvGrapherPin::Remove ( IlvGraphic node)
static

Removes the IlvGrapherPin instance associated with a given node.

Does not delete the grapher pin. It can therefore be kept for future use.

Parameters
nodeThe considered node.
Returns
The associated grapher pin if it exists and 0 otherwise.

§ removeLink()

void IlvGrapherPin::removeLink ( const IlvGraphic node,
const IlvGraphic link,
IlBoolean  from 
)

Removes a link connected to a pin.

Removes link from the list of links connected to one of the pins managed by the instance.

Parameters
nodeThe node this instance is associated with.
linkThe link to disconnect.
fromA Boolean value indicating whether the link starts (IlTrue) or ends (IlFalse) at the corresponding node.

§ set()

IlvGrapherPin* IlvGrapherPin::set ( IlvGraphic node)

Associates the instance with a graphic node.

This method is equivalent to: node->setNamedProperty(this);.

Parameters
nodeThe considered node.
Returns
The IlvGrapherPin instance that was previously associated with the node node.

§ setPinIndex()

virtual void IlvGrapherPin::setPinIndex ( const IlvGraphic link,
IlUInt  pinIndex,
IlBoolean  from 
)
virtual

Sets the connection pin for a given link.

Specifies that the link link connects through this grapher pin at the pin index pinIndex. If the link was already connected through the grapher pin, its previous pin index is replaced.

Parameters
linkThe considered link.
pinIndexThe index of the new connection pin.
fromA Boolean value indicating whether the connection is made on the start point of the link (IlTrue) or on its end point (IlFalse).

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