(root)/
libredwg-0.13/
test/
unit-testing/
dimension_diameter.c
       1  #define DWG_TYPE DWG_TYPE_DIMENSION_DIAMETER
       2  #include "common.c"
       3  
       4  void
       5  api_process (dwg_object *obj)
       6  {
       7    int error;
       8    double elevation, act_measurement, horiz_dir, lspace_factor, text_rotation,
       9        ins_rotation, leader_len;
      10    BITCODE_B flip_arrow1, flip_arrow2;
      11    BITCODE_RC class_version, flag, flag1;
      12    BITCODE_BS lspace_style, attachment;
      13    char *user_text;
      14    int isnew;
      15    dwg_point_2d text_midpt, clone_ins_pt;
      16    dwg_point_3d def_pt, first_arc_pt, extrusion, ins_scale;
      17    BITCODE_H dimstyle, block;
      18  
      19    dwg_ent_dim_diameter *dim_diameter = dwg_object_to_DIMENSION_DIAMETER (obj);
      20    dwg_ent_dim *dim = dwg_object_to_DIMENSION (obj);
      21  
      22    /* common */
      23    CHK_ENTITY_TYPE (dim, DIMENSION_DIAMETER, class_version, RC);
      24    CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_DIAMETER, lspace_style, BS);
      25    CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_DIAMETER, lspace_factor, BD);
      26    CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_DIAMETER, act_measurement, BD);
      27    CHK_ENTITY_TYPE (dim, DIMENSION_DIAMETER, attachment, BS);
      28    CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_DIAMETER, elevation, BD);
      29    CHK_ENTITY_3RD (dim, DIMENSION_DIAMETER, extrusion);
      30    CHK_ENTITY_2RD_W_OLD (dim, DIMENSION_DIAMETER, clone_ins_pt);
      31    CHK_ENTITY_2RD_W_OLD (dim, DIMENSION_DIAMETER, text_midpt);
      32    CHK_ENTITY_UTF8TEXT (dim, DIMENSION_DIAMETER, user_text);
      33    CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_DIAMETER, text_rotation, BD);
      34    CHK_ENTITY_3RD_W_OLD (dim, DIMENSION_DIAMETER, ins_scale);
      35    CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_DIAMETER, ins_rotation, BD);
      36    CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_DIAMETER, horiz_dir, BD);
      37    CHK_ENTITY_MAX (dim, DIMENSION_DIAMETER, text_rotation, BD, MAX_ANGLE);
      38    CHK_ENTITY_MAX (dim, DIMENSION_DIAMETER, ins_rotation, BD, MAX_ANGLE);
      39    CHK_ENTITY_MAX (dim, DIMENSION_DIAMETER, horiz_dir, BD, MAX_ANGLE);
      40    CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_DIAMETER, flip_arrow1, B);
      41    CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_DIAMETER, flip_arrow2, B);
      42    CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_DIAMETER, flag1, RC);
      43    CHK_ENTITY_TYPE (dim, DIMENSION_DIAMETER, flag, RC);
      44  
      45    /* diameter */
      46    CHK_ENTITY_3RD_W_OLD (dim_diameter, DIMENSION_DIAMETER, def_pt);
      47    CHK_ENTITY_3RD_W_OLD (dim_diameter, DIMENSION_DIAMETER, first_arc_pt);
      48    CHK_ENTITY_TYPE (dim_diameter, DIMENSION_DIAMETER, leader_len, BD);
      49  #ifdef USE_DEPRECATED_API
      50    if (leader_len
      51            != dwg_ent_dim_diameter_get_leader_length (dim_diameter, &error)
      52        || error)
      53      fail ("old API dwg_ent_dim_diameter_get_leader_length");
      54    else
      55      pass ();
      56  #endif
      57  
      58    CHK_ENTITY_H (dim_diameter, DIMENSION_DIAMETER, dimstyle);
      59    CHK_ENTITY_H (dim_diameter, DIMENSION_DIAMETER, block);
      60  }