点击查看详细介绍

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

misnn 7年前 669 0

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


函数结构:
UF_MODL_ask_face_grid_count
(
tag_t object,
int * u_count,
int * v_count
)

函数说明:
返回脸部或身体的u和v格计数。它返回-1作为算上当所选体的表面网格数不同。

函数参数:
第1个参数为输入:
object代表参数变量,tag_t 为输入参数类型,脸上或身上的标签

第2个参数为输出:
输出int * 整数型的参数,参数的变量格式为u_count,ü格数

第3个参数为输出:
输出int * 整数型的参数,参数的变量格式为v_count,千伏电网计数

UF_MODL_ask_face_grid_count函数实例代码演示:
说明:此文件包含以下外部函数支持面部问计网:UF_MODL_ask_face_grid_count

#include <stdio.h>
#include <uf.h>
#include <uf_part.h>
#include <uf_defs.h>
#include <uf_modl.h>
#define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X)))
static int report( char *file, int line, char *call, int irc)
{
  if (irc)
  {
     char    messg[133];
     printf("%s, line %d:  %s\n", file, line, call);
     (UF_get_fail_message(irc, messg)) ?
       printf("    returned a %d\n", irc) :
       printf("    returned error %d:  %s\n", irc, messg);
  }
  return(irc);
}
static void do_ugopen_api(void)
{
  char    *edge_length[3] = {"5.0", "5.0", "5.0"};
  char    *prtnam = "face_grid";
  double  origin[3] = {0.0, 0.0, 0.0};
  int     u_count;
  int     v_count;
        
  tag_t   body_tag;
  tag_t   feat_tag;
  tag_t   part_tag;
  UF_FEATURE_SIGN create = UF_NULLSIGN;
  
  /* Open a new part */
  UF_CALL( UF_PART_new(prtnam, METRIC, &part_tag) );
  /* Create a block of dimensions 5, 5, 5 */
  UF_CALL(UF_MODL_create_block1(create, origin, edge_length, &feat_tag));
  UF_CALL(UF_MODL_ask_feat_body(feat_tag, &body_tag));
  /* fetch the U and V grid counts of the body. They both should be zero */
  UF_CALL(UF_MODL_ask_face_grid_count(body_tag, &u_count, &v_count));
  
  if ( u_count != 0 || v_count != 0 )
     printf("*** ERROR from UF_MODL_ask_face_grid_count ***\n");
     
  /* change the grid counts of the body to 10 and 5 respectively */
  u_count = 10;
  v_count = 5;
  UF_CALL(UF_MODL_edit_face_grid_count(body_tag, u_count, v_count));
  
  /* verify grid count by fetching them again */
  UF_CALL(UF_MODL_ask_face_grid_count(body_tag, &u_count, &v_count));
  
  if ( u_count != 10 || v_count != 5 )
     printf("*** ERROR from UF_MODL_ask_face_grid_count ***\n");  
}
/*ARGSUSED*/
void ufusr(char *param, int *retcode, int param_len)
{
  if (!UF_CALL(UF_initialize()))
  {
    do_ugopen_api();
    UF_CALL(UF_terminate());
  }
}
int ufusr_ask_unload(void)
{
  return (UF_UNLOAD_IMMEDIATELY);
}


0

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