Limbo
|
#include <GdsWriter.h>
Public Member Functions | |
GdsWriter (const char *filename) | |
constructor More... | |
~GdsWriter () | |
destructor | |
char * | gds_adjust_string (const char *input, int *output_length) |
high level interfaces | |
void | write_boundary (int layer, int datatype, std::vector< int > const &vx, std::vector< int > const &vy, bool has_last=true) |
write a boundary object More... | |
void | write_box (int layer, int datatype, int xl, int yl, int xh, int yh) |
write a box object More... | |
void | create_lib (const char *libname, double dbu_uu, double dbu_m) |
create GDSII library More... | |
low level interfaces | |
void | gds_make_next_item (struct gds_itemtype **ci) |
void | gds_bindump (BYTE x) |
void | gds_write_float (double x) |
void | gds_swap4bytes (BYTE *four) |
swap bytes More... | |
void | gds_swap2bytes (BYTE *two) |
swap bytes More... | |
void | gds_write_header () |
write HEADER | |
void | gds_write_bgnlib () |
write BGNLIB | |
void | gds_write_bgnstr () |
write BGNSTR | |
void | gds_write_endlib () |
write ENDLIB | |
void | gds_write_endstr () |
write ENDSTR | |
void | gds_write_libname (const char *name) |
write LIBNAME More... | |
void | gds_write_strname (const char *name) |
write STRNAME More... | |
void | gds_write_string (const char *s) |
write STRING More... | |
void | gds_write_sname (const char *s) |
write SNAME More... | |
void | gds_write_boundary () |
write BOUNDARY | |
void | gds_write_box () |
write BOX | |
void | gds_write_boxtype (short int dt) |
write BOXTYPE More... | |
void | gds_write_path () |
write PATH | |
void | gds_write_sref () |
write SREF | |
void | gds_write_aref () |
write AREF | |
void | gds_write_text () |
write TEXT | |
void | gds_write_endel () |
write ENDEL | |
void | gds_write_layer (short int layer) |
write LAYER More... | |
void | gds_write_width (int width) |
write WIDTH More... | |
void | gds_write_datatype (short int dt) |
write DATATYPE More... | |
void | gds_write_texttype (short int dt) |
write TEXTTYPE More... | |
void | gds_write_generations (short int gens) |
write GENERATIONS More... | |
void | gds_write_pathtype (short int pt) |
write PATHTYPE More... | |
void | gds_write_presentation (int font, int vp, int hp) |
write PRESENTATION More... | |
void | gds_write_strans (BOOL reflect, BOOL abs_angle, BOOL abs_mag) |
write STRANS More... | |
void | gds_write_xy (const int *x, const int *y, int n, bool has_last=true) |
write XY More... | |
void | gds_write_colrow (int ncols, int nrows) |
write COLROW More... | |
void | gds_write_units (double dbu_uu, double dbu_m) |
write UNITS More... | |
void | gds_write_mag (double mag) |
write MAG More... | |
void | gds_write_angle (double angle) |
write ANGLE More... | |
void | gds_create_lib (const char *libname, double dbu_um) |
create library with name and unit More... | |
void | gds_create_text (const char *str, int x, int y, int layer, int size) |
wrapper to create text More... | |
Protected Member Functions | |
int | gds_write (const char *b, std::size_t n) |
void | gds_flush () |
flush all contents in the buffer | |
Protected Attributes | |
GdsStream * | m_os |
output stream | |
BYTE | gdsswap |
moved from global variables | |
short | gdsword |
move from global variables | |
std::size_t | m_capacity |
output buffer capacity | |
std::size_t | m_size |
output buffer size | |
char * | m_buffer |
output buffer | |
write GDSII
Definition at line 90 of file GdsWriter.h.
GdsParser::GdsWriter::GdsWriter | ( | const char * | filename | ) |
constructor
filename | output file name |
void GdsParser::GdsWriter::create_lib | ( | const char * | libname, |
double | dbu_uu, | ||
double | dbu_m | ||
) |
create GDSII library
libname | name of the library |
dbu_uu | is user unit, 1nm per bit |
dbu_m | is database unit in meter, usually 1e-9 this wrapper is different from gds_create_lib in terms of units |
char* GdsParser::GdsWriter::gds_adjust_string | ( | const char * | input, |
int * | output_length | ||
) |
handle string with odd length; generate new string output and return its length
input | a string |
output_length | result length |
void GdsParser::GdsWriter::gds_create_lib | ( | const char * | libname, |
double | dbu_um | ||
) |
create library with name and unit
libname | name of library |
dbu_um | database unit in microns, usually 1e-6 |
void GdsParser::GdsWriter::gds_create_text | ( | const char * | str, |
int | x, | ||
int | y, | ||
int | layer, | ||
int | size | ||
) |
wrapper to create text
str | text |
x | x position |
y | y position |
layer | layer |
size | text size |
void GdsParser::GdsWriter::gds_swap2bytes | ( | BYTE * | two | ) |
swap bytes
two | 2-byte of data |
void GdsParser::GdsWriter::gds_swap4bytes | ( | BYTE * | four | ) |
swap bytes
four | 4-byte of data |
|
protected |
a buffered putting scheme to speedup writing
void GdsParser::GdsWriter::gds_write_angle | ( | double | angle | ) |
write ANGLE
angle | angle in degree |
void GdsParser::GdsWriter::gds_write_boxtype | ( | short int | dt | ) |
write BOXTYPE
dt | data type |
void GdsParser::GdsWriter::gds_write_colrow | ( | int | ncols, |
int | nrows | ||
) |
write COLROW
ncols | number of columns |
nrows | number of rows |
void GdsParser::GdsWriter::gds_write_datatype | ( | short int | dt | ) |
write DATATYPE
dt | data type |
void GdsParser::GdsWriter::gds_write_generations | ( | short int | gens | ) |
write GENERATIONS
gens | generations |
void GdsParser::GdsWriter::gds_write_layer | ( | short int | layer | ) |
write LAYER
layer | layer |
void GdsParser::GdsWriter::gds_write_libname | ( | const char * | name | ) |
write LIBNAME
name | name of library |
void GdsParser::GdsWriter::gds_write_mag | ( | double | mag | ) |
write MAG
mag | magnification |
void GdsParser::GdsWriter::gds_write_pathtype | ( | short int | pt | ) |
write PATHTYPE
pt | path type |
void GdsParser::GdsWriter::gds_write_presentation | ( | int | font, |
int | vp, | ||
int | hp | ||
) |
write PRESENTATION
font | font number 0, 1, 2, 3 |
vp | vertical presentation 0 = top 1 = middle 2 = bottom |
hp | horizontal presentation 0 = left 1 = center 2 = right |
void GdsParser::GdsWriter::gds_write_sname | ( | const char * | s | ) |
write SNAME
s | string |
write STRANS
reflect | reflect about X axis before rotation (normally false) |
abs_angle | angles are absolute (normally false) |
abs_mag | magnification (scale) is absolute (normally false) |
void GdsParser::GdsWriter::gds_write_string | ( | const char * | s | ) |
write STRING
s | string |
void GdsParser::GdsWriter::gds_write_strname | ( | const char * | name | ) |
write STRNAME
name | name |
void GdsParser::GdsWriter::gds_write_texttype | ( | short int | dt | ) |
write TEXTTYPE
dt | text type |
void GdsParser::GdsWriter::gds_write_units | ( | double | dbu_uu, |
double | dbu_m | ||
) |
write UNITS
dbu_uu | database unit in user units, usually 0.001 |
dbu_m | database unit in meters, usually 1e-9 |
void GdsParser::GdsWriter::gds_write_width | ( | int | width | ) |
write WIDTH
width | width |
void GdsParser::GdsWriter::gds_write_xy | ( | const int * | x, |
const int * | y, | ||
int | n, | ||
bool | has_last = true |
||
) |
write XY
x | array of x coordinates |
y | array of y coordinates |
n | length of array |
has_last | if true, it means the last point is the same as the first point; otherwise, we need to add one point to the end. Default value is true. |
void GdsParser::GdsWriter::write_boundary | ( | int | layer, |
int | datatype, | ||
std::vector< int > const & | vx, | ||
std::vector< int > const & | vy, | ||
bool | has_last = true |
||
) |
write a boundary object
layer | layer |
datatype | data type |
vx | array of x coordinates |
vy | array of y coordinates |
has_last | if true, it means the last point is the same as the first point; otherwise, we need to add one point to the end. Default value is true |
void GdsParser::GdsWriter::write_box | ( | int | layer, |
int | datatype, | ||
int | xl, | ||
int | yl, | ||
int | xh, | ||
int | yh | ||
) |
write a box object
layer | layer |
datatype | data type |
xl,yl,xh,yh | coordinates of the box |