/*----------------------------------------------------------------------------- File: UgGraphLineCircleDraw.c Description: demo drawing lines/circles PTC File Date Version Author Vers Comment --------- ------- -------- ----- --------------------------------------------- 04-dec-97 H-02-02 AWY/CHI $$1 setup. -----------------------------------------------------------------------------*/ /*---------------------- Pro/Toolkit Includes ------------------------*/ #include "ProToolkit.h" #include "ProGraphic.h" /*---------------------- Application Includes ------------------------*/ #include "TestError.h" /*---------------------- Function Prototypes -------------------------*/ ProError UserDraw(); ProError UserDraw() { ProFileName msgfil; ProColortype old_color,dummy_color; ProMouseButton button; ProPoint3d point; ProError err; int first=1; ProStringToWstring(msgfil,"msg_uggraph.txt"); /*---------------------------------------------------------------------*\ Set the Pro/TOOLKIT graphics color to MAGENTA \*---------------------------------------------------------------------*/ err=ProGraphicsColorSet(PRO_COLOR_ERROR,&old_color); ERROR_CHECK("UserDraw","ProGraphicsColorSet",err); /*---------------------------------------------------------------------*\ 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); } /*---------------------------------------------------------------------*\ Set the color back. \*---------------------------------------------------------------------*/ err=ProGraphicsColorSet(old_color,&dummy_color); ERROR_CHECK("UserDraw","ProGraphicsColorSet(reset)",err); return ( err ); }