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

#include <idf_parser.h>

Public Member Functions

 IDF3_COMP_OUTLINE_DATA ()
 Create an object with default settings and no parent or associated outline.
 
 IDF3_COMP_OUTLINE_DATA (IDF3_COMPONENT *aParent, IDF3_COMP_OUTLINE *aOutline)
 Create an object with default settings and the specified parent and associated outline.
 
 IDF3_COMP_OUTLINE_DATA (IDF3_COMPONENT *aParent, IDF3_COMP_OUTLINE *aOutline, double aXoff, double aYoff, double aZoff, double aAngleOff)
 Create an object the specified parent and associated outline and the specified data.
 
 ~IDF3_COMP_OUTLINE_DATA ()
 
bool SetOffsets (double aXoff, double aYoff, double aZoff, double aAngleOff)
 Set the position and orientation of this outline item in relation to its parent.
 
void GetOffsets (double &aXoff, double &aYoff, double &aZoff, double &aAngleOff)
 Retrieve the position and orientation of this outline item in relation to its parent.
 
void SetParent (IDF3_COMPONENT *aParent)
 Set the parent object.
 
bool SetOutline (IDF3_COMP_OUTLINE *aOutline)
 Set the outline whose position is managed by this object.
 
IDF3_COMP_OUTLINE * GetOutline (void)
 Retrieve the outline whose position is managed by this object.
 
const std::string & GetError (void)
 

Private Member Functions

bool checkOwnership (int aSourceLine, const char *aSourceFunc)
 
bool readPlaceData (std::istream &aBoardFile, IDF3::FILE_STATE &aBoardState, IDF3_BOARD *aBoard, IDF3::IDF_VERSION aIdfVersion, bool aNoSubstituteOutlines)
 Read placement data from an open IDFv3 file.
 
void writePlaceData (std::ostream &aBoardFile, double aXpos, double aYpos, double aAngle, const std::string &aRefDes, IDF3::IDF_PLACEMENT aPlacement, IDF3::IDF_LAYER aSide)
 Write RECORD 2 and RECORD 3 of a PLACEMENT section as per IDFv3 specification.
 

Private Attributes

double xoff
 
double yoff
 
double zoff
 
double aoff
 
std::string errormsg
 
IDF3_COMP_OUTLINE * outline
 
IDF3_COMPONENT * parent
 

Friends

class IDF3_BOARD
 
class IDF3_COMPONENT
 

Detailed Description

Definition at line 61 of file idf_parser.h.

Constructor & Destructor Documentation

◆ IDF3_COMP_OUTLINE_DATA() [1/3]

IDF3_COMP_OUTLINE_DATA::IDF3_COMP_OUTLINE_DATA ( )

Create an object with default settings and no parent or associated outline.

Definition at line 84 of file idf_parser.cpp.

References aoff, outline, parent, xoff, yoff, and zoff.

Referenced by readPlaceData().

◆ IDF3_COMP_OUTLINE_DATA() [2/3]

IDF3_COMP_OUTLINE_DATA::IDF3_COMP_OUTLINE_DATA ( IDF3_COMPONENT * aParent,
IDF3_COMP_OUTLINE * aOutline )

Create an object with default settings and the specified parent and associated outline.

Parameters
aParentis the owning IDF3_COMPONENT object.
aOutlineis the outline for this placed component.

Definition at line 95 of file idf_parser.cpp.

References aoff, IDF3_COMPONENT, IDF3_COMP_OUTLINE::incrementRef(), outline, parent, xoff, yoff, and zoff.

◆ IDF3_COMP_OUTLINE_DATA() [3/3]

IDF3_COMP_OUTLINE_DATA::IDF3_COMP_OUTLINE_DATA ( IDF3_COMPONENT * aParent,
IDF3_COMP_OUTLINE * aOutline,
double aXoff,
double aYoff,
double aZoff,
double aAngleOff )

Create an object the specified parent and associated outline and the specified data.

