KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ROUTE_KO_OUTLINE Class Reference

Regions and layers where no electrical routing is permitted. More...

#include <idf_outlines.h>

Inheritance diagram for ROUTE_KO_OUTLINE:
ROUTE_OUTLINE BOARD_OUTLINE

Public Member Functions

 ROUTE_KO_OUTLINE (IDF3_BOARD *aParent)
 
virtual bool SetLayers (IDF3::IDF_LAYER aLayer)
 Function SetLayers sets the layer or group of layers this outline is applicable to.
 
virtual IDF3::IDF_LAYER GetLayers (void)
 Function GetLayers returns the layer or group of layers which this outline is applicable to.
 
virtual bool Clear (void) override
 Function Clear deletes internal data except for the parent object.
 
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)
 
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)
 

Protected Attributes

IDF3::IDF_LAYER layers
 
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
 

Private Member Functions

virtual void readData (std::istream &aBoardFile, const std::string &aHeader, IDF3::IDF_VERSION aIdfVersion) override
 Read ROUTE_OUTLINE data from an IDFv3 file.
 
virtual void writeData (std::ostream &aBoardFile) override
 Write the ROUTE_OUTLINE data to an open IDFv3 file.
 

Detailed Description

Regions and layers where no electrical routing is permitted.

Definition at line 515 of file idf_outlines.h.

Constructor & Destructor Documentation

◆ ROUTE_KO_OUTLINE()

ROUTE_KO_OUTLINE::ROUTE_KO_OUTLINE ( IDF3_BOARD * aParent)

Member Function Documentation

◆ AddComment()

void BOARD_OUTLINE::AddComment ( const std::string & aComment)
inherited

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().

◆ AddOutline()

bool BOARD_OUTLINE::AddOutline ( IDF_OUTLINE * aOutline)
inherited

Add the specified outline to this object.

Parameters
aOutlineis a valid IDF outline.
Returns
true if the outline was added; false if the outline already existed or an ownership violation occurs.

Definition at line 1326 of file idf_outlines.cpp.

References addOutline(), CheckOwnership(), errormsg, outlineType, owner, and parent.

Referenced by IDF_EXPORTER::createOutlineFromExtrudedBody().

◆ addOutline()

bool BOARD_OUTLINE::addOutline ( IDF_OUTLINE * aOutline)
protectedinherited

Definition at line 1296 of file idf_outlines.cpp.

References errormsg, and outlines.

Referenced by AddOutline().

◆ Clear()

bool ROUTE_OUTLINE::Clear ( void )
overridevirtualinherited

Function Clear deletes internal data except for the parent object.

Reimplemented from BOARD_OUTLINE.

Definition at line 2252 of file idf_outlines.cpp.

References CheckOwnership(), BOARD_OUTLINE::clear(), BOARD_OUTLINE::errormsg, layers, IDF3::LYR_INVALID, BOARD_OUTLINE::outlineType, BOARD_OUTLINE::owner, and BOARD_OUTLINE::parent.

◆ clear()

void BOARD_OUTLINE::clear ( void )
protectedvirtualinherited

◆ ClearComments()

void BOARD_OUTLINE::ClearComments ( void )
inherited

Deletes all comments.

Definition at line 1570 of file idf_outlines.cpp.

References comments.

◆ ClearOutlines()

void BOARD_OUTLINE::ClearOutlines ( void )
inherited

Clear internal data except for the parent pointer.

◆ clearOutlines()

void BOARD_OUTLINE::clearOutlines ( void )
protectedinherited

Definition at line 1505 of file idf_outlines.cpp.

References outlines.

Referenced by clear(), and readOutlines().

◆ CommentsSize()

size_t BOARD_OUTLINE::CommentsSize ( void )
inherited
Returns
the number of comments in the internal list.

Definition at line 1529 of file idf_outlines.cpp.

References comments.

◆ DeleteComment()

bool BOARD_OUTLINE::DeleteComment ( size_t aIndex)
inherited

Deletes a comment based on the given index.

Returns
true if a comment was deleted, false if the index is out of bounds.

Definition at line 1555 of file idf_outlines.cpp.

