UFUN function UF_CSYS function UF_MTX function (how to create a coordinate system);

1  //   (Subject is not long enough, in which a write)
 2  //    function there
 . 3  //   UF_MTX3_initialize, UF_CSYS_create_matrix, UF_CSYS_create_csys, UF_CSYS_ask_csys_info, UF_CSYS_set_wcs_display, UF_CSYS_ask_matrix_values, UF_CSYS_edit_matrix_of_object, UF_CSYS_set_origin, UF_CSYS_set_wcs 
. 4      UF_initialize ();
 . 5  
. 6      // MTX3_initialize
 . 7      / / a given x, y direction 
. 8      Double x_vec [ . 3 ] = { 1.0 , 0.0 , 0.0 };
 . 9      Double y_vec [ . 3 ] = { 0.0 , 1.0 , 0.0};
10     double mtx[9]={0.0};
11     //CSYS_create_matrix
12     tag_t matrix_id=NULL;
13     //CSYS_create_csys
14     double csys_orign[3]={10.0,10.0,0.0};
15     tag_t csys_id=NULL;
16     //CSYS_ask_csys_info
17     tag_t out_mtx_id=NULL;
18     double out_csys_origin[3]={0.0};
19     //CSYS_set_wcs_display 
20 is      int display_status = . 1 ;
 21 is      // CSYS_ask_matrix_values 
22 is      Double matrix_value [ . 9 ] = { 0.0 };
 23 is      // give the x direction, y direction of the output of a 3x3 matrix of 
24      UF_MTX3_initialize (x_vec, y_vec, MTX);
 25      // 3x3 input matrix to obtain tag value matrix 
26 is      UF_CSYS_create_matrix (MTX, & matrix_id);
 27      // Create a coordinate system csys 
28      UF_CSYS_create_csys (csys_orign, matrix_id, & csys_id);
 29      // get tag coordinate system to obtain information 
30     UF_CSYS_ask_csys_info (csys_id, & out_mtx_id, out_csys_origin);
 31 is      // set the coordinate system display 
32      UF_CSYS_set_wcs_display (display_status);
 33 is      // input matrix acquired tag value matrix 
34 is      UF_CSYS_ask_matrix_values (matrix_id, matrix_value);
 35  
36      char MSG [ 256 ], MSG1 [ 256 ];
 37 [      sprintf (MSG, " % F,% F,% F \ n- " , out_csys_origin [ 0 ], out_csys_origin [ . 1 ], out_csys_origin [ 2 ]);
 38 is      sprintf (MSG1, " % F,% F ,% f \ the n-% f,% f,% f \ the n-% f,% f,% f \ the n- ",matrix_value[0],matrix_value[1],matrix_value[2],matrix_value[3],matrix_value[4],matrix_value[5],matrix_value[6],matrix_value[7],matrix_value[8]);
39     //打印
40     UF_UI_open_listing_window();
41     UF_UI_write_listing_window(msg);
42     UF_UI_write_listing_window("\n");
43     UF_UI_write_listing_window(msg1);
44 
45     //************************ The following ******************* to change the coordinates of the new function ********** // 
46      // given x, y direction 
47      Double x_vec_ew [ . 3 ] = { 5.0 , 8.0 , 9.0 };
 48      Double y_vec_new [ . 3 ] = { 2.0 , 3.0 , 6.0 } ;
 49      Double mtx_new [ . 9 ] = { 0.0 };
 50      // CSYS_create_matrix 
51 is      tag_t new_matrix_id = NULL;
 52 is      // new_origin 
53 is      Doublenew_csys_orign [ . 3 ] = { 30.0 , 80.0 , 100.0 };
 54 is      // give the x direction, y direction of the output of a 3x3 matrix of 
55      UF_MTX3_initialize (x_vec_ew, y_vec_new, mtx_new);
 56 is      // input 3x3 matrix, the matrix obtained tag the value 
57 is      UF_CSYS_create_matrix (mtx_new, & new_matrix_id);
 58      // identifier update the new coordinate system specified by the matrix of the coordinate system specified matrix 
59      UF_CSYS_edit_matrix_of_object (csys_id, new_matrix_id);
 60      // specified to the origin of the new coordinate system 
61 is      UF_CSYS_set_origin (csys_id , new_csys_orign);
 62 is      // set wcs coordinate system 
63 is      UF_CSYS_set_wcs (csys_id);
 64 
65     UF_MODL_update();
66 
67     UF_terminate();

Guess you like

Origin www.cnblogs.com/zzyfym/p/12038628.html