xp_comm_proj/nurbs/nurbutil.c
/* NRB_DUMP_PCH: dump nrb patch data in the proper form */
dump nrb patch data in the proper form
dump nrb patch data in the proper form
void nrb_dump_pch (char *name,int dbkey,Qnurbs_pch *pch_data)
{
    Qfloat   *tu, *tv;
    Qpoint4 *pcp;
    int     ku, nu, kv, nv, i, j, jj;
    if (pch_data == NULL) return;
    nrb_pch_data (pch_data, &ku, &nu, &kv, &nv, &tu, &tv, &pcp);
    printf ("NURBS_PCH %s DATA ====================>\n", name);
    printf ("DATA BASE KEY = %d\n", dbkey);
    printf ("U: ORDER = %d, CPT NO = %d\n", ku, nu);
    printf ("V: ORDER = %d, CPT NO = %d\n", kv, nv);
    printf ("U KNOTS VECTOR ==>\n");
    for (i = 0; i < ku + nu; i++) 
	printf ("   %d ==> %f\n", i, tu[i]);
    printf ("V KNOTS VECTOR ==>\n");
    for (i = 0; i < kv + nv; i++) 
	printf ("   %d ==> %f\n", i, tv[i]);
    printf ("4D CONTROL POINTS ==>\n");
    for (i = 0; i < nv; i++)
    for (j = 0; j < nu; j++) {
	jj = i * nu + j;
	printf ("%f, %f, %f, %f,\n", 
		pcp[jj].x, pcp[jj].y, pcp[jj].z, pcp[jj].w);
    }
}
void nrb_dump_pch ( char * name , int dbkey , Qnurbs_pch * pch_data ) { Qfloat * tu , * tv ; Qpoint4 * pcp ; int ku , nu , kv , nv , i , j , jj ; if ( pch_data == NULL ) return ; nrb_pch_data ( pch_data , & ku , & nu , & kv , & nv , & tu , & tv , & pcp ) ; printf ( " \n " , name ) ; printf ( " \n " , dbkey ) ; printf ( " \n " , ku , nu ) ; printf ( " \n " , kv , nv ) ; printf ( " \n " ) ; for ( i = 0 ; i < ku + nu ; i ++ ) printf ( " \n " , i , tu [ i ] ) ; printf ( " \n " ) ; for ( i = 0 ; i < kv + nv ; i ++ ) printf ( " \n " , i , tv [ i ] ) ; printf ( " \n " ) ; for ( i = 0 ; i < nv ; i ++ ) for ( j = 0 ; j < nu ; j ++ ) { jj = i * nu + j ; printf ( " \n " , pcp [ jj ] . x , pcp [ jj ] . y , pcp [ jj ] . z , pcp [ jj ] . w ) ; } }
NRB_DUMP_PCH: dump nrb patch data in the proper form
NRB_DUMP_PCH : dump nrb patch data in the proper form
/* comment name */ /* related DB key */ /* nrb patch data */ /* dump nurbs pch data */