CoordinateTracker <Tracked3D>
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Constructor
Type parameters
- Tracked3D: TrackCoordinate3D = Vertex3
Parameters
bimApi: BimCoreApi
BIM Core API.
recalculate2DEachFrame: boolean = false
If
true
then it updates the 2D positions for each tracked 3D coordinate at the end of each frame.
Returns CoordinateTracker<Tracked3D>
Properties
publicreadonlyonUpdateObservable
Called when a tracked 3D coordinate changes its 2D position (when camera is manipulated). Same as onUpdate but using a Observable instead.
Accessors
publicsize
Number of items currently being tracked.
Returns number
Methods
publicclear
Removes all tracked coordinates from the tracker.
Returns void
publicdispose
Disposes the coordinate tracker.
Returns void
publicentries
Allows iteration of all entities that are tracked (and their ids)
Returns IterableIterator<[unknown, Tracked3D]>
collection of all tracked entities and their id.
publicforceRecalculation
Immediately force a recalculation of all 2D coordinates
Returns void
publicget
Attempt to get a currently tracked object by id.
Parameters
id: unknown
Id of tracked object.
Returns undefined | TrackCoordinate2D<Tracked3D>
Tracked object if it exists. Otherwise undefined
publiconUpdate
Register a callback which will be called when the active camera moves. It is called once for each coordinate registered by track.
Parameters
callback: (coordinate: TrackCoordinate2D<Tracked3D>) => void
Callback to trigger when an active camera moves.
Returns void
publictrack
This method takes a coordinate in 3D to track screen space position when the camera moves. When method is called notifyObservers and _callback are immediately raised for the passed coordinate. Same coordinate can be passed multiple times (with same id) but it will only be added once. However notifyObservers and _callback will still be immediately raised and report 2D coordinates data even if coordinate is already tracked.
Parameters
coordinate: Tracked3D
Coordinate to track.
optionalid: unknown
Optional. If not specified an id will be generated
Returns unknown
id of tracked coordinate.
publictrackOnce
Gets 2D coordinate of a 3D coordinate once.
Parameters
coordinate: Tracked3D
3D coordinate to get 2D coordinate from
id: unknown
Identifier for 3D coordinate.
Returns undefined | TrackCoordinate2D<Tracked3D>
publicuntrack
Stops tracking of a 3D coordinate.
Parameters
id: unknown
Id of 3D coordinate to stop tracking
Returns undefined | Tracked3D
Object that was untracked. If there is no such object then undefined.
CoordinateTracker contains methods for tracking a screen space coordinate from a 3D position.