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; ){
130 while (bnet != NULL) {
135 g_string_free (bnet->
label, TRUE);
150 free_amacro(image->
amacro);
163 g_free(image->
info->name);
164 g_free(image->
info->type);
165 gerbv_attribute_destroy_HID_attribute (image->
info->attr_list, image->
info->n_attr);
172 for (net = image->
netlist; net != NULL; ) {
175 if (tmp->
cirseg != NULL) {
180 g_string_free (tmp->
label, TRUE);
185 for (layer = image->
layers; layer != NULL; ) {
189 g_free (tempLayer->
name);
192 for (state = image->
states; state != NULL; ) {
224 gerb_verify_error_t error = GERB_IMAGE_OK;
227 gboolean needs_aperture = FALSE;
228 gboolean in_parea = FALSE;
230 if (image->
netlist == NULL) error |= GERB_IMAGE_MISSING_NETLIST;
231 if (image->
format == NULL) error |= GERB_IMAGE_MISSING_FORMAT;
232 if (image->
info == NULL) error |= GERB_IMAGE_MISSING_INFO;
244 else if (!in_parea &&
247 needs_aperture = TRUE;
252 if (needs_aperture) {
253 for (i = 0; i < APERTURE_MAX && image->
aperture[i] == NULL; i++);
254 if (i == APERTURE_MAX) error |= GERB_IMAGE_MISSING_APERTURES;
265 printf(_(
"..state off"));
268 printf(_(
"..state on"));
271 printf(_(
"..state flash"));
274 printf(_(
"..state unknown"));
283 gerbv_aperture_t *
const* aperture;
287 printf(_(
"Apertures:\n"));
289 for (i = 0; i < APERTURE_MAX; i++) {
291 printf(_(
" Aperture no:%d is an "), i);
292 switch(aperture[i]->type) {
297 printf(_(
"rectangle"));
303 printf(_(
"polygon"));
309 printf(_(
"unknown"));
311 for (j = 0; j < aperture[i]->nuf_parameters; j++) {
312 printf(
" %f", aperture[i]->parameter[j]);
321 printf(_(
"(%f,%f)->(%f,%f) with %d ("), net->
start_x, net->
start_y,
336 *newLayer = *previousLayer;
337 previousLayer->
next = newLayer;
339 newLayer->
knockout.firstInstance = FALSE;
340 newLayer->
name = NULL;
341 newLayer->
next = NULL;
352 *newState = *previousState;
353 previousState->
next = newState;
364 newState->
next = NULL;
373 *newLayer = *oldLayer;
374 newLayer->
name = g_strdup (oldLayer->
name);
375 newLayer->
next = NULL;
384 *newState = *oldState;
385 newState->
next = NULL;
389 static gerbv_aperture_t *
390 gerbv_image_duplicate_aperture (gerbv_aperture_t *oldAperture)
392 gerbv_aperture_t *newAperture = g_new0 (gerbv_aperture_t,1);
393 gerbv_simplified_amacro_t *simplifiedMacro, *tempSimplified;
395 *newAperture = *oldAperture;
399 newAperture->amacro = NULL;
400 newAperture->simplified = NULL;
403 tempSimplified = NULL;
404 for (simplifiedMacro = oldAperture->simplified; simplifiedMacro != NULL; simplifiedMacro = simplifiedMacro->next) {
405 gerbv_simplified_amacro_t *newSimplified = g_new0 (gerbv_simplified_amacro_t,1);
406 *newSimplified = *simplifiedMacro;
408 tempSimplified->next = newSimplified;
410 newAperture->simplified = newSimplified;
411 tempSimplified = newSimplified;
421 GArray *translationTable)
430 gerbv_aperture_t *aper;
431 gerbv_simplified_amacro_t *sam;
432 int *trans_apers = NULL;
433 int aper_last_id = 0;
434 guint err_scale_circle = 0,
435 err_scale_line_macro = 0,
436 err_scale_poly_macro = 0,
437 err_scale_thermo_macro = 0,
438 err_scale_moire_macro = 0,
439 err_unknown_aperture = 0,
440 err_unknown_macro_aperture = 0,
446 GERB_COMPILE_ERROR(_(
"Exporting mirrored file "
447 "is not supported!"));
453 GERB_COMPILE_ERROR(_(
"Exporting inverted file "
454 "is not supported!"));
461 for (aper_last_id = APERTURE_MAX - 1; aper_last_id > 0;
463 if (destImage->
aperture[aper_last_id] != NULL)
467 trans_apers = g_new (
int, aper_last_id + 1);
469 for (
int i = 0; i < aper_last_id + 1; i++)
473 for (currentNet = sourceImage->
netlist; currentNet != NULL;
474 currentNet = currentNet->
next) {
480 if (currentNet->
layer != srcLayer) {
481 srcLayer = currentNet->
layer;
483 gerbv_image_duplicate_layer (currentNet->
layer);
484 lastLayer = lastLayer->
next;
489 if (currentNet->
state != srcState) {
490 srcState = currentNet->
state;
492 gerbv_image_duplicate_state (currentNet->
state);
493 lastState = lastState->
next;
498 *newNet = *currentNet;
501 newNet->
cirseg = g_new (gerbv_cirseg_t, 1);
505 if (currentNet->
label)
506 newNet->
label = g_string_new (currentNet->
label->str);
508 newNet->
label = NULL;
510 newNet->
state = lastState;
511 newNet->
layer = lastLayer;
514 lastNet->
next = newNet;
521 if (translationTable) {
522 for (guint i = 0; i < translationTable->len; i++) {
523 gerb_translation_entry_t translationEntry;
526 g_array_index (translationTable,
527 gerb_translation_entry_t, i);
529 if (translationEntry.oldAperture ==
532 translationEntry.newAperture;
551 &newNet->
cirseg->cp_y, trans);
558 && fabs(trans->
rotation) < GERBV_PRECISION_ANGLE_RAD)
562 if (trans_apers[newNet->
aperture] != -1) {
576 && trans->
scaleX == 1.0) {
581 aper = gerbv_image_duplicate_aperture (
584 aper->parameter[0] *= trans->
scaleX;
586 trans_apers[newNet->
aperture] = ++aper_last_id;
587 destImage->
aperture[aper_last_id] = aper;
597 && fabs(fabs(trans->
rotation) - M_PI)
598 < GERBV_PRECISION_ANGLE_RAD)
601 aper = gerbv_image_duplicate_aperture (
603 aper->parameter[0] *= trans->
scaleX;
604 aper->parameter[1] *= trans->
scaleY;
606 if (fabs(fabs(trans->
rotation) - M_PI_2)
607 < GERBV_PRECISION_ANGLE_RAD
608 || fabs(fabs(trans->
rotation) - (M_PI+M_PI_2))
609 < GERBV_PRECISION_ANGLE_RAD) {
610 double t = aper->parameter[0];
611 aper->parameter[0] = aper->parameter[1];
612 aper->parameter[1] = t;
622 trans_apers[newNet->
aperture] = ++aper_last_id;
623 destImage->
aperture[aper_last_id] = aper;
629 aper = gerbv_image_duplicate_aperture (
631 sam = aper->simplified;
633 for (; sam != NULL; sam = sam->next) {
636 sam->parameter[CIRCLE_CENTER_X] *=
638 sam->parameter[CIRCLE_CENTER_Y] *=
640 sam->parameter[CIRCLE_ROTATION] +=
647 sam->parameter[CIRCLE_DIAMETER] *=
654 sam->parameter[LINE20_LINE_WIDTH] *=
656 }
else if (sam->parameter[LINE20_START_X] ==
657 sam->parameter[LINE20_END_X]) {
658 sam->parameter[LINE20_LINE_WIDTH] *=
660 }
else if (sam->parameter[LINE20_START_Y] ==
661 sam->parameter[LINE20_END_Y]) {
662 sam->parameter[LINE20_LINE_WIDTH] *=
666 err_scale_line_macro++;
670 sam->parameter[LINE20_START_X] *=
672 sam->parameter[LINE20_START_Y] *=
674 sam->parameter[LINE20_END_X] *=
676 sam->parameter[LINE20_END_Y] *=
682 sam->parameter[LINE20_ROTATION] +=
687 #if (LINE21_WIDTH != LINE22_WIDTH) \
688 || (LINE21_HEIGHT != LINE22_HEIGHT) \
689 || (LINE21_ROTATION != LINE22_ROTATION) \
690 || (LINE21_CENTER_X != LINE22_LOWER_LEFT_X) \
691 || (LINE21_CENTER_Y != LINE22_LOWER_LEFT_Y)
692 # error "LINE21 and LINE22 indexes are not equal"
704 sam->parameter[LINE21_WIDTH] *=
706 sam->parameter[LINE21_HEIGHT] *=
709 }
else if (fabs(sam->parameter[LINE21_ROTATION]) == 0
710 || fabs(sam->parameter[LINE21_ROTATION]) == 180) {
711 sam->parameter[LINE21_WIDTH] *=
713 sam->parameter[LINE21_HEIGHT] *=
716 }
else if (fabs(sam->parameter[LINE21_ROTATION]) == 90
717 || fabs(sam->parameter[LINE21_ROTATION]) == 270) {
719 t = sam->parameter[LINE21_WIDTH];
720 sam->parameter[LINE21_WIDTH] =
724 sam->parameter[LINE21_HEIGHT] =
728 err_scale_line_macro++;
732 sam->parameter[LINE21_CENTER_X] *=
734 sam->parameter[LINE21_CENTER_Y] *=
737 sam->parameter[LINE21_ROTATION] +=
742 for (
int i = 0; i < 1 + sam->parameter[
743 OUTLINE_NUMBER_OF_POINTS]; i++) {
744 sam->parameter[OUTLINE_X_IDX_OF_POINT(i)] *=
746 sam->parameter[OUTLINE_Y_IDX_OF_POINT(i)] *=
750 sam->parameter[OUTLINE_ROTATION_IDX(sam->parameter)] +=
757 gerbv_selection_item_t sItem = {sourceImage, currentNet};
758 selection_add_item (&screen.selectionInfo, &sItem);
764 sam->parameter[POLYGON_CENTER_X]
766 sam->parameter[POLYGON_CENTER_Y]
768 sam->parameter[POLYGON_DIAMETER]
772 err_scale_poly_macro++;
776 sam->parameter[POLYGON_ROTATION] +=
782 sam->parameter[MOIRE_CENTER_X]
784 sam->parameter[MOIRE_CENTER_Y]
786 sam->parameter[MOIRE_OUTSIDE_DIAMETER]
788 sam->parameter[MOIRE_CIRCLE_THICKNESS]
790 sam->parameter[MOIRE_GAP_WIDTH]
792 sam->parameter[MOIRE_CROSSHAIR_THICKNESS]
794 sam->parameter[MOIRE_CROSSHAIR_LENGTH]
797 err_scale_moire_macro++;
801 sam->parameter[MOIRE_ROTATION] +=
807 sam->parameter[THERMAL_CENTER_X]
809 sam->parameter[THERMAL_CENTER_Y]
811 sam->parameter[THERMAL_INSIDE_DIAMETER]
813 sam->parameter[THERMAL_OUTSIDE_DIAMETER]
815 sam->parameter[THERMAL_CROSSHAIR_THICKNESS]
818 err_scale_thermo_macro++;
822 sam->parameter[THERMAL_ROTATION] +=
828 err_unknown_macro_aperture++;
832 trans_apers[newNet->
aperture] = ++aper_last_id;
833 destImage->
aperture[aper_last_id] = aper;
838 err_unknown_aperture++;
843 GERB_COMPILE_ERROR(ngettext(
844 "Can't rotate %u rectangular aperture to %.2f "
845 "degrees (non 90 multiply)!",
846 "Can't rotate %u rectangular apertures to %.2f "
847 "degrees (non 90 multiply)!", err_rotate_rect),
848 err_rotate_rect, RAD2DEG(trans->
rotation));
850 if (err_scale_line_macro)
851 GERB_COMPILE_ERROR(ngettext(
852 "Can't scale %u line macro!",
853 "Can't scale %u line macros!",
854 err_scale_line_macro), err_scale_line_macro);
856 if (err_scale_poly_macro)
857 GERB_COMPILE_ERROR(ngettext(
858 "Can't scale %u polygon macro!",
859 "Can't scale %u polygon macros!",
860 err_scale_poly_macro), err_scale_poly_macro);
862 if (err_scale_thermo_macro)
863 GERB_COMPILE_ERROR(ngettext(
864 "Can't scale %u thermal macro!",
865 "Can't scale %u thermal macros!",
866 err_scale_poly_macro), err_scale_poly_macro);
868 if (err_scale_moire_macro)
869 GERB_COMPILE_ERROR(ngettext(
870 "Can't scale %u moire macro!",
871 "Can't scale %u moire macros!",
872 err_scale_poly_macro), err_scale_poly_macro);
875 GERB_COMPILE_ERROR(ngettext(
876 "Can't rotate %u oval aperture to %.2f "
877 "degrees (non 90 multiply)!",
878 "Can't rotate %u oval apertures to %.2f "
879 "degrees (non 90 multiply)!", err_rotate_oval),
880 err_rotate_oval, RAD2DEG(trans->
rotation));
882 if (err_scale_circle)
883 GERB_COMPILE_ERROR(ngettext(
884 "Can't scale %u circle aperture to ellipse!",
885 "Can't scale %u circle apertures to ellipse!",
886 err_scale_circle), err_scale_circle);
888 if (err_unknown_aperture)
889 GERB_COMPILE_ERROR(ngettext(
890 "Skipped %u aperture with unknown type!",
891 "Skipped %u apertures with unknown type!",
892 err_unknown_aperture), err_unknown_aperture);
894 if (err_unknown_macro_aperture)
895 GERB_COMPILE_ERROR(ngettext(
896 "Skipped %u macro aperture!",
897 "Skipped %u macro apertures!",
898 err_unknown_macro_aperture),
899 err_unknown_macro_aperture);
901 g_free (trans_apers);
905 gerbv_image_find_existing_aperture_match (gerbv_aperture_t *checkAperture,
gerbv_image_t *imageToSearch) {
909 for (i = 0; i < APERTURE_MAX; i++) {
910 if (imageToSearch->
aperture[i] != NULL) {
911 if ((imageToSearch->
aperture[i]->type == checkAperture->type) &&
912 (imageToSearch->
aperture[i]->simplified == NULL) &&
913 (imageToSearch->
aperture[i]->unit == checkAperture->unit)) {
916 for (j=0; j<APERTURE_PARAMETERS_MAX; j++){
917 if (imageToSearch->
aperture[i]->parameter[j] != checkAperture->parameter[j])
929 gerbv_image_find_unused_aperture_number (
int startIndex,
gerbv_image_t *image){
932 for (i = startIndex; i < APERTURE_MAX; i++) {
944 int lastUsedApertureNumber = APERTURE_MIN - 1;
945 GArray *apertureNumberTable = g_array_new(FALSE,FALSE,
sizeof(gerb_translation_entry_t));
951 g_free(newImage->
info->type);
959 *(newImage->
info) = *(sourceImage->
info);
960 newImage->
info->name = g_strdup (sourceImage->
info->name);
961 newImage->
info->type = g_strdup (sourceImage->
info->type);
962 newImage->
info->plotterFilm = g_strdup (sourceImage->
info->plotterFilm);
963 newImage->
info->attr_list = gerbv_attribute_dup (sourceImage->
info->attr_list,
964 sourceImage->
info->n_attr);
968 for (i = 0; i < APERTURE_MAX; i++) {
969 if (sourceImage->
aperture[i] != NULL) {
970 gerbv_aperture_t *newAperture = gerbv_image_duplicate_aperture (sourceImage->
aperture[i]);
972 lastUsedApertureNumber = gerbv_image_find_unused_aperture_number (lastUsedApertureNumber + 1, newImage);
974 gerb_translation_entry_t translationEntry={i,lastUsedApertureNumber};
975 g_array_append_val (apertureNumberTable,translationEntry);
977 newImage->
aperture[lastUsedApertureNumber] = newAperture;
983 gerbv_image_copy_all_nets (sourceImage, newImage, newImage->
layers, newImage->
states, NULL, transform, apertureNumberTable);
984 g_array_free (apertureNumberTable, TRUE);
990 int lastUsedApertureNumber = APERTURE_MIN - 1;
992 GArray *apertureNumberTable = g_array_new(FALSE,FALSE,
sizeof(gerb_translation_entry_t));
995 for (i = 0; i < APERTURE_MAX; i++) {
996 if (sourceImage->
aperture[i] != NULL) {
997 gint existingAperture = gerbv_image_find_existing_aperture_match (sourceImage->
aperture[i], destinationImage);
1001 if (existingAperture > 0) {
1002 gerb_translation_entry_t translationEntry={i,existingAperture};
1003 g_array_append_val (apertureNumberTable,translationEntry);
1007 gerbv_aperture_t *newAperture = gerbv_image_duplicate_aperture (sourceImage->
aperture[i]);
1009 lastUsedApertureNumber = gerbv_image_find_unused_aperture_number (lastUsedApertureNumber + 1, destinationImage);
1011 gerb_translation_entry_t translationEntry={i,lastUsedApertureNumber};
1012 g_array_append_val (apertureNumberTable,translationEntry);
1014 destinationImage->
aperture[lastUsedApertureNumber] = newAperture;
1023 for (lastState = destinationImage->
states; lastState->
next; lastState=lastState->
next){}
1024 for (lastLayer = destinationImage->
layers; lastLayer->
next; lastLayer=lastLayer->
next){}
1025 for (lastNet = destinationImage->
netlist; lastNet->
next; lastNet=lastNet->
next){}
1028 gerbv_image_copy_all_nets (sourceImage, destinationImage, lastLayer, lastState, lastNet, transform, apertureNumberTable);
1029 g_array_free (apertureNumberTable, TRUE);
1036 g_assert (currentNet);
1044 for (tempNet = currentNet->
next; tempNet; tempNet = tempNet->
next){
1064 gdouble coordinateY, gdouble width, gdouble height) {
1068 for (currentNet = image->
netlist; currentNet->
next; currentNet = currentNet->
next){}
1071 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1075 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1078 currentNet->
start_x = coordinateX;
1079 currentNet->
start_y = coordinateY;
1080 currentNet->
stop_x = coordinateX;
1081 currentNet->
stop_y = coordinateY;
1084 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1087 currentNet->
start_x = coordinateX;
1088 currentNet->
start_y = coordinateY;
1089 currentNet->
stop_x = coordinateX + width;
1090 currentNet->
stop_y = coordinateY;
1093 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1095 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1098 currentNet->
stop_x = coordinateX + width;
1099 currentNet->
stop_y = coordinateY + height;
1102 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1104 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1107 currentNet->
stop_x = coordinateX;
1108 currentNet->
stop_y = coordinateY + height;
1111 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1113 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1116 currentNet->
stop_x = coordinateX;
1117 currentNet->
stop_y = coordinateY;
1120 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1123 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1130 gerb_image_return_aperture_index (
gerbv_image_t *image, gdouble lineWidth,
int *apertureIndex){
1132 gerbv_aperture_t *aperture=NULL;
1136 for (currentNet = image->
netlist; currentNet->
next; currentNet = currentNet->
next){}
1139 for (i = 0; i < APERTURE_MAX; i++) {
1142 (fabs (image->
aperture[i]->parameter[0] - lineWidth) < 0.001)){
1152 if (!gerber_create_new_aperture (image, apertureIndex,
1163 gdouble radius, gdouble startAngle, gdouble endAngle, gdouble lineWidth,
1167 gerbv_cirseg_t cirSeg = {centerX, centerY, radius, radius, startAngle, endAngle};
1169 currentNet = gerb_image_return_aperture_index(image, lineWidth, &apertureIndex);
1175 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1178 currentNet->
aperture = apertureIndex;
1179 currentNet->
start_x = centerX + (cos(DEG2RAD(startAngle)) * radius);
1180 currentNet->
start_y = centerY + (sin(DEG2RAD(startAngle)) * radius);
1181 currentNet->
stop_x = centerX + (cos(DEG2RAD(endAngle)) * radius);
1182 currentNet->
stop_y = centerY + (sin(DEG2RAD(endAngle)) * radius);
1183 currentNet->
cirseg = g_new0 (gerbv_cirseg_t,1);
1184 *(currentNet->
cirseg) = cirSeg;
1186 gdouble angleDiff = currentNet->
cirseg->angle2 - currentNet->
cirseg->angle1;
1187 gint i, steps = fabs(angleDiff);
1188 for (i=0; i<=steps; i++){
1189 gdouble tempX = currentNet->
cirseg->cp_x + currentNet->
cirseg->width / 2.0 *
1190 cos (DEG2RAD(currentNet->
cirseg->angle1 +
1191 (i*angleDiff)/steps));
1192 gdouble tempY = currentNet->
cirseg->cp_y + currentNet->
cirseg->width / 2.0 *
1193 sin (DEG2RAD(currentNet->
cirseg->angle1 +
1194 (i*angleDiff)/steps));
1195 gerber_update_min_and_max (¤tNet->
boundingBox,
1197 lineWidth/2,lineWidth/2,
1198 lineWidth/2,lineWidth/2);
1200 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1210 currentNet = gerb_image_return_aperture_index(image, lineWidth, &apertureIndex);
1216 currentNet = gerber_create_new_net (currentNet, NULL, NULL);
1220 if ((fabs(startX - endX) < 0.001) && (fabs(startY - endY) < 0.001))
1224 currentNet->
aperture = apertureIndex;
1227 currentNet->
stop_x = endX;
1228 currentNet->
stop_y = endY;
1231 lineWidth/2,lineWidth/2,lineWidth/2,lineWidth/2);
1233 lineWidth/2,lineWidth/2,lineWidth/2,lineWidth/2);
1234 gerber_update_image_min_max (¤tNet->
boundingBox, 0, 0, image);
1239 gerbv_image_create_window_pane_objects (
gerbv_image_t *image, gdouble lowerLeftX,
1240 gdouble lowerLeftY, gdouble width, gdouble height, gdouble areaReduction,
1241 gint paneRows, gint paneColumns, gdouble paneSeparation){
1243 gdouble startX,startY,boxWidth,boxHeight;
1245 startX = lowerLeftX + (areaReduction * width) / 2.0;
1246 startY = lowerLeftY + (areaReduction * height) / 2.0;
1247 boxWidth = (width * (1.0 - areaReduction) - (paneSeparation * (paneColumns - 1))) / paneColumns;
1248 boxHeight = (height * (1.0 - areaReduction) - (paneSeparation * (paneRows - 1))) / paneRows;
1250 for (i=0; i<paneColumns; i++){
1251 for (j=0; j<paneRows; j++) {
1253 startY + (j * (boxHeight + paneSeparation)),boxWidth, boxHeight);
1261 gerbv_image_reduce_area_of_selected_objects (GArray *selectionArray,
1262 gdouble areaReduction, gint paneRows, gint paneColumns, gdouble paneSeparation){
1263 gdouble minX,minY,maxX,maxY;
1265 for (guint i=0; i<selectionArray->len; i++) {
1266 gerbv_selection_item_t sItem = g_array_index (selectionArray,gerbv_selection_item_t, i);
1281 for (currentNet = currentNet->
next; currentNet; currentNet = currentNet->
next){
1285 if (currentNet->
stop_x < minX)
1286 minX = currentNet->
stop_x;
1287 if (currentNet->
stop_y < minY)
1288 minY = currentNet->
stop_y;
1289 if (currentNet->
stop_x > maxX)
1290 maxX = currentNet->
stop_x;
1291 if (currentNet->
stop_y > maxY)
1292 maxY = currentNet->
stop_y;
1303 gerbv_aperture_t *apert =
1307 switch (apert->type) {
1311 dx = dy = apert->parameter[0];
1314 dx = apert->parameter[0]/2;
1315 dy = apert->parameter[1]/2;
1320 if (currentNet->
start_x-dx < minX)
1321 minX = currentNet->
start_x-dx;
1322 if (currentNet->
start_y-dy < minY)
1323 minY = currentNet->
start_y-dy;
1324 if (currentNet->
start_x+dx > maxX)
1325 maxX = currentNet->
start_x+dx;
1326 if (currentNet->
start_y+dy > maxY)
1327 maxY = currentNet->
start_y+dy;
1329 if (currentNet->
stop_x-dx < minX)
1330 minX = currentNet->
stop_x-dx;
1331 if (currentNet->
stop_y-dy < minY)
1332 minY = currentNet->
stop_y-dy;
1333 if (currentNet->
stop_x+dx > maxX)
1334 maxX = currentNet->
stop_x+dx;
1335 if (currentNet->
stop_y+dy > maxY)
1336 maxY = currentNet->
stop_y+dy;
1350 gerbv_image_create_window_pane_objects (image, minX, minY, maxX - minX, maxY - minY,
1351 areaReduction, paneRows, paneColumns, paneSeparation);
1357 gerbv_image_move_selected_objects (GArray *selectionArray, gdouble translationX,
1358 gdouble translationY)
1360 for (guint i=0; i<selectionArray->len; i++) {
1361 gerbv_selection_item_t sItem = g_array_index (selectionArray,gerbv_selection_item_t, i);
1366 for (currentNet = currentNet->
next; currentNet; currentNet = currentNet->
next){
1369 currentNet->
start_x += translationX;
1370 currentNet->
start_y += translationY;
1371 currentNet->
stop_x += translationX;
1372 currentNet->
stop_y += translationY;
1377 currentNet->
start_x += translationX;
1378 currentNet->
start_y += translationY;
1379 currentNet->
stop_x += translationX;
1380 currentNet->
stop_y += translationY;
1392 for (currentNet = currentNet->
next; currentNet; currentNet = currentNet->
next){
1394 return currentNet->
next;
1400 return currentNet->
next;
1409 for (currentNet = parsed_image->
netlist; currentNet->
next; currentNet = currentNet->
next){
1411 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