UFUN函数 UF_TRNS(平移 变换)( uf5943 , uf5947)
//设置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)的更多相关文章
- OpenGL旋转平移 变换
#include<gl/glut.h> #include<gl/GL.h> #include<gl/GLU.h> #include<math.h> #i ...
- 常用函数的DTFT变换对和z变换对
直接从书上抓图的,为以后查表方便 1.DTFT 2.z变换对
- 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 ...
- UFUN 函数 UF_DISP (UF_DISP_create_image ) (如何把显示部件部分截图放到指定的文件夹中)
//此函数功能是输入工作部件的tag,返回工作部件的路径 static string path_name(tag_t path_tag) { ]=""; //得到工作部件的路径 U ...
- 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 ...
- UFUN函数 UF_ATTR函数(UF_ATTR_read_value 函数用法)
//此函数的功能是输入tag值,返回与属性标题对应的属性值 static string read_attr(tag_t object_tag) { UF_initialize(); ]="零 ...
- 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 ...
- UFUN函数 UF_CSYS函数 UF_MTX函数(如何创建坐标系);
// (题目不够长,写在这了) // 函数有 // UF_MTX3_initialize,UF_CSYS_create_matrix,UF_CSYS_create_csys,UF_CSYS_ask_c ...
- UFUN函数 UF_ATTR函数(UF_ATTR_cycle )
UF_initialize(); tag_t ; ; int type=UF_ATTR_any ; ]=""; UF_ATTR_value_t value; //循环读取程序的属性 ...
随机推荐
- Altera DDR2 IP核学习总结2-----------DDR2 IP核的生成
打开IP核工具,然后选择Verilog HDL选项,填写路径,写入文件名DDR2_IP.V,点击next PLL reference clock frequency填入板子晶振的频率50MHZ,这里设 ...
- Linux (1)
@https://blog.csdn.net/mayi_xiaochaun这人博客里有一系列linux教程 @linux中,文件名最前加/ 比如 cd /usr/local是绝对路径 若#前显示当前 ...
- mongodb 数据库操作 -- 》常用命令
首先需要下载数据库,安装后,找到bin目录,点开bin目录,复制当前路径配置到环境变量中 和bin的同级下,需要建立一个data/db文件夹,该文件夹并不会自动生成,必须手动设置 启动数据库 看 ...
- 20191128 Spring Boot官方文档学习(10)
10.附录 附录A:通用应用程序属性 附录B:配置元数据 附录C:自动配置类 附录D:测试的自动配置注释 附录E:可执行的Jar格式 附录F:依赖版本
- python 并发编程 协程池
协程池 from gevent.pool import Pool from gevent import monkey;monkey.patch_all() import gevent from gev ...
- [转帖]Windows与Linux的命令行命令对比
Windows与Linux的命令行命令对比 https://www.cnblogs.com/sztom/p/10785140.html * Windows不区分大小写,Linux区分大小写的. sn ...
- POJ 2492 A Bug's Life 题解
题面 这道题是一道标准的种类并查集: 种类并查集是给每个结点一个权值.然后在合并和查找的时候根据情况对权值来进行维护. 通过将原有的区间范围变大使并查集可以维护种类的联系: #include < ...
- POJ 2955 Brackets 区间DP 入门
dp[i][j]代表i->j区间内最多的合法括号数 if(s[i]=='('&&s[j]==')'||s[i]=='['&&s[j]==']') dp[i][j] ...
- 09、RNA降解图的计算过程
RNA降解是影响芯片质量的一个很重要的因素,因为RNA是从5’开始降解的,所以理论5’的荧光强度要低于3’.RNA降解曲线可以表现这种趋势. 以样品GSM286756.CEL和GSM286757.CE ...
- tornado源码简单实现
首先基本的同步流程是: class Index(tornado.web.RequestHandle): def get(self): self.write('hellow,word') app = t ...