43 } gerb_translation_entry_t;
72 image->
info->min_x = HUGE_VAL;
73 image->
info->min_y = HUGE_VAL;
74 image->
info->max_x = -HUGE_VAL;
75 image->
info->max_y = -HUGE_VAL;
93 image->
info->type = g_strdup (_(
"unknown"));
95 image->
info->type = g_strdup (type);
98 image->
info->attr_list = NULL;
99 image->
info->n_attr = 0;
112 gerbv_simplified_amacro_t *sam,*sam2;
120 for (i = 0; i < APERTURE_MAX; i++)
122 for (sam = image->
aperture[i]->simplified; sam != NULL; ){
137 free_amacro(image->
amacro);
150 g_free(image->
info->name);
151 g_free(image->
info->type);
152 gerbv_attribute_destroy_HID_attribute (image->
info->attr_list, image->
info->n_attr);
159 for (net = image->
netlist; net != NULL; ) {
162 if (tmp->
cirseg != NULL) {
167 g_string_free (tmp->
label, TRUE);
172 for (layer = image->
layers; layer != NULL; ) {
176 g_free (tempLayer->
name);
179 for (state = image->
states; state != NULL; ) {
211 gerb_verify_error_t error = GERB_IMAGE_OK;
215 if (image->
netlist == NULL) error |= GERB_IMAGE_MISSING_NETLIST;
216 if (image->
format == NULL) error |= GERB_IMAGE_MISSING_FORMAT;
217 if (image->
info == NULL) error |= GERB_IMAGE_MISSING_INFO;
229 for (i = 0; i < APERTURE_MAX && image->
aperture[i] == NULL; i++);
230 if (i == APERTURE_MAX) error |= GERB_IMAGE_MISSING_APERTURES;
241 printf(_(
"..state off"));
244 printf(_(
"..state on"));
247 printf(_(
"..state flash"));
250 printf(_(
"..state unknown"));
259 gerbv_aperture_t *
const* aperture;
263 printf(_(
"Apertures:\n"));
265 for (i = 0; i < APERTURE_MAX; i++) {
267 printf(_(
" Aperture no:%d is an "), i);
268 switch(aperture[i]->type) {
273 printf(_(
"rectangle"));
279 printf(_(
"polygon"));
285 printf(_(
"unknown"));
287 for (j = 0; j < aperture[i]->nuf_parameters; j++) {
288 printf(
" %f", aperture[i]->parameter[j]);
297 printf(_(
"(%f,%f)->(%f,%f) with %d ("), net->
start_x, net->
start_y,
312 *newLayer = *previousLayer;
313 previousLayer->
next = newLayer;
315 newLayer->
knockout.firstInstance = FALSE;
316 newLayer->
name = NULL;
317 newLayer->
next = NULL;
328 *newState = *previousState;
329 previousState->
next = newState;
332 newState->
next = NULL;
341 *newLayer = *oldLayer;
342 newLayer->
name = g_strdup (oldLayer->
name);
343 newLayer->
next = NULL;
352 *newState = *oldState;
353 newState->
next = NULL;
357 static gerbv_aperture_t *
358 gerbv_image_duplicate_aperture (gerbv_aperture_t *oldAperture)
360 gerbv_aperture_t *newAperture = g_new0 (gerbv_aperture_t,1);
361 gerbv_simplified_amacro_t *simplifiedMacro, *tempSimplified;
363 *newAperture = *oldAperture;
367 newAperture->amacro = NULL;
368 newAperture->simplified = NULL;
371 tempSimplified = NULL;
372 for (simplifiedMacro = oldAperture->simplified; simplifiedMacro != NULL; simplifiedMacro = simplifiedMacro->next) {
373 gerbv_simplified_amacro_t *newSimplified = g_new0 (gerbv_simplified_amacro_t,1);
374 *newSimplified = *simplifiedMacro;
376 tempSimplified->next = newSimplified;
378 newAperture->simplified = newSimplified;
379 tempSimplified = newSimplified;
389 GArray *translationTable)
398 gerbv_aperture_t *aper;
399 gerbv_simplified_amacro_t *sam;
400 int *trans_apers = NULL;
401 int aper_last_id = 0;
402 guint err_scale_circle = 0,
403 err_scale_line_macro = 0,
404 err_scale_poly_macro = 0,
405 err_scale_thermo_macro = 0,
406 err_scale_moire_macro = 0,
407 err_unknown_aperture = 0,
408 err_unknown_macro_aperture = 0,
414 GERB_COMPILE_ERROR(_(
"Exporting mirrored file "
415 "is not supported!"));
421 GERB_COMPILE_ERROR(_(
"Exporting inverted file "
422 "is not supported!"));
429 for (aper_last_id = APERTURE_MAX - 1; aper_last_id > 0;
431 if (destImage->
aperture[aper_last_id] != NULL)
435 trans_apers = g_new (
int, aper_last_id + 1);
437 for (
int i = 0; i < aper_last_id + 1; i++)
441 for (currentNet = sourceImage->
netlist; currentNet != NULL;
442 currentNet = currentNet->
next) {
448 if (currentNet->
layer != srcLayer) {
449 srcLayer = currentNet->
layer;
451 gerbv_image_duplicate_layer (currentNet->
layer);
452 lastLayer = lastLayer->
next;
457 if (currentNet->
state != srcState) {
458 srcState = currentNet->
state;
460 gerbv_image_duplicate_state (currentNet->
state);
461 lastState = lastState->
next;
466 *newNet = *currentNet;
469 newNet->
cirseg = g_new (gerbv_cirseg_t, 1);
473 if (currentNet->
label)
474 newNet->
label = g_string_new (currentNet->
label->str);
476 newNet->
label = NULL;
478 newNet->
state = lastState;
479 newNet->
layer = lastLayer;
482 lastNet->
next = newNet;
489 if (translationTable) {
490 for (guint i = 0; i < translationTable->len; i++) {
491 gerb_translation_entry_t translationEntry;
494 g_array_index (translationTable,
495 gerb_translation_entry_t, i);
497 if (translationEntry.oldAperture ==
500 translationEntry.newAperture;
519 &newNet->
cirseg->cp_y, trans);
526 && fabs(trans->
rotation) < GERBV_PRECISION_ANGLE_RAD)
530 if (trans_apers[newNet->
aperture] != -1) {
544 && trans->
scaleX == 1.0) {
549 aper = gerbv_image_duplicate_aperture (
552 aper->parameter[0] *= trans->
scaleX;
554 trans_apers[newNet->
aperture] = ++aper_last_id;
555 destImage->
aperture[aper_last_id] = aper;
565 && fabs(fabs(trans->
rotation) - M_PI)
566 < GERBV_PRECISION_ANGLE_RAD)
569 aper = gerbv_image_duplicate_aperture (
571 aper->parameter[0] *= trans->
scaleX;
572 aper->parameter[1] *= trans->
scaleY;
574 if (fabs(fabs(trans->
rotation) - M_PI_2)
575 < GERBV_PRECISION_ANGLE_RAD
576 || fabs(fabs(trans->
rotation) - (M_PI+M_PI_2))
577 < GERBV_PRECISION_ANGLE_RAD) {
578 double t = aper->parameter[0];
579 aper->parameter[0] = aper->parameter[1];
580 aper->parameter[1] = t;
590 trans_apers[newNet->
aperture] = ++aper_last_id;
591 destImage->
aperture[aper_last_id] = aper;
597 aper = gerbv_image_duplicate_aperture (
599 sam = aper->simplified;
601 for (; sam != NULL; sam = sam->next) {
604 sam->parameter[CIRCLE_CENTER_X] *=
606 sam->parameter[CIRCLE_CENTER_Y] *=
608 sam->parameter[CIRCLE_ROTATION] +=
615 sam->parameter[CIRCLE_DIAMETER] *=
622 sam->parameter[LINE20_LINE_WIDTH] *=
624 }
else if (sam->parameter[LINE20_START_X] ==
625 sam->parameter[LINE20_END_X]) {
626 sam->parameter[LINE20_LINE_WIDTH] *=
628 }
else if (sam->parameter[LINE20_START_Y] ==
629 sam->parameter[LINE20_END_Y]) {
630 sam->parameter[LINE20_LINE_WIDTH] *=
634 err_scale_line_macro++;
638 sam->parameter[LINE20_START_X] *=
640 sam->parameter[LINE20_START_Y] *=
642 sam->parameter[LINE20_END_X] *=
644 sam->parameter[LINE20_END_Y] *=
650 sam->parameter[LINE20_ROTATION] +=
655 #if (LINE21_WIDTH != LINE22_WIDTH) \
656 || (LINE21_HEIGHT != LINE22_HEIGHT) \
657 || (LINE21_ROTATION != LINE22_ROTATION) \
658 || (LINE21_CENTER_X != LINE22_LOWER_LEFT_X) \
659 || (LINE21_CENTER_Y != LINE22_LOWER_LEFT_Y)
660 # error "LINE21 and LINE22 indexes are not equal"
672 sam->parameter[LINE21_WIDTH] *=
674 sam->parameter[LINE21_HEIGHT] *=
677 }
else if (fabs(sam->parameter[LINE21_ROTATION]) == 0
678 || fabs(sam->parameter[LINE21_ROTATION]) == 180) {
679 sam->parameter[LINE21_WIDTH] *=
681 sam->parameter[LINE21_HEIGHT] *=
684 }
else if (fabs(sam->parameter[LINE21_ROTATION]) == 90
685 || fabs(sam->parameter[LINE21_ROTATION]) == 270) {
687 t = sam->parameter[LINE21_WIDTH];
688 sam->parameter[LINE21_WIDTH] =
692 sam->parameter[LINE21_HEIGHT] =
696 err_scale_line_macro++;
700 sam->parameter[LINE21_CENTER_X] *=
702 sam->parameter[LINE21_CENTER_Y] *=
705 sam->parameter[LINE21_ROTATION] +=
710 for (
int i = 0; i < 1 + sam->parameter[
711 OUTLINE_NUMBER_OF_POINTS]; i++) {
712 sam->parameter[OUTLINE_X_IDX_OF_POINT(i)] *=
714 sam->parameter[OUTLINE_Y_IDX_OF_POINT(i)] *=
718 sam->parameter[OUTLINE_ROTATION_IDX(sam->parameter)] +=
725 gerbv_selection_item_t sItem = {sourceImage, currentNet};
726 selection_add_item (&screen.selectionInfo, &sItem);
732 sam->parameter[POLYGON_CENTER_X]
734 sam->parameter[POLYGON_CENTER_Y]
736 sam->parameter[POLYGON_DIAMETER]
740 err_scale_poly_macro++;
744 sam->parameter[POLYGON_ROTATION] +=
750 sam->parameter[MOIRE_CENTER_X]
752 sam->parameter[MOIRE_CENTER_Y]
754 sam->parameter[MOIRE_OUTSIDE_DIAMETER]
756 sam->parameter[MOIRE_CIRCLE_THICKNESS]
758 sam->parameter[MOIRE_GAP_WIDTH]
760 sam->parameter[MOIRE_CROSSHAIR_THICKNESS]
762 sam->parameter[MOIRE_CROSSHAIR_LENGTH]
765 err_scale_moire_macro++;
769 sam->parameter[MOIRE_ROTATION] +=
775 sam->parameter[THERMAL_CENTER_X]
777 sam->parameter[THERMAL_CENTER_Y]
779 sam->parameter[THERMAL_INSIDE_DIAMETER]
781 sam->parameter[THERMAL_OUTSIDE_DIAMETER]
783 sam->parameter[THERMAL_CROSSHAIR_THICKNESS]
786 err_scale_thermo_macro++;
790 sam->parameter[THERMAL_ROTATION] +=
796 err_unknown_macro_aperture++;
800 trans_apers[newNet->
aperture] = ++aper_last_id;
801 destImage->
aperture[aper_last_id] = aper;
806 err_unknown_aperture++;
811 GERB_COMPILE_ERROR(ngettext(
812 "Can't rotate %u rectangular aperture to %.2f "
813 "degrees (non 90 multiply)!",
814 "Can't rotate %u rectangular apertures to %.2f "
815 "degrees (non 90 multiply)!", err_rotate_rect),
816 err_rotate_rect, RAD2DEG(trans->
rotation));
818 if (err_scale_line_macro)
819 GERB_COMPILE_ERROR(ngettext(
820 "Can't scale %u line macro!",
821 "Can't scale %u line macros!",
822 err_scale_line_macro), err_scale_line_macro);
824 if (err_scale_poly_macro)
825 GERB_COMPILE_ERROR(ngettext(
826 "Can't scale %u polygon macro!",
827 "Can't scale %u polygon macros!",
828 err_scale_poly_macro), err_scale_poly_macro);
830 if (err_scale_thermo_macro)
831 GERB_COMPILE_ERROR(ngettext(
832 "Can't scale %u thermal macro!",
833 "Can't scale %u thermal macros!",
834 err_scale_poly_macro), err_scale_poly_macro);
836 if (err_scale_moire_macro)
837 GERB_COMPILE_ERROR(ngettext(
838 "Can't scale %u moire macro!",
839 "Can't scale %u moire macros!",
840 err_scale_poly_macro), err_scale_poly_macro);
843 GERB_COMPILE_ERROR(ngettext(
844 "Can't rotate %u oval aperture to %.2f "
845 "degrees (non 90 multiply)!",
846 "Can't rotate %u oval apertures to %.2f "
847 "degrees (non 90 multiply)!", err_rotate_oval),
848 err_rotate_oval, RAD2DEG(trans->
rotation));
850 if (err_scale_circle)
851 GERB_COMPILE_ERROR(ngettext(
852 "Can't scale %u circle aperture to ellipse!",
853 "Can't scale %u circle apertures to ellipse!",
854 err_scale_circle), err_scale_circle);
856 if (err_unknown_aperture)
857 GERB_COMPILE_ERROR(ngettext(
858 "Skipped %u aperture with unknown type!",
859 "Skipped %u apertures with unknown type!",
860 err_unknown_aperture), err_unknown_aperture);
862 if (err_unknown_macro_aperture)
863 GERB_COMPILE_ERROR(ngettext(
864 "Skipped %u macro aperture!",
865 "Skipped %u macro apertures!",
866 err_unknown_macro_aperture),
867 err_unknown_macro_aperture);
869 g_free (trans_apers);
873 gerbv_image_find_existing_aperture_match (gerbv_aperture_t *checkAperture,
gerbv_image_t *imageToSearch) {
877 for (i = 0; i < APERTURE_MAX; i++) {
878 if (imageToSearch->
aperture[i] != NULL) {
879 if ((imageToSearch->
aperture[i]->type == checkAperture->type) &&
880 (imageToSearch->
aperture[i]->simplified == NULL) &&
881 (imageToSearch->
aperture[i]->unit == checkAperture->unit)) {
884 for (j=0; j<APERTURE_PARAMETERS_MAX; j++){
885 if (imageToSearch->
aperture[i]->parameter[j] != checkAperture->parameter[j])
897 gerbv_image_find_unused_aperture_number (
int startIndex,
gerbv_image_t *image){
900 for (i = startIndex; i < APERTURE_MAX; i++) {
912 int lastUsedApertureNumber = APERTURE_MIN - 1;
913 GArray *apertureNumberTable = g_array_new(FALSE,FALSE,
sizeof(gerb_translation_entry_t));
917 *(newImage->
info) = *(sourceImage->
info);
918 newImage->
info->name = g_strdup (sourceImage->
info->name);
919 newImage->
info->type = g_strdup (sourceImage->
info->type);
920 newImage->
info->plotterFilm = g_strdup (sourceImage->
info->plotterFilm);
921 newImage->
info->attr_list = gerbv_attribute_dup (sourceImage->
info->attr_list,
922 sourceImage->
info->n_attr);
926 for (i = 0; i < APERTURE_MAX; i++) {
927 if (sourceImage->
aperture[i] != NULL) {
928 gerbv_aperture_t *newAperture = gerbv_image_duplicate_aperture (sourceImage->
aperture[i]);
930 lastUsedApertureNumber = gerbv_image_find_unused_aperture_number (lastUsedApertureNumber + 1, newImage);
932 gerb_translation_entry_t translationEntry={i,lastUsedApertureNumber};
933 g_array_append_val (apertureNumberTable,translationEntry);
935 newImage->
aperture[lastUsedApertureNumber] = newAperture;
941 gerbv_image_copy_all_nets (sourceImage, newImage, newImage->
layers, newImage->
states, NULL, transform, apertureNumberTable);
942 g_array_free (apertureNumberTable, TRUE);
948 int lastUsedApertureNumber = APERTURE_MIN - 1;
950 GArray *apertureNumberTable = g_array_new(FALSE,FALSE,
sizeof(gerb_translation_entry_t));
953 for (i = 0; i < APERTURE_MAX; i++) {
954 if (sourceImage->
aperture[i] != NULL) {
955 gint existingAperture = gerbv_image_find_existing_aperture_match (sourceImage->
aperture[i], destinationImage);
959 if (existingAperture > 0) {
960 gerb_translation_entry_t translationEntry={i,existingAperture};
961 g_array_append_val (apertureNumberTable,translationEntry);
965 gerbv_aperture_t *newAperture = gerbv_image_duplicate_aperture (sourceImage->
aperture[i]);
967 lastUsedApertureNumber = gerbv_image_find_unused_aperture_number (lastUsedApertureNumber + 1, destinationImage);
969 gerb_translation_entry_t translationEntry={i,lastUsedApertureNumber};
970 g_array_append_val (apertureNumberTable,translationEntry);
972 destinationImage->
aperture[lastUsedApertureNumber] = newAperture;
981 for (lastState = destinationImage->
states; lastState->
next; lastState=lastState->
next){}
982 for (lastLayer = destinationImage->
layers; lastLayer->
next; lastLayer=lastLayer->
next){}
983 for (lastNet = destinationImage->
netlist; lastNet->
next; lastNet=lastNet->
next){}
986 gerbv_image_copy_all_nets (sourceImage, destinationImage, lastLayer, lastState, lastNet, transform, apertureNumberTable);
987 g_array_free (apertureNumberTable, TRUE);
994 g_assert (currentNet);
1002 for (tempNet = currentNet->
next; tempNet; tempNet = tempNet->
next){
1022 gdouble coordinateY, gdouble width, gdouble height) {
1026 for (currentNet = image->
netlist; currentNet->
next; currentNet = currentNet->
next){}
1029 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1033 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1036 currentNet->
start_x = coordinateX;
1037 currentNet->
start_y = coordinateY;
1038 currentNet->
stop_x = coordinateX;
1039 currentNet->
stop_y = coordinateY;
1042 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1045 currentNet->
start_x = coordinateX;
1046 currentNet->
start_y = coordinateY;
1047 currentNet->
stop_x = coordinateX + width;
1048 currentNet->
stop_y = coordinateY;
1051 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1053 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1056 currentNet->
stop_x = coordinateX + width;
1057 currentNet->
stop_y = coordinateY + height;
1060 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1062 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1065 currentNet->
stop_x = coordinateX;
1066 currentNet->
stop_y = coordinateY + height;
1069 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1071 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1074 currentNet->
stop_x = coordinateX;
1075 currentNet->
stop_y = coordinateY;
1078 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1081 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1088 gerb_image_return_aperture_index (
gerbv_image_t *image, gdouble lineWidth,
int *apertureIndex){
1090 gerbv_aperture_t *aperture=NULL;
1094 for (currentNet = image->
netlist; currentNet->
next; currentNet = currentNet->
next){}
1097 for (i = 0; i < APERTURE_MAX; i++) {
1100 (fabs (image->
aperture[i]->parameter[0] - lineWidth) < 0.001)){
1110 if (!gerber_create_new_aperture (image, apertureIndex,
1121 gdouble radius, gdouble startAngle, gdouble endAngle, gdouble lineWidth,
1125 gerbv_cirseg_t cirSeg = {centerX, centerY, radius, radius, startAngle, endAngle};
1127 currentNet = gerb_image_return_aperture_index(image, lineWidth, &apertureIndex);
1133 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1136 currentNet->
aperture = apertureIndex;
1137 currentNet->
start_x = centerX + (cos(DEG2RAD(startAngle)) * radius);
1138 currentNet->
start_y = centerY + (sin(DEG2RAD(startAngle)) * radius);
1139 currentNet->
stop_x = centerX + (cos(DEG2RAD(endAngle)) * radius);
1140 currentNet->
stop_y = centerY + (sin(DEG2RAD(endAngle)) * radius);
1141 currentNet->
cirseg = g_new0 (gerbv_cirseg_t,1);
1142 *(currentNet->
cirseg) = cirSeg;
1144 gdouble angleDiff = currentNet->
cirseg->angle2 - currentNet->
cirseg->angle1;
1145 gint i, steps = fabs(angleDiff);
1146 for (i=0; i<=steps; i++){
1147 gdouble tempX = currentNet->
cirseg->cp_x + currentNet->
cirseg->width / 2.0 *
1148 cos (DEG2RAD(currentNet->
cirseg->angle1 +
1149 (i*angleDiff)/steps));
1150 gdouble tempY = currentNet->
cirseg->cp_y + currentNet->
cirseg->width / 2.0 *
1151 sin (DEG2RAD(currentNet->
cirseg->angle1 +
1152 (i*angleDiff)/steps));
1153 gerber_update_min_and_max (¤tNet->
boundingBox,
1155 lineWidth/2,lineWidth/2,
1156 lineWidth/2,lineWidth/2);
1158 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1168 currentNet = gerb_image_return_aperture_index(image, lineWidth, &apertureIndex);
1174 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1178 if ((fabs(startX - endX) < 0.001) && (fabs(startY - endY) < 0.001))
1182 currentNet->
aperture = apertureIndex;
1185 currentNet->
stop_x = endX;
1186 currentNet->
stop_y = endY;
1189 lineWidth/2,lineWidth/2,lineWidth/2,lineWidth/2);
1191 lineWidth/2,lineWidth/2,lineWidth/2,lineWidth/2);
1192 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1197 gerbv_image_create_window_pane_objects (
gerbv_image_t *image, gdouble lowerLeftX,
1198 gdouble lowerLeftY, gdouble width, gdouble height, gdouble areaReduction,
1199 gint paneRows, gint paneColumns, gdouble paneSeparation){
1201 gdouble startX,startY,boxWidth,boxHeight;
1203 startX = lowerLeftX + (areaReduction * width) / 2.0;
1204 startY = lowerLeftY + (areaReduction * height) / 2.0;
1205 boxWidth = (width * (1.0 - areaReduction) - (paneSeparation * (paneColumns - 1))) / paneColumns;
1206 boxHeight = (height * (1.0 - areaReduction) - (paneSeparation * (paneRows - 1))) / paneRows;
1208 for (i=0; i<paneColumns; i++){
1209 for (j=0; j<paneRows; j++) {
1211 startY + (j * (boxHeight + paneSeparation)),boxWidth, boxHeight);
1219 gerbv_image_reduce_area_of_selected_objects (GArray *selectionArray,
1220 gdouble areaReduction, gint paneRows, gint paneColumns, gdouble paneSeparation){
1221 gdouble minX,minY,maxX,maxY;
1223 for (guint i=0; i<selectionArray->len; i++) {
1224 gerbv_selection_item_t sItem = g_array_index (selectionArray,gerbv_selection_item_t, i);
1239 for (currentNet = currentNet->
next; currentNet; currentNet = currentNet->
next){
1243 if (currentNet->
stop_x < minX)
1244 minX = currentNet->
stop_x;
1245 if (currentNet->
stop_y < minY)
1246 minY = currentNet->
stop_y;
1247 if (currentNet->
stop_x > maxX)
1248 maxX = currentNet->
stop_x;
1249 if (currentNet->
stop_y > maxY)
1250 maxY = currentNet->
stop_y;
1261 gerbv_aperture_t *apert =
1265 switch (apert->type) {
1269 dx = dy = apert->parameter[0];
1272 dx = apert->parameter[0]/2;
1273 dy = apert->parameter[1]/2;
1278 if (currentNet->
start_x-dx < minX)
1279 minX = currentNet->
start_x-dx;
1280 if (currentNet->
start_y-dy < minY)
1281 minY = currentNet->
start_y-dy;
1282 if (currentNet->
start_x+dx > maxX)
1283 maxX = currentNet->
start_x+dx;
1284 if (currentNet->
start_y+dy > maxY)
1285 maxY = currentNet->
start_y+dy;
1287 if (currentNet->
stop_x-dx < minX)
1288 minX = currentNet->
stop_x-dx;
1289 if (currentNet->
stop_y-dy < minY)
1290 minY = currentNet->
stop_y-dy;
1291 if (currentNet->
stop_x+dx > maxX)
1292 maxX = currentNet->
stop_x+dx;
1293 if (currentNet->
stop_y+dy > maxY)
1294 maxY = currentNet->
stop_y+dy;
1308 gerbv_image_create_window_pane_objects (image, minX, minY, maxX - minX, maxY - minY,
1309 areaReduction, paneRows, paneColumns, paneSeparation);
1315 gerbv_image_move_selected_objects (GArray *selectionArray, gdouble translationX,
1316 gdouble translationY)
1318 for (guint i=0; i<selectionArray->len; i++) {
1319 gerbv_selection_item_t sItem = g_array_index (selectionArray,gerbv_selection_item_t, i);
1324 for (currentNet = currentNet->
next; currentNet; currentNet = currentNet->
next){
1327 currentNet->
start_x += translationX;
1328 currentNet->
start_y += translationY;
1329 currentNet->
stop_x += translationX;
1330 currentNet->
stop_y += translationY;
1335 currentNet->
start_x += translationX;
1336 currentNet->
start_y += translationY;
1337 currentNet->
stop_x += translationX;
1338 currentNet->
stop_y += translationY;
1350 for (currentNet = currentNet->
next; currentNet; currentNet = currentNet->
next){
1352 return currentNet->
next;
1358 return currentNet->
next;
1367 for (currentNet = parsed_image->
netlist; currentNet->
next; currentNet = currentNet->
next){
1369 parsed_image->
aperture[currentNet->
aperture] = g_new0 (gerbv_aperture_t, 1);
Aperture macro parsing header info.
void gerbv_drill_stats_destroy(gerbv_drill_stats_t *stats)
void gerbv_destroy_image(gerbv_image_t *image)
Free an image structure.
void gerbv_image_create_rectangle_object(gerbv_image_t *image, gdouble coordinateX, gdouble coordinateY, gdouble width, gdouble height)
Draw a filled rectangle on the specified image
void gerbv_image_copy_image(gerbv_image_t *sourceImage, gerbv_user_transformation_t *transform, gerbv_image_t *destinationImage)
Copy an image into an existing image, effectively merging the two together.
gerbv_image_t * gerbv_create_image(gerbv_image_t *image, const gchar *type)
Allocate a new gerbv_image structure.
void gerbv_image_create_line_object(gerbv_image_t *image, gdouble startX, gdouble startY, gdouble endX, gdouble endY, gdouble lineWidth, gerbv_aperture_type_t apertureType)
Draw a line on the specified image.
void gerbv_image_delete_net(gerbv_net_t *currentNet)
Delete a net in an existing image.
gerbv_net_t * gerbv_image_return_next_renderable_object(gerbv_net_t *oldNet)
Return the next net entry which corresponds to a unique visible object.
gerbv_image_t * gerbv_image_duplicate_image(gerbv_image_t *sourceImage, gerbv_user_transformation_t *transform)
Duplicate an existing image and return the new copy.
void gerbv_image_create_dummy_apertures(gerbv_image_t *parsed_image)
Create any missing apertures in the specified image.
void gerbv_image_create_arc_object(gerbv_image_t *image, gdouble centerX, gdouble centerY, gdouble radius, gdouble startAngle, gdouble endAngle, gdouble lineWidth, gerbv_aperture_type_t apertureType)
Draw an arc on the specified image.
Header info for the image editing and support functions.
void gerbv_stats_destroy(gerbv_stats_t *stats)
Header info for the RS274X parsing functions.
const char * gerbv_interpolation_name(gerbv_interpolation_t interp)
Return string name of gerbv_interpolation_t interpolation.
void gerbv_transform_coord(double *x, double *y, const gerbv_user_transformation_t *trans)
The main header file for the libgerbv library.
@ GERBV_APERTURE_STATE_OFF
@ GERBV_APERTURE_STATE_ON
@ GERBV_APERTURE_STATE_FLASH
@ GERBV_APTYPE_MACRO_LINE20
@ GERBV_APTYPE_MACRO_LINE21
@ GERBV_APTYPE_MACRO_OUTLINE
@ GERBV_APTYPE_MACRO_CIRCLE
@ GERBV_APTYPE_MACRO_POLYGON
@ GERBV_APTYPE_MACRO_THERMAL
@ GERBV_APTYPE_MACRO_LINE22
@ GERBV_APTYPE_MACRO_MOIRE
@ GERBV_INTERPOLATION_LINEARx01
@ GERBV_INTERPOLATION_PAREA_START
@ GERBV_INTERPOLATION_LINEARx001
@ GERBV_INTERPOLATION_DELETED
@ GERBV_INTERPOLATION_PAREA_END
@ GERBV_INTERPOLATION_LINEARx10
@ GERBV_INTERPOLATION_CCW_CIRCULAR
@ GERBV_INTERPOLATION_LINEARx1
Header info for common structs and functions used for the GUI application.
gerbv_stats_t * gerbv_stats
gerbv_layertype_t layertype
gerbv_drill_stats_t * drill_stats
gerbv_aperture_t * aperture[APERTURE_MAX]
gerbv_netstate_t * states
gerbv_image_info_t * info
gerbv_step_and_repeat_t stepAndRepeat
gerbv_polarity_t polarity
gerbv_knockout_t knockout
gerbv_render_size_t boundingBox
gerbv_aperture_state_t aperture_state
gerbv_interpolation_t interpolation