1 #define DWG_TYPE DWG_TYPE_DIMENSION_ANG2LN
2 #include "common.c"
3
4 void
api_process(dwg_object * obj)5 api_process (dwg_object *obj)
6 {
7 int error, isnew;
8 double elevation, act_measurement, horiz_dir, lspace_factor, text_rotation,
9 ins_rotation;
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 dwg_point_2d text_midpt, clone_ins_pt, pt2d;
15 dwg_point_3d def_pt, extrusion, ins_scale, pt3d;
16 BITCODE_H dimstyle, block;
17
18 BITCODE_3BD xline1start_pt;
19 BITCODE_3BD xline1end_pt;
20 BITCODE_3BD xline2start_pt;
21 BITCODE_3BD xline2end_pt;
22
23 dwg_ent_dim_ang2ln *dim_ang2ln = dwg_object_to_DIMENSION_ANG2LN (obj);
24 dwg_ent_dim *dim = dwg_object_to_DIMENSION (obj);
25
26 /* common */
27 CHK_ENTITY_TYPE (dim, DIMENSION_ANG2LN, class_version, RC);
28 CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_ANG2LN, lspace_style, BS);
29 CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_ANG2LN, lspace_factor, BD);
30 CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_ANG2LN, act_measurement, BD);
31 CHK_ENTITY_TYPE (dim, DIMENSION_ANG2LN, attachment, BS);
32 CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_ANG2LN, elevation, BD);
33 CHK_ENTITY_3RD (dim, DIMENSION_ANG2LN, extrusion);
34 CHK_ENTITY_2RD_W_OLD (dim, DIMENSION_ANG2LN, clone_ins_pt);
35 CHK_ENTITY_2RD_W_OLD (dim, DIMENSION_ANG2LN, text_midpt);
36 CHK_ENTITY_UTF8TEXT (dim, DIMENSION_ANG2LN, user_text);
37 CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_ANG2LN, text_rotation, BD);
38 CHK_ENTITY_3RD_W_OLD (dim, DIMENSION_ANG2LN, ins_scale);
39 CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_ANG2LN, ins_rotation, BD);
40 CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_ANG2LN, horiz_dir, BD);
41 CHK_ENTITY_MAX (dim, DIMENSION_ANG2LN, text_rotation, BD, MAX_ANGLE);
42 CHK_ENTITY_MAX (dim, DIMENSION_ANG2LN, ins_rotation, BD, MAX_ANGLE);
43 CHK_ENTITY_MAX (dim, DIMENSION_ANG2LN, horiz_dir, BD, MAX_ANGLE);
44 CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_ANG2LN, flip_arrow1, B);
45 CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_ANG2LN, flip_arrow2, B);
46 CHK_ENTITY_TYPE_W_OLD (dim, DIMENSION_ANG2LN, flag1, RC);
47 CHK_ENTITY_TYPE (dim, DIMENSION_ANG2LN, flag, RC);
48 // Note: def_pt.z should be the elevation here, but is not.
49 CHK_ENTITY_2RD (dim_ang2ln, DIMENSION_ANG2LN, def_pt);
50
51 /* ang2ln */
52 CHK_ENTITY_3RD (dim_ang2ln, DIMENSION_ANG2LN, xline1start_pt);
53 #ifdef USE_DEPRECATED_API
54 dwg_ent_dim_ang2ln_get_13_pt (dim_ang2ln, &pt3d, &error);
55 if (error || memcmp (&xline1start_pt, &pt3d, sizeof (xline1start_pt)))
56 fail ("old API dwg_ent_dim_ang2ln_get_13_pt");
57 else
58 pass ();
59 #endif
60 CHK_ENTITY_3RD (dim_ang2ln, DIMENSION_ANG2LN, xline1end_pt);
61 #ifdef USE_DEPRECATED_API
62 dwg_ent_dim_ang2ln_get_14_pt (dim_ang2ln, &pt3d, &error);
63 if (error || memcmp (&xline1end_pt, &pt3d, sizeof (xline1end_pt)))
64 fail ("old API dwg_ent_dim_ang2ln_get_14_pt");
65 else
66 pass ();
67 #endif
68 CHK_ENTITY_3RD (dim_ang2ln, DIMENSION_ANG2LN, xline2start_pt);
69 /*
70 dwg_ent_dim_ang2ln_get_15_pt (dim_ang2ln, &pt3d, &error);
71 if (error || memcmp (&xline2start_pt, &pt3d, sizeof (xline2start_pt)))
72 fail ("old API dwg_ent_dim_ang2ln_get_15_pt");
73 else
74 pass ();
75 */
76 CHK_ENTITY_3RD (dim_ang2ln, DIMENSION_ANG2LN, xline2end_pt);
77 #ifdef USE_DEPRECATED_API
78 dwg_ent_dim_ang2ln_get_16_pt (dim_ang2ln, &pt3d, &error);
79 if (error || memcmp (&xline2end_pt, &pt3d, sizeof (xline2end_pt)))
80 fail ("old API dwg_ent_dim_ang2ln_get_16_pt");
81 else
82 pass ();
83 #endif
84
85 CHK_ENTITY_H (dim_ang2ln, DIMENSION_ANG2LN, dimstyle);
86 CHK_ENTITY_H (dim_ang2ln, DIMENSION_ANG2LN, block);
87 }
88