//设置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. java并发编程 线程基础

    java并发编程 线程基础 1. java中的多线程 java是天生多线程的,可以通过启动一个main方法,查看main方法启动的同时有多少线程同时启动 public class OnlyMain { ...

  2. P3611 【[USACO17JAN]Cow Dance Show奶牛舞蹈】

    想了一下还是不发以前做过的水题了,意义也不是很大,现在的话大概只有洛谷黄题以上才会收录了哦~~~ 喵了个咪的题面~~ 洛谷题解dalao不是P党就是优先队列,看的我作为一个新手蒟蒻好慌啊... 这题用 ...

  3. 意想不到的JavaScript(每日一题3)

    题目: 答案: 1 4 3 2 解析:

  4. GCC+Make 自动生成 Makefile 依赖

    目录 BASIS wildcard .PHONY 静态模式 常用自动变量 自动生成依赖(GCC) -M 参数 编写 Makefile Makefile 细节说明 其他 本文内容基于 GNU MAKE. ...

  5. 【神经网络与深度学习】leveldb的实现原理

    郑重声明:本篇博客是自己学习 Leveldb 实现原理时参考了郎格科技系列博客整理的,原文地址:http://www.samecity.com/blog/Index.asp?SortID=12,只是为 ...

  6. docker mysql 容器报too many connections 引发的liunx磁盘扩容操作

    症状每次删除mysql容器重启没两分钟又报标题错 df -h 命令查看各个挂载空间应用情况发现root home var 三个文件目录挂载的空间满了 网上百度了一下liunx磁盘扩容操作,fdisk ...

  7. 20191128 Spring Boot官方文档学习【目录】

    Spring Boot文档 入门 使用Spring Boot 3.1. 构建系统 3.2. 结构化代码 3.3. 配置类 3.4. 自动配置 3.5. Spring beans和依赖注入 3.6. 使 ...

  8. Spring Boot(十七):使用 Spring Boot 上传文件

      上传文件是互联网中常常应用的场景之一,最典型的情况就是上传头像等,今天就带着带着大家做一个 Spring Boot 上传文件的小案例. 1.pom 包配置 我们使用 Spring Boot 版本 ...

  9. Kettle的Kitchen和Span

    Kitchen——工作(job)执行器 (命令行方式) -rep  : Repository name   任务包所在存储名    -user  : Repository username   执行人 ...

  10. [codeforces1234F]Yet Another Substring Reverse

    题目链接 大致题意为将某个子串进行翻转后,使得不包含相同字符的字符子串长度最长.只能翻转一次或零次. 设一个子串的状态为包含字符的二进制.如子串为$abacd$,则状态为$00000000000000 ...