点击查看详细介绍

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

misnn 7年前 744 0

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


函数结构:
UF_DRAW_ask_body_sils_in_view
(
tag_t body_tag,
tag_t view_tag,
int * num_silhouettes,
tag_p_t * silhouette_tags
)

函数说明:
输出输入体的剪影的阵列驻留在输入绘图员视图。

函数参数:
第1个参数为输入:
body_tag代表参数变量,tag_t 为输入参数类型,身体的标签

第2个参数为输入:
view_tag代表参数变量,tag_t 为输入参数类型,绘图员视图的标签

第3个参数为输出:
输出int * 整数型的参数,参数的变量格式为num_silhouettes,剪影数

第4个参数为输出:
silhouette_tags代表参数变量,tag_p_t * 为输出参数类型,如果num剪影> 0,这是轮廓标记的阵列。免费使用,以释放该内存。

UF_DRAW_ask_body_sils_in_view函数实例代码演示:
询问某一机构的剪影在一个实例函数鉴于图纸会员查看,然后要求这些剪影的面孔。
[quote]
#include <stdio.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_draw.h>
#include <uf_draw_types.h>
#include <uf_drf_types.h>
#include <uf_obj.h>
#include <uf_view.h>
void ufusr(char *param, int *retcod, int param_len)
{
int ifail = 0;
int num_silhouettes = 0;
int ndx = 0;
tag_t body_tag = NULL_TAG;
tag_t view_tag = NULL_TAG;
tag_t face_tag = NULL_TAG;
tag_t * silhouette_tags = NULL;
char error_message[133];
char * body_name = "body1";
char * view_name = "TOP@1";
char * face_name = "face1";
ifail = UF_initialize();
/* Find the tags of the body and view from their names. */
if( ifail == 0 )
ifail = UF_OBJ_cycle_by_name( body_name, &body_tag );
if( ifail == 0 )
ifail = UF_VIEW_ask_tag_of_view_name( view_name,
&view_tag );
/* Retrieve the sils of the body in the top view. */
if( ifail == 0 )
ifail = UF_DRAW_ask_body_sils_in_view( body_tag,
view_tag, &num_silhouettes, &silhouette_tags );
if( ifail == 0 )
{
for( ndx=0; ndx<num_silhouettes; ndx++ )
{
tag_t sil_face_tag = NULL_TAG;
ifail = UF_DRAW_ask_face_of_sil(
silhouette_tags[ndx],
&sil_face_tag );
/* Add code here to process silhouette and face. */
}
}
UF_free( silhouette_tags );
/* Or retrieve the sils of a known face on the body. */
silhouette_tags = NULL;
if( ifail == 0 )
ifail = UF_OBJ_cycle_by_name( face_name, &face_tag );
if( ifail == 0 )
ifail = UF_DRAW_ask_face_sils_in_view( face_tag,
view_tag, &num_silhouettes, &silhouette_tags );
if( ifail == 0 )
{
for( ndx=0; ndx<num_silhouettes; ndx++ )
{
/* Add code here to process silhouettes of face. */
}
}
UF_free( silhouette_tags );
printf( "UF_DRAW_ask_body_sils_in_view sample " );
if( ifail > 0 )
{
ifail = UF_get_fail_message( ifail, error_message );
printf( "fails.\nError is: %s\n", error_message );
}
else
printf( "is successful.\n" );
ifail = UF_terminate();
}



[/quote]

0

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