References comments.

◆ DelOutline() [1/2]

bool BOARD_OUTLINE::DelOutline ( IDF_OUTLINE * aOutline)
inherited

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.

Parameters
aOutlineis a pointer to the outline to remove from the list.
Returns
true if the outline was found and removed; false if the outline was not found or an ownership violation occurs.

Definition at line 1337 of file idf_outlines.cpp.

References errormsg, GetOutlineTypeString(), outlines, and outlineType.

◆ DelOutline() [2/2]

bool BOARD_OUTLINE::DelOutline ( size_t aIndex)
inherited

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.

Parameters
aIndexis an index to the outline to delete
Returns
true if the outline was found and deleted; false if the outline was not found or an ownership violation or indexation error occurs.

Definition at line 1395 of file idf_outlines.cpp.

References errormsg, GetOutlineTypeString(), outlines, and outlineType.

◆ GetComment()

const std::string * BOARD_OUTLINE::GetComment ( size_t aIndex)
inherited
Returns
indexed comment or NULL if the index is out of bounds.

Definition at line 1541 of file idf_outlines.cpp.

References comments.

◆ GetComments()

std::list< std::string > * BOARD_OUTLINE::GetComments ( void )
inherited
Returns
the internal list of comments.

Definition at line 1535 of file idf_outlines.cpp.

References comments.

◆ GetError()

const std::string & BOARD_OUTLINE::GetError ( void )
inlineinherited

Definition at line 253 of file idf_outlines.h.

References errormsg.

◆ GetLayers()

IDF3::IDF_LAYER ROUTE_OUTLINE::GetLayers ( void )
virtualinherited

Function GetLayers returns the layer or group of layers which this outline is applicable to.

Definition at line 1999 of file idf_outlines.cpp.

References layers.

◆ GetOutline()

IDF_OUTLINE * BOARD_OUTLINE::GetOutline ( size_t aIndex)
inherited

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().

◆ GetOutlines()

const std::list< IDF_OUTLINE * > * BOARD_OUTLINE::GetOutlines ( void )
inherited

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().

◆ GetOutlineType()

IDF3::OUTLINE_TYPE BOARD_OUTLINE::GetOutlineType ( void )
inherited
Returns
the type of outline according to the IDFv3 classification.

Definition at line 145 of file idf_outlines.cpp.

References outlineType.

◆ GetOwner()

IDF3::KEY_OWNER BOARD_OUTLINE::GetOwner ( void )
inherited
Returns
the ownership status of the outline (ECAD, MCAD, UNOWNED).

Definition at line 1481 of file idf_outlines.cpp.

References owner.

◆ GetParent()

IDF3_BOARD * BOARD_OUTLINE::GetParent ( void )
inherited
Returns
the parent IDF_BOARD object.

Definition at line 1290 of file idf_outlines.cpp.

References IDF3_BOARD, and parent.

◆ GetThickness()

double BOARD_OUTLINE::GetThickness ( void )
virtualinherited
Returns
the thickness or height of an outline (mm).

Definition at line 1040 of file idf_outlines.cpp.

References thickness.

Referenced by addOutline(), and makeOtherOutlines().

◆ GetUnit()

IDF3::IDF_UNIT BOARD_OUTLINE::GetUnit ( void )
virtualinherited

Return the native unit type of the outline.

Returns
IDF_UNIT is the native unit (UNIT_MM or UNIT_THOU).

Definition at line 1005 of file idf_outlines.cpp.

References unit.

◆ IsSingle()

bool BOARD_OUTLINE::IsSingle ( void )
inherited
Returns
true if this type of outline only supports a single outline. All outlines except for BOARD_OUTLINE are single.

Definition at line 1499 of file idf_outlines.cpp.

References single.

◆ OutlinesSize()

size_t BOARD_OUTLINE::OutlinesSize ( void )
inherited
Returns
the number of items in the internal outline list.

Definition at line 1454 of file idf_outlines.cpp.

References outlines.

Referenced by IDF_EXPORTER::createOutlineFromExtrudedBody(), and MatchCompOutline().

◆ readData()

