Rogue Wave Views
Manager Package API Reference Guide
Product Documentation:

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

Manager interactor class. More...

#include <ilviews/manager/mkpolyin.h>

Inheritance diagram for IlvMakeSplineInteractor:
IlvMakePolyPointsInteractor IlvManagerViewInteractor IlvValueInterface IlvMakeFilledSplineInteractor IlvMakeClosedSplineInteractor

Public Member Functions

 IlvMakeSplineInteractor (IlvManager *manager, IlvView *view)
 Initializes a new instance of the IlvMakeSplineInteractor class. More...
 
IlBoolean accept (IlvPoint &)
 Lets the interactor accept or refuse a new point location. More...
 
virtual void commit (IlBoolean)
 Called by handleEvent when the polypoint is terminated. More...
 
IlBoolean displayIntermediatePoints ()
 Indicates whether or not the control points which are not on the curve are displayed. More...
 
void displayIntermediatePoints (IlBoolean d)
 the interactor whether or not to display the control points which are not on the curve. More...
 
virtual void doIt (IlUInt count, IlvPoint *points)
 Finalizes the interaction by creating an IlvSpline object. More...
 
virtual void drawGhost ()
 Provides the visual feedback during interaction. More...
 
virtual void drawHull ()
 Draws the control points of the Bezier curve. More...
 
void react (IlvPoint &p, IlUShort modifiers=0)
 Ensures the Bezier spline remains continuously derivable as new points are entered. More...
 
- Public Member Functions inherited from IlvMakePolyPointsInteractor
 IlvMakePolyPointsInteractor (IlvManager *manager, IlvView *view)
 Initializes a new IlvMakePolyPointsInteractor instance. More...
 
void abort ()
 Aborts the interaction. More...
 
IlUInt count ()
 Returns the number of elements in the current array of points. More...
 
IlUShort getThreshold () const
 Returns the threshold. More...
 
virtual IlBoolean handleEvent (IlvEvent &event)
 Handles events for the manager view. More...
 
void init ()
 Initialization, when the interactor is attached to a view. More...
 
IlvPointpoints ()
 Returns the current array of points. More...
 
void setThreshold (IlUShort val)
 Sets the threshold. More...
 
- Public Member Functions inherited from IlvManagerViewInteractor
 IlvManagerViewInteractor (IlvManager *manager, IlvView *view)
 Initializes a new IlvManagerViewInteractor. More...
 
virtual void ensureVisible (const IlvPoint &point)
 Ensures the visibility of a given location. More...
 
IlvDisplaygetDisplay () const
 Returns the display of the manager view. More...
 
IlvManagergetManager () const
 Returns the manager. More...
 
IlvTransformergetTransformer () const
 Returns the transformer used with the manager view. More...
 
IlvViewgetView () const
 Returns the manager view. More...
 
virtual void handleExpose (IlvRegion *clip=0)
 Called when the manager view receives an expose event. More...
 

Additional Inherited Members

- Protected Member Functions inherited from IlvMakePolyPointsInteractor
IlvPointtransformPoints () const
 Returns the array of points in the coordinate system of the view. More...
 

Detailed Description

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:

  1. Clicks and drag the left mouse button to add a point and set its tangents and tension.
  2. Presses the return or space key, or double clicks to finish.

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.

See also
IlvSpline, IlvPolySelectInteractor, IlvMakePolylineInteractor, IlvMakeFilledSplineInteractor, IlvMakeClosedSplineInteractor.

Constructor & Destructor Documentation

§ IlvMakeSplineInteractor()

IlvMakeSplineInteractor::IlvMakeSplineInteractor ( IlvManager manager,
IlvView view 
)

Initializes a new instance of the IlvMakeSplineInteractor class.

Parameters
managerThe manager.
viewThe manager view.

Member Function Documentation

§ accept()

IlBoolean IlvMakeSplineInteractor::accept ( IlvPoint p)
virtual

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.

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:

IlvAbs(cur.x() - prev.x()) >= threshold
IlvAbs(cur.y() - prev.y()) >= threshold
Parameters
pThe point, in the object coordinate system.
Returns
IlTrue if the point is accepted and IlFalse if it is not.

Reimplemented from IlvMakePolyPointsInteractor.

§ commit()

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.

Parameters
removeExtraPointsWhen 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.

§ displayIntermediatePoints() [1/2]

IlBoolean IlvMakeSplineInteractor::displayIntermediatePoints ( )

Indicates whether or not the control points which are not on the curve are displayed.

Returns
IlTrue if intermediate points are indicated with a marker, and IlFalse if they are not.

§ displayIntermediatePoints() [2/2]

void IlvMakeSplineInteractor::displayIntermediatePoints ( IlBoolean  d)

the interactor whether or not to display the control points which are not on the curve.

Parameters
dIlTrue to place a marker on intermediate points, or IlFalse not to place markers.

§ doIt()

virtual void IlvMakeSplineInteractor::doIt ( IlUInt  count,
IlvPoint points 
)
virtual

Finalizes the interaction by creating an IlvSpline object.

Creates an IlvSpline in the manager from the array of points provided during the interaction.

Parameters
countThe number of points in the array.
pointsThe array of points, in the object coordinate system.

Implements IlvMakePolyPointsInteractor.

Reimplemented in IlvMakeClosedSplineInteractor, and IlvMakeFilledSplineInteractor.

§ drawGhost()

virtual void IlvMakeSplineInteractor::drawGhost ( )
virtual

Provides the visual feedback during interaction.

Draws a spline in XOR mode.

Implements IlvMakePolyPointsInteractor.

Reimplemented in IlvMakeClosedSplineInteractor, and IlvMakeFilledSplineInteractor.

§ drawHull()

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.

§ react()

void IlvMakeSplineInteractor::react ( IlvPoint p,
IlUShort  modifiers = 0 
)
virtual

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.

Parameters
pThe point, in the object coordinate system.
modifiersThe modifier keys that were depressed when the user created the current point

Reimplemented from IlvMakePolyPointsInteractor.

Reimplemented in IlvMakeFilledSplineInteractor.


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