Sample Text版主你好!我的出现: error C2065: 'UF_CALL' : undeclared identifier这个错误,下面是我得改回调函数内添加的程序:
int J_apply_cb ( int dialog_id,
void * client_data,
UF_STYLER_item_value_type_p_t callback_data)
{
/* Make sure User Function is available. */
UF_STYLER_item_value_type_t data;
int num_u,num_v; //网格数控制
char* option_string;
if ( UF_initialize() != 0)
return ( UF_UI_CB_CONTINUE_DIALOG );
data.item_id="NUM_U";
data.item_attr=UF_STYLER_VALUE;
UF_STYLER_ask_value(dialog_id,&data);
num_u=data.value.integer;
data.item_id="NUM_V";
data.item_attr=UF_STYLER_VALUE;
UF_STYLER_ask_value(dialog_id,&data);
num_v=data.value.integer;
data.item_id="OPTION";
data.item_attr=UF_STYLER_SUBITEM_VALUES;
UF_STYLER_ask_value(dialog_id,&data);
option_string=data.value.string;
// UF_STYLER_free_value;
//#define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X)))
char cue[] = "Select Objects";
char title[] = "User Title";
int response, count, i;
double face_param[2],face_point[3],face_u_deriv1[3],face_v_deriv1[3],face_u_deriv2[3];
double face_v_deriv2[3],face_normal[3],face_radii[2];
double face_max_curva[4],face_range[4];
int face_curva_type[4];
int p,j,k,m,n,h;
int tt1=1;
double mincvt,maxcvt,gauscvt;
double uv_min_max[4];
int uv_flag;
int isocurve_cnt;
double parameter;
double dist_tol=0.001;
tag_t *isocurve_id;
tag_t point;
double u[1000],v[1000]; //划分网格的最大个数
// int num_knot_u,num_knot_v,num_poles;
tag_p_t objects;
UF_MODL_bsurface_t bsurf;
char buffer[133];
int ii,jj,off=0;
for(i=1;i<= num_u;i++) //控制U向网格个数
{
u[0]=0;
u=u[i-1]+(double)1/num_u;
}
for(i=1;i<= num_v;i++) //控制V向网格个数
{
v[0]=0;
v=v[i-1]+(double)1/num_v;
}
if((UF_CALL(UF_UI_select_with_class_dialog(
cue, title, UF_UI_SEL_SCOPE_WORK_PART,
NULL, NULL, &response, &count, &objects))) == 0)
{
UF_UI_open_listing_window();
// sprintf(buffer,"response= %d, object count= %d\n",response,count);
// UF_UI_write_listing_window(buffer);
if (response == UF_UI_OK && count > 0)
{
for (p=0; p<count; p++)
{
UF_CALL(UF_MODL_ask_bsurf( objects[p], &bsurf ));
/* sprintf(buffer,"bsurf.order_u=%d,bsurf.order_v=%d,bsurf.num_poles_u=%d,bsurf.num_poles_v=%d,bsurf.is_rational=%d",
bsurf.order_u,bsurf.order_v,bsurf.num_poles_u,bsurf.num_poles_v,bsurf.is_rational);
UF_UI_write_listing_window(buffer);
UF_UI_write_listing_window("\n");
*/
/* validate the surface */
for(m=0;m<=num_u;m++)
{
face_param[0]=u[m];
for(k=0;k<=num_v;k++)
{
tt1=tt1+1;
face_param[1]=v[k];
UF_MODL_ask_face_props(objects[p],
face_param,
face_point,
face_u_deriv1,face_v_deriv1,
face_u_deriv2,face_v_deriv2,
face_normal,face_radii);
//***********************************添加求取曲率代码
face_range[0]=u[k];
face_range[1]=v[k];
UF_MODL_ask_max_curvature (
objects[p],
face_range,
response,
face_max_curva,
face_curva_type); |