Code covered by the BSD License

# Mathworks Rubik version 2

### Thomas Beneder (view profile)

04 Apr 2013 (Updated )

Display, tester and solver of the Rubik's game, including "full cubes".

2; break; end end end if pinpol==1 set(hFig,'Pointer','custom','PointerShapeCData',Cube.hand,... 'PointerShapeHotSpot',[1 8]); elseif pinpol==2 set(hFig,'Pointer','custom','PointerShapeCData',Cube.arrows,... 'PointerShapeHotSpot',[8 8]);
```function ChangePointer
% to change the mouse pointer
hFig=gcf;
if ~strcmp(get(hFig,'Tag'),'RubikFigure')
return
end
hAxes=findobj(hFig,'Tag','RubikAxes');
if isempty(hAxes)
return
end
if ~strcmp(get(hAxes,'Tag'),'RubikAxes')
return
end
Cube=get(hAxes,'UserData');
p = get(hFig,'CurrentPoint'); % pointer coordinates
pinpol = 0; % =1, if Pointer is in any polygon
for k=1:size(Cube.PgRotCubeX,2),
if inpolygon(p(1),p(2),Cube.PgRotCubeX(:,k),Cube.PgRotCubeY(:,k))==1,
pinpol = 1;
break;
end
end
if pinpol==0,
for k=1:size(Cube.PgRotLayX,2),
if inpolygon(p(1),p(2),Cube.PgRotLayX(:,k),Cube.PgRotLayY(:,k))==1,
pinpol = 2;
break;
end
end
end
if pinpol==1
set(hFig,'Pointer','custom','PointerShapeCData',Cube.hand,...
'PointerShapeHotSpot',[1 8]);
elseif pinpol==2
set(hFig,'Pointer','custom','PointerShapeCData',Cube.arrows,...
'PointerShapeHotSpot',[8 8]);
else
set(hFig,'Pointer','arrow');
end
```