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

Interactor to select and manipulate gantt nodes. More...

#include <ilviews/gantt/ganttint.h>

Inheritance diagram for IlvGanttSelectInteractor:
IlvGraphSelectInteractor IlvSelectInteractor IlvManagerViewInteractor IlvValueInterface

Public Member Functions

 IlvGanttSelectInteractor (IlvGanttChart *gantt, IlvView *view)
 Constructor. More...
 
virtual void doReshape (IlvGraphic *graphic, const IlvRect &rect)
 Changes the schedule of Gantt subnodes. More...
 
virtual void doTranslate (const IlvPoint &p)
 Moves Gantt subnodes. More...
 
virtual void drawGhostMove (IlvGraphic *graphic, IlvRegion *clip=0)
 Draws the image of the moved subnode. More...
 
virtual void drawGhostReshape (IlvGraphic *graphic, IlvRegion *clip=0)
 Draws the image of the reshaped subnode. More...
 
virtual void ensureVisible (const IlvPoint &p)
 Translates the working view according to the mouse position. More...
 
IlvGanttChartgetGanttChart () const
 Returns the Gantt chart with which this interactor is associated. More...
 
virtual IlBoolean handleEvent (IlvEvent &event)
 Handles all incoming events. More...
 
virtual void moveNode (IlvGanttNode *node, IlInt *startMinArray, IlInt *startMaxArray, IlInt *endMinArray, IlInt *endMaxArray, IlvGanttLine **lines)
 Moves all subnodes of a Gantt node. More...
 
virtual void moveSubNode (IlvGanttNode *node, IlUShort idx, IlInt startMin, IlInt startMax, IlInt endMin, IlInt endMax, IlvGanttLine *line)
 Moves a subnode of a Gantt node. More...
 
virtual void reshapeNode (IlvGanttNode *node, IlInt *startMinArray, IlInt *startMaxArray, IlInt *endMinArray, IlInt *endMaxArray)
 Changes the schedule of all subnodes of a Gantt node. More...
 
virtual void reshapeSubNode (IlvGanttNode *node, IlUShort idx, IlInt startMin, IlInt startMax, IlInt endMin, IlInt endMax)
 Changes the schedule of a subnode. More...
 

Detailed Description

Interactor to select and manipulate gantt nodes.

Library: ilvgantt

The IlvGanttSelectInteractor instances handle all selection, translation, and object-resizing tasks.

See also
IlvGanttChart, IlvGanttSubNode, IlvGanttNode.

Constructor & Destructor Documentation

◆ IlvGanttSelectInteractor()

IlvGanttSelectInteractor::IlvGanttSelectInteractor ( IlvGanttChart gantt,
IlvView view 
)

Constructor.

The constructor initializes a new instance of the IlvGanttSelectInteractor class that will let the user select Gantt subnodes, Gantt nodes, or groups of Gantt subnodes in the view view connected to the grapher of the Gantt chart gantt.

Parameters
ganttThe gantt to which the interactor is attached.
viewThe view to which the interactor is attached. This view must be one of the Gantt grapher view where activities (nodes) are displayed.

Member Function Documentation

◆ doReshape()

virtual void IlvGanttSelectInteractor::doReshape ( IlvGraphic graphic,
const IlvRect rect 
)
virtual

Changes the schedule of Gantt subnodes.

Computes the new start and end times of the Gantt subnode represented by the graphic object graphic. Once these values are computed, two cases are considered:

Parameters
graphicThe considered graphic object.
rectThe new bounding box for the graphic object.

Reimplemented from IlvSelectInteractor.

◆ doTranslate()

virtual void IlvGanttSelectInteractor::doTranslate ( const IlvPoint p)
virtual

Moves Gantt subnodes.

Computes the new start and end times of the current selected Gantt chart subnodes and determines the new lines they are attached to. Once these values are computed, two cases are considered:

Parameters
pThe new position of the bounding box of the objects.

Reimplemented from IlvSelectInteractor.

◆ drawGhostMove()

virtual void IlvGanttSelectInteractor::drawGhostMove ( IlvGraphic graphic,
IlvRegion clip = 0 
)
virtual

Draws the image of the moved subnode.

Snaps the position of graphic with respect to the Gantt lines.

Parameters
graphicThe graphic object representing the Gantt subnode.
clipThe clip used for the drawing.

Reimplemented from IlvSelectInteractor.

◆ drawGhostReshape()

virtual void IlvGanttSelectInteractor::drawGhostReshape ( IlvGraphic graphic,
IlvRegion clip = 0 
)
virtual

