找回密码 注册 QQ登录
开思网工业级高精度在线3D打印服务

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?快速3D打印 手板模型CNC加工服务在线3D打印服务,上传模型,自动报价
查看: 18773|回复: 11
打印 上一主题 下一主题

【求助】UF_UI_select_with_class_dialog的用法!!!

[复制链接]
跳转到指定楼层
1
发表于 2004-4-4 22:21:41 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

马上注册,结交更多同行朋友,交流,分享,学习。

您需要 登录 才可以下载或查看,没有帐号?注册

x
我按例子调用UF_UI_select_with_class_dialog,为什么总不弹出对话框??
望各位告手帮帮忙!!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
12
发表于 2006-6-26 15:01:48 | 只看该作者
我把UF_call去掉之后能够通过,但是在UG里面点击菜单没有反应阿
11
发表于 2006-6-26 09:56:05 | 只看该作者
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);
10
发表于 2004-4-5 22:10:45 | 只看该作者
多谢版主的提示,不是代码的问题,是对话框的设置问题。现在已经解决了。谢谢!!
9
发表于 2004-4-5 20:02:38 | 只看该作者
调用UF_UI_select_with_class_dialog也如此。
8
发表于 2004-4-5 20:02:05 | 只看该作者
以上是调用UF_UI_select_with_single_dialog的代码
7
发表于 2004-4-5 20:00:08 | 只看该作者
int MOLDWIZARD_select_apart_line_cb ( int dialog_id,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void * client_data,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UF_STYLER_item_value_type_p_t callback_data)
{
  
&nbsp;&nbsp;char cue[] = "cue message";
&nbsp;&nbsp;char title[] = "请选择要实体!";
&nbsp;&nbsp;int response = 0;
&nbsp;&nbsp;tag_t tag_object = NULL_TAG;  
&nbsp;&nbsp;tag_t tag_view = NULL_TAG;
&nbsp;&nbsp;double cursor[3];
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( UF_initialize() != 0)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return ( UF_UI_CB_CONTINUE_DIALOG );
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* ---- Enter your callback code here ----- */
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UF_CALL(UF_UI_select_with_single_dialog(cue,title,
&nbsp;&nbsp;&nbsp;&nbsp; UF_UI_SEL_SCOPE_NO_CHANGE, init_proc, NULL,
&nbsp;&nbsp;&nbsp;&nbsp; [$response, &object, cursor, &view))]  
&nbsp;&nbsp; if(object != NULL_TAG)
&nbsp;&nbsp; {
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; UF_CALL(UF_MODL_ask_feat_body (object, [$body_tag))]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;           
&nbsp;&nbsp; }
&nbsp;&nbsp; else
&nbsp;&nbsp; {
&nbsp;&nbsp;&nbsp;&nbsp; uc1601("请选择实体!",1);
&nbsp;&nbsp;&nbsp;&nbsp; return (UF_UI_CB_CONTINUE_DIALOG);
&nbsp;&nbsp; }
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UF_terminate ();
  
&nbsp;&nbsp;&nbsp;&nbsp;/* Callback acknowledged, do not terminate dialog */
&nbsp;&nbsp;&nbsp;&nbsp;return (UF_UI_CB_CONTINUE_DIALOG);  
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;/* or Callback acknowledged, terminate dialog.    */
&nbsp;&nbsp;&nbsp;&nbsp;/* return ( UF_UI_CB_EXIT_DIALOG );               */
  
}
6
发表于 2004-4-5 11:46:40 | 只看该作者
把你的代码发上来看一下
5
发表于 2004-4-5 11:18:57 | 只看该作者
我调用时出现错误对话框

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
4
发表于 2004-4-5 11:16:51 | 只看该作者
怎样才能让回调函数允许打开对话框?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2025-9-18 15:13 , Processed in 0.032498 second(s), 13 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2025 www.iCAx.org

快速回复 返回顶部 返回列表