/* ========================================================================== * * * * Copyright (c) 1995-2000 Unigraphics Solutions Inc. * * Unpublished - All rights reserved * * * * ========================================================================== */ /* ========================================================================== * * * Description: This file contains the following external functions that * support b-surface functions: * * UF_MODL_ask_bsurf * UF_MODL_create_bsurf * UF_MODL_edit_bsurf * * ========================================================================== */ #include #include #include #include #include #include #define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X))) static int report( char *file, int line, char *call, int irc) { if (irc) { char messg[133]; printf("%s, line %d: %s\n", file, line, call); (UF_get_fail_message(irc, messg)) ? printf(" returned a %d\n", irc) : printf(" returned error %d: %s\n", irc, messg); } return(irc); } static void do_ugopen_api(void) { char *prtnam = "create_bsurf"; /* Points for B-surface */ double points[16][3] = { 3.5, 2.5, 0.0, 4.0, 2.6, 0.2, 4.5, 2.6, 0.2, 5.0, 2.5, 0.0, 3.3, 3.0, 0.2, 4.1, 3.2, 0.3, 4.5, 3.2, 0.3, 5.0, 3.0, 0.2, 3.0, 3.5, 0.2, 3.8, 3.6, 0.3, 4.5, 3.6, 0.3, 5.0, 3.5, 0.2, 2.6, 4.0, 0.0, 3.3, 4.0, 0.2, 4.5, 4.0, 0.2, 5.0, 4.0, 0.0 }; int create_mode = 1; int u_closed_status = 0; int v_closed_status = 0; int u_degree = 3; int v_degree = 3; int num_rows = 4; int pts_per_row[4] = {4, 4, 4, 4}; int ii, jj, kk, indx; tag_t part_tag; tag_t bsurf_obj_id = NULL_TAG; UF_MODL_bsurf_row_info_t *pts_info_per_row; /* pts info for each row */ UF_MODL_bsurface_t bsurf; /* Open a new part */ UF_CALL( UF_PART_new(prtnam, METRIC, &part_tag) ); pts_info_per_row = ( UF_MODL_bsurf_row_info_t *)malloc( num_rows * sizeof(UF_MODL_bsurf_row_info_t) ); /* allocate and load point and other information for each row of points */ indx = 0; for (ii=0; ii