Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Graphic path-related class. More...
#include <ilviews/graphics/path.h>
Public Member Functions | |
IlFloat | getAngle () const |
Gets the angle of the current step. | |
IlUInt | getCurPath () const |
Gets the current path. | |
const IlvPoint * | getCurPosition () const |
Gets the coordinates of a point on the current segment. | |
IlUInt | getCurSegment () const |
Gets the current segment in the current path. | |
const IlvGraphicPath * | getGraphicPath () const |
Gets the graphic path. | |
const IlvPointArray * | getTransformedPaths () const |
Gets an array of transformed IlvPointArray . | |
const IlvTransformer * | getTransformer () const |
Gets the current transformer. | |
IlAny | getUserArg () const |
Gets the user-defined value given to the constructor. | |
IlUInt | getUserStep () const |
Gets the step used in stepping . | |
virtual void | init (const IlvGraphicPath *gp, const IlvPointArray *transformed, const IlvTransformer *tr) |
Reinitializes the drawing data. | |
virtual void | stepping () |
Implements the algorithm to travel along the graphic path. | |
Protected Member Functions | |
IlvPathSteppingData (IlUInt userStep, IlAny userArg) | |
Constructor. | |
virtual IlBoolean | acceptPath () |
Protected Member Function. | |
virtual IlBoolean | beginStepping () |
Begins the travelling operation. | |
virtual IlBoolean | doIt ()=0 |
Protected Member Function. | |
virtual void | endStepping () |
Begins the travelling operation. |
Graphic path-related class.
Library: views
The IlvPathSteppingData
class is an abstract class. Instances of this class are intended to be associated with an IlvGraphicPath
object. Its main purpose is to travel the collection of polypoints, considered for this purpose as polylines, and to call its member function doIt
periodically. How often doIt
is called depends on the step of the IlvPathSteppingData
.
The step is not time-based but must be considered as a distance along the path.
IlvGraphicPath
, IlvPathDrawingData
. Constructor.
The constructor initializes a new IlvPathSteppingData
object with a stepping distance of userStep and a user parameter of userArg.
userStep | The stepping distance. | |
userArg | The user parameter. |
virtual IlBoolean IlvPathSteppingData::acceptPath | ( | ) | [protected, virtual] |
Protected Member Function.
Called by stepping
before processing a new point array. If it returns IlFalse
, this point array is ignored and stepping
proceeds with the next one. The default implementation does nothing and returns IlTrue
. This method is called by the method stepping
and is meant to be redefined in subclasses. The default implementation is minimal.
virtual IlBoolean IlvPathSteppingData::beginStepping | ( | ) | [protected, virtual] |
Begins the travelling operation.
Called by stepping
before anything else. If it returns IlFalse
, stepping
returns immediately without calling endStepping
. The default implementation does nothing and returns IlTrue
. This method is called by the method stepping
and is meant to be redefined in subclasses. The default implementation is minimal.
virtual IlBoolean IlvPathSteppingData::doIt | ( | ) | [protected, pure virtual] |
Protected Member Function.
Called at each step by stepping
. If it returns IlFalse
, stepping
returns immediately without calling endStepping
. This method is called by the method stepping
and is meant to be redefined in subclasses.
Implemented in IlvPathDrawingData.
virtual void IlvPathSteppingData::endStepping | ( | ) | [protected, virtual] |
Begins the travelling operation.
Called at each step by stepping
. The default implementation does nothing. This method is called by the method stepping
and is meant to be redefined in subclasses.
IlFloat IlvPathSteppingData::getAngle | ( | ) | const |
Gets the angle of the current step.
Holds the angle of the current step relative to a horizontal line. This value is not always equal to the angle of the current polyline segment. This method is called by the method stepping
and is meant to be redefined in subclasses. The default implementation is minimal.
IlUInt IlvPathSteppingData::getCurPath | ( | ) | const |
Gets the current path.
Holds the index of the current IlvPointArray
.
const IlvPoint* IlvPathSteppingData::getCurPosition | ( | ) | const |
Gets the coordinates of a point on the current segment.
Holds the actual coordinates of a point on the current segment. This point is the origin of the current step
.
IlUInt IlvPathSteppingData::getCurSegment | ( | ) | const |
Gets the current segment in the current path.
Holds the index of the current segment in the current path, that is, the index of the last IlvPoint
crossed in the current IlvPointArray
indicated by _curPath
.
const IlvGraphicPath* IlvPathSteppingData::getGraphicPath | ( | ) | const |
Gets the graphic path.
Returns the graphic path. This is set each time init
is called.
const IlvPointArray* IlvPathSteppingData::getTransformedPaths | ( | ) | const |
Gets an array of transformed IlvPointArray
.
Returns an array of transformed IlvPointArray
. The member function stepping
uses this array instead of the points contained in the IlvGraphicPath
(these two data items may be identical if the transformer returned by getTransformer
is 0
).
IlvPointArray
. const IlvTransformer* IlvPathSteppingData::getTransformer | ( | ) | const |
Gets the current transformer.
IlAny IlvPathSteppingData::getUserArg | ( | ) | const |
Gets the user-defined value given to the constructor.
Returns the user-defined value given to the constructor.
IlUInt IlvPathSteppingData::getUserStep | ( | ) | const |
Gets the step used in stepping
.
Returns the step used in stepping
.
stepping
. virtual void IlvPathSteppingData::init | ( | const IlvGraphicPath * | gp, | |
const IlvPointArray * | transformed, | |||
const IlvTransformer * | tr | |||
) | [virtual] |
Reinitializes the drawing data.
Reinitializes the drawing data between subsequent calls to stepping
. transformed is an array of IlvPointArray
. It contains the points of the IlvGraphicPath
, and the transformer tr has been applied to each of them. stepping
uses this data instead of the original points of gp. If tr is 0
, transformed may be equal to the internal array of the graphic path, that is, gp->getPaths()
.
gp | The graphic path. | |
transformed | The array of transformed IlvPointArray . | |
tr | The transformer to be applied to gp. |
virtual void IlvPathSteppingData::stepping | ( | ) | [virtual] |
Implements the algorithm to travel along the graphic path.
Implements the algorithm to travel along the graphic path and calls doIt
every time a distance equal to the step is travelled. In other words, stepping
approximates each polypoint of the IlvGraphicPath
by a polyline whose segments all have the same length, step. For each one of these segments, stepping
calls doIt
.
stepping
calls several virtual methods to allow subclasses to perform specific actions without rewriting the entire stepping algorithm.
stepping
calls beginStepping
. If it returns IlFalse
, the method returns immediately (without calling endStepping
). stepping
calls acceptPath
: if the return value is IlFalse
, the point array is ignored and the next one is picked. doIt
is called at each step, as described above. If it returns IlFalse
, stepping
returns immediately (without calling endStepping
). endStepping
is called. This method is responsible for updating most of the protected fields returned by the following get
methods.
© 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.