void ROUTE_OUTLINE::readData ( std::istream & aBoardFile,
const std::string & aHeader,
IDF3::IDF_VERSION aIdfVersion )
overrideprivatevirtualinherited

Read ROUTE_OUTLINE data from an IDFv3 file.

If an unrecoverable error occurs an exception is thrown.

Parameters
aBoardFileis an open IDFv3 board file.
aHeaderis the .ROUTE_OUTLINE header as returned by FetchIDFLine.

Reimplemented from BOARD_OUTLINE.

Definition at line 2005 of file idf_outlines.cpp.

References IDF3::CompareToken(), ERROR_IDF, IDF3::FetchIDFLine(), IDF3::GetIDFString(), GetOutlineTypeString(), IDF3::IDF_V2, layers, IDF3::LYR_ALL, IDF3::LYR_INNER, IDF3::OTLN_ROUTE, IDF3::OTLN_ROUTE_KEEPOUT, BOARD_OUTLINE::outlineType, BOARD_OUTLINE::owner, IDF3::ParseIDFLayer(), IDF3::ParseOwner(), BOARD_OUTLINE::readOutlines(), and IDF3::UNOWNED.

Referenced by IDF3_BOARD::readBrdSection().

◆ readOutlines()

◆ SetLayers()

bool ROUTE_OUTLINE::SetLayers ( IDF3::IDF_LAYER aLayer)
virtualinherited

Function SetLayers sets the layer or group of layers this outline is applicable to.

This function is subject to IDF ownership rules; true is returned on success, otherwise false is returned and the error message is set.

Definition at line 1986 of file idf_outlines.cpp.

References CheckOwnership(), BOARD_OUTLINE::errormsg, layers, BOARD_OUTLINE::outlineType, BOARD_OUTLINE::owner, and BOARD_OUTLINE::parent.

◆ SetOwner()

bool BOARD_OUTLINE::SetOwner ( IDF3::KEY_OWNER aOwner)
inherited

Set the ownership status of the outline subject to IDF ownership rules.

Returns
true if the ownership was changed and false if a specification violation occurred.

Definition at line 1487 of file idf_outlines.cpp.

References CheckOwnership(), errormsg, outlineType, owner, and parent.

◆ setParent()

void BOARD_OUTLINE::setParent ( IDF3_BOARD * aParent)
protectedinherited

◆ SetThickness()

bool BOARD_OUTLINE::SetThickness ( double aThickness)
virtualinherited

Set the thickness or height of the outline (mm).

Parameters
aThicknessis 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().

◆ setThickness()

bool BOARD_OUTLINE::setThickness ( double aThickness)
protectedvirtualinherited

Definition at line 1011 of file idf_outlines.cpp.

References errormsg, GetOutlineTypeString(), outlineType, and thickness.

Referenced by SetThickness().

◆ SetUnit()

bool BOARD_OUTLINE::SetUnit ( IDF3::IDF_UNIT aUnit)
virtualinherited

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.

Parameters
aUnitis 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().

◆ writeComments()

bool BOARD_OUTLINE::writeComments ( std::ostream & aBoardFile)
protectedinherited

◆ writeData()

void ROUTE_OUTLINE::writeData ( std::ostream & aBoardFile)
overrideprivatevirtualinherited

◆ writeOutline()

◆ writeOutlines()

void BOARD_OUTLINE::writeOutlines ( std::ostream & aBoardFile)
protectedinherited

◆ writeOwner()

bool BOARD_OUTLINE::writeOwner ( std::ostream & aBoardFile)
protectedinherited

Member Data Documentation

◆ comments

std::list< std::string > BOARD_OUTLINE::comments
protectedinherited

◆ errormsg

◆ layers

IDF3::IDF_LAYER ROUTE_OUTLINE::layers
protectedinherited

Definition at line 439 of file idf_outlines.h.

Referenced by Clear(), GetLayers(), readData(), ROUTE_OUTLINE(), SetLayers(), and writeData().

◆ outlines

◆ outlineType

◆ owner

◆ parent

◆ single

◆ thickness

◆ unit


The documentation for this class was generated from the following files: