//设置class_dialog选择过滤
static int init_proc(UF_UI_selection_p_t select,void* user_data)
{
int num_triples = ;
//实体 片体
UF_UI_mask_t mask_triples[] = {UF_solid_type,,};
/* enable only lines and edges */
if((UF_UI_set_sel_mask(select,UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC,num_triples, mask_triples)) == )
{
return (UF_UI_SEL_SUCCESS);
}
else
{
return (UF_UI_SEL_FAILURE);
}
} extern DllExport void ufsta( char *param, int *returnCode, int rlen )
{
/* Initialize the API environment */
if( UF_CALL(UF_initialize()) )
{
/* Failed to initialize */
return;
} /* TODO: Add your application code here */
UF_initialize(); //select_with_class_dialog
char message[]="类选择对话框";
char title[]="按类选择:";
int scope=UF_UI_SEL_SCOPE_ANY_IN_ASSEMBLY;
int response=;
int count=;
tag_t* objects=NULL;
//
double translation[]={0.0,500.0,500.0};
double matrix_value[]={0.0};
/*
绝对坐标系 的平移距离
translation[0] x向的距离
translation[1] y向的距离
translation[2] z向的距离
*/
//
tag_t *objects_array=NULL;
int move_or_copy=;//1 - Move 2 - copy
int dest_layer=;//0 - the original layer, -1 - the work layer, 1 - 256 - the specified layer
int trace_curves=;//轨迹曲线状态1 means on, 2 means off.
tag_t *copies=NULL;//这是当move_or_copy等于1(移动)时不使用。当move_or_copy为2(副本)时,应设置一个为空tag_t
tag_t trace_curve_group=NULL;//当trace_curves=2时,此处设置为null
int status_value=;
//多选对话框
UF_UI_select_with_class_dialog (message,title,scope,init_proc,NULL,&response,&count,&objects);
//分配内存
objects_array=(tag_t*)malloc(sizeof(tag_t)*count);
if (response == UF_UI_OK && count > )
{
for (int i=; i<count; i++)
{
objects_array[i]=objects[i];
UF_DISP_set_highlight(objects[i], );
} }
//返回矩阵以执行线性变换,沿着 绝对坐标系 的X轴,Y轴和Z轴。
uf5943(translation,matrix_value);
//分配内存
copies=(tag_t*)malloc(sizeof(tag_t)*count);
//平移
uf5947(matrix_value,objects_array,&count,&move_or_copy,&dest_layer,&trace_curves,copies,&trace_curve_group,&status_value);
//释放内存
free(copies);
free(objects_array);
/*
注意:
1.坐标系问题
注意平移变换 这个玩意是按 绝对坐标系 方向来的(坐标系不统一时先把坐标系统一)
2.注意内存的分配。
3.如果是有参数的体 经过 uf5947 平移变换后变成 去参后的体。 4.trace_curves 轨迹曲线状态 ps:我也不明白是什么意思,求大神什么解释
*/ UF_terminate(); /* Terminate the API environment */
UF_CALL(UF_terminate());
}

UFUN函数 UF_TRNS(平移 变换)( uf5943 , uf5947)的更多相关文章

  1. OpenGL旋转平移 变换

    #include<gl/glut.h> #include<gl/GL.h> #include<gl/GLU.h> #include<math.h> #i ...

  2. 常用函数的DTFT变换对和z变换对

    直接从书上抓图的,为以后查表方便 1.DTFT 2.z变换对

  3. UFUN函数 UF_UI UF_PART函数(UF_UI_select_with_class_dialog, UF_PART_export_with_options)

    /*主要演示 UF_PART_export_with_options 这个函数 */1 //设置class_dialog选择过滤 static int init_proc(UF_UI_selectio ...

  4. UFUN 函数 UF_DISP (UF_DISP_create_image ) (如何把显示部件部分截图放到指定的文件夹中)

    //此函数功能是输入工作部件的tag,返回工作部件的路径 static string path_name(tag_t path_tag) { ]=""; //得到工作部件的路径 U ...

  5. UFUN函数 UF_ASSEM UF_PART函数(UF_ASSEM_ask_work_part,UF_PART_ask_part_name)

    UF_initialize(); tag_t work_part_tag=NULL_TAG; ]=""; //获取当前工作部件的tag work_part_tag=UF_ASSEM ...

  6. UFUN函数 UF_ATTR函数(UF_ATTR_read_value 函数用法)

    //此函数的功能是输入tag值,返回与属性标题对应的属性值 static string read_attr(tag_t object_tag) { UF_initialize(); ]="零 ...

  7. UFUN函数 UF_CSYS UF_MODL UF_OBJ函数(建模注意坐标系);

    //用到的函数 //UF_MODL_create_block1 ,UF_MODL_ask_feat_body,UF_OBJ_set_name,UF_CSYS_map_point UF_initiali ...

  8. UFUN函数 UF_CSYS函数 UF_MTX函数(如何创建坐标系);

    // (题目不够长,写在这了) // 函数有 // UF_MTX3_initialize,UF_CSYS_create_matrix,UF_CSYS_create_csys,UF_CSYS_ask_c ...

  9. UFUN函数 UF_ATTR函数(UF_ATTR_cycle )

    UF_initialize(); tag_t ; ; int type=UF_ATTR_any ; ]=""; UF_ATTR_value_t value; //循环读取程序的属性 ...

随机推荐

  1. python文档的数据读取,把读取数据写入到新的表里

    目的:接口自动化过程需要从表格文件读取,然后把结果写到表格中.没有多余内容全部是精华! 读取文件1 读取文件2 代码如下图: # -*-coding:utf-8 -*-# Author:wangjun ...

  2. centos8飞行驾驶舱和docker安装

    零.先解决cenos8的网络(systemctl restart network.service已被废弃) 1.# vim /etc/sysconfig/network-scripts/ifcfg-e ...

  3. awk 控制语句if-else

    语法: 一.if (条件){语句}[else 语句] 单分支 二.if (条件){语句}else if( 条件){语句} 多分支 示例: .[root@localhost ~]# awk -F: '{ ...

  4. 设置Eclipse代码自动提示

    对于编程人员来说,要记住大量的类名或类方法的名字,着实不是一件容易的事情.如果要IDE能够自动补全代码,那将为我们编程人员带来很大帮助. Eclipse代码里面的代码提示功能默认是关闭的,只有输入“. ...

  5. 【一个蒟蒻的挣扎】LCA (倍增)

    #include<cstdio> #include<iostream> #include<cstring> using namespace std; struct ...

  6. 高效编程之 concurrent.future

    背景 我们知道 Python 中有多线程threading 和多进程multiprocessing 实现并发, 但是这两个东西开销很大,一是开启线程/进程的开销,二是主程序和子程序之间的通信需要 序列 ...

  7. Select 和Alert

    Select 和Alert使用前都必须先导入 from selenium.webdriver.common.alert import Alert from selenium.webdriver.sup ...

  8. c# 模拟post登录

    使用模拟登录大致可以分为两步 一.post登录获取cookis public CookieContainer GetCookie(string url,string account,string pa ...

  9. curry&unCurry函数

    unCurry函数与curry函数区别:curry化函数:固定部分参数,返回一个接受剩余参数的新函数,目的是为了缩小适用范围,创建一个针对性更强的函数. unCurry化函数:扩大适用范围,创建一个应 ...

  10. 十三、LaTex中的参考文献BibTex

    将默认文献工具设置为bibtex