API / geotoolkit / renderer / GraphicsPath / GraphicsPath
renderer.GraphicsPath.GraphicsPath
Provides a container for connected lines, curves.
Constructors
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
bounds | Rect | Bounds |
bounds-height | number | Height |
bounds-readonly | boolean | Readonly |
bounds-width | number | Width |
bounds-x | number | Left |
bounds-y | number | Top |
Methods
▸ arcTo(x1, y1, x2, y2, radius): GraphicsPath
Add command to draw an arc from the current position to specified point
| Name | Type | Description |
|---|---|---|
x1 | number | x-coordinate of control point |
y1 | number | y-coordinate of control point |
x2 | number | The x-coordinate of the destination point |
y2 | number | The y-coordinate of the destination point |
radius | number | The radius of arc |
this
▸ bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y): GraphicsPath
Draws a cubic Bezier curve from the current point to the point (x, y), with control points (cp1x, cp1y) and (cp2x, cp2y).
| Name | Type | Description |
|---|---|---|
cp1x | number | the x coordinate of the first control point |
cp1y | number | the y coordinate of the first control point |
cp2x | number | the x coordinate of the second control point |
cp2y | number | the y coordinate of the second control point |
x | number | the x coordinate of the end point |
y | number | the y coordinate of the end point |
this
▸ clear(): GraphicsPath
Remove all of this path's points.
this
▸ clone(): GraphicsPath
Create a deep copy
clone
▸ close(): GraphicsPath
Close path
this
▸ copy(src): GraphicsPath
Copy path from source
| Name | Type | Description |
|---|---|---|
src | GraphicsPath | source path to copy from |
▸ Protected copyConstructor(src): void
Copy constructor
| Name | Type | Description |
|---|---|---|
src | GraphicsPath | instance to create a copy from |
void
▸ getBounds(): Rect
Return bounds
▸ getClassName(): string
string
▸ getElement(i): { type: LINETO | MOVETO ; x: number ; y: number } | { radius: number ; type: ARCTO ; x1: number ; x2: number ; y1: number ; y2: number } | { cp1x: number ; cp1y: number ; cp2x: number ; cp2y: number ; type: BEZIERCURVETO ; x: number ; y: number } | { type: CLOSE }
Returns the element at the given index in the painter path.
| Name | Type | Description |
|---|---|---|
i | number | index of the element |
{ type: LINETO | MOVETO ; x: number ; y: number } | { radius: number ; type: ARCTO ; x1: number ; x2: number ; y1: number ; y2: number } | { cp1x: number ; cp1y: number ; cp2x: number ; cp2y: number ; type: BEZIERCURVETO ; x: number ; y: number } | { type: CLOSE }
▸ getElementCount(): number
Returns the number of elements
number
▸ getIndex(i): number
Returns a start index in the x and y for the current command.
| Name | Type | Description |
|---|---|---|
i | number | index of the element |
number
▸ getLength(): number
Returns the length of the current path.
number
▸ getProperties(): Required<Options>
Gets all the properties pertaining to this object
Required<Options>
properties object
▸ getTags(): PointType[]
Returns an array of tags.
▸ getX(): number[]
Returns an array of x coordinates.
number[]
▸ getY(): number[]
Returns an array of y coordinates.
number[]
▸ intersect(rect): GraphicsPath
Makes the intersection of this path's fill area and rectangle. This method is experimental and work for bounds only.
Throws
if the rect is null
| Name | Type | Description |
|---|---|---|
rect | Rect | the specified rectangle |
this
▸ isEmpty(): boolean
Returns true if there are no elements in this path
boolean
▸ lineTo(x, y): GraphicsPath
Add command to draw a line from the current position to specified point
| Name | Type | Description |
|---|---|---|
x | number | The x-coordinate of the destination point |
y | number | The y-coordinate of the destination point |
this
▸ moveTo(x, y): GraphicsPath
Add command to move the current position.
| Name | Type | Description |
|---|---|---|
x | number | The x-coordinate of the destination point |
y | number | The y-coordinate of the destination point |
▸ setProperties(properties?): GraphicsPath
Sets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional properties | Options | An object containing the properties to set |
▸ toString(): string
Returns the path's string representation
string
▸ transform(transformation): GraphicsPath
Transform path using the current transformation
| Name | Type | Description |
|---|---|---|
transformation | Transformation | the specified transformation |
▸ Static fromRect(rect): GraphicsPath
Returns a path shape which represents a rectangle
| Name | Type | Description |
|---|---|---|
rect | Rect | rectangle |
instance
▸ Static fromSVG(str): GraphicsPath
Returns a path shape created from SVG formatted path string
| Name | Type | Description |
|---|---|---|
str | string | SVG formatted path |
▸ Static getClassName(): string
string