Class: SpatialComponent
component.SpatialComponent
#
HierarchyComponent
<SpatialConfiguration
>↳
SpatialComponent
#
Properties#
componentNameâ–ª Static
componentName: ComponentName
= "spatial"
#
Overrides#
Defined incomponent/spatial/SpatialComponent.ts:77
#
Accessors#
activated• get
activated(): boolean
Get activated.
#
Returnsboolean
Value indicating if the component is currently active.
#
Defined in#
defaultConfiguration• get
defaultConfiguration(): TConfiguration
Get default configuration.
#
ReturnsTConfiguration
Default configuration for component.
#
Defined in#
name• get
name(): string
Get name.
description
The name of the component. Used when interacting with the
component through the Viewer's API.
#
Returnsstring
#
Defined in#
Methods#
configureâ–¸ configure(configuration
): void
Configure the component.
#
ParametersName | Type | Description |
---|---|---|
configuration | SpatialConfiguration | Component configuration. |
#
Returnsvoid
#
Inherited from#
Defined in#
fireâ–¸ fire<T
>(type
, event
): void
#
Type parametersName |
---|
T |
#
ParametersName | Type |
---|---|
type | ComponentEventType |
event | T |
#
Returnsvoid
#
Inherited from#
Defined in#
getFrameIdAtâ–¸ getFrameIdAt(pixelPoint
): Promise
<string
>
Returns the image id of the camera frame closest to the current render camera position at the specified point.
description
Notice that the pixelPoint argument requires x, y
coordinates from pixel space.
With this function, you can use the coordinates provided by mouse events to get information out of the spatial component.
If no camera frame exist at the pixel
point, null
will be returned.
example
spatialComponent.getFrameIdAt([100, 125]) .then((imageId) => { console.log(imageId); });
#
ParametersName | Type | Description |
---|---|---|
pixelPoint | number [] | Pixel coordinates on the viewer element. |
#
ReturnsPromise
<string
>
Image id of the camera frame closest to
the camera. If no camera frame is intersected at the
pixel point, null
will be returned.
#
Defined incomponent/spatial/SpatialComponent.ts:121
#
offâ–¸ off<T
>(type
, handler
): void
Unsubscribe from an event by its name.
#
Type parametersName |
---|
T |
#
ParametersName | Type | Description |
---|---|---|
type | ComponentEventType | The name of the event to unsubscribe from. |
handler | (event : T ) => void | The handler to remove. |
#
Returnsvoid
#
Inherited from#
Defined in#
onâ–¸ on<T
>(type
, handler
): void
Subscribe to an event by its name.
#
Type parametersName |
---|
T |
#
ParametersName | Type | Description |
---|---|---|
type | ComponentEventType | The name of the event to subscribe to. |
handler | (event : T ) => void | The handler called when the event occurs. |
#
Returnsvoid