zoukankan      html  css  js  c++  java
  • OPENC函数 UF_CURVE函数(UF_CURVE_create_line、UF_CURVE_create_arc、UF_CURVE_ask_arc_data、UF_CURVE_ask_line_data)

     1 UF_initialize();
     2     //CSYS_ask_wcs
     3     tag_t wcs_id=NULL_TAG;
     4     //CSYS_ask_csys_info
     5     double csys_orign[3]={0.0};
     6     //CURVE_create_line
     7     UF_CURVE_line_t line_coords;
     8     tag_t line=NULL_TAG;
     9     //CURVE_create_arc
    10     UF_CURVE_arc_t arc_coords;
    11     tag_t arc=NULL_TAG;
    12     //CURVE_ask_arc_data
    13     UF_CURVE_arc_t ask_arc_coords;
    14     //CURVE_ask_line_data
    15     UF_CURVE_line_t ask_line_coords;
    16     //获取当的wcs坐标系的tag
    17     UF_CSYS_ask_wcs(&wcs_id);
    18     //寻问坐标系的信息(原点和矩阵的tag)
    19     UF_CSYS_ask_csys_info(wcs_id,&arc_coords.matrix_tag,csys_orign);
    20     //CURVE_create_arc
    21     arc_coords.start_angle=10.0*DEGRA;/*注意创建圆弧时,需要在后面乘以弧度,不乘以弧度,不报错不出现圆弧线*/
    22     arc_coords.end_angle=300.0*DEGRA;/*      DEGRA   .01745329251994328*/
    23     arc_coords.arc_center[0]=100.0;
    24     arc_coords.arc_center[1]=0.0;
    25     arc_coords.arc_center[2]=0.0;
    26     arc_coords.radius=100.0;
    27     //CURVE_create_line
    28     line_coords.start_point[0]=0.0;
    29     line_coords.start_point[1]=0.0;
    30     line_coords.start_point[2]=0.0;
    31     line_coords.end_point[0]=100.0;
    32     line_coords.end_point[1]=0.0;
    33     line_coords.end_point[2]=0.0;
    34     //创建直线
    35     UF_CURVE_create_line(&line_coords,&line);
    36     //创建圆弧
    37     UF_CURVE_create_arc (&arc_coords,&arc);
    38     //圆弧数据
    39     UF_CURVE_ask_arc_data(arc,&ask_arc_coords);
    40     //直线数据
    41     UF_CURVE_ask_line_data (line,&ask_line_coords);
    42     //转换数据(圆弧)
    43     char arc_center[256],arc_angle[256],arc_radius[256],arc_mtx_tag[256];
    44     sprintf(arc_center,"圆弧中心为:%f,%f,%f
    ",ask_arc_coords.arc_center[0],ask_arc_coords.arc_center[1],ask_arc_coords.arc_center[2]);
    45     sprintf(arc_angle,"圆弧起始角度为:%f,终止角度为:%f
    ",ask_arc_coords.start_angle,ask_arc_coords.end_angle);
    46     sprintf(arc_radius,"弧度为:%f
    ",ask_arc_coords.radius);
    47     sprintf(arc_mtx_tag,"矩阵tag值为:%d
    ",ask_arc_coords.matrix_tag);
    48     //转换数据(直线)
    49     char line_data[256];
    50     sprintf(line_data,"直线起始点位置为:%f,%f,%f
    终点位置为:%f,%f,%f
    ",ask_line_coords.start_point[0],ask_line_coords.start_point[1],ask_line_coords.start_point[2],ask_line_coords.end_point[0],ask_line_coords.end_point[1],ask_line_coords.end_point[2]);
    51     //打印信息
    52     UF_UI_open_listing_window();
    53     //******************圆弧信息***********************//
    54     UF_UI_write_listing_window(arc_center);
    55     UF_UI_write_listing_window(arc_angle);
    56     UF_UI_write_listing_window(arc_radius);
    57     UF_UI_write_listing_window(arc_mtx_tag);
    58     //******************直线信息***********************//
    59     UF_UI_write_listing_window("
    ");
    60     UF_UI_write_listing_window("
    ");
    61     UF_UI_write_listing_window(line_data);
    62     
    63     UF_terminate();

  • 相关阅读:
    金融大数据行业应用及发展全洞察
    金融大数据行业应用及发展全洞察
    R语言-组间差异的非参数检验
    R语言-组间差异的非参数检验
    互联网,将从内部颠覆企业管理模式
    GitHub使用教程
    sublime text3编辑器经常使用快捷方式
    webpy学习笔记之中的一个
    浏览器的重绘和重排的影响
    《Java并发编程实战》第九章 图形用户界面应用程序界面 读书笔记
  • 原文地址:https://www.cnblogs.com/zzyfym/p/12038651.html
Copyright © 2011-2022 走看看