1 #define DWG_TYPE DWG_TYPE_PDFUNDERLAY
2 #include "common.c"
3 
4 void
api_process(dwg_object * obj)5 api_process (dwg_object *obj)
6 {
7   int error;
8   BITCODE_BL class_version;
9   dwg_point_3d extrusion, ins_pt, scale;
10   BITCODE_RC flag;
11   BITCODE_RC contrast;
12   BITCODE_RC fade;
13   BITCODE_BL num_clip_verts;
14   dwg_point_2d* clip_verts;
15   BITCODE_BS num_clip_inverts;
16   dwg_point_2d *clip_inverts;
17   BITCODE_H definition_id;
18 
19   dwg_ent_underlay *underlay = dwg_object_to_PDFUNDERLAY (obj);
20 
21   CHK_ENTITY_3RD (underlay, PDFUNDERLAY, extrusion);
22   CHK_ENTITY_3RD (underlay, PDFUNDERLAY, ins_pt);
23   CHK_ENTITY_3RD (underlay, PDFUNDERLAY, scale);
24   CHK_ENTITY_TYPE (underlay, PDFUNDERLAY, flag, RC);
25   CHK_ENTITY_TYPE (underlay, PDFUNDERLAY, contrast, RC);
26   CHK_ENTITY_TYPE (underlay, PDFUNDERLAY, fade, RC);
27   CHK_ENTITY_TYPE (underlay, PDFUNDERLAY, num_clip_verts, BL);
28   if (!dwg_dynapi_entity_value (underlay, "PDFUNDERLAY", "clip_verts", &clip_verts, NULL))
29     fail ("PDFUNDERLAY.clip_verts");
30   else
31     {
32       for (BITCODE_BL i = 0; i < num_clip_verts; i++)
33         {
34           ok ("PDFUNDERLAY.clip_verts[%d]: (%f, %f)", i, clip_verts[i].x, clip_verts[i].y);
35         }
36     }
37   CHK_ENTITY_TYPE (underlay, PDFUNDERLAY, num_clip_inverts, BS);
38   if (!dwg_dynapi_entity_value (underlay, "PDFUNDERLAY", "clip_inverts", &clip_inverts, NULL))
39     fail ("PDFUNDERLAY.clip_inverts");
40   else
41     {
42       for (BITCODE_BL i = 0; i < num_clip_inverts; i++)
43         {
44           ok ("PDFUNDERLAY.clip_inverts[%d]: (%f, %f)", i, clip_inverts[i].x, clip_inverts[i].y);
45         }
46     }
47   CHK_ENTITY_H (underlay, PDFUNDERLAY, definition_id);
48 }
49