function GetPointBCs(fighandle)
% GetPointBCs(FIGHANDLE)
%
% This function accepts the handle to the main GUI figure FIGHANDLE
% and lets the user apply boundary conditions to nodal points in the mesh.
% GetPointBCs shows all the nodal points in the main figure axes and calls 
% a dialogue PointBCDialogue to ask for point coordinates and boundary
% condition. 

% get handles and nodal coordinates
handles=guidata(fighandle);
xcors=handles.mesh.xcoords;
ycors=handles.mesh.ycoords;

% plot all nodes in the axes
axes(handles.axes1);
cla reset
plot(xcors,ycors,'b.','MarkerSize',10)

xn=min(xcors); xx=max(xcors); yn=min(ycors); yx=max(ycors);
pad=0.1*max(abs([xn xx yn yx]));
xn=xn-pad; xx=xx+pad; yn=yn-pad; yx=yx+pad;
axis([xn xx yn yx]);
clear xn xx yn yx pad

% open a dialogue for defining the boundary conditions for a point
PBCI=PointBCDialogue;
POS =PBCI(1:2);
code=PBCI(3);
tang=PBCI(4);
norm=PBCI(5);
ang =PBCI(6);
% [POS, code, tang, norm, ang]=PointBCDialogue;

% add the boundary condition to the handles.bcsi structure
nodenum=ApplyPointBCs(fighandle, PBCI);

% highlight in the axes the node you just picked
u = tang*cos(ang)-norm*sin(ang);
v = tang*sin(ang)+norm*cos(ang);
mag=sqrt(tang^2+norm^2);
x=xcors(nodenum);
y=ycors(nodenum);
hold on
plot(x,y,'rx','MarkerSize',14)
if mag~=0
    quiver(x,y,u,v,0.25/mag,'g')
end
hold off

% update handles structure
% guidata(fighandle,handles);