Parameters
aParentis the owning IDF3_COMPONENT object.
aOutlineis the outline for this placed component.
aXoffis the X offset of this outline in relation to its parent.
aYoffis the Y offset of this outline in relation to its parent.
aZoffis the board offset of this outline as per IDFv3 specification.
aAoffis the rotational offset of this outline in relation to its parent.

Definition at line 110 of file idf_parser.cpp.

References aoff, IDF3_COMPONENT, outline, parent, xoff, yoff, and zoff.

◆ ~IDF3_COMP_OUTLINE_DATA()

IDF3_COMP_OUTLINE_DATA::~IDF3_COMP_OUTLINE_DATA ( )

Definition at line 124 of file idf_parser.cpp.

References outline.

Member Function Documentation

◆ checkOwnership()

bool IDF3_COMP_OUTLINE_DATA::checkOwnership ( int aSourceLine,
const char * aSourceFunc )
private

◆ GetError()

const std::string & IDF3_COMP_OUTLINE_DATA::GetError ( void )
inline

Definition at line 139 of file idf_parser.h.

References errormsg.

◆ GetOffsets()

void IDF3_COMP_OUTLINE_DATA::GetOffsets ( double & aXoff,
double & aYoff,
double & aZoff,
double & aAngleOff )

Retrieve the position and orientation of this outline item in relation to its parent.

Parameters
aXoffis the X offset of this outline in relation to its parent.
aYoffis the Y offset of this outline in relation to its parent.
aZoffis the board offset of this outline as per IDFv3 specification.
aAoffis the rotational offset of this outline in relation to its parent.

Definition at line 193 of file idf_parser.cpp.

References aoff, xoff, yoff, and zoff.

◆ GetOutline()

IDF3_COMP_OUTLINE * IDF3_COMP_OUTLINE_DATA::GetOutline ( void )
inline

Retrieve the outline whose position is managed by this object.

Returns
the outline for this component.

Definition at line 134 of file idf_parser.h.

References outline.

◆ readPlaceData()

bool IDF3_COMP_OUTLINE_DATA::readPlaceData ( std::istream & aBoardFile,
IDF3::FILE_STATE & aBoardState,
IDF3_BOARD * aBoard,
IDF3::IDF_VERSION aIdfVersion,
bool aNoSubstituteOutlines )
private

Read placement data from an open IDFv3 file.

Parameters
aBoardFileis the open IDFv3 file
aBoardStateis the internal status flag of the IDF parser
aIdfVersionis the version of the file currently being parsed
aBoardis the IDF3_BOARD object which will store the data
Returns
true if placement data was successfully read. false if no placement data was read; this may happen if the end of the placement data was encountered or an error occurred. if an error occurred then an exception is thrown.

Definition at line 228 of file idf_parser.cpp.

References IDF3_BOARD::AddComponent(), aoff, IDF3::CAD_ELEC, IDF3::CompareToken(), ERROR_IDF, IDF3::FetchIDFLine(), IDF3::FILE_PLACEMENT, IDF3_BOARD::FindComponent(), IDF3_BOARD::GetCadType(), IDF3_BOARD::GetComponentOutline(), IDF3::GetIDFString(), IDF3_BOARD::GetInvalidOutline(), IDF3::GetLayerString(), IDF3_BOARD::GetNewRefDes(), IDF3::GetPlacementString(), IDF3_BOARD::GetUnit(), IDF3_BOARD, IDF3_COMP_OUTLINE_DATA(), IDF3_COMPONENT, IDF_THOU_TO_MM, IDF3::IDF_V2, IDF3::IDF_V3, IDF3::LYR_BOTTOM, IDF3::LYR_TOP, outline, parent, IDF3::PS_ECAD, IDF3::PS_MCAD, IDF3::PS_PLACED, IDF3::PS_UNPLACED, IDF3_COMPONENT::SetPlacement(), IDF3_COMPONENT::SetPosition(), IDF3_COMPONENT::SetRefDes(), IDF3::UNIT_THOU, xoff, yoff, and zoff.

