Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
19
Добавлен:
09.02.2015
Размер:
297.47 Кб
Скачать

Implicit arguments (similar to handle callbacks):

function [res] = myfunction(obj,event_obj)

% OBJ handle to the object that has been clicked on.

% EVENT_OBJ handle to event object (empty in this release).

% RES a logical flag to determine whether the rotate

operation should take place or the

'ButtonDownFcn' property of the object should

take precedence.

ActionPreCallback <function_handle>

Set this callback to listen to when a rotate operation will start.

The input function handle should reference a function with two

implicit arguments (similar to handle callbacks):

function myfunction(obj,event_obj)

% OBJ handle to the figure that has been clicked on.

% EVENT_OBJ handle to event object.

The event object has the following read only

property:

Axes The handle of the axes that is being rotated.

ActionPostCallback <function_handle>

Set this callback to listen to when a rotate operation has finished.

The input function handle should reference a function with two

implicit arguments (similar to handle callbacks):

function myfunction(obj,event_obj)

% OBJ handle to the figure that has been clicked on.

% EVENT_OBJ handle to event object. The object has the same

properties as the EVENT_OBJ of the

'ModePreCallback' callback.

Enable 'on'|{'off'}

Specifies whether this figure mode is currently

enabled on the figure.

FigureHandle <handle>

The associated figure handle. This property supports GET only.

RotateStyle {'orbit'}|'box'

Sets the method of rotation. 'orbit' rotates the entire axes.

'box' rotates a plot-box outline of the axes.

UIContextMenu <handle>

Specifies a custom context menu to be displayed during a

right-click action.

FLAGS = isAllowAxesRotate(H,AXES)

Calling the function ISALLOWAXESROTATE on the rotate3d object,

H, with a vector of axes handles, AXES, as input will return a

logical array of the same dimension as the axes handle vector

which indicate whether a rotate operation is permitted on the

axes objects.

setAllowAxesRotate(H,AXES,FLAG)

Calling the function SETALLOWAXESROTATE on the rotate3d object,

H, with a vector of axes handles, AXES, and a logical scalar,

FLAG, will either allow or disallow a rotate operation on the

axes objects.

EXAMPLE 1:

surf(peaks);

rotate3d on

% rotate the plot

EXAMPLE 2:

surf(peaks);

h = rotate3d;

set(h,'RotateStyle','box','Enable','on');

% Rotate the plot using the "Plot Box" rotate style.

EXAMPLE 3:

ax1 = subplot(1,2,1);

surf(peaks);

h = rotate3d;

ax2 = subplot(1,2,2);

surf(membrane);

setAllowAxesRotate(h,ax2,false);

% rotate the plots.

EXAMPLE 4: (copy into a file)

function demo

% Allow a line to have its own 'ButtonDownFcn' callback.

hLine = plot(rand(1,10));

set(hLine,'ButtonDownFcn','disp(''This executes'')');

set(hLine,'Tag','DoNotIgnore');

h = rotate3d;

set(h,'ButtonDownFilter',@mycallback);

set(h,'Enable','on');

% mouse click on the line

function [flag] = mycallback(obj,event_obj)

% If the tag of the object is 'DoNotIgnore', then return true.

objTag = get(obj,'Tag');

Соседние файлы в папке Библиотеки Matlab