1 // TODO coverage
2 #define DWG_TYPE DWG_TYPE_ASSOCARRAYMODIFYACTIONBODY
3 #include "common.c"
4 
5 void
api_process(dwg_object * obj)6 api_process (dwg_object *obj)
7 {
8   int error, isnew;
9   ASSOCARRAYACTIONBODY_fields;
10   BITCODE_H *deps;
11   BITCODE_BS status;
12   BITCODE_BL num_items;
13   Dwg_ARRAYITEMLOCATOR *items;
14 
15 
16   Dwg_Version_Type dwg_version = obj->parent->header.version;
17 #ifdef DEBUG_CLASSES
18   dwg_obj_assocarraymodifyactionbody *_obj = dwg_object_to_ASSOCARRAYMODIFYACTIONBODY (obj);
19   bool good = 1;
20 
21   // ASSOCACTIONBODY:
22   CHK_ENTITY_TYPE (_obj, ASSOCARRAYMODIFYACTIONBODY, aab_version, BL);
23   CHK_ASSOCPARAMBASEDACTIONBODY (ASSOCARRAYMODIFYACTIONBODY);
24 
25   CHK_ENTITY_TYPE (_obj, ASSOCARRAYMODIFYACTIONBODY, aaab_version, BL);
26   CHK_ENTITY_UTF8TEXT (_obj, ASSOCARRAYMODIFYACTIONBODY, paramblock);
27   if (!dwg_dynapi_entity_value (_obj, "ASSOCARRAYMODIFYACTIONBODY", "transmatrix", &transmatrix, NULL))
28     fail ("ASSOCARRAYMODIFYACTIONBODY.transmatrix");
29   for (unsigned i = 0; i < 16; i += 4)
30     {
31       for (unsigned j = i; j < i + 4; j++)
32         { /* catches nan */
33           if (transmatrix[j] != _obj->transmatrix[j])
34             good = 0;
35         }
36       if (good)
37         ok ("ASSOCARRAYMODIFYACTIONBODY.transmatrix[%d]: (%f, %f, %f, %f)", i, transmatrix[i],
38             transmatrix[i + 1], transmatrix[i + 2], transmatrix[i + 3]);
39       else
40         fail ("ASSOCARRAYMODIFYACTIONBODY.transmatrix[%d]: (%f, %f, %f, %f)", i, transmatrix[i],
41               transmatrix[i + 1], transmatrix[i + 2], transmatrix[i + 3]);
42     }
43 
44   CHK_ENTITY_TYPE (_obj, ASSOCARRAYMODIFYACTIONBODY, status, BS);
45   CHK_ENTITY_TYPE (_obj, ASSOCARRAYMODIFYACTIONBODY, num_items, BL);
46   if (!dwg_dynapi_entity_value (_obj, "ASSOCARRAYMODIFYACTIONBODY", "items", &items, NULL))
47     fail ("ASSOCARRAYMODIFYACTIONBODY.items");
48   for (unsigned i = 0; i < num_items; i++)
49     {
50       CHK_SUBCLASS_TYPE (items[i], ARRAYITEMLOCATOR, itemloc1, BL);
51       CHK_SUBCLASS_TYPE (items[i], ARRAYITEMLOCATOR, itemloc2, BL);
52       CHK_SUBCLASS_TYPE (items[i], ARRAYITEMLOCATOR, itemloc3, BL);
53       // FIXME CHK_SUBCLASS_VECTOR_TYPE (items[i], ARRAYITEMLOCATOR, "itemloc[3]", 3, BL);
54       //ok ("ASSOCARRAYMODIFYACTIONBODY.items[%d].itemloc[0]: " FORMAT_BL, i, items[i].itemloc[0]);
55       //ok ("ASSOCARRAYMODIFYACTIONBODY.items[%d].itemloc[1]: " FORMAT_BL, i, items[i].itemloc[1]);
56       //ok ("ASSOCARRAYMODIFYACTIONBODY.items[%d].itemloc[2]: " FORMAT_BL, i, items[i].itemloc[2]);
57     }
58 #endif
59 }
60