Referenced by IDF3_BOARD::readBrdPlacement().

◆ SetOffsets()

bool IDF3_COMP_OUTLINE_DATA::SetOffsets ( double aXoff,
double aYoff,
double aZoff,
double aAngleOff )

Set the position and orientation of this outline item in relation to its parent.

Parameters
aXoffis the X offset of this outline in relation to its parent.
aYoffis the Y offset of this outline in relation to its parent.
aZoffis the board offset of this outline as per IDFv3 specification.
aAoffis the rotational offset of this outline in relation to its parent.
Returns
true if the operation succeeded, false if an ownership violation occurred.

Definition at line 177 of file idf_parser.cpp.

References aoff, checkOwnership(), xoff, yoff, and zoff.

Referenced by IDF_EXPORTER::exportFootprint(), and IDF_EXPORTER::exportFootprintIdfModels().

◆ SetOutline()

bool IDF3_COMP_OUTLINE_DATA::SetOutline ( IDF3_COMP_OUTLINE * aOutline)

Set the outline whose position is managed by this object.

Parameters
aOutlineis the outline for this component.
Returns
true if the operation succeeded, false if an ownership violation occurred.

Definition at line 209 of file idf_parser.cpp.

References checkOwnership(), and outline.

◆ SetParent()

void IDF3_COMP_OUTLINE_DATA::SetParent ( IDF3_COMPONENT * aParent)

Set the parent object.

Parameters
aParentis the owning IDF3_COMPONENT object.

Definition at line 203 of file idf_parser.cpp.

References IDF3_COMPONENT, and parent.

◆ writePlaceData()

void IDF3_COMP_OUTLINE_DATA::writePlaceData ( std::ostream & aBoardFile,
double aXpos,
double aYpos,
double aAngle,
const std::string & aRefDes,
IDF3::IDF_PLACEMENT aPlacement,
IDF3::IDF_LAYER aSide )
private

Write RECORD 2 and RECORD 3 of a PLACEMENT section as per IDFv3 specification.

Parameters
aBoardFileis the open IDFv3 file.
aXposis the X location of the parent component.
aYposis the Y location of the parent component.
aAngleis the rotation of the parent component.
aRefDesis the reference designator of the parent component.
aPlacementis the IDF Placement Status of the parent component.
aSideis the IDF Layer Designator (TOP or BOTTOM).
Returns
true if data was successfully written, otherwise false.

Definition at line 713 of file idf_parser.cpp.

References aoff, IDF3::CompareToken(), ERROR_IDF, IDF3::GetLayerString(), IDF_THOU_TO_MM, IDF3::LYR_BOTTOM, IDF3::LYR_TOP, outline, parent, IDF3::PS_INVALID, IDF3::PS_MCAD, IDF3::PS_PLACED, IDF3::PS_UNPLACED, IDF3::UNIT_MM, IDF3::WriteLayersText(), xoff, yoff, and zoff.

Friends And Related Symbol Documentation

◆ IDF3_BOARD

friend class IDF3_BOARD
friend

Definition at line 183 of file idf_parser.h.

References IDF3_BOARD.

Referenced by IDF3_BOARD, and readPlaceData().

◆ IDF3_COMPONENT

friend class IDF3_COMPONENT
friend

Member Data Documentation

◆ aoff

double IDF3_COMP_OUTLINE_DATA::aoff
private

◆ errormsg

std::string IDF3_COMP_OUTLINE_DATA::errormsg
private

Definition at line 190 of file idf_parser.h.

Referenced by checkOwnership(), and GetError().

◆ outline

◆ parent

◆ xoff

double IDF3_COMP_OUTLINE_DATA::xoff
private

◆ yoff

double IDF3_COMP_OUTLINE_DATA::yoff
private

◆ zoff

double IDF3_COMP_OUTLINE_DATA::zoff
private

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