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;
214 gboolean needs_aperture = FALSE;
215 gboolean in_parea = FALSE;
217 if (image->
netlist == NULL) error |= GERB_IMAGE_MISSING_NETLIST;
218 if (image->
format == NULL) error |= GERB_IMAGE_MISSING_FORMAT;
219 if (image->
info == NULL) error |= GERB_IMAGE_MISSING_INFO;
231 else if (!in_parea &&
234 needs_aperture = TRUE;
239 if (needs_aperture) {
240 for (i = 0; i < APERTURE_MAX && image->
aperture[i] == NULL; i++);
241 if (i == APERTURE_MAX) error |= GERB_IMAGE_MISSING_APERTURES;
252 printf(_(
"..state off"));
255 printf(_(
"..state on"));
258 printf(_(
"..state flash"));
261 printf(_(
"..state unknown"));
270 gerbv_aperture_t *
const* aperture;
274 printf(_(
"Apertures:\n"));
276 for (i = 0; i < APERTURE_MAX; i++) {
278 printf(_(
" Aperture no:%d is an "), i);
279 switch(aperture[i]->type) {
284 printf(_(
"rectangle"));
290 printf(_(
"polygon"));
296 printf(_(
"unknown"));
298 for (j = 0; j < aperture[i]->nuf_parameters; j++) {
299 printf(
" %f", aperture[i]->parameter[j]);
308 printf(_(
"(%f,%f)->(%f,%f) with %d ("), net->
start_x, net->
start_y,
323 *newLayer = *previousLayer;
324 previousLayer->
next = newLayer;
326 newLayer->
knockout.firstInstance = FALSE;
327 newLayer->
name = NULL;
328 newLayer->
next = NULL;
339 *newState = *previousState;
340 previousState->
next = newState;
343 newState->
next = NULL;
352 *newLayer = *oldLayer;
353 newLayer->
name = g_strdup (oldLayer->
name);
354 newLayer->
next = NULL;
363 *newState = *oldState;
364 newState->
next = NULL;
368 static gerbv_aperture_t *
369 gerbv_image_duplicate_aperture (gerbv_aperture_t *oldAperture)
371 gerbv_aperture_t *newAperture = g_new0 (gerbv_aperture_t,1);
372 gerbv_simplified_amacro_t *simplifiedMacro, *tempSimplified;
374 *newAperture = *oldAperture;
378 newAperture->amacro = NULL;
379 newAperture->simplified = NULL;
382 tempSimplified = NULL;
383 for (simplifiedMacro = oldAperture->simplified; simplifiedMacro != NULL; simplifiedMacro = simplifiedMacro->next) {
384 gerbv_simplified_amacro_t *newSimplified = g_new0 (gerbv_simplified_amacro_t,1);
385 *newSimplified = *simplifiedMacro;
387 tempSimplified->next = newSimplified;
389 newAperture->simplified = newSimplified;
390 tempSimplified = newSimplified;
400 GArray *translationTable)
409 gerbv_aperture_t *aper;
410 gerbv_simplified_amacro_t *sam;
411 int *trans_apers = NULL;
412 int aper_last_id = 0;
413 guint err_scale_circle = 0,
414 err_scale_line_macro = 0,
415 err_scale_poly_macro = 0,
416 err_scale_thermo_macro = 0,
417 err_scale_moire_macro = 0,
418 err_unknown_aperture = 0,
419 err_unknown_macro_aperture = 0,
425 GERB_COMPILE_ERROR(_(
"Exporting mirrored file "
426 "is not supported!"));
432 GERB_COMPILE_ERROR(_(
"Exporting inverted file "
433 "is not supported!"));
440 for (aper_last_id = APERTURE_MAX - 1; aper_last_id > 0;
442 if (destImage->
aperture[aper_last_id] != NULL)
446 trans_apers = g_new (
int, aper_last_id + 1);
448 for (
int i = 0; i < aper_last_id + 1; i++)
452 for (currentNet = sourceImage->
netlist; currentNet != NULL;
453 currentNet = currentNet->
next) {
459 if (currentNet->
layer != srcLayer) {
460 srcLayer = currentNet->
layer;
462 gerbv_image_duplicate_layer (currentNet->
layer);
463 lastLayer = lastLayer->
next;
468 if (currentNet->
state != srcState) {
469 srcState = currentNet->
state;
471 gerbv_image_duplicate_state (currentNet->
state);
472 lastState = lastState->
next;
477 *newNet = *currentNet;
480 newNet->
cirseg = g_new (gerbv_cirseg_t, 1);
484 if (currentNet->
label)
485 newNet->
label = g_string_new (currentNet->
label->str);
487 newNet->
label = NULL;
489 newNet->
state = lastState;
490 newNet->
layer = lastLayer;
493 lastNet->
next = newNet;
500 if (translationTable) {
501 for (guint i = 0; i < translationTable->len; i++) {
502 gerb_translation_entry_t translationEntry;
505 g_array_index (translationTable,
506 gerb_translation_entry_t, i);
508 if (translationEntry.oldAperture ==
511 translationEntry.newAperture;
530 &newNet->
cirseg->cp_y, trans);
537 && fabs(trans->
rotation) < GERBV_PRECISION_ANGLE_RAD)
541 if (trans_apers[newNet->
aperture] != -1) {
555 && trans->
scaleX == 1.0) {
560 aper = gerbv_image_duplicate_aperture (
563 aper->parameter[0] *= trans->
scaleX;
565 trans_apers[newNet->
aperture] = ++aper_last_id;
566 destImage->
aperture[aper_last_id] = aper;
576 && fabs(fabs(trans->
rotation) - M_PI)
577 < GERBV_PRECISION_ANGLE_RAD)
580 aper = gerbv_image_duplicate_aperture (
582 aper->parameter[0] *= trans->
scaleX;
583 aper->parameter[1] *= trans->
scaleY;
585 if (fabs(fabs(trans->
rotation) - M_PI_2)
586 < GERBV_PRECISION_ANGLE_RAD
587 || fabs(fabs(trans->
rotation) - (M_PI+M_PI_2))
588 < GERBV_PRECISION_ANGLE_RAD) {
589 double t = aper->parameter[0];
590 aper->parameter[0] = aper->parameter[1];
591 aper->parameter[1] = t;
601 trans_apers[newNet->
aperture] = ++aper_last_id;
602 destImage->
aperture[aper_last_id] = aper;
608 aper = gerbv_image_duplicate_aperture (
610 sam = aper->simplified;
612 for (; sam != NULL; sam = sam->next) {
615 sam->parameter[CIRCLE_CENTER_X] *=
617 sam->parameter[CIRCLE_CENTER_Y] *=
619 sam->parameter[CIRCLE_ROTATION] +=
626 sam->parameter[CIRCLE_DIAMETER] *=
633 sam->parameter[LINE20_LINE_WIDTH] *=
635 }
else if (sam->parameter[LINE20_START_X] ==
636 sam->parameter[LINE20_END_X]) {
637 sam->parameter[LINE20_LINE_WIDTH] *=
639 }
else if (sam->parameter[LINE20_START_Y] ==
640 sam->parameter[LINE20_END_Y]) {
641 sam->parameter[LINE20_LINE_WIDTH] *=
645 err_scale_line_macro++;
649 sam->parameter[LINE20_START_X] *=
651 sam->parameter[LINE20_START_Y] *=
653 sam->parameter[LINE20_END_X] *=
655 sam->parameter[LINE20_END_Y] *=
661 sam->parameter[LINE20_ROTATION] +=
666 #if (LINE21_WIDTH != LINE22_WIDTH) \
667 || (LINE21_HEIGHT != LINE22_HEIGHT) \
668 || (LINE21_ROTATION != LINE22_ROTATION) \
669 || (LINE21_CENTER_X != LINE22_LOWER_LEFT_X) \
670 || (LINE21_CENTER_Y != LINE22_LOWER_LEFT_Y)
671 # error "LINE21 and LINE22 indexes are not equal"
683 sam->parameter[LINE21_WIDTH] *=
685 sam->parameter[LINE21_HEIGHT] *=
688 }
else if (fabs(sam->parameter[LINE21_ROTATION]) == 0
689 || fabs(sam->parameter[LINE21_ROTATION]) == 180) {
690 sam->parameter[LINE21_WIDTH] *=
692 sam->parameter[LINE21_HEIGHT] *=
695 }
else if (fabs(sam->parameter[LINE21_ROTATION]) == 90
696 || fabs(sam->parameter[LINE21_ROTATION]) == 270) {
698 t = sam->parameter[LINE21_WIDTH];
699 sam->parameter[LINE21_WIDTH] =
703 sam->parameter[LINE21_HEIGHT] =
707 err_scale_line_macro++;
711 sam->parameter[LINE21_CENTER_X] *=
713 sam->parameter[LINE21_CENTER_Y] *=
716 sam->parameter[LINE21_ROTATION] +=
721 for (
int i = 0; i < 1 + sam->parameter[
722 OUTLINE_NUMBER_OF_POINTS]; i++) {
723 sam->parameter[OUTLINE_X_IDX_OF_POINT(i)] *=
725 sam->parameter[OUTLINE_Y_IDX_OF_POINT(i)] *=
729 sam->parameter[OUTLINE_ROTATION_IDX(sam->parameter)] +=
736 gerbv_selection_item_t sItem = {sourceImage, currentNet};
737 selection_add_item (&screen.selectionInfo, &sItem);
743 sam->parameter[POLYGON_CENTER_X]
745 sam->parameter[POLYGON_CENTER_Y]
747 sam->parameter[POLYGON_DIAMETER]
751 err_scale_poly_macro++;
755 sam->parameter[POLYGON_ROTATION] +=
761 sam->parameter[MOIRE_CENTER_X]
763 sam->parameter[MOIRE_CENTER_Y]
765 sam->parameter[MOIRE_OUTSIDE_DIAMETER]
767 sam->parameter[MOIRE_CIRCLE_THICKNESS]
769 sam->parameter[MOIRE_GAP_WIDTH]
771 sam->parameter[MOIRE_CROSSHAIR_THICKNESS]
773 sam->parameter[MOIRE_CROSSHAIR_LENGTH]
776 err_scale_moire_macro++;
780 sam->parameter[MOIRE_ROTATION] +=
786 sam->parameter[THERMAL_CENTER_X]
788 sam->parameter[THERMAL_CENTER_Y]
790 sam->parameter[THERMAL_INSIDE_DIAMETER]
792 sam->parameter[THERMAL_OUTSIDE_DIAMETER]
794 sam->parameter[THERMAL_CROSSHAIR_THICKNESS]
797 err_scale_thermo_macro++;
801 sam->parameter[THERMAL_ROTATION] +=
807 err_unknown_macro_aperture++;
811 trans_apers[newNet->
aperture] = ++aper_last_id;
812 destImage->
aperture[aper_last_id] = aper;
817 err_unknown_aperture++;
822 GERB_COMPILE_ERROR(ngettext(
823 "Can't rotate %u rectangular aperture to %.2f "
824 "degrees (non 90 multiply)!",
825 "Can't rotate %u rectangular apertures to %.2f "
826 "degrees (non 90 multiply)!", err_rotate_rect),
827 err_rotate_rect, RAD2DEG(trans->
rotation));
829 if (err_scale_line_macro)
830 GERB_COMPILE_ERROR(ngettext(
831 "Can't scale %u line macro!",
832 "Can't scale %u line macros!",
833 err_scale_line_macro), err_scale_line_macro);
835 if (err_scale_poly_macro)
836 GERB_COMPILE_ERROR(ngettext(
837 "Can't scale %u polygon macro!",
838 "Can't scale %u polygon macros!",
839 err_scale_poly_macro), err_scale_poly_macro);
841 if (err_scale_thermo_macro)
842 GERB_COMPILE_ERROR(ngettext(
843 "Can't scale %u thermal macro!",
844 "Can't scale %u thermal macros!",
845 err_scale_poly_macro), err_scale_poly_macro);
847 if (err_scale_moire_macro)
848 GERB_COMPILE_ERROR(ngettext(
849 "Can't scale %u moire macro!",
850 "Can't scale %u moire macros!",
851 err_scale_poly_macro), err_scale_poly_macro);
854 GERB_COMPILE_ERROR(ngettext(
855 "Can't rotate %u oval aperture to %.2f "
856 "degrees (non 90 multiply)!",
857 "Can't rotate %u oval apertures to %.2f "
858 "degrees (non 90 multiply)!", err_rotate_oval),
859 err_rotate_oval, RAD2DEG(trans->
rotation));
861 if (err_scale_circle)
862 GERB_COMPILE_ERROR(ngettext(
863 "Can't scale %u circle aperture to ellipse!",
864 "Can't scale %u circle apertures to ellipse!",
865 err_scale_circle), err_scale_circle);
867 if (err_unknown_aperture)
868 GERB_COMPILE_ERROR(ngettext(
869 "Skipped %u aperture with unknown type!",
870 "Skipped %u apertures with unknown type!",
871 err_unknown_aperture), err_unknown_aperture);
873 if (err_unknown_macro_aperture)
874 GERB_COMPILE_ERROR(ngettext(
875 "Skipped %u macro aperture!",
876 "Skipped %u macro apertures!",
877 err_unknown_macro_aperture),
878 err_unknown_macro_aperture);
880 g_free (trans_apers);
884 gerbv_image_find_existing_aperture_match (gerbv_aperture_t *checkAperture,
gerbv_image_t *imageToSearch) {
888 for (i = 0; i < APERTURE_MAX; i++) {
889 if (imageToSearch->
aperture[i] != NULL) {
890 if ((imageToSearch->
aperture[i]->type == checkAperture->type) &&
891 (imageToSearch->
aperture[i]->simplified == NULL) &&
892 (imageToSearch->
aperture[i]->unit == checkAperture->unit)) {
895 for (j=0; j<APERTURE_PARAMETERS_MAX; j++){
896 if (imageToSearch->
aperture[i]->parameter[j] != checkAperture->parameter[j])
908 gerbv_image_find_unused_aperture_number (
int startIndex,
gerbv_image_t *image){
911 for (i = startIndex; i < APERTURE_MAX; i++) {
923 int lastUsedApertureNumber = APERTURE_MIN - 1;
924 GArray *apertureNumberTable = g_array_new(FALSE,FALSE,
sizeof(gerb_translation_entry_t));
928 *(newImage->
info) = *(sourceImage->
info);
929 newImage->
info->name = g_strdup (sourceImage->
info->name);
930 newImage->
info->type = g_strdup (sourceImage->
info->type);
931 newImage->
info->plotterFilm = g_strdup (sourceImage->
info->plotterFilm);
932 newImage->
info->attr_list = gerbv_attribute_dup (sourceImage->
info->attr_list,
933 sourceImage->
info->n_attr);
937 for (i = 0; i < APERTURE_MAX; i++) {
938 if (sourceImage->
aperture[i] != NULL) {
939 gerbv_aperture_t *newAperture = gerbv_image_duplicate_aperture (sourceImage->
aperture[i]);
941 lastUsedApertureNumber = gerbv_image_find_unused_aperture_number (lastUsedApertureNumber + 1, newImage);
943 gerb_translation_entry_t translationEntry={i,lastUsedApertureNumber};
944 g_array_append_val (apertureNumberTable,translationEntry);
946 newImage->
aperture[lastUsedApertureNumber] = newAperture;
952 gerbv_image_copy_all_nets (sourceImage, newImage, newImage->
layers, newImage->
states, NULL, transform, apertureNumberTable);
953 g_array_free (apertureNumberTable, TRUE);
959 int lastUsedApertureNumber = APERTURE_MIN - 1;
961 GArray *apertureNumberTable = g_array_new(FALSE,FALSE,
sizeof(gerb_translation_entry_t));
964 for (i = 0; i < APERTURE_MAX; i++) {
965 if (sourceImage->
aperture[i] != NULL) {
966 gint existingAperture = gerbv_image_find_existing_aperture_match (sourceImage->
aperture[i], destinationImage);
970 if (existingAperture > 0) {
971 gerb_translation_entry_t translationEntry={i,existingAperture};
972 g_array_append_val (apertureNumberTable,translationEntry);
976 gerbv_aperture_t *newAperture = gerbv_image_duplicate_aperture (sourceImage->
aperture[i]);
978 lastUsedApertureNumber = gerbv_image_find_unused_aperture_number (lastUsedApertureNumber + 1, destinationImage);
980 gerb_translation_entry_t translationEntry={i,lastUsedApertureNumber};
981 g_array_append_val (apertureNumberTable,translationEntry);
983 destinationImage->
aperture[lastUsedApertureNumber] = newAperture;
992 for (lastState = destinationImage->
states; lastState->
next; lastState=lastState->
next){}
993 for (lastLayer = destinationImage->
layers; lastLayer->
next; lastLayer=lastLayer->
next){}
994 for (lastNet = destinationImage->
netlist; lastNet->
next; lastNet=lastNet->
next){}
997 gerbv_image_copy_all_nets (sourceImage, destinationImage, lastLayer, lastState, lastNet, transform, apertureNumberTable);
998 g_array_free (apertureNumberTable, TRUE);
1005 g_assert (currentNet);
1013 for (tempNet = currentNet->
next; tempNet; tempNet = tempNet->
next){
1033 gdouble coordinateY, gdouble width, gdouble height) {
1037 for (currentNet = image->
netlist; currentNet->
next; currentNet = currentNet->
next){}
1040 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1044 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1047 currentNet->
start_x = coordinateX;
1048 currentNet->
start_y = coordinateY;
1049 currentNet->
stop_x = coordinateX;
1050 currentNet->
stop_y = coordinateY;
1053 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1056 currentNet->
start_x = coordinateX;
1057 currentNet->
start_y = coordinateY;
1058 currentNet->
stop_x = coordinateX + width;
1059 currentNet->
stop_y = coordinateY;
1062 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1064 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1067 currentNet->
stop_x = coordinateX + width;
1068 currentNet->
stop_y = coordinateY + height;
1071 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1073 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1076 currentNet->
stop_x = coordinateX;
1077 currentNet->
stop_y = coordinateY + height;
1080 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1082 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1085 currentNet->
stop_x = coordinateX;
1086 currentNet->
stop_y = coordinateY;
1089 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1092 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1099 gerb_image_return_aperture_index (
gerbv_image_t *image, gdouble lineWidth,
int *apertureIndex){
1101 gerbv_aperture_t *aperture=NULL;
1105 for (currentNet = image->
netlist; currentNet->
next; currentNet = currentNet->
next){}
1108 for (i = 0; i < APERTURE_MAX; i++) {
1111 (fabs (image->
aperture[i]->parameter[0] - lineWidth) < 0.001)){
1121 if (!gerber_create_new_aperture (image, apertureIndex,
1132 gdouble radius, gdouble startAngle, gdouble endAngle, gdouble lineWidth,
1136 gerbv_cirseg_t cirSeg = {centerX, centerY, radius, radius, startAngle, endAngle};
1138 currentNet = gerb_image_return_aperture_index(image, lineWidth, &apertureIndex);
1144 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1147 currentNet->
aperture = apertureIndex;
1148 currentNet->
start_x = centerX + (cos(DEG2RAD(startAngle)) * radius);
1149 currentNet->
start_y = centerY + (sin(DEG2RAD(startAngle)) * radius);
1150 currentNet->
stop_x = centerX + (cos(DEG2RAD(endAngle)) * radius);
1151 currentNet->
stop_y = centerY + (sin(DEG2RAD(endAngle)) * radius);
1152 currentNet->
cirseg = g_new0 (gerbv_cirseg_t,1);
1153 *(currentNet->
cirseg) = cirSeg;
1155 gdouble angleDiff = currentNet->
cirseg->angle2 - currentNet->
cirseg->angle1;
1156 gint i, steps = fabs(angleDiff);
1157 for (i=0; i<=steps; i++){
1158 gdouble tempX = currentNet->
cirseg->cp_x + currentNet->
cirseg->width / 2.0 *
1159 cos (DEG2RAD(currentNet->
cirseg->angle1 +
1160 (i*angleDiff)/steps));
1161 gdouble tempY = currentNet->
cirseg->cp_y + currentNet->
cirseg->width / 2.0 *
1162 sin (DEG2RAD(currentNet->
cirseg->angle1 +
1163 (i*angleDiff)/steps));
1164 gerber_update_min_and_max (¤tNet->
boundingBox,
1166 lineWidth/2,lineWidth/2,
1167 lineWidth/2,lineWidth/2);
1169 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1179 currentNet = gerb_image_return_aperture_index(image, lineWidth, &apertureIndex);
1185 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1189 if ((fabs(startX - endX) < 0.001) && (fabs(startY - endY) < 0.001))
1193 currentNet->
aperture = apertureIndex;
1196 currentNet->
stop_x = endX;
1197 currentNet->
stop_y = endY;
1200 lineWidth/2,lineWidth/2,lineWidth/2,lineWidth/2);
1202 lineWidth/2,lineWidth/2,lineWidth/2,lineWidth/2);
1203 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1208 gerbv_image_create_window_pane_objects (
gerbv_image_t *image, gdouble lowerLeftX,
1209 gdouble lowerLeftY, gdouble width, gdouble height, gdouble areaReduction,
1210 gint paneRows, gint paneColumns, gdouble paneSeparation){
1212 gdouble startX,startY,boxWidth,boxHeight;
1214 startX = lowerLeftX + (areaReduction * width) / 2.0;
1215 startY = lowerLeftY + (areaReduction * height) / 2.0;
1216 boxWidth = (width * (1.0 - areaReduction) - (paneSeparation * (paneColumns - 1))) / paneColumns;
1217 boxHeight = (height * (1.0 - areaReduction) - (paneSeparation * (paneRows - 1))) / paneRows;
1219 for (i=0; i<paneColumns; i++){
1220 for (j=0; j<paneRows; j++) {
1222 startY + (j * (boxHeight + paneSeparation)),boxWidth, boxHeight);
1230 gerbv_image_reduce_area_of_selected_objects (GArray *selectionArray,
1231 gdouble areaReduction, gint paneRows, gint paneColumns, gdouble paneSeparation){
1232 gdouble minX,minY,maxX,maxY;
1234 for (guint i=0; i<selectionArray->len; i++) {
1235 gerbv_selection_item_t sItem = g_array_index (selectionArray,gerbv_selection_item_t, i);
1250 for (currentNet = currentNet->
next; currentNet; currentNet = currentNet->
next){
1254 if (currentNet->
stop_x < minX)
1255 minX = currentNet->
stop_x;
1256 if (currentNet->
stop_y < minY)
1257 minY = currentNet->
stop_y;
1258 if (currentNet->
stop_x > maxX)
1259 maxX = currentNet->
stop_x;
1260 if (currentNet->
stop_y > maxY)
1261 maxY = currentNet->
stop_y;
1272 gerbv_aperture_t *apert =
1276 switch (apert->type) {
1280 dx = dy = apert->parameter[0];
1283 dx = apert->parameter[0]/2;
1284 dy = apert->parameter[1]/2;
1289 if (currentNet->
start_x-dx < minX)
1290 minX = currentNet->
start_x-dx;
1291 if (currentNet->
start_y-dy < minY)
1292 minY = currentNet->
start_y-dy;
1293 if (currentNet->
start_x+dx > maxX)
1294 maxX = currentNet->
start_x+dx;
1295 if (currentNet->
start_y+dy > maxY)
1296 maxY = currentNet->
start_y+dy;
1298 if (currentNet->
stop_x-dx < minX)
1299 minX = currentNet->
stop_x-dx;
1300 if (currentNet->
stop_y-dy < minY)
1301 minY = currentNet->
stop_y-dy;
1302 if (currentNet->
stop_x+dx > maxX)
1303 maxX = currentNet->
stop_x+dx;
1304 if (currentNet->
stop_y+dy > maxY)
1305 maxY = currentNet->
stop_y+dy;
1319 gerbv_image_create_window_pane_objects (image, minX, minY, maxX - minX, maxY - minY,
1320 areaReduction, paneRows, paneColumns, paneSeparation);
1326 gerbv_image_move_selected_objects (GArray *selectionArray, gdouble translationX,
1327 gdouble translationY)
1329 for (guint i=0; i<selectionArray->len; i++) {
1330 gerbv_selection_item_t sItem = g_array_index (selectionArray,gerbv_selection_item_t, i);
1335 for (currentNet = currentNet->
next; currentNet; currentNet = currentNet->
next){
1338 currentNet->
start_x += translationX;
1339 currentNet->
start_y += translationY;
1340 currentNet->
stop_x += translationX;
1341 currentNet->
stop_y += translationY;
1346 currentNet->
start_x += translationX;
1347 currentNet->
start_y += translationY;
1348 currentNet->
stop_x += translationX;
1349 currentNet->
stop_y += translationY;
1361 for (currentNet = currentNet->
next; currentNet; currentNet = currentNet->
next){
1363 return currentNet->
next;
1369 return currentNet->
next;
1378 for (currentNet = parsed_image->
netlist; currentNet->
next; currentNet = currentNet->
next){
1380 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