DynamicPolygon <Point>
Implements
Index
Constructors
Properties
Accessors
Methods
Constructors
publicconstructor
Polygon constructor, counter-clockwise polygon winding order.
Type parameters
- Point: DynamicPolygonPoint<Point> = DynamicPolygonPoint
Parameters
name: string
Name of polyline
_api: BimCoreApi
BimCoreApi instance
pointFactory: DynamicPolygonPointFactoryHandler<Point>
Factory method which is used to create the instances of generic class type
Point
.recalculate2DEachFrame: boolean = false
If
true
then it updates the 2D positions for each tracked 3D coordinate at the end of each frame.optionalparent: TransformNode
If Babylon TransformNode is provided the dynamic polygon will attach as a child and follow its parent.
optionaldragPointPositioningFunction: DragPointPositioningFunction
Function to calculate the drag points position in the polygon.
Returns DynamicPolygon<Point>
Properties
publicoptionaldragPointPositioningFunction
Function to calculate the drag points position in the polygon.
publicheight
publicreadonlyname
Name of polyline
publicreadonlyonAreaLabelTrackableScreen
Triggered when apply is called or when camera moves around. By listening to this event it is possible to know when the area label X,Y position is updated (This always exists on a DynamicPolygon). It is also possible to see how far away the points are from the camera. What position they have in 2D space (perhaps one wants to add a HTML element to the DOM there.).
publicreadonlyonPointTrackableScreen
Triggered when apply is called or when camera moves around. By listening to this event, it is possible to know when new polygon points are added, updated and removed. It is also possible to see how far away the points are from the camera. And to see what position they have in 2D space (for example, to add a HTML element to the DOM).
Accessors
publicbottomArea
Polygon bottom area. Only updated when apply or build is called. Calculated with polygonArea function with a height of zero.
Returns number
The polygon bottom area.
publicinteriorPoint
Interior point. Only updated when apply or build is called.
Returns Vertex3
The interior point.
publicisDisposed
Whether or not the mesh is disposed or not.
Returns boolean
boolean.
publicisEmpty
Returns boolean
true
if polygon has no points. Otherwisefalse
.
publicisEnabled
Returns boolean
true
if the dynamic polygon is enabled otherwisefalse
.Sets isEnabled on the dynamicpolygon and sets isEnabled on the polygon mesh if it has any points.
Parameters
b: boolean
state to set
Returns void
publicmesh
BabylonJS mesh.
Returns Mesh
mesh
publicparent
Returns undefined | TransformNode
Sets the parent of the DynamicPolygon without keeping the position in world space.
Parameters
node: undefined | TransformNode
new parent for the DynamicPolygon.
Returns void
publicplane
Plane spanned by points. Only updated when build or assignNewPolygonPoints is called.
Returns Plane
The Plane.
publicsurfaceArea
Polygon surface area. Only updated when apply or build is called.
Returns number
The polygon surface area.
publicvolume
Polygon volume. Only updated when there exists a height and apply or build is called.
Returns number
The polygon volume.
Methods
publicapply
Applies changes to polygon which occurred when calling methods on move, virtual and delete. It will also trigger onPointTrackableScreen events.
Returns void
publicassignNewPolygonPoints
Assigns points to define the polygon, this method can be used instead of build which adds virtual points
Parameters
dynamicPolygonPoints: Point[]
Returns void
publicbuild
Attempt to build a DynamicPolygon using the
points
parameter.Parameters
points: Vertex3[]
Vertex3 points.
transformPointsToLocal: boolean = true
Wheter to transform the points to the DynamicPolygon’s parent local space before using them to build
Returns DynamicPolygonPointValidationResult
returns a DynamicPolygonPointValidationResult.
publicclear
Clears the polygon of all current points
Returns void
publicdispose
Disposes the DynamicPolygon. It is no longer useable after this call.
Returns void
publicpoints
Parameters
optionalpredicate: (p: DynamicPolygonPoint) => boolean
backwards: boolean = false
Returns Generator<DynamicPolygonPoint, void, unknown>
registerParentWorldMatrixCallback
Returns void
worldMatrix
Get the world matrix of this DynamicPolygon
Returns Matrix
the world matrix for this DynamicPolygon.
publicstaticvalidatePoints
Validates the specified
points
.Parameters
Returns DynamicPolygonPointValidationResult
returns a DynamicPolygonPointValidationResult.
Represents a dynamic polygon. It is possible to add, insert and remove points to it and have those changes reflect its 3D visualization. Useful for tools that need to calculate area.