Draws the image of the reshaped subnode.

Prevents the user from modifying the height of graphic.

Parameters
graphicThe graphic object representing the Gantt subnode.
clipThe clip used for the drawing.

Reimplemented from IlvSelectInteractor.

◆ ensureVisible()

virtual void IlvGanttSelectInteractor::ensureVisible ( const IlvPoint p)
virtual

Translates the working view according to the mouse position.

Performs a logical view translation when the user drags the mouse outside the view.

Parameters
pThe location of the mouse, in view coordinates.

Reimplemented from IlvManagerViewInteractor.

◆ getGanttChart()

IlvGanttChart* IlvGanttSelectInteractor::getGanttChart ( ) const

Returns the Gantt chart with which this interactor is associated.

Returns
The Gantt chart with which this interactor is associated.

◆ handleEvent()

virtual IlBoolean IlvGanttSelectInteractor::handleEvent ( IlvEvent event)
virtual

Handles all incoming events.

Lets the user select, translate, and reshape Gantt chart subnodes as well as a Gantt chart node. Gantt nodes can be selected using the mouse button with the Ctrl key pressed.

Parameters
eventThe received event.
Returns
IlTrue if the event is consumed, IlFalse otherwise.

Reimplemented from IlvSelectInteractor.

◆ moveNode()

virtual void IlvGanttSelectInteractor::moveNode ( IlvGanttNode node,
IlInt startMinArray,
IlInt startMaxArray,
IlInt endMinArray,
IlInt endMaxArray,
IlvGanttLine **  lines 
)
virtual

Moves all subnodes of a Gantt node.

Is designed to be overloaded when linking the Gantt chart with a scheduling program. The default implementation modifies the start and end times of each Gantt subnode of node to the corresponding values in the given arrays, and associates the subnode to the corresponding Gantt line in lines.

Parameters
nodeThe considered Gantt node.
startMinArrayThe new earliest start times for the subnodes of node.
startMaxArrayThe new latest start times for the subnodes of node.
endMinArrayThe new earliest end times for the subnodes of node.
endMaxArrayThe new latest end times for the subnodes of node.
linesThe new Gantt lines for the subnodes of node.

◆ moveSubNode()

virtual void IlvGanttSelectInteractor::moveSubNode ( IlvGanttNode node,
IlUShort  idx,
IlInt  startMin,
IlInt  startMax,
IlInt  endMin,
IlInt  endMax,
IlvGanttLine line 
)
virtual

Moves a subnode of a Gantt node.

Is designed to be overloaded when linking the Gantt chart with a scheduling program. The default implementation modifies the start and end times of the subnode of index idx in the node node, as well as its associated Gantt line.

Parameters
nodeThe considered Gantt node.
idxThe index of the considered subnode in node.
startMinThe new earliest start time for the subnode.
startMaxThe new latest start time for the subnode
endMinThe new earliest end time for the subnode.
endMaxThe new latest end time for the subnode.
lineThe new Gantt line for the subnode.

◆ reshapeNode()

virtual void IlvGanttSelectInteractor::reshapeNode ( IlvGanttNode node,
IlInt startMinArray,
IlInt startMaxArray,
IlInt endMinArray,
IlInt endMaxArray 
)
virtual

Changes the schedule of all subnodes of a Gantt node.

Is designed to be overloaded when linking the Gantt chart with a scheduling program. The default implementation modifies the start and end times of each Gantt subnode of node to the corresponding values in the given arrays.

Parameters
nodeThe considered Gantt node.
startMinArrayThe new earliest start times for the subnodes of node.
startMaxArrayThe new latest start times for the subnodes of node.
endMinArrayThe new earliest end times for the subnodes of node.
endMaxArrayThe new latest end times for the subnodes of node.

◆ reshapeSubNode()

virtual void IlvGanttSelectInteractor::reshapeSubNode ( IlvGanttNode node,
IlUShort  idx,
IlInt  startMin,
IlInt  startMax,
IlInt  endMin,
IlInt  endMax 
)
virtual

Changes the schedule of a subnode.

Is designed to be overloaded when linking the Gantt chart with a scheduling program. The default implementation modifies the start and end times of the subnode of index idx in the node node.

Parameters
nodeThe considered Gantt node.
idxThe index of the considered subnode in node.
startMinThe new earliest start time for the subnode.
startMaxThe new latest start time for the subnode
endMinThe new earliest end time for the subnode.
endMaxThe new latest end time for the subnode.