Enabled parser to detect path-types, fix indentation
This commit is contained in:
@@ -59,6 +59,7 @@ enum record {
|
||||
BOX = 0x2D00,
|
||||
LAYER = 0x0D02,
|
||||
WIDTH = 0x0F03,
|
||||
PATHTYPE = 0x2102
|
||||
};
|
||||
|
||||
static int name_cell_ref(struct gds_cell_instance *cell_inst,
|
||||
@@ -189,7 +190,8 @@ static GList *append_graphics(GList *curr_list, enum graphics_type type,
|
||||
gfx->layer = 0;
|
||||
gfx->vertices = NULL;
|
||||
gfx->width_absolute = 0;
|
||||
gfx->type = type;
|
||||
gfx->gfx_type = type;
|
||||
gfx->path_render_type = PATH_FLUSH;
|
||||
} else
|
||||
return NULL;
|
||||
|
||||
@@ -561,7 +563,7 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
case ENDEL:
|
||||
if (current_graphics != NULL) {
|
||||
|
||||
printf("\tLeaving %s\n", (current_graphics->type == GRAPHIC_POLYGON ? "boundary" : "path"));
|
||||
printf("\tLeaving %s\n", (current_graphics->gfx_type == GRAPHIC_POLYGON ? "boundary" : "path"));
|
||||
current_graphics = NULL;
|
||||
}
|
||||
if (current_s_reference != NULL) {
|
||||
@@ -587,6 +589,8 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
break;
|
||||
case WIDTH:
|
||||
break;
|
||||
case PATHTYPE:
|
||||
break;
|
||||
default:
|
||||
//GDS_WARN("Record: %04x, len: %u", (unsigned int)rec_type, (unsigned int)rec_data_length);
|
||||
break;
|
||||
@@ -693,6 +697,18 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
printf("\t\tAngle defined: %lf\n", current_s_reference->angle);
|
||||
}
|
||||
break;
|
||||
case PATHTYPE:
|
||||
if (current_graphics == NULL) {
|
||||
GDS_WARN("Path type defined outside of path. Ignoring");
|
||||
break;
|
||||
}
|
||||
if (current_graphics->gfx_type == GRAPHIC_PATH) {
|
||||
current_graphics->path_render_type = (int)gds_convert_signed_int16(workbuff);
|
||||
printf("\t\tPathtype: %d\n", current_graphics->path_render_type);
|
||||
} else {
|
||||
GDS_WARN("Path type defined inside non-path graphics object. Ignoring");
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
@@ -7,54 +7,55 @@
|
||||
#define CELL_NAME_MAX (100)
|
||||
|
||||
enum graphics_type {GRAPHIC_PATH = 0, GRAPHIC_POLYGON = 1};
|
||||
enum path_type {PATH_FLUSH = 0, PATH_ROUNDED = 1, PATH_SQUARED = 2};
|
||||
|
||||
struct gds_time_field {
|
||||
uint16_t year;
|
||||
uint16_t month;
|
||||
uint16_t day;
|
||||
uint16_t hour;
|
||||
uint16_t minute;
|
||||
uint16_t second;
|
||||
uint16_t year;
|
||||
uint16_t month;
|
||||
uint16_t day;
|
||||
uint16_t hour;
|
||||
uint16_t minute;
|
||||
uint16_t second;
|
||||
};
|
||||
|
||||
struct gds_point {
|
||||
int x;
|
||||
int y;
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
struct gds_graphics {
|
||||
enum graphics_type type;
|
||||
GList *vertices;
|
||||
unsigned int path_width;
|
||||
int width_absolute;
|
||||
int16_t layer;
|
||||
uint16_t datatype;
|
||||
enum graphics_type gfx_type;
|
||||
GList *vertices;
|
||||
enum path_type path_render_type;
|
||||
int width_absolute;
|
||||
int16_t layer;
|
||||
uint16_t datatype;
|
||||
};
|
||||
|
||||
struct gds_cell_instance {
|
||||
char ref_name[CELL_NAME_MAX];
|
||||
struct gds_cell *cell_ref;
|
||||
struct gds_point origin;
|
||||
int flipped;
|
||||
double angle;
|
||||
double magnification;
|
||||
char ref_name[CELL_NAME_MAX];
|
||||
struct gds_cell *cell_ref;
|
||||
struct gds_point origin;
|
||||
int flipped;
|
||||
double angle;
|
||||
double magnification;
|
||||
};
|
||||
|
||||
struct gds_cell {
|
||||
char name[CELL_NAME_MAX];
|
||||
struct gds_time_field mod_time;
|
||||
struct gds_time_field access_time;
|
||||
GList *child_cells;
|
||||
GList *graphic_objs;
|
||||
char name[CELL_NAME_MAX];
|
||||
struct gds_time_field mod_time;
|
||||
struct gds_time_field access_time;
|
||||
GList *child_cells;
|
||||
GList *graphic_objs;
|
||||
};
|
||||
|
||||
struct gds_library {
|
||||
char name[CELL_NAME_MAX];
|
||||
struct gds_time_field mod_time;
|
||||
struct gds_time_field access_time;
|
||||
double unit_to_meters;
|
||||
GList *cells;
|
||||
GList *cell_names;
|
||||
char name[CELL_NAME_MAX];
|
||||
struct gds_time_field mod_time;
|
||||
struct gds_time_field access_time;
|
||||
double unit_to_meters;
|
||||
GList *cells;
|
||||
GList *cell_names;
|
||||
};
|
||||
|
||||
#endif /* __GDS_TYPES_H__ */
|
||||
|
Reference in New Issue
Block a user