Creating Nodes
The IlvMakeNodeInteractor class is the base class for interactors that allow the user to interactively create nodes in a grapher. Instances of this class must be attached to a grapher and one of its connected views, as shown here:
IlvGrapher* graph = ...;
IlvView* view = ...;
IlvMakeNodeInteractor * inter = new IlvMakeNodeInteractor(graph, view);
graph->setInteractor(inter);
To create a node, drag a rectangular region in the working view. There are two ways to specify what type of graphic object is created:
-
Subtype the IlvMakeNodeInteractor class and overload its createNode method.
-
Subtype the IlvMakeNodeInteractorFactory class and overload its createNode method. You can associate a node factory with an interactor by using the setFactory method.
The grapher library provides predefined subclasses of IlvMakeNodeInteractor:
-
IlvMakeShadowNodeInteractor - This interactor creates instances of the IlvShadowLabel class and stores them as nodes in the grapher.
-
IlvMakeReliefNodeInteractor - This interactor creates instances of the IlvReliefLabel class and stores them as nodes in the grapher.