/*
	Copyright (c) 2024 PTC Inc. and/or Its Subsidiary Companies. All Rights Reserved.
*/



/*---------------------- Pro/Toolkit Includes ------------------------*/
#include "ProToolkit.h"
#include "ProGraphic.h"

/*---------------------- Application Includes ------------------------*/
#include "TestError.h"

/*---------------------- Function Prototypes -------------------------*/
ProError UserDraw();


ProError UserDraw()
{
    ProFileName msgfil;
    ProMouseButton button;
    ProPoint3d point;
    ProError err = PRO_TK_NO_ERROR;
    int first=1;

    ProStringToWstring(msgfil,"msg_uggraph.txt");

/*---------------------------------------------------------------------*\
    Get the user to select the points
\*---------------------------------------------------------------------*/
    ProMessageDisplay(msgfil,"USER Select points");
    while( ProMousePickGet(PRO_LEFT_BUTTON,&button,point) == PRO_TK_NO_ERROR
	   &&  button == PRO_LEFT_BUTTON )
    {
/*---------------------------------------------------------------------*\
        Draw a small circle at the point
\*---------------------------------------------------------------------*/
        ProGraphicsCircleDraw(point,5.1);

/*---------------------------------------------------------------------*\
        At the first point, just move there;
        at subsequent points, draw line from the previous point.
\*---------------------------------------------------------------------*/
        if(first)
        {
            ProGraphicsPenPosition(point);
            first = 0;
        }
        else
            ProGraphicsLineDraw(point);
    }

    return ( err );
}