点击查看详细介绍

UF_BREP_ask_topology() 函数的参数解释说明、函数详细用法,以及实例代码演示

misnn 7年前 1654 0

购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008  QQ号:85585969  


函数结构:
UF_BREP_ask_topology
(
tag_t body,
const UF_BREP_options_t * options,
UF_BREP_topology_t * * body_topos,
int * num_states,
UF_BREP_state_t * * states
)

函数说明:
返回身体或面部的拓扑描述。该body_topos名单与孩子指针数组定义之间的连接主体的实体。将返回一个面拓扑,好像它是一个片体,除非SP曲线修改请求,在这种情况下,顶点是省略。边缘或在循环散热片的取向是由指示面向儿童的结构取向材料。

函数参数:
第1个参数为输入:
body代表参数变量,tag_t 为输入参数类型,身体要返回拓扑标签

第2个参数为输入:
options代表参数变量,const UF_BREP_options_t * 为输入参数类型,根据需要指定的选项。请求调整表面数据时翅修改(压扁,奇点)在这里指定。

第3个参数为输出:
body_topos代表参数变量,UF_BREP_topology_t * * 为输出参数类型,拓扑结构和数组描述身体。

第4个参数为输出:
输出int * 整数型的参数,参数的变量格式为num_states,状态的状态阵列中的数

第5个参数为输出:
states代表参数变量,UF_BREP_state_t * * 为输出参数类型,UF BREP分配的数组。如果调用者传递一个NULL,UF BREP不分配的数组。这应该通过调用UF_free释放。

UF_BREP_ask_topology函数实例代码演示:
[quote]
#include <stdio.h>
#include <stdlib.h>
#include <uf.h>
#include <uf_brep.h>
#include <uf_obj.h>
#include <uf_object_types.h>
#include <uf_part.h>

/* Recursive routine to print an indented topology tree.*/

print_topology_tree
(
UF_BREP_topology_t *parent_topology,
int child_ndx,
UF_BREP_topology_t *child_topology,
int tree_depth
)

{
int i,unique_id,grand_child_ndx;
tag_t ug_tag;

for (i=0; i<tree_depth; i++) printf (" ");
switch (child_topology->type)
{
case UF_BREP_SOLID_TOPO: printf ("Solid"); break;
case UF_BREP_SHEET_TOPO: printf ("Sheet"); break;
case UF_BREP_TRIMSURF_TOPO: printf ("Trimsurf"); break;
case UF_BREP_SHELL_TOPO: printf ("Shell"); break;
case UF_BREP_FACE_TOPO: printf ("Face"); break;
case UF_BREP_LOOP_TOPO: printf ("Loop"); break;
case UF_BREP_FIN_TOPO: printf ("Fin"); break;
case UF_BREP_EDGE_TOPO: printf ("Edge"); break;
case UF_BREP_VERTEX_TOPO: printf ("Vertex"); break;
}
UF_BREP_ask_identifier(child_topology,&unique_id);

printf(": UGtag=%d, id=%d\n",
child_topology->tag, unique_id);

for (grand_child_ndx=0;
grand_child_ndx < child_topology->num_children;
grand_child_ndx++)
print_topology_tree(
child_topology,
grand_child_ndx,
child_topology->children[grand_child_ndx].child,
tree_depth+1);
}

main()
{ tag_t body;
UF_BREP_topology_p_t topo;
tag_t part;
UF_PART_load_status_t part_status;
UF_BREP_geometry_t geometry;
UF_BREP_state_p_t states;
int nstates;
int ntopo;
UF_BREP_topology_p_t tdx; /* topology element */
int cdx; /* child index */

UF_initialize();
UF_PART_open("tetrahedron.prt",&part,&part_status);

/*
* At this point, some means is employed to determine which body
* to treat. We assume the variable body has been set as a result
* of this process.
*/

UF_BREP_ask_topology(body,0,&topo,&nstates,&states);

print_topology_tree(NULL,0,topo,0);

UF_BREP_release_topology(&topo);
UF_terminate();
}

/*************************************************************************
The program might produce the following topology tree listing:

Solid: UGtag=375, id=206
Shell: UGtag=0, id=209
Face: UGtag=382, id=261
Loop: UGtag=0, id=225
Fin: UGtag=0, id=224
Edge: UGtag=400, id=227
Vertex: UGtag=0, id=223
Vertex: UGtag=0, id=221
Fin: UGtag=0, id=216
Edge: UGtag=398, id=236
Vertex: UGtag=0, id=215
Vertex: UGtag=0, id=223
Fin: UGtag=0, id=226
Edge: UGtag=397, id=238
Vertex: UGtag=0, id=221
Vertex: UGtag=0, id=215
Face: UGtag=381, id=256
Loop: UGtag=0, id=229
Fin: UGtag=0, id=222
Edge: UGtag=400, id=227
Vertex: UGtag=0, id=223
Vertex: UGtag=0, id=221
Fin: UGtag=0, id=230
Edge: UGtag=396, id=247
Vertex: UGtag=0, id=217
Vertex: UGtag=0, id=221
Fin: UGtag=0, id=228
Edge: UGtag=395, id=232
Vertex: UGtag=0, id=223
Vertex: UGtag=0, id=217
Face: UGtag=380, id=253
Loop: UGtag=0, id=250
Fin: UGtag=0, id=249
Edge: UGtag=396, id=247
Vertex: UGtag=0, id=217
Vertex: UGtag=0, id=221
Fin: UGtag=0, id=251
Edge: UGtag=397, id=238
Vertex: UGtag=0, id=221
Vertex: UGtag=0, id=215
Fin: UGtag=0, id=252
Edge: UGtag=399, id=214
Vertex: UGtag=0, id=217
Vertex: UGtag=0, id=215
Face: UGtag=379, id=255
Loop: UGtag=0, id=234
Fin: UGtag=0, id=233
Edge: UGtag=398, id=236
Vertex: UGtag=0, id=215
Vertex: UGtag=0, id=223
Fin: UGtag=0, id=231
Edge: UGtag=395, id=232
Vertex: UGtag=0, id=223
Vertex: UGtag=0, id=217
Fin: UGtag=0, id=235
Edge: UGtag=399, id=214
Vertex: UGtag=0, id=217
Vertex: UGtag=0, id=215
*************************************************************************/




[/quote]

0

最新回复 (0)
请登录后发表新帖