editor › Globals › PolygonOrnamentAnnotation
Class: PolygonOrnamentAnnotation
This class describes any annotation that can be attached to a {@see PolygonOrnamentDescriptor}. They alter the container polygons of their PolygonOrnamentDescriptor to create the polygons that should actually be cutout. e.g. {@see RoundCornerAnnotation}, {@see MosaicElementAnnotation}. The RoundCornerAnnotation would edit the container polygons (for example a square) to round one of its corners. The cutout of this PolygonOrnamentDescriptor would then be rounded, but it would not affect alignment on the container level. The MosaicElementAnnotation is more general and can cut any cutout into a container.
Hierarchy
- PolygonOrnamentAnnotation
Index
Constructors
Properties
Methods
- _replacePoint
- addAppliedCount
- applyMatrix
- applyOntoContainerPolygons
- applyOntoCutoutPolygons
- applyOntoPolygons
- clone
- distanceTo
- doesPointEqual
- getAppliedCount
- getPoint
- getType
- isStillApplicable
- roundPoint
- setPoint
Constructors
constructor
+ new PolygonOrnamentAnnotation(point: ArrayPoint2, appliedCount: number): PolygonOrnamentAnnotation
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:21
Parameters:
| Name | Type | Default |
|---|---|---|
point |
ArrayPoint2 | - |
appliedCount |
number | 1 |
Returns: PolygonOrnamentAnnotation
Properties
Protected appliedCount
• appliedCount: number
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:21
Protected point
• point: ArrayPoint2
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:19
Protected Abstract type
• type: string
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:16
Methods
Protected _replacePoint
▸ _replacePoint(polygon: Polygon, idx: number, points: ArrayPoint2[]): Polygon
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:98
Parameters:
| Name | Type |
|---|---|
polygon |
Polygon |
idx |
number |
points |
ArrayPoint2[] |
Returns: Polygon
addAppliedCount
▸ addAppliedCount(): void
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:94
Returns: void
applyMatrix
▸ applyMatrix(matrix: Matrix4): this
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:60
Parameters:
| Name | Type |
|---|---|
matrix |
Matrix4 |
Returns: this
applyOntoContainerPolygons
▸ applyOntoContainerPolygons(polygons: Polygon[]): Polygon[]
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:30
Parameters:
| Name | Type |
|---|---|
polygons |
Polygon[] |
Returns: Polygon[]
applyOntoCutoutPolygons
▸ applyOntoCutoutPolygons(polygons: Polygon[]): Polygon[]
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:37
Apply this annotation only for cutout polygons and only add polygons that are cutouts
Parameters:
| Name | Type |
|---|---|
polygons |
Polygon[] |
Returns: Polygon[]
applyOntoPolygons
▸ applyOntoPolygons(polygons: Polygon[]): Polygon[]
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:44
Apply this annotation to the given polygons
Parameters:
| Name | Type |
|---|---|
polygons |
Polygon[] |
Returns: Polygon[]
Abstract clone
▸ clone(): PolygonOrnamentAnnotation
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:28
Returns: PolygonOrnamentAnnotation
distanceTo
▸ distanceTo(localPosition: Vector3): number
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:56
Parameters:
| Name | Type |
|---|---|
localPosition |
Vector3 |
Returns: number
doesPointEqual
▸ doesPointEqual(x: number, y: number): boolean
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:52
Parameters:
| Name | Type |
|---|---|
x |
number |
y |
number |
Returns: boolean
getAppliedCount
▸ getAppliedCount(): number
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:90
Returns: number
getPoint
▸ getPoint(): ArrayPoint2
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:86
Returns: ArrayPoint2
getType
▸ getType(): string
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:82
Returns: string
isStillApplicable
▸ isStillApplicable(polygons: Polygon[]): boolean
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:48
Parameters:
| Name | Type |
|---|---|
polygons |
Polygon[] |
Returns: boolean
roundPoint
▸ roundPoint(precision: number): this
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:73
Parameters:
| Name | Type | Default |
|---|---|---|
precision |
number | 1 |
Returns: this
setPoint
▸ setPoint(point: ArrayPoint2): this
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:67
Parameters:
| Name | Type |
|---|---|
point |
ArrayPoint2 |
Returns: this