imat_vtkplot/interactiveselector (+FEA)


Purpose

Select entities interactively.

Syntax

out = hplot.measure(type,mode,cbfcn)
out = hplot('off');

Description

This method provides an interactive selector for nodes and elements. You may provide a callback function that will be called whenever the user selects an entity of the type specified.

TYPE is a string specifying the entity type. Valid choices are 'node' (default) and 'element'.

MODE specifies the model from which the entities are extracted -- 'undeformed' (default) or 'deformed'.

CBFCN is either a function handle or a cell array containing the callback function handle or name and valid input arguments to the callback function. The entity ID will be passed in as the last input argument to the function.

If no callback function is specified, INTERACTIVESELECTOR will return with the entity label selected. Otherwise, it will stay in the interactive selector mode until the user cancels by pressing <ESC>.

Passing in the string 'off' causes INTERACTIVESELECTOR to disable interactive selection. This is useful for situations where you want to disable the interactive selector from another external callback.

OUT contains the ID of the last entity selected. If the user cancels, OUT will be empty.

 

Examples

>> out = hplot.measure('node','undeformed',{@my_function, 1, 'argument'})
>> out = hplot.measure('elem','deformed',@my_function)