HardwareSelector
Methods
attach
Attaches a render window + renderer to this hardware selector.
| Argument | Type | Required | Description |
|---|---|---|---|
openglRenderWindow | Nullable<vtkOpenGLRenderWindow> | Yes | |
renderer | Nullable<vtkRenderer> | Yes |
beginSelection
Preps for picking the scene.
Call endSelection() afterwards.
buildPropHitList
Builds the prop hit list.
| Argument | Type | Required | Description |
|---|---|---|---|
pixelBuffer | Uint8Array | Yes |
captureBuffers
Captures the scene for picking.
Returns
| Type | Description |
|---|---|
| whether the capture succeeded. |
endSelection
Cleans up picking state.
Should be after a call to beginSelection();
generateSelection
Generates selections in a given area.
| Argument | Type | Required | Description |
|---|---|---|---|
fx1 | number | Yes | top left x coord |
fy1 | number | Yes | top left y coord |
fx2 | number | Yes | bottom right x coord |
fy2 | number | Yes | bottom right y coord |
getArea
Gets the selection area.
getCurrentPass
Gets the current pass type.
getMaximumCellId
Gets the maximum cell ID.
getMaximumPointId
Gets the maximum point ID.
getPixelBuffer
Get the pixel buffer for a pass type.
| Argument | Type | Required | Description |
|---|---|---|---|
passNo | PassTypes | Yes |
getPixelInformation
Gets the selection information for a given pixel.
| Argument | Type | Required | Description |
|---|---|---|---|
inDispPos | Yes | The input diplay position. | |
maxDistance | Yes | The max distance to consider from the input position. | |
outDispPos | Yes | The output display position. |
getPropColorValue
Gets the prop color value.
getRawPixelBuffer
Get the raw pixel buffer for a pass type.
| Argument | Type | Required | Description |
|---|---|---|---|
passNo | PassTypes | Yes |
getRenderer
Gets the current renderer.
getSourceDataAsync
Get the picking source data.
| Argument | Type | Required | Description |
|---|---|---|---|
renderer | vtkRenderer | Yes | |
fx1 | number | Yes | top left x coord |
fy1 | number | Yes | top left y coord |
fx2 | number | Yes | bottom right x coord |
fy2 | number | Yes | bottom right y coord |
isPropHit
Has the prop with the given internal ID been hit.
| Argument | Type | Required | Description |
|---|---|---|---|
id | number | Yes |
onEvent
Listen to the start/stop events.
| Argument | Type | Required | Description |
|---|---|---|---|
cb | Yes | ||
priority | Yes |
passRequired
Determines if a pass is required.
| Argument | Type | Required | Description |
|---|---|---|---|
pass | PassTypes | Yes |
passTypeToString
Returns the pass type name as a string.
| Argument | Type | Required | Description |
|---|---|---|---|
type | PassTypes | Yes |
postCapturePass
Runs a post-capture pass.
preCapturePass
Runs a pre-capture pass.
processPixelBuffers
Processes the pixel buffers for actors.
releasePixBuffers
Releases internal pixel buffer memory.
renderAttributeId
Renders an attribute ID.
| Argument | Type | Required | Description |
|---|---|---|---|
attribId | number | Yes |
renderCompositeIndex
Sets the current prop's color value for the composite index.
| Argument | Type | Required | Description |
|---|---|---|---|
index | number | Yes |
renderProp
Renders a prop for picking.
| Argument | Type | Required | Description |
|---|---|---|---|
prop | vtkProp | Yes |
savePixelBuffer
Saves the pixel buffer from the view.
| Argument | Type | Required | Description |
|---|---|---|---|
pass | PassTypes | Yes |
select
Generates a selection.
setArea
Sets the selection area.
| Argument | Type | Required | Description |
|---|---|---|---|
fx1 | number | Yes | top left x coord |
fy1 | number | Yes | top left y coord |
fx2 | number | Yes | bottom right x coord |
fy2 | number | Yes | bottom right y coord |
setArea
Sets the selection area.
| Argument | Type | Required | Description |
|---|---|---|---|
area | Yes | An area bounding box |
setCurrentPass
Sets the current pass type.
| Argument | Type | Required | Description |
|---|---|---|---|
pass | PassTypes | Yes |
setMaximumCellId
Sets the maximum cell ID.
| Argument | Type | Required | Description |
|---|---|---|---|
id | number | Yes |
setMaximumPointId
Sets the maximum point ID.
| Argument | Type | Required | Description |
|---|---|---|---|
id | number | Yes |
setOpenGLRenderWindow
Sets the current opengl render window.
| Argument | Type | Required | Description |
|---|---|---|---|
oglrw | vtkOpenGLRenderWindow | Yes |
setPropColorValue
Sets the prop's color value.
| Argument | Type | Required | Description |
|---|---|---|---|
r | number | Yes | |
g | number | Yes | |
b | number | Yes |
setPropColorValue
Sets the prop's color value.
| Argument | Type | Required | Description |
|---|---|---|---|
color | Vector3 | Yes |
setPropColorValueFromInt
Sets the internal color used for coloring the current prop.
| Argument | Type | Required | Description |
|---|---|---|---|
val | number | Yes |
setRenderer
Sets the current renderer.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes |