function showinout(w)
% plots the classification of b-splines for 2D
% splines are marked at the lower left position of their support
% the inner and outer b-splines for w=1
% the extended and normal inner and outer bsplines for w=2
% Created by G.Apaydin in June 2006
global name x y gi gj xx yy bb n h;
cwd=pwd;cd('output');open([name,'region.fig']);
plot(x,y,'k',x',y','k','Linewidth',2);
for i=1:size(bb,1),
   for j=1:size(bb,2),
      if bb(i,j)==3,plot(xx(j),yy(i),'bo','MarkerFaceColor','b','MarkerSize',11);
      elseif bb(i,j)==2,plot(xx(j),yy(i),'go','MarkerFaceColor','g','MarkerSize',11);
      elseif bb(i,j)==1,plot(xx(j),yy(i),'ro','MarkerFaceColor','r','MarkerSize',11);
      end      
   end
end
gii=find(bb==3);xlabel('x');ylabel('y');
if w==1,
    title([num2str(length(gj)),' outer, ',num2str(length(gi)),...
        ' inner b-splines for n=',num2str(n),' & h=',num2str(h)],'FontSize',16);
    saveas(gcf,['inoutbspln',name,'.jpg']);cd(cwd);
else
    title([num2str(length(gj)),' outer, ',num2str(length(gii)),...
        ' extended inner & ',num2str(length(gi)-length(gii)),...
        ' standard inner b-splines for n=',num2str(n),...
        ' & h=',num2str(h)],'FontSize',16);
    saveas(gcf,['inoutextbspl',name,'.jpg']);cd(cwd);
end