SelectElements class

Select one or more elements by mouse clicking.

Signature:

export default class SelectElement extends Tool 

Extends: Tool

Example

var selectElement = new Modelo.View.Tool.SelectElement(viewer);
viewer.addTool(selectElement);

viewer.getEventEmitter().on("onElementSelected", elementNames1 => {
   if (elementNames1.length === 0) {
       console.log("none is selected");
   } else {
       console.log(elementNames1.join(","));
   }
viewer.getEventEmitter().on("onPointPicked", point => {
   console.log(point);
})
});

Constructors

ConstructorDescription
(constructor)(viewer)Create the tool.

Methods

MethodDescription
addInput(input)Add input to the selectElement tool
pick(elementNames, changeCamera)Pick elements by specifying their names.
setClearselectEnabled(enabled)Enable/Disable clearSelect default : false
setCloseUpEnabled(enabled)Enable/Disable moving camera to a close up view after elements selected.
setHighlightEnabled(enabled)If the elements will be highlighted when selected.
setLineColor(lineColor)Set the elements' lines color when elements are picked.
setMultiselectEnabled(enabled)Enable/Disable multiSelect
setOverridedColor(color)Set the overrided color of unselected elements.
setRegionSelectEnabled(enabled)Enable/Disable region select.
setSelectionRectangleColor(color)Change the color of selection rectangluar gizmo color and transparency.