ArbitraryShapePoint
Hierarchy
- DynamicPolygonPoint
- ArbitraryShapePoint
Index
Constructors
publicconstructor
Parameters
_api: BimCoreApi
BimCoreApi API.
plane: Plane
Plane that this point lies on.
isVirtual: boolean
whether point is virtual or not.
Returns ArbitraryShapePoint
Properties
publicisEnabled
When true
then onPointTrackableScreen will trigger for this instance. Otherwise it will not
publicreadonlyplane
Plane that this point lies on.
Accessors
publicisDeletable
Check if
this
point can be deleted or not.Returns DynamicPolygonPointDeleteResult
publiclocalX
X coordinate of point in local space.
Returns number
publiclocalY
Y coordinate of point in local space.
Returns number
publiclocalZ
Z coordinate of point in local space.
Returns number
publicx
X coordinate of point in world space.
Returns number
Set the X coordinate of point in world space.
Parameters
val: number
Returns void
publicy
Y coordinate of point in world space.
Returns number
Set the Y coordinate of point in world space.
Parameters
val: number
Returns void
publicz
Z coordinate of point in world space.
Returns number
Set the Z coordinate of point in world space.
Parameters
val: number
Returns void
Methods
publicapply
Same as calling apply.
Returns void
publicdelete
Deletes
this
point from the parent DynamicPolygon. It is possible to use isDeletable to check if point can be deleted beforehand.Returns DynamicPolygonPointDeleteResult
publicmove
Attempt to move a point to a new location on Plane. To find the location, a ray is shot from camera through
canvasCoordinate
and then an intersection test is performed. If the ray intersects Plane, the point is moved to the coordinates of the intersection. Otherwise nothing happens. It is also not possible to move a point if it results in a complex polygon. The point is assigned the same x,y,z values as the coordinate where the ray intersects the plane.Parameters
canvasCoordinate: Vertex2
Returns DynamicPolygonPointMoveResult
publicpoints
Enables iteration of all points in the polygon.
Parameters
optionalpredicate: (p: ArbitraryShapePoint) => boolean
Optional predicate. If specified only points where the predicate returns
true
will be returned.
Returns Generator<ArbitraryShapePoint, void, unknown>
generator.
publicsetLocals
Set coordinates in local space.
Parameters
x: number
X coordinate in local space.
y: number
Y coordinate in local space.
z: number
Z coordinate in local space.
Returns void
publicvirtual
This method has two purposes.
- Check if
this
point is virtual or not (ifv
is undefined). This is very useful in a UI where a different visualization for a ‘virtual drag point’ and a ‘real drag point’ may be required.. - Convert
this
point to/from virtual by specifyingv
.
Parameters
optionalv: boolean
Optional. If not specified function only returns current state. If specified then point is converted to either a virtual point (v =
true
) or a non virtual point (v = false
).
Returns boolean
If
v
was not specified thentrue
if point is virtual, otherwisefalse
. Ifv
was specified it returnstrue
if point was successfully converted. Otherwisefalse
. A point cannot be converted from non virtual to virtual if there are 3 or less non virtual points in the polygon.- Check if
publicstaticIsNotVirtual
Predicate to check if a point is virtual or not.
Parameters
p: DynamicPolygonPoint
Point to check
Returns boolean
true
if point is not virtual, otherwisefalse
.
Represents a control point in a DynamicPolygonWithArbitraryPoints. Inherit from this class if additional functionality is required.