Module extra/OccViewerCommands

The module which contains Command interface which responses for creating interactive commands, and contains several interactive commands realization. Commands Api based on observables and produce events such as OccViewer.UserEvents onTextRequest or onUserMessage. Subscribing to this events allows to customize input of the text from user, customize displaying of commands help message.

 // Create command executor.
const aCommandExecutor = new CommandExecutor(OccViewerModule);
...
// Call the sample command
aCommandExecutor.call(AddTextLabelCommand);
}));
OccViewerModule.eventManager.addEventListener(UserEvents.onTextRequest, ()=>{
let anInitialValue = aCommandExecutor.activeCommand().initialValue;
let aText = prompt( aCommands.control(anUserMessageControl).value(), anInitialValue);
aCommandExecutor.onTextInput(aText);
return 0;
});

Classes

AddInteractiveLineCommand
AddInteractivePointCommand
AddLengthDimensionCommand
AddTextLabelCommand
Command
CommandExecutor
EditLengthDimensionCommand
EditTextLabelCommand