Hoi Zamme,
I have a question regarding the change of the behaviour of Matlabs impoly function. I want to modify the moving behaviour that the user is only able to move the vertexes along the X axes and the Y position stays the same.
I tried the following:
f = 40*membrane(1,40);r = (1:size(f,2))*5;t = (1:size(f,1))/10;
figure;imagesc(t, r, f); axis xy;hold on;
plot(t, 100*ones(size(t)), 'g');plot(t, 200*ones(size(t)), 'g')
hp = impoly(gca, [1 100; 5, 200]);
addNewPositionCallback(hp,@(p) setPosition(hp, [p(1,1) 100; p(2,1) 200]))
But it seems that the new positionCallback is put in front of the original callback function, as the help page to "iptaddcallback" states:
NOTE ... If a callback is already installed, iptaddcallback replaces that callback function with the iptaddcallback callback processor, and then adds the preexisting callback function to the iptaddcallback list. ...
Is my assumption with the order of Callbacks right and how can I achieve my needs? Or is there a more clever way to get impoly's vertexes move only along the x-axes?
Thanks in advance!