rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Grapher Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvMakePolyLinkInteractor Class Reference

Grapher interactor to create links defined by several points. More...

#include <ilviews/grapher/polylink.h>

Inheritance diagram for IlvMakePolyLinkInteractor:
IlvMakePolyPointsInteractor IlvManagerViewInteractor IlvMakePolylineLinkInteractor

List of all members.

Public Member Functions

 IlvMakePolyLinkInteractor (IlvManager *manager, IlvView *view, IlBoolean oriented=IlFalse)
 Constructor.
virtual void abort ()
 Resets the interactor to an inactive state.
virtual IlBoolean accept (IlvPoint &point)
 Checks if a point is valid.
virtual IlBoolean acceptEnd (IlUInt count, IlvPoint *allPoints)
 Validates the link creation.
virtual void doIt (IlUInt count, IlvPoint *allPoints)
 Creates and adds a new link to the grapher.
IlvGraphicgetEndNode () const
 Returns the ending node.
IlvGraphergetGrapher () const
 Returns the grapher to which the interactor is attached.
IlvGraphicgetStartNode () const
 Returns the starting node.
virtual void init ()
 Resets the interactor to an active state.
IlBoolean isOriented () const
 Indicates whether created links are oriented.
virtual void react (IlvPoint &point, IlUShort modifier=0)
 Highlights the nodes under a given point.
void setEndNode (IlvGraphic *end)
 Sets the ending node.
void setStartNode (IlvGraphic *start)
 Sets the starting node.

Protected Member Functions

virtual IlvLinkImagemakeLink (IlUInt count, IlvPoint *points)=0
 Factory method to create the new link instance.
virtual void storeLink (IlvLinkImage *link)
 Adds the new link instance to the grapher.

Detailed Description

Grapher interactor to create links defined by several points.

Library: ilvgrapher

This is an interactor abstract class. You need to subtype this class to create the links. In particular, the IlvMakePolyLinkInteractor::makeLink method should be redefined to create links of the appropriate type.

See also:
IlvPolylineLinkImage.

Constructor & Destructor Documentation

IlvMakePolyLinkInteractor::IlvMakePolyLinkInteractor ( IlvManager manager,
IlvView view,
IlBoolean  oriented = IlFalse 
)

Constructor.

The constructor initializes a new instance of the IlvMakePolyLinkInteractor class for the view v and the grapher mgr.

The mgr parameter is assumed to be of type IlvGrapher. The oriented parameter is used to create the link in the IlvMakePolyLinkInteractor::makeLink method.

Parameters:
mgr The grapher to which the interactor is attached.
v The view to which the interactor is attached.
oriented IlTrue if created links are oriented and IlFalse otherwise.

Member Function Documentation

virtual IlBoolean IlvMakePolyLinkInteractor::accept ( IlvPoint point  )  [virtual]

Checks if a point is valid.

If the point point is the first of the link, it is accepted only if there is a node containing this point. In this case, the node is registered as the starting node of the link that will be created by the IlvMakePolyLinkInteractor::makeLink method.
This method can be overloaded to add specific constraints on the starting node or on the intermediate points that will define the link.

Parameters:
point The point to validate, in manager coordinates.
Returns:
IlTrue if the point that the user provides is acceptable. Otherwise, it returns IlFalse.
See also:
getStartNode.

Reimplemented from IlvMakePolyPointsInteractor.

virtual IlBoolean IlvMakePolyLinkInteractor::acceptEnd ( IlUInt  count,
IlvPoint allPoints 
) [virtual]

Validates the link creation.

Called by the member function IlvMakePolyLinkInteractor::doIt before creating the link. If this method returns IlTrue, the doIt method proceeds. Otherwise, it is aborted and no link is created. The default implementation returns IlTrue.

Parameters:
count The number of points specified by the user.
allPoints The points specified by the user.
virtual void IlvMakePolyLinkInteractor::doIt ( IlUInt  count,
IlvPoint allPoints 
) [virtual]

Creates and adds a new link to the grapher.

Called when the user ends the interaction (usually through a double-click). The allPoints array gives all the points drawn by the user. The default implementation first calls the IlvMakePolyLinkInteractor::makeLink method with the intermediate points of the link (that is, all the points of allPoints except the first and the last). It then calls IlvMakePolyLinkInteractor::storeLink with the created instance to add it to the grapher.

Parameters:
count The number of points specified by the user.
allPoints The points specified by the user.

Implements IlvMakePolyPointsInteractor.

IlvGraphic* IlvMakePolyLinkInteractor::getEndNode (  )  const

Returns the ending node.

The ending node is registered by the IlvMakePolyLinkInteractor::react member function each time the mouse passes over a new node.

Returns:
The ending node.
IlvGrapher* IlvMakePolyLinkInteractor::getGrapher (  )  const

Returns the grapher to which the interactor is attached.

Returns:
The grapher to which the interactor is attached.
IlvGraphic* IlvMakePolyLinkInteractor::getStartNode (  )  const

Returns the starting node.

The starting node is stored by the IlvMakePolyLinkInteractor::accept member function when the first mouse click occurs.

Returns:
The starting node.
IlBoolean IlvMakePolyLinkInteractor::isOriented (  )  const

Indicates whether created links are oriented.

Returns:
IlTrue if created links are oriented and IlFalse otherwise.
virtual IlvLinkImage* IlvMakePolyLinkInteractor::makeLink ( IlUInt  count,
IlvPoint points 
) [protected, pure virtual]

Factory method to create the new link instance.

The points array specifies the intermediate points of the link (that is, the two endpoints of the link are not given in this array).
This method must be redefined to create the appropriate link instance. The link is created using the information given by the IlvMakePolyLinkInteractor::getStartNode, IlvMakePolyLinkInteractor::getEndNode, and IlvMakePolyLinkInteractor::isOriented methods.

Parameters:
count The number of intermediate points defining the link.
points The intermediate points defining the link.
See also:
getStartNode, getEndNode, isOriented.

Implemented in IlvMakePolylineLinkInteractor.

virtual void IlvMakePolyLinkInteractor::react ( IlvPoint point,
IlUShort  modifier = 0 
) [virtual]

Highlights the nodes under a given point.

Highlights (by selecting and deselecting) the nodes over which the mouse passes. The last selected node is registered as the ending node of the link. If the node uses connection pins, these are highlighted and the closest pin to point point is stored.

Parameters:
point The point in manager coordinates.
See also:
IlvGrapherPin, IlvGrapherPin::getClosest, getEndNode.

Reimplemented from IlvMakePolyPointsInteractor.

void IlvMakePolyLinkInteractor::setEndNode ( IlvGraphic end  ) 

Sets the ending node.

Parameters:
end The new ending node.
void IlvMakePolyLinkInteractor::setStartNode ( IlvGraphic start  ) 

Sets the starting node.

Parameters:
start The new starting node.
virtual void IlvMakePolyLinkInteractor::storeLink ( IlvLinkImage link  )  [protected, virtual]

Adds the new link instance to the grapher.

If connection pins were registered during the interaction, this method connects them to link before it is added to the grapher.

Parameters:
link The new link.
See also:
IlvGrapherPin, IlvGrapherPin::setPinIndex.

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