|
KiCad PCB EDA Suite
|
Enumerations | |
| enum class | FILE_STATE { FILE_START = 0 , FILE_HEADER , FILE_OUTLINE , FILE_PLACEMENT , FILE_INVALID , FILE_ERROR } |
| State values for the IDF parser's input. More... | |
| enum class | IDF_VERSION { IDF_V2 = 0 , IDF_V3 } |
| The supported IDF versions (3.0 and 2.0 ONLY). More... | |
| enum class | KEY_OWNER { UNOWNED = 0 , MCAD , ECAD } |
| The type of CAD which has ownership an object. More... | |
| enum class | KEY_HOLETYPE { PIN = 0 , VIA , MTG , TOOL , OTHER } |
| The purpose of an IDF hole. More... | |
| enum class | KEY_PLATING { PTH = 0 , NPTH } |
| The plating condition of a hole. More... | |
| enum class | KEY_REFDES { BOARD = 0 , NOREFDES , PANEL , REFDES } |
| A component's Reference Designator. More... | |
| enum class | CAD_TYPE { CAD_ELEC = 0 , CAD_MECH , CAD_INVALID } |
| The class of CAD program which is opening or modifying a file. More... | |
| enum class | IDF_LAYER { LYR_TOP = 0 , LYR_BOTTOM , LYR_BOTH , LYR_INNER , LYR_ALL , LYR_INVALID } |
| The various IDF layer classes and groupings. More... | |
| enum class | OUTLINE_TYPE { OTLN_BOARD = 0 , OTLN_OTHER , OTLN_PLACE , OTLN_ROUTE , OTLN_PLACE_KEEPOUT , OTLN_ROUTE_KEEPOUT , OTLN_VIA_KEEPOUT , OTLN_GROUP_PLACE , OTLN_COMPONENT , OTLN_INVALID } |
| The class of outline. More... | |
| enum class | COMP_TYPE { COMP_ELEC = 0 , COMP_MECH , COMP_INVALID } |
| Whether a component is a mechanical or electrical part. More... | |
| enum class | IDF_UNIT { UNIT_MM = 0 , UNIT_THOU , UNIT_TNM , UNIT_INVALID } |
| The native unit of the board and of component outlines. More... | |
| enum class | IDF_PLACEMENT { PS_UNPLACED = 0 , PS_PLACED , PS_MCAD , PS_ECAD , PS_INVALID } |
| The placement status of a component. More... | |
Functions | |
| double | CalcAngleRad (const IDF_POINT &aStartPoint, const IDF_POINT &aEndPoint) |
| Calculate the angle (radians) between the horizon and the segment aStartPoint to aEndPoint. | |
| double | CalcAngleDeg (const IDF_POINT &aStartPoint, const IDF_POINT &aEndPoint) |
| Calculate the angle (degrees) between the horizon and the segment aStartPoint to aEndPoint. | |
| void | GetOutline (std::list< IDF_SEGMENT * > &aLines, IDF_OUTLINE &aOutline) |
| Take contiguous elements from 'aLines' and stuffs them into 'aOutline'; elements put into the outline are deleted from aLines. | |
| bool | FetchIDFLine (std::istream &aModel, std::string &aLine, bool &isComment, std::streampos &aFilePos) |
| Retrieve a single line from an IDF file and performs minimal processing. | |
| bool | GetIDFString (const std::string &aLine, std::string &aIDFString, bool &hasQuotes, int &aIndex) |
| Parse a line retrieved via FetchIDFLine() and returns the first IDF string found from the starting point aIndex. | |
| bool | CompareToken (const char *aTokenString, const std::string &aInputString) |
| Perform a case-insensitive comparison of a token string and an input string. | |
| bool | ParseOwner (const std::string &aToken, IDF3::KEY_OWNER &aOwner) |
| Parse the input string for a valid IDF Owner type. | |
| bool | ParseIDFLayer (const std::string &aToken, IDF3::IDF_LAYER &aLayer) |
| Parse an input string for a valid IDF layer specification. | |
| bool | WriteLayersText (std::ostream &aBoardFile, IDF3::IDF_LAYER aLayer) |
| Write out text corresponding to the given IDF Layer type. | |
| std::string | GetPlacementString (IDF3::IDF_PLACEMENT aPlacement) |
| Return a string representing the given IDF Placement type. | |
| std::string | GetLayerString (IDF3::IDF_LAYER aLayer) |
| Return a string representing the given IDF Layer type. | |
| std::string | GetOwnerString (IDF3::KEY_OWNER aOwner) |
|
strong |
The class of CAD program which is opening or modifying a file.
| Enumerator | |
|---|---|
| CAD_ELEC | |
| CAD_MECH | |
| CAD_INVALID | |
Definition at line 126 of file idf_common.h.
|
strong |
Whether a component is a mechanical or electrical part.
| Enumerator | |
|---|---|
| COMP_ELEC | |
| COMP_MECH | |
| COMP_INVALID | |
Definition at line 166 of file idf_common.h.
|
strong |
State values for the IDF parser's input.
| Enumerator | |
|---|---|
| FILE_START | |
| FILE_HEADER | |
| FILE_OUTLINE | |
| FILE_PLACEMENT | |
| FILE_INVALID | |
| FILE_ERROR | |
Definition at line 62 of file idf_common.h.
|
strong |
The various IDF layer classes and groupings.
| Enumerator | |
|---|---|
| LYR_TOP | |
| LYR_BOTTOM | |
| LYR_BOTH | |
| LYR_INNER | |
| LYR_ALL | |
| LYR_INVALID | |
Definition at line 136 of file idf_common.h.
|
strong |
The placement status of a component.
| Enumerator | |
|---|---|
| PS_UNPLACED | |
| PS_PLACED | |
| PS_MCAD | |
| PS_ECAD | |
| PS_INVALID | |
Definition at line 187 of file idf_common.h.
|
strong |
The native unit of the board and of component outlines.
| Enumerator | |
|---|---|
| UNIT_MM | |
| UNIT_THOU | |
| UNIT_TNM | |
| UNIT_INVALID | |
Definition at line 176 of file idf_common.h.
|
strong |
The supported IDF versions (3.0 and 2.0 ONLY).
| Enumerator | |
|---|---|
| IDF_V2 | |
| IDF_V3 | |
Definition at line 75 of file idf_common.h.
|
strong |
The purpose of an IDF hole.
| Enumerator | |
|---|---|
| PIN | |
| VIA | |
| MTG | |
| TOOL | |
| OTHER | |
Definition at line 94 of file idf_common.h.
|
strong |
The type of CAD which has ownership an object.
| Enumerator | |
|---|---|
| UNOWNED | |
| MCAD | |
| ECAD | |
Definition at line 84 of file idf_common.h.
|
strong |
|
strong |
A component's Reference Designator.
| Enumerator | |
|---|---|
| BOARD | |
| NOREFDES | |
| PANEL | |
| REFDES | |
Definition at line 115 of file idf_common.h.
|
strong |
The class of outline.
| Enumerator | |
|---|---|
| OTLN_BOARD | |
| OTLN_OTHER | |
| OTLN_PLACE | |
| OTLN_ROUTE | |
| OTLN_PLACE_KEEPOUT | |
| OTLN_ROUTE_KEEPOUT | |
| OTLN_VIA_KEEPOUT | |
| OTLN_GROUP_PLACE | |
| OTLN_COMPONENT | |
| OTLN_INVALID | |
Definition at line 149 of file idf_common.h.
Calculate the angle (degrees) between the horizon and the segment aStartPoint to aEndPoint.
| aStartPoint | is the start point of a line segment. |
| aEndPoint | is the end point of a line segment. |
Definition at line 826 of file idf_common.cpp.
References CalcAngleRad(), and M_PI.
Referenced by IDF_SEGMENT::CalcCenterAndRadius(), IDF_SEGMENT::IDF_SEGMENT(), and IDF_SEGMENT::SwapEnds().
Calculate the angle (radians) between the horizon and the segment aStartPoint to aEndPoint.
| aStartPoint | is the start point of a line segment. |
| aEndPoint | is the end point of a line segment. |
Definition at line 820 of file idf_common.cpp.
References IDF_POINT::x, and IDF_POINT::y.
Referenced by CalcAngleDeg(), and IDF_SEGMENT::CalcCenterAndRadius().
| bool IDF3::CompareToken | ( | const char * | aTokenString, |
| const std::string & | aInputString ) |
Perform a case-insensitive comparison of a token string and an input string.
| aToken | is an IDF token such as ".HEADER". |
| aInputString | is a string typically retrieved via GetIDFString. |
Definition at line 129 of file idf_helpers.cpp.
Referenced by IDF3_BOARD::addCompDrill(), IDF3_BOARD::addCompDrill(), IDF3_BOARD::AddDrill(), IDF3_COMPONENT::AddDrill(), IDF3_BOARD::GetComponentOutline(), ParseIDFLayer(), ParseOwner(), IDF_DRILL_DATA::read(), IDF3_BOARD::readBrdHeader(), IDF3_BOARD::readBrdSection(), BOARD_OUTLINE::readData(), GROUP_OUTLINE::readData(), IDF3_COMP_OUTLINE::readData(), OTHER_OUTLINE::readData(), PLACE_OUTLINE::readData(), ROUTE_OUTLINE::readData(), IDF3_BOARD::readLibHeader(), IDF3_BOARD::readLibSection(), IDF_NOTE::readNote(), BOARD_OUTLINE::readOutlines(), IDF3_COMP_OUTLINE_DATA::readPlaceData(), IDF3_COMP_OUTLINE::readProperties(), IDF3_COMPONENT::SetRefDes(), and IDF3_COMP_OUTLINE_DATA::writePlaceData().
| bool IDF3::FetchIDFLine | ( | std::istream & | aModel, |
| std::string & | aLine, | ||
| bool & | isComment, | ||
| std::streampos & | aFilePos ) |
Retrieve a single line from an IDF file and performs minimal processing.
If a comment symbol is encountered then it is removed and a single leading space is removed if present; all trailing spaces are removed. If the line is not a comment then all leading and trailing spaces are stripped.
| [in] | aModel | is an open IDFv3 file. |
| [out] | aLine | is the line retrieved from the file. |
| [out] | isComment | is set to true if the line is a comment. |
| [out] | aFilePosis | set to the beginning of the line in case the file needs to be rewound. |
Definition at line 32 of file idf_helpers.cpp.
Referenced by IDF3_BOARD::GetComponentOutline(), IDF_DRILL_DATA::read(), IDF3_BOARD::readBoardFile(), IDF3_BOARD::readBrdHeader(), IDF3_BOARD::readBrdSection(), BOARD_OUTLINE::readData(), GROUP_OUTLINE::readData(), IDF3_COMP_OUTLINE::readData(), OTHER_OUTLINE::readData(), PLACE_OUTLINE::readData(), ROUTE_OUTLINE::readData(), IDF3_BOARD::readLibHeader(), IDF3_BOARD::readLibSection(), IDF_NOTE::readNote(), BOARD_OUTLINE::readOutlines(), IDF3_COMP_OUTLINE_DATA::readPlaceData(), and IDF3_COMP_OUTLINE::readProperties().
| bool IDF3::GetIDFString | ( | const std::string & | aLine, |
| std::string & | aIDFString, | ||
| bool & | hasQuotes, | ||
| int & | aIndex ) |
Parse a line retrieved via FetchIDFLine() and returns the first IDF string found from the starting point aIndex.
| [in] | aLine | is the line to parse. |
| [out] | aIDFString | is the IDF string retrieved. |
| [out] | hasQuotes | is true if the string was in quotation marks. |
| [in,out] | aIndex | is the index into the input line. |
Definition at line 68 of file idf_helpers.cpp.
References ERROR_IDF.
Referenced by IDF_DRILL_DATA::read(), IDF3_BOARD::readBrdHeader(), IDF3_BOARD::readBrdSection(), BOARD_OUTLINE::readData(), GROUP_OUTLINE::readData(), IDF3_COMP_OUTLINE::readData(), OTHER_OUTLINE::readData(), PLACE_OUTLINE::readData(), ROUTE_OUTLINE::readData(), IDF3_BOARD::readLibHeader(), IDF3_BOARD::readLibSection(), IDF_NOTE::readNote(), BOARD_OUTLINE::readOutlines(), IDF3_COMP_OUTLINE_DATA::readPlaceData(), and IDF3_COMP_OUTLINE::readProperties().
| std::string IDF3::GetLayerString | ( | IDF3::IDF_LAYER | aLayer | ) |
Return a string representing the given IDF Layer type.
| aLayer | is the IDF layer type to encode as a string. |
Definition at line 271 of file idf_helpers.cpp.
References LYR_ALL, LYR_BOTH, LYR_BOTTOM, LYR_INNER, and LYR_TOP.
Referenced by IDF3_COMP_OUTLINE_DATA::readPlaceData(), IDF3_COMPONENT::SetPosition(), and IDF3_COMP_OUTLINE_DATA::writePlaceData().
| void IDF3::GetOutline | ( | std::list< IDF_SEGMENT * > & | aLines, |
| IDF_OUTLINE & | aOutline ) |
Take contiguous elements from 'aLines' and stuffs them into 'aOutline'; elements put into the outline are deleted from aLines.
This function is useful for sorting the jumbled mess of line segments and arcs which represent a board outline and cutouts in KiCad. The function will determine which segment element within aLines contains the leftmost point and retrieve the outline of which that segment is part.
| aLines | (input/output) is a list of IDF segments which comprise an outline and cutouts. |
| aOutline | (output) is the ordered set of segments/ |
Definition at line 839 of file idf_common.cpp.
References IDF_SEGMENT::angle, IDF_OUTLINE::back(), IDF_OUTLINE::Clear(), IDF_SEGMENT::endPoint, IDF_OUTLINE::front(), IDF_SEGMENT::IsCircle(), IDF_SEGMENT::MatchesStart(), MIN_ANG, IDF_OUTLINE::push(), IDF_OUTLINE::size(), and IDF_SEGMENT::startPoint.
Referenced by IDF_EXPORTER::createOutlineFromExtrudedBody(), IDF_EXPORTER::exportFootprint(), and idf_export_outline().
| std::string IDF3::GetOwnerString | ( | IDF3::KEY_OWNER | aOwner | ) |
Definition at line 301 of file idf_helpers.cpp.
References ECAD, MCAD, and UNOWNED.
Referenced by CheckOwnership().
| std::string IDF3::GetPlacementString | ( | IDF3::IDF_PLACEMENT | aPlacement | ) |
Return a string representing the given IDF Placement type.
| aPlacement | is the IDF placement type to encode as a string. |
Definition at line 244 of file idf_helpers.cpp.
References PS_ECAD, PS_MCAD, PS_PLACED, and PS_UNPLACED.
Referenced by IDF3_BOARD::checkComponentOwnership(), IDF3_COMP_OUTLINE_DATA::checkOwnership(), IDF3_COMPONENT::checkOwnership(), and IDF3_COMP_OUTLINE_DATA::readPlaceData().
| bool IDF3::ParseIDFLayer | ( | const std::string & | aToken, |
| IDF3::IDF_LAYER & | aLayer ) |
Parse an input string for a valid IDF layer specification.
| [in] | aToken | is the string to be parsed. |
| [out] | aLayer | is the IDF Layer type or group. |
Definition at line 169 of file idf_helpers.cpp.
References CompareToken(), ERROR_IDF, LYR_ALL, LYR_BOTH, LYR_BOTTOM, LYR_INNER, LYR_INVALID, and LYR_TOP.
Referenced by GROUP_OUTLINE::readData(), OTHER_OUTLINE::readData(), PLACE_OUTLINE::readData(), and ROUTE_OUTLINE::readData().
| bool IDF3::ParseOwner | ( | const std::string & | aToken, |
| IDF3::KEY_OWNER & | aOwner ) |
Parse the input string for a valid IDF Owner type.
| [in] | aToken | is the string to be parsed. |
| [out] | aOwner | is the IDF Owner class. |
Definition at line 145 of file idf_helpers.cpp.
References CompareToken(), ECAD, ERROR_IDF, MCAD, and UNOWNED.
Referenced by IDF_DRILL_DATA::read(), BOARD_OUTLINE::readData(), GROUP_OUTLINE::readData(), OTHER_OUTLINE::readData(), PLACE_OUTLINE::readData(), and ROUTE_OUTLINE::readData().
| bool IDF3::WriteLayersText | ( | std::ostream & | aBoardFile, |
| IDF3::IDF_LAYER | aLayer ) |
Write out text corresponding to the given IDF Layer type.
| [in] | aBoardFile | is an IDFv3 file open for output. |
| aLayer | is the IDF Layer type. |
Definition at line 204 of file idf_helpers.cpp.
References LYR_ALL, LYR_BOTH, LYR_BOTTOM, LYR_INNER, and LYR_TOP.
Referenced by GROUP_OUTLINE::writeData(), OTHER_OUTLINE::writeData(), PLACE_OUTLINE::writeData(), ROUTE_OUTLINE::writeData(), and IDF3_COMP_OUTLINE_DATA::writePlaceData().