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; //循环读取程序的属性 ...
随机推荐
- 【神经网络与深度学习】leveldb的实现原理
郑重声明:本篇博客是自己学习 Leveldb 实现原理时参考了郎格科技系列博客整理的,原文地址:http://www.samecity.com/blog/Index.asp?SortID=12,只是为 ...
- layer最大话.最小化.还原回调方法
layer.open({ type: 1, title: ‘在线调试‘, content: ‘这里是内容‘, ...
- IIS服务搭建 试图加载格式不正确的程序
1.基础步骤 https://jingyan.baidu.com/article/fedf073770f23335ac8977b1.html 2.错误解决 试图加载格式不正确的程序 解决:在IIS ...
- opencv学习之等待按键事件-waitKey函数
文章来源: https://mangoroom.cn/opencv/opencv-learning-waitKey.html 序 waitKey函数属于opencv函数里既常用又非常基础的函数,无论是 ...
- HNUSTOJ-1674 水果消除(搜索或并查集)
1674: 水果消除 时间限制: 2 Sec 内存限制: 128 MB提交: 335 解决: 164[提交][状态][讨论版] 题目描述 “水果消除”是一款手机游戏,相信大家都玩过或玩过类似的游戏 ...
- thinkphp5 安装
thinkphp 5开始可以使用composer安装 所以在安装thinkphp5.1之前,我们先安装composer ,下载地址:https://www.phpcomposer.com/ 安装完co ...
- LeetCode 338. 比特位计数
338. 比特位计数 题目描述 给定一个非负整数 num.对于 0 ≤ i ≤ num 范围中的每个数字 i ,计算其二进制数中的 1 的数目并将它们作为数组返回. 示例 示例 1: 输入: 2 输出 ...
- linux复习4:文件和目录
7一.linux文件 1.linux文件的扩展名:文件扩展名是文件名最后一个点之后的部分,下面列出了其中一部分 (1)压缩文件和归档文件 压缩和归档的文件扩展名及其含义如下. .bz2:使用bzip2 ...
- 国际化:node导语言包
项目做国际化,是离不开语言包的en.json.zh-CN.json等等.难道要一个一个json文件的写吗???不!!!只要我们写在excel里,然后用nodejs导出我们需要的语言包就可以了!这样大大 ...
- 机器学习-回归中的相关度和R平方值
1. 皮尔逊相关系数(Pearson Correlation Coefficient) 1.1 衡量两个值线性相关强度的量 1.2 取值范围[-1, 1] 正相关:>0, 负相关:<0, ...