Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 14721) +++ trunk/src/obj_subc.c (revision 14722) @@ -246,6 +246,33 @@ return 0; } +int pcb_subc_get_host_trans(const pcb_subc_t *sc, pcb_host_trans_t *tr) +{ + int res = 0; + double rr; + + if (pcb_subc_get_origin(sc, &tr->ox, &tr->ox) != 0) { + tr->ox = tr->oy = 0; + res = -1; + } + + if (pcb_subc_get_rotation(sc, &tr->rot) != 0) { + tr->rot = 0; + res = -1; + } + + if (pcb_subc_get_side(sc, &tr->on_bottom) != 0) { + tr->on_bottom = 0; + res = -1; + } + + rr = tr->rot / PCB_RAD_TO_DEG; + tr->cosa = cos(rr); + tr->sina = sin(rr); + + return res; +} + static void pcb_subc_cache_invalidate(pcb_subc_t *sc) { sc->aux_cache[0] = NULL; Index: trunk/src/obj_subc.h =================================================================== --- trunk/src/obj_subc.h (revision 14721) +++ trunk/src/obj_subc.h (revision 14722) @@ -99,6 +99,7 @@ int pcb_subc_get_origin(pcb_subc_t *sc, pcb_coord_t *x, pcb_coord_t *y); int pcb_subc_get_rotation(pcb_subc_t *sc, double *rot); int pcb_subc_get_side(pcb_subc_t *sc, int *on_bottom); +int pcb_subc_get_host_trans(const pcb_subc_t *sc, pcb_host_trans_t *tr); /* Search for the named subc; name is relative path in hierarchy. Returns NULL if not found */