|
KiCad PCB EDA Suite
|
IDFv3 BOARD OUTLINE data and is the basis of other IDFv3 outline objects. More...
#include <idf_outlines.h>
Public Member Functions | |
| BOARD_OUTLINE () | |
| virtual | ~BOARD_OUTLINE () |
| virtual bool | SetUnit (IDF3::IDF_UNIT aUnit) |
| Function SetUnit sets the native unit of the outline; except for component outlines this must be the same as the native unit of the parent IDF_BOARD object. | |
| virtual IDF3::IDF_UNIT | GetUnit (void) |
| Return the native unit type of the outline. | |
| virtual bool | SetThickness (double aThickness) |
| Set the thickness or height of the outline (mm). | |
| virtual double | GetThickness (void) |
| virtual bool | Clear (void) |
| Free memory and reinitializes all internal data except for the parent pointer. | |
| IDF3::OUTLINE_TYPE | GetOutlineType (void) |
| IDF3_BOARD * | GetParent (void) |
| bool | AddOutline (IDF_OUTLINE *aOutline) |
| Add the specified outline to this object. | |
| bool | DelOutline (IDF_OUTLINE *aOutline) |
| Remove the given outline, subject to IDF ownership rules, if it is owned by this object. | |
| bool | DelOutline (size_t aIndex) |
| Delete the outline specified by the given index, subject to IDF ownership rules. | |
| const std::list< IDF_OUTLINE * > * | GetOutlines (void) |
| Return outlines list. | |
| size_t | OutlinesSize (void) |
| IDF_OUTLINE * | GetOutline (size_t aIndex) |
| Return a pointer to the outline as specified by aIndex. | |
| IDF3::KEY_OWNER | GetOwner (void) |
| bool | SetOwner (IDF3::KEY_OWNER aOwner) |
| Set the ownership status of the outline subject to IDF ownership rules. | |
| bool | IsSingle (void) |
| void | ClearOutlines (void) |
| Clear internal data except for the parent pointer. | |
| void | AddComment (const std::string &aComment) |
| Add a comment to the outline data. | |
| size_t | CommentsSize (void) |
| std::list< std::string > * | GetComments (void) |
| const std::string * | GetComment (size_t aIndex) |
| bool | DeleteComment (size_t aIndex) |
| Deletes a comment based on the given index. | |
| void | ClearComments (void) |
| Deletes all comments. | |
| const std::string & | GetError (void) |
Protected Member Functions | |
| void | readOutlines (std::istream &aBoardFile, IDF3::IDF_VERSION aIdfVersion) |
| bool | writeComments (std::ostream &aBoardFile) |
| bool | writeOwner (std::ostream &aBoardFile) |
| void | writeOutline (std::ostream &aBoardFile, IDF_OUTLINE *aOutline, size_t aIndex) |
| void | writeOutlines (std::ostream &aBoardFile) |
| void | clearOutlines (void) |
| void | setParent (IDF3_BOARD *aParent) |
| Set the parent IDF_BOARD object. | |
| bool | addOutline (IDF_OUTLINE *aOutline) |
| virtual bool | setThickness (double aThickness) |
| virtual void | clear (void) |
| virtual void | readData (std::istream &aBoardFile, const std::string &aHeader, IDF3::IDF_VERSION aIdfVersion) |
| Read data from a .BOARD_OUTLINE section. | |
| virtual void | writeData (std::ostream &aBoardFile) |
| Write the comments and .BOARD_OUTLINE section to an IDFv3 file. | |
Protected Attributes | |
| std::string | errormsg |
| std::list< IDF_OUTLINE * > | outlines |
| IDF3::KEY_OWNER | owner |
| IDF3::OUTLINE_TYPE | outlineType |
| bool | single |
| std::list< std::string > | comments |
| IDF3::IDF_UNIT | unit |
| IDF3_BOARD * | parent |
| double | thickness |
Friends | |
| class | IDF3_BOARD |
IDFv3 BOARD OUTLINE data and is the basis of other IDFv3 outline objects.
Definition at line 86 of file idf_outlines.h.
| BOARD_OUTLINE::BOARD_OUTLINE | ( | ) |
Definition at line 128 of file idf_outlines.cpp.
References IDF3::OTLN_BOARD, outlineType, owner, parent, single, thickness, unit, IDF3::UNIT_MM, and IDF3::UNOWNED.
|
virtual |
Definition at line 139 of file idf_outlines.cpp.
References clear().
| void BOARD_OUTLINE::AddComment | ( | const std::string & | aComment | ) |
Add a comment to the outline data.
This function is not subject to IDF ownership rules.
Definition at line 1520 of file idf_outlines.cpp.
References comments.
Referenced by IDF3_BOARD::GetComponentOutline(), IDF3_BOARD::readBrdSection(), and IDF3_BOARD::readLibSection().
| bool BOARD_OUTLINE::AddOutline | ( | IDF_OUTLINE * | aOutline | ) |
Add the specified outline to this object.
| aOutline | is a valid IDF outline. |
Definition at line 1326 of file idf_outlines.cpp.
References addOutline(), CheckOwnership(), errormsg, outlineType, owner, and parent.
Referenced by IDF_EXPORTER::createOutlineFromExtrudedBody().
|
protected |
Definition at line 1296 of file idf_outlines.cpp.
References errormsg, and outlines.
Referenced by AddOutline().
|
virtual |
Free memory and reinitializes all internal data except for the parent pointer.
Reimplemented in GROUP_OUTLINE, IDF3_COMP_OUTLINE, OTHER_OUTLINE, PLACE_OUTLINE, and ROUTE_OUTLINE.
Definition at line 1271 of file idf_outlines.cpp.
References CheckOwnership(), clear(), errormsg, outlineType, owner, and parent.
|
protectedvirtual |
Definition at line 1261 of file idf_outlines.cpp.
References clearOutlines(), comments, owner, and IDF3::UNOWNED.
Referenced by Clear(), GROUP_OUTLINE::Clear(), IDF3_COMP_OUTLINE::Clear(), OTHER_OUTLINE::Clear(), PLACE_OUTLINE::Clear(), ROUTE_OUTLINE::Clear(), and ~BOARD_OUTLINE().
| void BOARD_OUTLINE::ClearComments | ( | void | ) |
| void BOARD_OUTLINE::ClearOutlines | ( | void | ) |
Clear internal data except for the parent pointer.
|
protected |
Definition at line 1505 of file idf_outlines.cpp.
References outlines.
Referenced by clear(), and readOutlines().
| size_t BOARD_OUTLINE::CommentsSize | ( | void | ) |
Definition at line 1529 of file idf_outlines.cpp.
References comments.
| bool BOARD_OUTLINE::DeleteComment | ( | size_t | aIndex | ) |
Deletes a comment based on the given index.
Definition at line 1555 of file idf_outlines.cpp.
References comments.
| bool BOARD_OUTLINE::DelOutline | ( | IDF_OUTLINE * | aOutline | ) |
Remove the given outline, subject to IDF ownership rules, if it is owned by this object.
The outline pointer remains valid and it is the user's responsibility to delete the object. The first outline in the list will never be deleted unless it is the sole remaining outline; this is to ensure that a board outline is not removed while the cutouts remain.
| aOutline | is a pointer to the outline to remove from the list. |
Definition at line 1337 of file idf_outlines.cpp.
References errormsg, GetOutlineTypeString(), outlines, and outlineType.
| bool BOARD_OUTLINE::DelOutline | ( | size_t | aIndex | ) |
Delete the outline specified by the given index, subject to IDF ownership rules.
The outline data is destroyed. The first outline in the list will never be deleted unless it is the sole remaining outline; this is to ensure that a board outline is not removed while the cutouts remain.
| aIndex | is an index to the outline to delete |
Definition at line 1395 of file idf_outlines.cpp.
References errormsg, GetOutlineTypeString(), outlines, and outlineType.
| const std::string * BOARD_OUTLINE::GetComment | ( | size_t | aIndex | ) |
Definition at line 1541 of file idf_outlines.cpp.
References comments.
| std::list< std::string > * BOARD_OUTLINE::GetComments | ( | void | ) |
Definition at line 1535 of file idf_outlines.cpp.
References comments.
|
inline |
Definition at line 253 of file idf_outlines.h.
References errormsg.
| IDF_OUTLINE * BOARD_OUTLINE::GetOutline | ( | size_t | aIndex | ) |
Return a pointer to the outline as specified by aIndex.
If the index is out of bounds NULL is returned and the error message is set. It is the responsibility of the user to observe IDF ownership rules.
Definition at line 1460 of file idf_outlines.cpp.
References errormsg, and outlines.
Referenced by MatchCompOutline().
| const std::list< IDF_OUTLINE * > * BOARD_OUTLINE::GetOutlines | ( | void | ) |
Return outlines list.
It is up to the user to respect the IDFv3 specification and avoid changes to this list which are in violation of the specification.
Definition at line 1448 of file idf_outlines.cpp.
References outlines.
Referenced by addOutline(), makeBoard(), and makeOtherOutlines().
| IDF3::OUTLINE_TYPE BOARD_OUTLINE::GetOutlineType | ( | void | ) |
Definition at line 145 of file idf_outlines.cpp.
References outlineType.
| IDF3::KEY_OWNER BOARD_OUTLINE::GetOwner | ( | void | ) |
Definition at line 1481 of file idf_outlines.cpp.
References owner.
| IDF3_BOARD * BOARD_OUTLINE::GetParent | ( | void | ) |
Definition at line 1290 of file idf_outlines.cpp.
References IDF3_BOARD, and parent.
|
virtual |
Definition at line 1040 of file idf_outlines.cpp.
References thickness.
Referenced by addOutline(), and makeOtherOutlines().
|
virtual |
Return the native unit type of the outline.
Definition at line 1005 of file idf_outlines.cpp.
References unit.
| bool BOARD_OUTLINE::IsSingle | ( | void | ) |
Definition at line 1499 of file idf_outlines.cpp.
References single.
| size_t BOARD_OUTLINE::OutlinesSize | ( | void | ) |
Definition at line 1454 of file idf_outlines.cpp.
References outlines.
Referenced by IDF_EXPORTER::createOutlineFromExtrudedBody(), and MatchCompOutline().
|
protectedvirtual |
Read data from a .BOARD_OUTLINE section.
In case of an unrecoverable error an exception is thrown. On a successful return the file pointer will be at the line following .END_BOARD_OUTLINE
| aBoardFile | is an IDFv3 file opened for reading. |
| aHeader | is the ".BOARD_OUTLINE" header line as read by FetchIDFLine. |
Reimplemented in GROUP_OUTLINE, IDF3_COMP_OUTLINE, OTHER_OUTLINE, PLACE_OUTLINE, and ROUTE_OUTLINE.
Definition at line 1045 of file idf_outlines.cpp.
References IDF3::CompareToken(), ERROR_IDF, IDF3::FetchIDFLine(), IDF3::GetIDFString(), GetOutlineTypeString(), IDF_THOU_TO_MM, IDF_TNM_TO_MM, IDF3::IDF_V2, outlineType, owner, IDF3::ParseOwner(), readOutlines(), thickness, unit, IDF3::UNIT_MM, IDF3::UNIT_THOU, IDF3::UNIT_TNM, and IDF3::UNOWNED.
|
protected |
Definition at line 151 of file idf_outlines.cpp.
References clearOutlines(), IDF3::CompareToken(), ERROR_IDF, IDF3::FetchIDFLine(), IDF_OUTLINE::front(), IDF3::GetIDFString(), GetOutlineTypeString(), IDF_THOU_TO_MM, IDF_TNM_TO_MM, IDF3::IDF_V2, IDF_OUTLINE::IsCCW(), IDF_OUTLINE::IsCircle(), IDF_SEGMENT::IsCircle(), IDF_POINT::Matches(), MIN_ANG, IDF3::OTLN_COMPONENT, outlines, outlineType, IDF_OUTLINE::push(), single, IDF_OUTLINE::size(), IDF_SEGMENT::startPoint, unit, IDF3::UNIT_MM, IDF3::UNIT_THOU, IDF3::UNIT_TNM, IDF_POINT::x, and IDF_POINT::y.
Referenced by readData(), GROUP_OUTLINE::readData(), IDF3_COMP_OUTLINE::readData(), OTHER_OUTLINE::readData(), PLACE_OUTLINE::readData(), and ROUTE_OUTLINE::readData().
| bool BOARD_OUTLINE::SetOwner | ( | IDF3::KEY_OWNER | aOwner | ) |
Set the ownership status of the outline subject to IDF ownership rules.
Definition at line 1487 of file idf_outlines.cpp.
References CheckOwnership(), errormsg, outlineType, owner, and parent.
|
protected |
Set the parent IDF_BOARD object.
Definition at line 1284 of file idf_outlines.cpp.
References IDF3_BOARD, and parent.
Referenced by GROUP_OUTLINE::GROUP_OUTLINE(), IDF3_COMP_OUTLINE::IDF3_COMP_OUTLINE(), OTHER_OUTLINE::OTHER_OUTLINE(), PLACE_OUTLINE::PLACE_OUTLINE(), and ROUTE_OUTLINE::ROUTE_OUTLINE().
|
virtual |
Set the thickness or height of the outline (mm).
| aThickness | is the thickness or height of the outline in mm. |
Definition at line 1029 of file idf_outlines.cpp.
References CheckOwnership(), errormsg, outlineType, owner, parent, and setThickness().
Referenced by IDF_EXPORTER::createOutlineFromExtrudedBody().
|
protectedvirtual |
Definition at line 1011 of file idf_outlines.cpp.
References errormsg, GetOutlineTypeString(), outlineType, and thickness.
Referenced by SetThickness().
|
virtual |
Function SetUnit sets the native unit of the outline; except for component outlines this must be the same as the native unit of the parent IDF_BOARD object.
| aUnit | is the native unit (UNIT_MM or UNIT_THOU) |
Definition at line 985 of file idf_outlines.cpp.
References errormsg, GetOutlineTypeString(), outlineType, unit, IDF3::UNIT_MM, IDF3::UNIT_THOU, and IDF3::UNIT_TNM.
Referenced by IDF_EXPORTER::createOutlineFromExtrudedBody(), and IDF3_BOARD::readBrdSection().
|
protected |
Definition at line 675 of file idf_outlines.cpp.
References comments.
Referenced by writeData(), GROUP_OUTLINE::writeData(), IDF3_COMP_OUTLINE::writeData(), OTHER_OUTLINE::writeData(), PLACE_OUTLINE::writeData(), and ROUTE_OUTLINE::writeData().
|
protectedvirtual |
Write the comments and .BOARD_OUTLINE section to an IDFv3 file.
Throws exceptions.
| aBoardFile | is an IDFv3 file opened for writing. |
Reimplemented in GROUP_OUTLINE, IDF3_COMP_OUTLINE, OTHER_OUTLINE, PLACE_OUTLINE, and ROUTE_OUTLINE.
Definition at line 1241 of file idf_outlines.cpp.
References IDF_THOU_TO_MM, thickness, unit, IDF3::UNIT_THOU, writeComments(), writeOutlines(), and writeOwner().
|
protected |
Definition at line 714 of file idf_outlines.cpp.
References IDF_SEGMENT::angle, IDF_OUTLINE::back(), IDF_OUTLINE::begin(), IDF_OUTLINE::end(), IDF_SEGMENT::endPoint, IDF_OUTLINE::front(), IDF_THOU_TO_MM, IDF_OUTLINE::IsCCW(), IDF_SEGMENT::IsCircle(), MIN_ANG, single, IDF_OUTLINE::size(), IDF_SEGMENT::startPoint, unit, IDF3::UNIT_THOU, IDF_POINT::x, and IDF_POINT::y.
Referenced by writeOutlines().
|
protected |
Definition at line 968 of file idf_outlines.cpp.
References outlines, and writeOutline().
Referenced by writeData(), GROUP_OUTLINE::writeData(), IDF3_COMP_OUTLINE::writeData(), OTHER_OUTLINE::writeData(), PLACE_OUTLINE::writeData(), and ROUTE_OUTLINE::writeData().
|
protected |
Definition at line 693 of file idf_outlines.cpp.
References IDF3::ECAD, IDF3::MCAD, and owner.
Referenced by writeData(), GROUP_OUTLINE::writeData(), OTHER_OUTLINE::writeData(), PLACE_OUTLINE::writeData(), and ROUTE_OUTLINE::writeData().
|
friend |
Definition at line 320 of file idf_outlines.h.
References IDF3_BOARD.
Referenced by GetParent(), IDF3_BOARD, and setParent().
|
protected |
Definition at line 314 of file idf_outlines.h.
Referenced by AddComment(), clear(), ClearComments(), CommentsSize(), DeleteComment(), GetComment(), GetComments(), and writeComments().
|
protected |
Definition at line 307 of file idf_outlines.h.
Referenced by AddOutline(), addOutline(), Clear(), GROUP_OUTLINE::Clear(), IDF3_COMP_OUTLINE::Clear(), OTHER_OUTLINE::Clear(), PLACE_OUTLINE::Clear(), ROUTE_OUTLINE::Clear(), IDF3_COMP_OUTLINE::decrementRef(), DelOutline(), DelOutline(), GetError(), GetOutline(), IDF3_COMP_OUTLINE::SetComponentClass(), GROUP_OUTLINE::SetGroupName(), ROUTE_OUTLINE::SetLayers(), PLACE_OUTLINE::SetMaxHeight(), OTHER_OUTLINE::SetOutlineIdentifier(), SetOwner(), GROUP_OUTLINE::SetSide(), OTHER_OUTLINE::SetSide(), PLACE_OUTLINE::SetSide(), SetThickness(), setThickness(), and SetUnit().
|
protected |
Definition at line 308 of file idf_outlines.h.
Referenced by addOutline(), clearOutlines(), IDF3_COMP_OUTLINE::CreateDefaultOutline(), DelOutline(), DelOutline(), GetOutline(), GetOutlines(), OutlinesSize(), readOutlines(), GROUP_OUTLINE::writeData(), OTHER_OUTLINE::writeData(), PLACE_OUTLINE::writeData(), ROUTE_OUTLINE::writeData(), and writeOutlines().
|
protected |
Definition at line 312 of file idf_outlines.h.
Referenced by AddOutline(), BOARD_OUTLINE(), Clear(), GROUP_OUTLINE::Clear(), IDF3_COMP_OUTLINE::Clear(), OTHER_OUTLINE::Clear(), PLACE_OUTLINE::Clear(), ROUTE_OUTLINE::Clear(), DelOutline(), DelOutline(), GetOutlineType(), GROUP_OUTLINE::GROUP_OUTLINE(), IDF3_COMP_OUTLINE::IDF3_COMP_OUTLINE(), OTHER_OUTLINE::OTHER_OUTLINE(), PLACE_KO_OUTLINE::PLACE_KO_OUTLINE(), PLACE_OUTLINE::PLACE_OUTLINE(), readData(), GROUP_OUTLINE::readData(), IDF3_COMP_OUTLINE::readData(), OTHER_OUTLINE::readData(), PLACE_OUTLINE::readData(), ROUTE_OUTLINE::readData(), readOutlines(), IDF3_COMP_OUTLINE::readProperties(), ROUTE_KO_OUTLINE::ROUTE_KO_OUTLINE(), ROUTE_OUTLINE::ROUTE_OUTLINE(), GROUP_OUTLINE::SetGroupName(), ROUTE_OUTLINE::SetLayers(), PLACE_OUTLINE::SetMaxHeight(), OTHER_OUTLINE::SetOutlineIdentifier(), SetOwner(), GROUP_OUTLINE::SetSide(), OTHER_OUTLINE::SetSide(), PLACE_OUTLINE::SetSide(), SetThickness(), setThickness(), SetUnit(), VIA_KO_OUTLINE::VIA_KO_OUTLINE(), OTHER_OUTLINE::writeData(), PLACE_OUTLINE::writeData(), and ROUTE_OUTLINE::writeData().
|
protected |
Definition at line 311 of file idf_outlines.h.
Referenced by AddOutline(), BOARD_OUTLINE(), Clear(), GROUP_OUTLINE::Clear(), IDF3_COMP_OUTLINE::Clear(), OTHER_OUTLINE::Clear(), PLACE_OUTLINE::Clear(), ROUTE_OUTLINE::Clear(), clear(), GetOwner(), readData(), GROUP_OUTLINE::readData(), OTHER_OUTLINE::readData(), PLACE_OUTLINE::readData(), ROUTE_OUTLINE::readData(), GROUP_OUTLINE::SetGroupName(), ROUTE_OUTLINE::SetLayers(), PLACE_OUTLINE::SetMaxHeight(), OTHER_OUTLINE::SetOutlineIdentifier(), SetOwner(), GROUP_OUTLINE::SetSide(), OTHER_OUTLINE::SetSide(), PLACE_OUTLINE::SetSide(), SetThickness(), and writeOwner().
|
protected |
Definition at line 316 of file idf_outlines.h.
Referenced by AddOutline(), BOARD_OUTLINE(), Clear(), GROUP_OUTLINE::Clear(), IDF3_COMP_OUTLINE::Clear(), OTHER_OUTLINE::Clear(), PLACE_OUTLINE::Clear(), ROUTE_OUTLINE::Clear(), GetParent(), GROUP_OUTLINE::SetGroupName(), ROUTE_OUTLINE::SetLayers(), PLACE_OUTLINE::SetMaxHeight(), OTHER_OUTLINE::SetOutlineIdentifier(), SetOwner(), setParent(), GROUP_OUTLINE::SetSide(), OTHER_OUTLINE::SetSide(), PLACE_OUTLINE::SetSide(), and SetThickness().
|
protected |
Definition at line 313 of file idf_outlines.h.
Referenced by BOARD_OUTLINE(), GROUP_OUTLINE::GROUP_OUTLINE(), IDF3_COMP_OUTLINE::IDF3_COMP_OUTLINE(), IsSingle(), OTHER_OUTLINE::OTHER_OUTLINE(), PLACE_OUTLINE::PLACE_OUTLINE(), readOutlines(), ROUTE_OUTLINE::ROUTE_OUTLINE(), VIA_KO_OUTLINE::VIA_KO_OUTLINE(), and writeOutline().
|
protected |
Definition at line 317 of file idf_outlines.h.
Referenced by BOARD_OUTLINE(), GROUP_OUTLINE::Clear(), PLACE_OUTLINE::Clear(), IDF3_COMP_OUTLINE::CreateDefaultOutline(), PLACE_OUTLINE::GetMaxHeight(), GetThickness(), GROUP_OUTLINE::GROUP_OUTLINE(), PLACE_OUTLINE::PLACE_OUTLINE(), readData(), IDF3_COMP_OUTLINE::readData(), OTHER_OUTLINE::readData(), PLACE_OUTLINE::readData(), PLACE_OUTLINE::SetMaxHeight(), setThickness(), writeData(), IDF3_COMP_OUTLINE::writeData(), OTHER_OUTLINE::writeData(), and PLACE_OUTLINE::writeData().
|
protected |
Definition at line 315 of file idf_outlines.h.
Referenced by BOARD_OUTLINE(), IDF3_COMP_OUTLINE::CreateDefaultOutline(), GetUnit(), readData(), IDF3_COMP_OUTLINE::readData(), OTHER_OUTLINE::readData(), PLACE_OUTLINE::readData(), readOutlines(), SetUnit(), writeData(), IDF3_COMP_OUTLINE::writeData(), OTHER_OUTLINE::writeData(), PLACE_OUTLINE::writeData(), and writeOutline().