SelectionManager
-
class
wv.Selection.SelectionManager() This class provides the main interface into the selection functionality of the viewer. The class manages a list of selection items that are optionally highlighted as the user selects objects in the scene.
Index
Accessors
Methods
addadvanceIncrementalSelectionbeginConvexPolyhedronSelectionbeginRayDrillSelectionbeginScreenSelectByAreabeginSphereSelectionclearcontainscontainsParenteachendIncrementalSelectionexportSelectionDatagetFirstgetHighlightFaceElementSelectiongetHighlightLineElementSelectiongetHighlightNodeSelectiongetHighlightPointElementSelectiongetIgnoreEntityWhenTogglingChildSelectiongetLastgetNodeElementSelectionColorgetNodeElementSelectionHighlightModegetNodeElementSelectionOutlineColorgetNodeSelectionColorgetNodeSelectionHighlightModegetNodeSelectionOutlineColorgetPickTolerancegetPruneSelectionDescendantsgetResultgetResultsgetSelectedLayersgetSelectedTypesgetSelectionFiltergetSelectParentIfSelectedgetSingleEntityToggleModeEnabledgetSuppressImplicitRemovalCallbackisNodeSelectedisSelectedloadSelectionDataremoveselectAllFromPointselectAllFromRayselectFromPointselectFromRayselectLayerselectNodeselectTypesetsetHighlightFaceElementSelectionsetHighlightLineElementSelectionsetHighlightNodeSelectionsetHighlightPointElementSelectionsetIgnoreEntityWhenTogglingChildSelectionsetNodeElementSelectionColorsetNodeElementSelectionHighlightModesetNodeElementSelectionOutlineColorsetNodeSelectionColorsetNodeSelectionHighlightModesetNodeSelectionOutlineColorsetPickTolerancesetPruneSelectionDescendantssetSelectionFiltersetSelectParentIfSelectedsetSingleEntityToggleModeEnabledsetSuppressImplicitRemovalCallbacksizetoggle
Accessors
-
wv.Selection.SelectionManager.viewer() - get viewer():
IWebViewerReturns:
IWebViewer
Methods
-
wv.Selection.SelectionManager.add() - add(itemOrItems: (None |
NodeSelectionItem|NodeSelectionItem[]), suppressCallback: boolean?): voidManually adds an item or array of items to the selection set. Triggers a selection event.
Parameters
itemOrItems: (None |
NodeSelectionItem|NodeSelectionItem[])A selectionItem or selectionItem array that will be added to the current selection set.suppressCallback: boolean = false
Optional boolean param to suppress the selectionArray callbacks calls to this generate.Returns: void
-
wv.Selection.SelectionManager.advanceIncrementalSelection() - advanceIncrementalSelection(handle:
IncrementalSelectionId, predicate: (None | (item:NodeSelectionItem) => Promise)?): PromiseAdds the next batch of instances selected by the supplied selection context to the selection set.
Parameters
handle:
IncrementalSelectionIdThe handle to an active area selection context.predicate: (None | (item:
NodeSelectionItem) => Promise) = nullAn optional function that returnstrueif a given [[NodeSelectionItem]] should be added to the selection set. Iffalseis returned, the item will not be added.Returns: Promise
trueif there are possibly more items to select andfalseif not.
-
wv.Selection.SelectionManager.beginConvexPolyhedronSelection() - beginConvexPolyhedronSelection(volumePlanes:
Plane[], heuristicOrigin:Point3, config:IncrementalPickConfig): PromiseCreates a new and active selection context for the provided selection volume. The selection volume is a convex polyhedron defined by the bounded intersection of its half-spaces.
Parameters
volumePlanes:
Plane[]The planes used to define volume. A point p is inside the volume if and only if (plane.determineSide(p) == true) for all supplied planes.heuristicOrigin:
Point3A point used to compute distances against for ordering returned results. This is typically (but not necessarily) the center of the volume.config:
IncrementalPickConfigThe configuration object used for this selection operation.Returns: Promise
The handle for the selection context.
-
wv.Selection.SelectionManager.beginRayDrillSelection() - beginRayDrillSelection(rayCssOrigin:
Point2, rayCssBoxRadius: number, config:IncrementalPickConfig, view:IView?): PromiseCreates a new and active selection context for the provided selection ray. The ray is created at the supplied ray origin and is cast into the scene. Faces are selected if they lie along the ray. Lines and points are selected if they lie within the ray’s box radius.
Note: Somewhat confusingly ray drill selection is actually a selection by volume. The provided ray origin and radius are used to create a frustum to preform the selection. This has some consequences. For example, the
SelectionResults returned by advancing a ray drill selection will not have selection positions, since they were not selected at a single point.Parameters
rayCssOrigin:
Point2The coordinate in css pixel space for the selection ray’s origin.rayCssBoxRadius: number
The radius around the ray in css pixel space used for line and point selection proximity.config:
IncrementalPickConfigThe configuration object used for this selection operation.view:
IView= …The view to use when projecting the point into the scene.Returns: Promise
The handle for the selection context.
-
wv.Selection.SelectionManager.beginScreenSelectByArea() - beginScreenSelectByArea(areaCssMin:
Point2, areaCssMax:Point2, config:IncrementalPickConfig, view:IView?): PromiseCreates a new and active selection context for the provided selection window.
Parameters
areaCssMin:
Point2The minimum coordinate in css pixel space for the selection window.areaCssMax:
Point2The maximum coordinate in css pixel space for the selection window.config:
IncrementalPickConfigThe configuration object used for this selection operation.view:
IView= …The view to use when projecting the point into the scene.Returns: Promise
The handle for the selection context.
-
wv.Selection.SelectionManager.beginSphereSelection() - beginSphereSelection(sphereCenter:
Point3, sphereRadius: number, config:IncrementalPickConfig): PromiseCreates a new and active selection context for the provided selection sphere.
Parameters
sphereCenter:
Point3The center of the selection sphere.sphereRadius: number
The radius of the selection sphere.config:
IncrementalPickConfigThe configuration object used for this selection operation.Returns: Promise
The handle for the selection context.
-
wv.Selection.SelectionManager.clear() - clear(triggerCallback: boolean?): void
Removes all items from the selection set.
Parameters
triggerCallback: boolean = true
triggers a null selection callback when true.Returns: void
-
wv.Selection.SelectionManager.contains() - contains(item:
SelectionItem): booleanParameters
item:SelectionItemReturns: boolean
-
wv.Selection.SelectionManager.containsParent() - containsParent(item:
NodeSelectionItem): (None |NodeSelectionItem)Checks if the parent of a selection item is in the selection set.
Parameters
item:NodeSelectionItemReturns: (None |
NodeSelectionItem)parent selection item, or null if not found
-
wv.Selection.SelectionManager.each() - each(func: (s:
NodeSelectionItem) => void): voidIterates over all selection items. The function passed in will be called once for every selection item and will receive the item as its parameter.
Parameters
func: (s:
NodeSelectionItem) => voida function to be called for every selection item.Returns: void