Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Manager interactor class. More...
#include <ilviews/manager/mkpolyin.h>
Public Member Functions | |
IlvMakeSplineInteractor (IlvManager *manager, IlvView *view) | |
Constructor. | |
IlBoolean | accept (IlvPoint &p) |
Lets the interactor accept or refuse a new point location. | |
virtual void | commit (IlBoolean removeExtraPoints) |
void | displayIntermediatePoints (IlBoolean d) |
IlBoolean | displayIntermediatePoints () |
virtual void | doIt (IlUInt count, IlvPoint *points) |
Finalizes the interaction by creating an IlvSpline object. | |
virtual void | drawGhost () |
Visual feedback during interaction. | |
virtual void | drawHull () |
draws the control points of the Bezier curve. | |
void | react (IlvPoint &p, IlUShort modifier=0) |
Ensures the Bezier spline remains continuously derivable as new points are entered. |
Manager interactor class.
Library: ilvmgr
Use this class to create IlvSpline
(Cubic Bezier) objects in a view controlled by a manager. The virtual member function handleEvent
monitors mouse events. To draw a spline, the user:
If the user presses the Control modifier while dragging the left mouse button, the left and right tangents at the current point are dissociated, letting the user create cusps on the Bezier spline.
IlvSpline
, IlvPolySelectInteractor
, IlvMakePolylineInteractor
, IlvMakeFilledSplineInteractor
, IlvMakeClosedSplineInteractor
. IlvMakeSplineInteractor::IlvMakeSplineInteractor | ( | IlvManager * | manager, | |
IlvView * | view | |||
) |
Constructor.
Initializes a new instance of the IlvMakeSplineInteractor
class.
manager | The manager. | |
view | The manager view. |
Lets the interactor accept or refuse a new point location.
Allows the interactor to determine whether a location chosen by the user is valid for the interaction.
IlTrue
if the point is accepted and IlFalse
if it is not. In the default implementation, the point is accepted if it is not too close to the previous one. More precisely, the point is accepted if the two following conditions are met: p | The point, in the object coordinate system. |
Reimplemented from IlvMakePolyPointsInteractor.
virtual void IlvMakeSplineInteractor::commit | ( | IlBoolean | removeExtraPoints | ) | [virtual] |
Called by handleEvent
when the polypoint is terminated. This method should call doIt() and post an undoable command if need be.
removeExtraPoints | When the curve entry is terminated by a double click, it may be desirable to remove the extra points that have been added in succession by the double click. This flag is set to tell the method that it should get rid of the extraneous points before calling doIt() . |
Reimplemented from IlvMakePolyPointsInteractor.
Reimplemented in IlvMakeFilledSplineInteractor.
void IlvMakeSplineInteractor::displayIntermediatePoints | ( | IlBoolean | d | ) |
Tells the interactor whether or not to display the control points which are not on the curve.
IlBoolean IlvMakeSplineInteractor::displayIntermediatePoints | ( | ) |
Indicates whether or not the control points which are not on the curve are displayed.
Finalizes the interaction by creating an IlvSpline
object.
Creates an IlvSpline
in the manager from the array of points provided during the interaction.
count | The number of points in the array. | |
points | The array of points, in the object coordinate system. |
Implements IlvMakePolyPointsInteractor.
Reimplemented in IlvMakeFilledSplineInteractor, and IlvMakeClosedSplineInteractor.
virtual void IlvMakeSplineInteractor::drawGhost | ( | ) | [virtual] |
Visual feedback during interaction.
Draws a spline in XOR
mode.
Implements IlvMakePolyPointsInteractor.
Reimplemented in IlvMakeFilledSplineInteractor, and IlvMakeClosedSplineInteractor.
virtual void IlvMakeSplineInteractor::drawHull | ( | ) | [virtual] |
draws the control points of the Bezier curve.
Draws a square for each end point of the Bezier and a cross for each control point.
Reimplemented from IlvMakePolyPointsInteractor.
Ensures the Bezier spline remains continuously derivable as new points are entered.
When a new control point is added, the default implementation realigns the previous control points if needed, to ensure that the Bezier stays continuous at each control point. This behavior is overridden if the user presses the Control modifier while drawing the curve.
Reimplemented from IlvMakePolyPointsInteractor.
Reimplemented in IlvMakeFilledSplineInteractor.
© 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.