FreeCalypso > hg > ueda-linux
comparison pads2gpcb/partinst.c @ 71:a3d47129ebdc
pads2gpcb: implemented mirroring and rotation of instantiated parts
| author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
|---|---|
| date | Mon, 01 Feb 2016 00:13:20 +0000 |
| parents | b7f49f029bc3 |
| children |
comparison
equal
deleted
inserted
replaced
| 70:a9a20c85140e | 71:a3d47129ebdc |
|---|---|
| 7 #include "struct.h" | 7 #include "struct.h" |
| 8 | 8 |
| 9 extern struct part_type *find_parttype_by_name(); | 9 extern struct part_type *find_parttype_by_name(); |
| 10 extern struct part_decal *find_decal_by_name(); | 10 extern struct part_decal *find_decal_by_name(); |
| 11 extern long convert_input_dim(); | 11 extern long convert_input_dim(); |
| 12 | |
| 13 extern void coordpair_mirror_x(); | |
| 14 extern void coordpair_rot_90(); | |
| 15 extern void coordpair_rot_180(); | |
| 16 extern void coordpair_rot_270(); | |
| 12 | 17 |
| 13 static struct part_instance *our_part; | 18 static struct part_instance *our_part; |
| 14 | 19 |
| 15 static void | 20 static void |
| 16 enter_part_inst() | 21 enter_part_inst() |
| 209 /* subsetting and renaming logic will go here */ | 214 /* subsetting and renaming logic will go here */ |
| 210 our_part->newname = our_part->name; | 215 our_part->newname = our_part->name; |
| 211 copy_footprint_body(); | 216 copy_footprint_body(); |
| 212 our_part->body->mark_x = our_part->mark_x; | 217 our_part->body->mark_x = our_part->mark_x; |
| 213 our_part->body->mark_y = our_part->mark_y; | 218 our_part->body->mark_y = our_part->mark_y; |
| 214 /* rotation and mirroring to be implemented */ | 219 switch (our_part->ori) { |
| 220 case 0: | |
| 221 break; | |
| 222 case 90: | |
| 223 manipulate_footprint_coord_pairs(our_part->body, | |
| 224 coordpair_rot_90); | |
| 225 break; | |
| 226 case 180: | |
| 227 manipulate_footprint_coord_pairs(our_part->body, | |
| 228 coordpair_rot_180); | |
| 229 break; | |
| 230 case 270: | |
| 231 manipulate_footprint_coord_pairs(our_part->body, | |
| 232 coordpair_rot_270); | |
| 233 } | |
| 234 if (our_part->onbottom) | |
| 235 manipulate_footprint_coord_pairs(our_part->body, | |
| 236 coordpair_mirror_x); | |
| 215 } | 237 } |
| 216 | 238 |
| 217 process_part_section() | 239 process_part_section() |
| 218 { | 240 { |
| 219 input_units_current = input_units_global; | 241 input_units_current = input_units_global; |
