gerbv  2.10.1-dev~93f1b5
gerber.h
Go to the documentation of this file.
1 /*
2  * gEDA - GNU Electronic Design Automation
3  * This files is a part of gerbv.
4  *
5  * Copyright (C) 2000-2002 Stefan Petersen (spe@stacken.kth.se)
6  *
7  * $Id$
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
22  */
23 
29 #ifndef GERBER_H
30 #define GERBER_H
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <stdio.h>
37 #include <glib.h>
38 
39 #include "gerb_file.h"
40 
41 typedef struct gerb_state {
42  int curr_x;
43  int curr_y;
44  int prev_x;
45  int prev_y;
46  int delta_cp_x;
47  int delta_cp_y;
48  int curr_aperture;
49  int changed;
50  gerbv_aperture_state_t aperture_state;
51  gerbv_interpolation_t interpolation;
52  gerbv_interpolation_t prev_interpolation;
53  gerbv_net_t* parea_start_node;
54  gerbv_layer_t* layer;
55  gerbv_netstate_t* state;
56  int in_parea_fill;
57  int mq_on; /* Is multiquadrant circular iterpolation */
58 } gerb_state_t;
59 
60 /*
61  * parse gerber file pointed to by fd
62  */
63 gerbv_image_t* parse_gerb(gerb_file_t* fd, gchar* directoryPath);
64 gboolean gerber_is_rs274x_p(gerb_file_t* fd, gboolean* returnFoundBinary);
65 gboolean gerber_is_rs274d_p(gerb_file_t* fd);
66 gerbv_net_t* gerber_create_new_net(gerbv_net_t* currentNet, gerbv_layer_t* layer, gerbv_netstate_t* state);
67 
68 gboolean gerber_create_new_aperture(
69  gerbv_image_t* image, int* indexNumber, gerbv_aperture_type_t apertureType, gdouble parameter1, gdouble parameter2
70 );
71 
72 void gerber_update_image_min_max(
73  gerbv_render_size_t* boundingBox, double repeat_off_X, double repeat_off_Y, gerbv_image_t* image
74 );
75 void gerber_update_min_and_max(
76  gerbv_render_size_t* boundingBox, gdouble x, gdouble y, gdouble apertureSizeX1, gdouble apertureSizeX2,
77  gdouble apertureSizeY1, gdouble apertureSizeY2
78 );
79 const char* gerber_d_code_name(int d_code);
80 const char* gerber_g_code_name(int g_code);
81 const char* gerber_m_code_name(int m_code);
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif /* GERBER_H */
Header info for the file parsing support functions.
gboolean gerber_is_rs274d_p(gerb_file_t *fd)
Definition: gerber.c:846
const char * gerber_d_code_name(int d_code)
Return Gerber D-code name by code number.
Definition: gerber.c:2578
const char * gerber_g_code_name(int g_code)
Return Gerber G-code name by code number.
Definition: gerber.c:2589
const char * gerber_m_code_name(int m_code)
Return Gerber M-code name by code number.
Definition: gerber.c:2615
gboolean gerber_is_rs274x_p(gerb_file_t *fd, gboolean *returnFoundBinary)
Definition: gerber.c:756
gerbv_image_t * parse_gerb(gerb_file_t *fd, gchar *directoryPath)
Definition: gerber.c:692
gerbv_aperture_state_t
Definition: gerbv.h:170
gerbv_aperture_type_t
Definition: gerbv.h:150
gerbv_interpolation_t
Definition: gerbv.h:293