API / geotoolkit / util / Region / Region
Class with can handle some operation with rectangles and polygons and represent a geometry region
Constructors
Methods
Constructors
• new Region(epsilon?)
| Name | Type | Description |
|---|---|---|
Optional epsilon | number | epsilon, accuracy of clipping |
Methods
▸ clear(): Region
Clear region
this
▸ contains(shape): boolean
Check if region contains shape
boolean
true if contains, else false
▸ containsPoint(point): boolean
Check if region contains point
| Name | Type | Description |
|---|---|---|
point | Point | point |
boolean
true if contains, else false
▸ getBoundingBox(): Rect
Return bounding rectangle
bounding box
▸ getGraphicsPath(): GraphicsPath
Return polygon as graphics path
graphics path
▸ getGraphicsPaths(): GraphicsPath[]
Return polygon as any array of non-overlapping graphics paths.
array of graphic paths
▸ getPolygons(): Polygon[]
Returns polygons
Polygon[]
polygons
▸ getRectangles(eps?): Rect[]
Return an array of non-overlapping rectangles that make up the region
| Name | Type | Description |
|---|---|---|
Optional eps | number | epsilon, accuracy |
Rect[]
array array of non-overlapping rectangles that make up the region
▸ intersect(shape, dest?): Polygon[]
Intersect shape
| Name | Type | Description |
|---|---|---|
shape | Rect | GraphicsPath | Rect[] | Region | Polygon | Polygon[] | Region[] | GraphicsPath[] | shape |
Optional dest | Region | destination region |
Polygon[]
result polygons
▸ intersects(shape): boolean
Check if region intersects shape
boolean
true if intersects, else false
▸ isEmpty(): boolean
Check if region is empty
boolean
true if it is empty, else false
▸ subtract(shape, dest?): Polygon[]
Subtract polygon
| Name | Type | Description |
|---|---|---|
shape | Rect | GraphicsPath | Rect[] | Region | Polygon | Polygon[] | Region[] | GraphicsPath[] | shape |
Optional dest | Region | destination region |
Polygon[]
result polygons
▸ transformRegion(transformation): Region
Transform region
| Name | Type | Description |
|---|---|---|
transformation | Transformation | transformation |
this
▸ union(shape, dest?): Polygon[]
Union shape
| Name | Type | Description |
|---|---|---|
shape | Rect | GraphicsPath | Rect[] | Region | Polygon | Polygon[] | Region[] | GraphicsPath[] | shape |
Optional dest | Region | destination region |
Polygon[]
result polygons