KiCad PCB EDA Suite
|
DRAWING_SHEET_PARSER holds data and functions pertinent to parsing a S-expression file for a DS_DATA_MODEL. More...
Public Member Functions | |
DRAWING_SHEET_PARSER (const char *aLine, const wxString &aSource) | |
void | Parse (DS_DATA_MODEL *aLayout) |
Private Member Functions | |
void | parseHeader (T aHeaderType) |
Parse the data specified at the very beginning of the file, like version and the application used to create this file. | |
int | parseInt () |
Parse an integer. | |
int | parseInt (int aMin, int aMax) |
Parse an integer and constrain it between two values. | |
double | parseDouble () |
Parse a double. | |
void | parseSetup (DS_DATA_MODEL *aLayout) |
void | parseGraphic (DS_DATA_ITEM *aItem) |
Parse a graphic item starting by "(line" or "(rect" and read parameters. | |
void | parseText (DS_DATA_ITEM_TEXT *aItem) |
Parse a text item starting by "(tbtext" and read parameters. | |
void | parsePolygon (DS_DATA_ITEM_POLYGONS *aItem) |
Parse a polygon item starting by "( polygon" and read parameters. | |
void | parsePolyOutline (DS_DATA_ITEM_POLYGONS *aItem) |
Parse a list of corners starting by "( pts" and read coordinates. | |
void | parseBitmap (DS_DATA_ITEM_BITMAP *aItem) |
Parse a bitmap item starting by "( bitmap" and read parameters. | |
void | parseCoordinate (POINT_COORD &aCoord) |
void | readOption (DS_DATA_ITEM *aItem) |
void | readPngdata (DS_DATA_ITEM_BITMAP *aItem) |
Private Attributes | |
int | m_requiredVersion |
wxString | m_generatorVersion |
DRAWING_SHEET_PARSER holds data and functions pertinent to parsing a S-expression file for a DS_DATA_MODEL.
Definition at line 49 of file drawing_sheet_parser.cpp.
DRAWING_SHEET_PARSER::DRAWING_SHEET_PARSER | ( | const char * | aLine, |
const wxString & | aSource | ||
) |
Definition at line 121 of file drawing_sheet_parser.cpp.
void DRAWING_SHEET_PARSER::Parse | ( | DS_DATA_MODEL * | aLayout | ) |
Definition at line 203 of file drawing_sheet_parser.cpp.
References DS_DATA_MODEL::Append(), convertLegacyVariableRefs(), DS_DATA_ITEM::DS_RECT, DS_DATA_ITEM::DS_SEGMENT, m_generatorVersion, m_requiredVersion, parseBitmap(), parseGraphic(), parseHeader(), parsePolygon(), parseSetup(), parseText(), DS_DATA_MODEL::SetFileFormatVersionAtLoad(), and SEXPR_WORKSHEET_FILE_VERSION.
Referenced by DS_DATA_MODEL::LoadDrawingSheet(), and DS_DATA_MODEL::SetPageLayout().
|
private |
Parse a bitmap item starting by "( bitmap" and read parameters.
Definition at line 482 of file drawing_sheet_parser.cpp.
References _, image, DS_DATA_ITEM_BITMAP::m_ImageBitmap, DS_DATA_ITEM::m_IncrementVector, DS_DATA_ITEM::m_Info, DS_DATA_ITEM::m_LineWidth, DS_DATA_ITEM::m_Name, DS_DATA_ITEM::m_Pos, DS_DATA_ITEM::m_RepeatCount, parseCoordinate(), parseDouble(), parseInt(), BITMAP_BASE::ReadImageFile(), readOption(), readPngdata(), BITMAP_BASE::SetScale(), THROW_IO_ERROR, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Parse().
|
private |
Definition at line 862 of file drawing_sheet_parser.cpp.
References LB_CORNER, LT_CORNER, POINT_COORD::m_Anchor, POINT_COORD::m_Pos, parseDouble(), RB_CORNER, RT_CORNER, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by parseBitmap(), parseGraphic(), parsePolygon(), and parseText().
|
private |
Parse a double.
Definition at line 903 of file drawing_sheet_parser.cpp.
References DSNLEXER::parseDouble().
Referenced by parseBitmap(), parseCoordinate(), parseGraphic(), parsePolygon(), parsePolyOutline(), parseSetup(), and parseText().
|
private |
Parse a graphic item starting by "(line" or "(rect" and read parameters.
Definition at line 624 of file drawing_sheet_parser.cpp.
References DS_DATA_ITEM::m_End, DS_DATA_ITEM::m_IncrementVector, DS_DATA_ITEM::m_Info, DS_DATA_ITEM::m_LineWidth, DS_DATA_ITEM::m_Name, DS_DATA_ITEM::m_Pos, DS_DATA_ITEM::m_RepeatCount, parseCoordinate(), parseDouble(), parseInt(), readOption(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Parse().
|
private |
Parse the data specified at the very beginning of the file, like version and the application used to create this file.
Definition at line 299 of file drawing_sheet_parser.cpp.
References m_requiredVersion, and parseInt().
Referenced by Parse().
|
private |
Parse an integer.
Definition at line 880 of file drawing_sheet_parser.cpp.
Referenced by parseBitmap(), parseGraphic(), parseHeader(), parseInt(), parsePolygon(), and parseText().
|
private |
Parse an integer and constrain it between two values.
aMin | is the smallest return value. |
aMax | is the largest return value. |
Definition at line 890 of file drawing_sheet_parser.cpp.
References parseInt().
|
private |
Parse a polygon item starting by "( polygon" and read parameters.
the list of corners included in this description is read by parsePolyOutline.
Definition at line 388 of file drawing_sheet_parser.cpp.
References DS_DATA_ITEM_POLYGONS::CloseContour(), DEGREES_T, DS_DATA_ITEM::m_IncrementVector, DS_DATA_ITEM::m_Info, DS_DATA_ITEM::m_LineWidth, DS_DATA_ITEM::m_Name, DS_DATA_ITEM_POLYGONS::m_Orient, DS_DATA_ITEM::m_Pos, DS_DATA_ITEM::m_RepeatCount, parseCoordinate(), parseDouble(), parseInt(), parsePolyOutline(), readOption(), DS_DATA_ITEM_POLYGONS::SetBoundingBox(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Parse().
|
private |
Parse a list of corners starting by "( pts" and read coordinates.
Definition at line 456 of file drawing_sheet_parser.cpp.
References DS_DATA_ITEM_POLYGONS::AppendCorner(), parseDouble(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by parsePolygon().
|
private |
Definition at line 331 of file drawing_sheet_parser.cpp.
References DS_DATA_MODEL::AllowVoidList(), DS_DATA_MODEL::m_DefaultLineWidth, DS_DATA_MODEL::m_DefaultTextSize, DS_DATA_MODEL::m_DefaultTextThickness, parseDouble(), DS_DATA_MODEL::SetBottomMargin(), DS_DATA_MODEL::SetLeftMargin(), DS_DATA_MODEL::SetRightMargin(), DS_DATA_MODEL::SetTopMargin(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Parse().
|
private |
Parse a text item starting by "(tbtext" and read parameters.
Definition at line 696 of file drawing_sheet_parser.cpp.
References KIGFX::COLOR4D::a, KIGFX::COLOR4D::b, ConvertToNewOverbarNotation(), KIGFX::COLOR4D::g, KIFONT::FONT::GetFont(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_TOP, DS_DATA_ITEM_TEXT::m_Bold, DS_DATA_ITEM_TEXT::m_BoundingBoxSize, DS_DATA_ITEM_TEXT::m_Font, DS_DATA_ITEM_TEXT::m_Hjustify, DS_DATA_ITEM::m_IncrementLabel, DS_DATA_ITEM::m_IncrementVector, DS_DATA_ITEM::m_Info, DS_DATA_ITEM_TEXT::m_Italic, DS_DATA_ITEM::m_LineWidth, DS_DATA_ITEM::m_Name, DS_DATA_ITEM_TEXT::m_Orient, DS_DATA_ITEM::m_Pos, DS_DATA_ITEM::m_RepeatCount, m_requiredVersion, DS_DATA_ITEM_TEXT::m_TextBase, DS_DATA_ITEM_TEXT::m_TextColor, DS_DATA_ITEM_TEXT::m_TextSize, DS_DATA_ITEM_TEXT::m_Vjustify, parseCoordinate(), parseDouble(), parseInt(), KIGFX::COLOR4D::r, readOption(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Parse().
|
private |
Definition at line 610 of file drawing_sheet_parser.cpp.
References FIRST_PAGE_ONLY, DS_DATA_ITEM::SetPage1Option(), and SUBSEQUENT_PAGES.
Referenced by parseBitmap(), parseGraphic(), parsePolygon(), and parseText().
|
private |
Definition at line 577 of file drawing_sheet_parser.cpp.
References BITMAP_BASE::LoadLegacyData(), and DS_DATA_ITEM_BITMAP::m_ImageBitmap.
Referenced by parseBitmap().
|
private |
Definition at line 57 of file drawing_sheet_parser.cpp.
Referenced by Parse().
|
private |
Definition at line 56 of file drawing_sheet_parser.cpp.
Referenced by Parse(), parseHeader(), and parseText().