classdef Rotate3D < handle properties (getAccess = public, SetAccess = private) FigureHandle; endproperties properties (public) Enable = "off"; RotateStyle = "orbit"; UIContextMenu = []; ButtonDownFilter = []; ActionPreCallback = []; ActionPostCallback = []; endproperties methods (Access = public) function this = Rotate3D (hfig) if (nargin == 0) error ("A figure handle has to be provided."); endif this.FigureHandle = hfig; endfunction function val = get (this, prop) val = this.(prop); endfunction function set (this, prop, val) if (strcmp (prop, "FigureHandle")) error ("property `FigureHandle' has private access and cannot be set in this context"); endif this.(prop) = val; endfunction function set.Enable (this, rm) switch lower (rm) case "on" this.Enable = "on"; case "off" this.Enable = "off"; otherwise error ("Invalid rotate3d mode."); endswitch rotate3d (this.FigureHandle, rm); endfunction function set.RotateStyle (this, rs) switch lower (rs) case "orbit" this.RotateStyle = "orbit"; case "box" this.RotateStyle = "box"; otherwise error ("Invalid rotate3d style."); endswitch endfunction endmethods endclassdef