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; //循环读取程序的属性 ...
随机推荐
- 在Opencv中将一幅图像均分成M* N个小图像
std::vector<std::vector<Mat> > partitionImage(Mat&src,int rows,int cols) 函数中有三个输入参数, ...
- python学习之面向对象(三)
6.8 类的结构细化 6.8.1 类的私有成员 类中的私有成员包括:私有类的属性,私有对象属性,私有类方法 私有静态属性 类的内部可以访问,类的外部不可以访问,派生类中不可以访问 class A: _ ...
- shell脚本判断里面的字符含义
[ -s FILE ] 如果 FILE 存在且大小不为0则为真. [ -a FILE ] 如果 FILE 存在则为真. [ -b FILE ] 如果 FILE 存在且是一个块特殊文件则为真. [ -c ...
- python-爬取糗事百科热图
此次运用requests和beautifulSoup爬取糗事百科热图,常用的网络库有:urllib,urllib3,requests,选取其中之一就行了:HTML/XML解析器有:lxml,Beaut ...
- XSS-DOM型
dom型因为js不会,无法理解啊!!!!!!!!!!!!! HTML DOM实例https://www.runoob.com/htmldom/htmldom-examples.html 其实DOM型x ...
- 【miscellaneous】GPRS本质论
GPRS DTU最基本的用法是:在DTU中放入一张开通GPRS功能的SIM卡,DTU上电后先注册到GPRS网络,然后通过GPRS网络和数据处理中心建立连接.这条连接涉及了无线网络运营商,因特网宽 带供 ...
- mysql 表字段 记录创建时间和更新时间
sql语句创建: CREATE TABLE `NewTable` ( `id` int NOT NULL AUTO_INCREMENT , `name` varchar(20) NOT NULL , ...
- javascript number与isNan
number 与 isnan Number:表示整数和浮点数 NaN:即非数值(not a Number)是 一个特殊的数值.是Number类型的一种. 说明:1.任何涉及NaN的操作(例如Nan/1 ...
- UML类图知识点整理
引用源:https://www.cnblogs.com/me115/p/4092632.html 从一个示例开始 请看以下这个类图,类之间的关系是我们需要关注的: 车的类图结构为<<abs ...
- Spring数据库主从分离
1.spring+spring mvc +mybatis+druid 实现数据库主从分离 2.Spring+MyBatis主从读写分离 3.MyCat痛点 4.Spring+MyBatis实现数据库读 ...