Apply affine transforms to graphic objects
The advantage of the function compared to hgtransform objects is that it operates directly on the XData,YData and ZData of the object which allows ButtonDownFcn callbacks to execute even when the object was moved. Moreover the applied transforms can be undone or redone stepwise as well as objects can be reseted. The transforms are stored as a structure in the 'UserData' of the graphic objects
The function supports line, surface, patch and text objects
Usage:
transform(obj, tmatrix)
[M step]=transform(obj, tmatrix)
applies the transform matrix 'tmatrix' to the graphic objects obj. Obj can be line,surface, patch, text or group objects.
Output 'M' is a cell array of transform matrices and step the index of the last transform applied.
[M step]=transform(obj,'undo',nb_steps) undoes 'nb_steps'
[M step]=transform(obj,'redo',nb_steps) redoes 'nb_steps'
transform(obj,'reset') resets obj to initial value. It deletes all transforms and associated UserData