Class CAAT.PathUtil.Path
Extends
CAAT.PathUtil.PathSegment.
Defined in: Path.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
starting path x position
|
|
starting path y position
|
|
A list of behaviors to apply to this path.
|
|
Path bounding box X position.
|
|
Path bounding box Y position.
|
|
Is this path closed ?
|
|
Path bounding box height.
|
|
Is this path interactive ?.
|
|
Path behaviors matrix.
|
|
spare CAAT.Math.Point to return calculated values in the path.
|
|
path length (sum of every segment length)
|
|
Original Path´s path segments points.
|
|
For each path segment in this path, the normalized calculated duration.
|
|
A collection of PathSegments.
|
|
For each path segment in this path, the normalized calculated start time.
|
|
Path rotation angle.
|
|
Path rotation x anchor.
|
|
Path rotation x anchor.
|
|
Path scale X anchor.
|
|
Path scale Y anchor.
|
|
Path X scale.
|
|
Path Y scale.
|
|
Path translation anchor X.
|
|
Path translation anchor Y.
|
|
Path translation X.
|
|
Path translation Y.
|
|
Spare calculation matrix.
|
|
Path bounding box width.
|
- Fields borrowed from class CAAT.PathUtil.PathSegment:
- bbox, color, length, parent
Method Attributes | Method Name and Description |
---|---|
<private> |
__getPositionImpl(time)
|
<private> |
__init()
|
addArcTo(x1, y1, x2, y2, radius, cw, color)
|
|
addBehavior(behavior)
Add a Behavior to the Actor.
|
|
addCatmullTo(px1, py1, px2, py2, px3, py3, color)
Add a Catmull-Rom segment to this path.
|
|
addCubicTo(px1, py1, px2, py2, px3, py3, color)
Add a Cubic Bezier segment to this path.
|
|
addLineTo(px1, py1, color)
Adds a line segment to this path.
|
|
addQuadricTo(px1, py1, px2, py2, color)
Add a Quadric Bezier path segment to this path.
|
|
addRectangleTo(x1, y1, cw, color)
|
|
addSegment(pathSegment)
Add a CAAT.PathSegment instance to this path.
|
|
applyAsPath(director)
Apply this path as a Canvas context path.
|
|
applyBehaviors(time)
|
|
beginPath(px0, py0)
Set the path's starting point.
|
|
|
|
drag(x, y, callback)
Drags a path's control point.
|
|
Removes all behaviors from an Actor.
|
|
Return the last point of the last path segment of this compound path.
|
|
endPath()
Finishes the process of building the path.
|
|
flatten(npatches, closed)
|
|
getContour(iSize)
Returns a collection of CAAT.Point objects which conform a path's contour.
|
|
getControlPoint(index)
|
|
Return the last path segment added to this path.
|
|
Returns an integer with the number of path segments that conform this path.
|
|
getPosition(time, open_contour)
This method, returns a CAAT.Foundation.Point instance indicating a coordinate in the path.
|
|
getPositionFromLength(iLength)
Analogously to the method getPosition, this method returns a CAAT.Point instance with
the coordinate on the path that corresponds to the given length.
|
|
getSegment(index)
Gets a CAAT.PathSegment instance.
|
|
isEmpty()
|
|
paint(director)
Paints the path.
|
|
press(x, y)
Sent by a CAAT.PathActor instance object to try to drag a path's control point.
|
|
release()
Method invoked when a CAAT.PathActor stops dragging a control point.
|
|
Remove a Behavior with id param as behavior identifier from this actor.
|
|
removeBehaviour(behavior)
Remove a Behavior from the Actor.
|
|
setCatmullRom(points, closed)
|
|
setCubic(x0, y0, x1, y1, x2, y2, x3, y3)
Sets this path to be composed by a single Cubic Bezier path segment.
|
|
setInteractive(interactive)
Set whether this path should paint handles for every control point.
|
|
setLinear(x0, y0, x1, y1)
Set the path to be composed by a single LinearPath segment.
|
|
setLocation(x, y)
|
|
setPoint(point, index)
Set a point from this path.
|
|
setPoints(points)
Reposition this path points.
|
|
setPosition(x, y)
|
|
setPositionAnchor(ax, ay)
|
|
setPositionAnchored(x, y, ax, ay)
|
|
setQuadric(x0, y0, x1, y1, x2, y2)
Set this path to be composed by a single Quadric Bezier path segment.
|
|
setRectangle(x0, y0, x1, y1)
|
|
setRotation(angle)
|
|
setRotationAnchor(ax, ay)
|
|
setRotationAnchored(angle, rx, ry)
|
|
setScale(sx, sy)
|
|
setScaleAnchor(ax, ay)
|
|
setScaleAnchored(scaleX, scaleY, sx, sy)
|
|
Return the first point of the first path segment of this compound path.
|
|
updatePath(point, callback)
Indicates that some path control point has changed, and that the path must recalculate
its internal data, ie: length and bbox.
|
- Methods borrowed from class CAAT.PathUtil.PathSegment:
- drawHandle, getBoundingBox, getLength, setColor, setParent, transform
- Parameters:
- time
- Parameters:
- x1
- y1
- x2
- y2
- radius
- cw
- color
- Parameters:
- behavior
- {CAAT.Behavior} a CAAT.Behavior instance
- Returns:
- this
- Parameters:
- px1
- {number}
- py1
- {number}
- px2
- {number}
- py2
- {number}
- px3
- {number}
- py3
- {number}
- color
- {color=}. optional parameter. determines the color to draw the segment with (if being drawn by a CAAT.PathActor).
- Returns:
- this
- Parameters:
- px1
- {number}
- py1
- {number}
- px2
- {number}
- py2
- {number}
- px3
- {number}
- py3
- {number}
- color
- {color=}. optional parameter. determines the color to draw the segment with (if being drawn by a CAAT.PathActor).
- Returns:
- this
- Parameters:
- px1
- {number}
- py1
- {number}
- color
- {color=}. optional parameter. determines the color to draw the segment with (if being drawn by a CAAT.PathActor).
- Returns:
- this
- Parameters:
- px1
- {number}
- py1
- {number}
- px2
- {number}
- py2
- {number}
- color
- {color=}. optional parameter. determines the color to draw the segment with (if being drawn by a CAAT.PathActor).
- Returns:
- this
- Parameters:
- x1
- y1
- cw
- color
- Parameters:
- pathSegment
- {CAAT.PathSegment}
- Returns:
- this
- Parameters:
- director
- Returns:
- {*}
- Parameters:
- time
If a call to any method of the form add
is called before this calling
this method, they will assume to start at -1,-1 and probably you'll get the wrong path.
- Parameters:
- px0
- {number}
- py0
- {number}
- Returns:
- this
This method closes a path by setting its last path segment's last control point to be the first path segment's first control point.
This method also sets the path as finished, and calculates all path's information such as length and bounding box.
- Returns:
- this
- Parameters:
- x
- {number}
- y
- {number}
- callback
- Returns:
- this
- Returns:
- {CAAT.Point}
This method must be called explicitly, except when closing a path (that is, calling the method closePath) which calls this method as well.
- Returns:
- this
- Parameters:
- npatches
- closed
- Parameters:
- iSize
- {number}. Number of samples for each path segment.
- Returns:
- {[CAAT.Point]}
- Parameters:
- index
- Returns:
- {CAAT.PathSegment}
- Returns:
- {number}
The parameter time must be a value ranging 0..1. If not constrained to these values, the parameter will be modulus 1, and then, if less than 0, be normalized to 1+time, so that the value always ranges from 0 to 1.
This method is needed when traversing the path throughout a CAAT.Interpolator instance.
- Parameters:
- time
- {number} a value between 0 and 1 both inclusive. 0 will return path's starting coordinate. 1 will return path's end coordinate.
- open_contour
- {boolean=} treat this path as an open contour. It is intended for open paths, and interpolators which give values above 1. see tutorial 7.1.
- Returns:
- {CAAT.Foundation.Point}
- Parameters:
- iLength
- {number} a float with the target length.
- Returns:
- {CAAT.Point}
- Parameters:
- index
- {number} the index of the desired CAAT.PathSegment.
- Returns:
- CAAT.PathSegment
- Parameters:
- director
- {CAAT.Director} a CAAT.Director instance.
- Parameters:
- x
- {number}
- y
- {number}
- Parameters:
- id
- {number} an integer. return this;
- Parameters:
- behavior
- {CAAT.Behavior} a CAAT.Behavior instance.
- Parameters:
- points
- closed
- Parameters:
- x0
- {number}
- y0
- {number}
- x1
- {number}
- y1
- {number}
- x2
- {number}
- y2
- {number}
- x3
- {number}
- y3
- {number}
- Returns:
- this
- Parameters:
- interactive
- {boolean}.
- Parameters:
- x0
- {number}
- y0
- {number}
- x1
- {number}
- y1
- {number}
- Returns:
- this
- Parameters:
- x
- y
- Parameters:
- point
- {CAAT.Point}
- index
- {integer} a point index.
- Parameters:
- points
- {Array
}
- Parameters:
- x
- y
- Parameters:
- ax
- ay
- Parameters:
- x
- y
- ax
- ay
- Parameters:
- x0
- {number}
- y0
- {number}
- x1
- {number}
- y1
- {number}
- x2
- {number}
- y2
- {number}
- Returns:
- this
- Parameters:
- x0
- y0
- x1
- y1
- Parameters:
- angle
- Parameters:
- ax
- ay
- Parameters:
- angle
- rx
- ry
- Parameters:
- sx
- sy
- Parameters:
- ax
- ay
- Parameters:
- scaleX
- scaleY
- sx
- sy
- Returns:
- {CAAT.Point}
- Parameters:
- point
- callback