KiCad PCB EDA Suite
|
#include <odb_feature.h>
Public Member Functions | |
FEATURES_MANAGER (BOARD *aBoard, PCB_IO_ODBPP *aPlugin, const wxString &aLayerName) | |
virtual | ~FEATURES_MANAGER () |
void | InitFeatureList (PCB_LAYER_ID aLayer, std::vector< BOARD_ITEM * > &aItems) |
void | AddFeatureLine (const VECTOR2I &aStart, const VECTOR2I &aEnd, uint64_t aWidth) |
void | AddFeatureArc (const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, uint64_t aWidth, ODB_DIRECTION aDirection) |
void | AddPadCircle (const VECTOR2I &aCenter, uint64_t aDiameter, const EDA_ANGLE &aAngle, bool aMirror, double aResize=1.0) |
void | AddPadShape (const PAD &aPad, PCB_LAYER_ID aLayer) |
void | AddFeatureSurface (const SHAPE_POLY_SET::POLYGON &aPolygon, FILL_T aFillType=FILL_T::FILLED_SHAPE) |
void | AddShape (const PCB_SHAPE &aShape, PCB_LAYER_ID aLayer=UNDEFINED_LAYER) |
void | AddVia (const PCB_VIA *aVia, PCB_LAYER_ID aLayer) |
void | AddViaDrillHole (const PCB_VIA *aVia, PCB_LAYER_ID aLayer) |
bool | AddContour (const SHAPE_POLY_SET &aPolySet, int aOutline=0, FILL_T aFillType=FILL_T::FILLED_SHAPE) |
bool | AddPolygon (const SHAPE_POLY_SET::POLYGON &aPolygon, FILL_T aFillType, int aWidth, LINE_STYLE aDashType) |
bool | AddPolygonCutouts (const SHAPE_POLY_SET::POLYGON &aPolygon) |
void | GenerateFeatureFile (std::ostream &ost) const |
void | GenerateProfileFeatures (std::ostream &ost) const |
template<typename Tr , typename Ta > | |
void | AddFeatureAttribute (Tr &r, Ta v) |
Protected Member Functions | |
size_t | GetAttrNameNumber (const wxString &name) |
void | WriteAttributes (std::ostream &ost, const std::string &prefix="") const |
void | WriteAttributesName (std::ostream &ost, const std::string &prefix="") const |
void | WriteAttributesText (std::ostream &ost, const std::string &prefix="") const |
Private Member Functions | |
uint32_t | AddCircleSymbol (const wxString &aDiameter) |
uint32_t | AddRoundDonutSymbol (const wxString &aOuterDim, const wxString &aInnerDim) |
uint32_t | AddRectSymbol (const wxString &aWidth, const wxString &aHeight) |
uint32_t | AddOvalSymbol (const wxString &aWidth, const wxString &aHeight) |
uint32_t | AddRoundRectSymbol (const wxString &aWidth, const wxString &aHeight, const wxString &aRadius) |
uint32_t | AddRoundRectDonutSymbol (const wxString &aOuterWidth, const wxString &aOuterHeight, const wxString &aLineWidth, const wxString &aRadius) |
uint32_t | AddChamferRectSymbol (const wxString &aWidth, const wxString &aHeight, const wxString &aRadius, int aPositions) |
uint32_t | GetSymbolIndex (std::map< wxString, uint32_t > &aSymMap, const wxString &aKey) |
template<typename T , typename... Args> | |
void | AddFeature (Args &&... args) |
PCB_IO_ODBPP * | GetODBPlugin () |
size_t | GetAttrTextNumber (const wxString &aName) |
size_t | GetTextIndex (std::unordered_map< std::string, size_t > &aMap, std::vector< std::pair< size_t, std::string > > &aVec, const std::string &aText) |
template<typename T , unsigned int n> | |
std::string | AttrValue2String (ODB_ATTR::FloatAttribute< T, n > a) |
template<typename T > | |
std::string | AttrValue2String (ODB_ATTR::BooleanAttribute< T > a) |
template<typename T > | |
std::string | AttrValue2String (ODB_ATTR::TextAttribute< T > a) |
Private Attributes | |
std::map< wxString, uint32_t > | m_circleSymMap |
std::map< wxString, uint32_t > | m_roundDonutSymMap |
std::map< wxString, uint32_t > | m_padSymMap |
std::map< wxString, uint32_t > | m_rectSymMap |
std::map< wxString, uint32_t > | m_ovalSymMap |
std::map< wxString, uint32_t > | m_roundRectSymMap |
std::map< wxString, uint32_t > | m_roundRectDonutSymMap |
std::map< wxString, uint32_t > | m_chamRectSymMap |
std::map< uint32_t, wxString > | m_allSymMap |
BOARD * | m_board |
PCB_IO_ODBPP * | m_plugin |
wxString | m_layerName |
uint32_t | m_symIndex = 0 |
std::list< std::unique_ptr< ODB_FEATURE > > | m_featuresList |
std::map< BOARD_ITEM *, std::vector< uint32_t > > | m_featureIDMap |
std::unordered_map< std::string, size_t > | m_attrNames |
std::vector< std::pair< size_t, std::string > > | m_attrNameVec |
std::unordered_map< std::string, size_t > | m_attrTexts |
std::vector< std::pair< size_t, std::string > > | m_attrTextVec |
Definition at line 49 of file odb_feature.h.
|
inline |
Definition at line 52 of file odb_feature.h.
|
inlinevirtual |
Definition at line 57 of file odb_feature.h.
References m_featuresList.
|
inlineprivate |
Definition at line 131 of file odb_feature.h.
References GetSymbolIndex(), m_chamRectSymMap, ODB_DIM_C, ODB_DIM_X, RECT_CHAMFER_ALL, RECT_CHAMFER_BOTTOM_LEFT, RECT_CHAMFER_BOTTOM_RIGHT, RECT_CHAMFER_TOP_LEFT, and RECT_CHAMFER_TOP_RIGHT.
Referenced by AddPadShape().
|
inlineprivate |
Definition at line 93 of file odb_feature.h.
References GetSymbolIndex(), and m_circleSymMap.
Referenced by AddFeatureArc(), AddFeatureLine(), AddPadCircle(), AddPadShape(), and AddShape().
bool FEATURES_MANAGER::AddContour | ( | const SHAPE_POLY_SET & | aPolySet, |
int | aOutline = 0 , |
||
FILL_T | aFillType = FILL_T::FILLED_SHAPE |
||
) |
Definition at line 65 of file odb_feature.cpp.
References AddFeatureSurface(), SHAPE_POLY_SET::OutlineCount(), and SHAPE_POLY_SET::Polygon().
Referenced by AddPadShape(), AddShape(), and InitFeatureList().
|
inlineprivate |
Definition at line 181 of file odb_feature.h.
References m_featuresList.
void FEATURES_MANAGER::AddFeatureArc | ( | const VECTOR2I & | aStart, |
const VECTOR2I & | aEnd, | ||
const VECTOR2I & | aCenter, | ||
uint64_t | aWidth, | ||
ODB_DIRECTION | aDirection | ||
) |
Definition at line 46 of file odb_feature.cpp.
References AddCircleSymbol(), ODB::AddXY(), and ODB::SymDouble2String().
Referenced by AddShape().
|
inlineinherited |
Definition at line 289 of file odb_attribute.h.
References ATTR_MANAGER::AttrValue2String(), and ATTR_MANAGER::GetAttrNameNumber().
Referenced by InitFeatureList().
void FEATURES_MANAGER::AddFeatureLine | ( | const VECTOR2I & | aStart, |
const VECTOR2I & | aEnd, | ||
uint64_t | aWidth | ||
) |
Definition at line 38 of file odb_feature.cpp.
References AddCircleSymbol(), ODB::AddXY(), and ODB::SymDouble2String().
Referenced by AddShape().
void FEATURES_MANAGER::AddFeatureSurface | ( | const SHAPE_POLY_SET::POLYGON & | aPolygon, |
FILL_T | aFillType = FILL_T::FILLED_SHAPE |
||
) |
Definition at line 235 of file odb_feature.cpp.
Referenced by AddContour().
|
inlineprivate |
Definition at line 110 of file odb_feature.h.
References GetSymbolIndex(), m_ovalSymMap, and ODB_DIM_X.
Referenced by AddPadShape().
void FEATURES_MANAGER::AddPadCircle | ( | const VECTOR2I & | aCenter, |
uint64_t | aDiameter, | ||
const EDA_ANGLE & | aAngle, | ||
bool | aMirror, | ||
double | aResize = 1.0 |
||
) |
Definition at line 55 of file odb_feature.cpp.
References AddCircleSymbol(), ODB::AddXY(), and ODB::SymDouble2String().
void FEATURES_MANAGER::AddPadShape | ( | const PAD & | aPad, |
PCB_LAYER_ID | aLayer | ||
) |
Definition at line 242 of file odb_feature.cpp.
References std::abs(), AddChamferRectSymbol(), AddCircleSymbol(), AddContour(), AddOvalSymbol(), AddRectSymbol(), AddRoundRectSymbol(), ODB::AddXY(), ANGLE_0, B_Mask, B_Paste, chamfer, ERROR_INSIDE, F_Mask, F_Paste, PAD::GetChamferPositions(), PAD::GetChamferRectRatio(), BOARD::GetDesignSettings(), PAD::GetOrientation(), BOARD_ITEM::GetParentFootprint(), PAD::GetRoundRectCornerRadius(), PAD::GetShape(), PAD::GetSize(), PAD::GetSolderMaskExpansion(), PAD::GetSolderPasteMargin(), SHAPE_POLY_SET::InflateWithLinkedHoles(), FOOTPRINT::IsFlipped(), KiROUND(), m_board, BOARD_DESIGN_SETTINGS::m_MaxError, PAD::MergePrimitivesAsPolygon(), SHAPE_POLY_SET::Move(), SHAPE_POLY_SET::OutlineCount(), SHAPE_POLY_SET::PM_FAST, SHAPE_POLY_SET::Rotate(), PAD::ShapePos(), ODB::SymDouble2String(), PAD::TransformShapeToPolygon(), UNDEFINED_LAYER, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by AddVia(), and AddViaDrillHole().
bool FEATURES_MANAGER::AddPolygon | ( | const SHAPE_POLY_SET::POLYGON & | aPolygon, |
FILL_T | aFillType, | ||
int | aWidth, | ||
LINE_STYLE | aDashType | ||
) |
bool FEATURES_MANAGER::AddPolygonCutouts | ( | const SHAPE_POLY_SET::POLYGON & | aPolygon | ) |
|
inlineprivate |
Definition at line 104 of file odb_feature.h.
References GetSymbolIndex(), m_rectSymMap, and ODB_DIM_X.
Referenced by AddPadShape().
|
inlineprivate |
Definition at line 98 of file odb_feature.h.
References GetSymbolIndex(), m_roundDonutSymMap, and ODB_DIM_X.
Referenced by AddShape().
|
inlineprivate |
Definition at line 123 of file odb_feature.h.
References GetSymbolIndex(), m_roundRectDonutSymMap, ODB_DIM_R, and ODB_DIM_X.
Referenced by AddShape().
|
inlineprivate |
Definition at line 116 of file odb_feature.h.
References GetSymbolIndex(), m_roundRectSymMap, ODB_DIM_R, and ODB_DIM_X.
Referenced by AddPadShape(), and AddShape().
void FEATURES_MANAGER::AddShape | ( | const PCB_SHAPE & | aShape, |
PCB_LAYER_ID | aLayer = UNDEFINED_LAYER |
||
) |
Definition at line 79 of file odb_feature.cpp.
References SEG::A, std::abs(), AddCircleSymbol(), AddContour(), AddFeatureArc(), AddFeatureLine(), AddRoundDonutSymbol(), AddRoundRectDonutSymbol(), AddRoundRectSymbol(), ODB::AddXY(), SEG::B, B_Mask, SHAPE_POLY_SET::BooleanAdd(), SHAPE_POLY_SET::CloneDropTriangulation(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CSegment(), SHAPE_POLY_SET::Deflate(), ERROR_OUTSIDE, F_Mask, SHAPE_POLY_SET::Fracture(), EDA_SHAPE::GetBezierPoints(), PCB_SHAPE::GetCenter(), BOARD::GetDesignSettings(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetFillMode(), EDA_SHAPE::GetPolyShape(), EDA_SHAPE::GetRadius(), EDA_SHAPE::GetRectangleHeight(), EDA_SHAPE::GetRectangleWidth(), EDA_SHAPE::GetShape(), ODB::GetShapePosition(), EDA_SHAPE::GetStart(), PCB_SHAPE::GetStroke(), STROKE_PARAMS::GetWidth(), PCB_SHAPE::GetWidth(), EDA_SHAPE::IsClockwiseArc(), EDA_SHAPE::IsFilled(), m_board, BOARD_DESIGN_SETTINGS::m_MaxError, SHAPE_POLY_SET::OutlineCount(), SHAPE_POLY_SET::PM_FAST, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, SHAPE_POLY_SET::Simplify(), ODB::SymDouble2String(), PCB_SHAPE::TransformShapeToPolygon(), and UNDEFINED_LAYER.
Referenced by InitFeatureList().
void FEATURES_MANAGER::AddVia | ( | const PCB_VIA * | aVia, |
PCB_LAYER_ID | aLayer | ||
) |
Definition at line 792 of file odb_feature.cpp.
References AddPadShape(), dummy, PCB_VIA::FlashLayer(), PCB_TRACK::GetStart(), and PCB_VIA::Padstack().
Referenced by InitFeatureList().
void FEATURES_MANAGER::AddViaDrillHole | ( | const PCB_VIA * | aVia, |
PCB_LAYER_ID | aLayer | ||
) |
Definition at line 805 of file odb_feature.cpp.
References AddPadShape(), PADSTACK::ALL_LAYERS, dummy, PCB_VIA::GetDrillValue(), and PCB_TRACK::GetStart().
Referenced by InitFeatureList().
|
inlineprivateinherited |
Definition at line 320 of file odb_attribute.h.
|
inlineprivateinherited |
Definition at line 314 of file odb_attribute.h.
References ODB_ATTR::FloatAttribute< T, N >::digits, ODB::Double2String(), and ODB_ATTR::AttributeBase< T, AttrType >::value.
Referenced by ATTR_MANAGER::AddFeatureAttribute().
|
inlineprivateinherited |
Definition at line 326 of file odb_attribute.h.
References ATTR_MANAGER::GetAttrTextNumber(), and ODB_ATTR::AttributeBase< T, AttrType >::value.
void FEATURES_MANAGER::GenerateFeatureFile | ( | std::ostream & | ost | ) | const |
Definition at line 834 of file odb_feature.cpp.
References m_allSymMap, m_featuresList, PCB_IO_ODBPP::m_unitsStr, name, and ATTR_MANAGER::WriteAttributes().
void FEATURES_MANAGER::GenerateProfileFeatures | ( | std::ostream & | ost | ) | const |
Definition at line 816 of file odb_feature.cpp.
References m_featuresList, and PCB_IO_ODBPP::m_unitsStr.
|
protectedinherited |
Definition at line 45 of file odb_attribute.cpp.
References ATTR_MANAGER::GetTextIndex(), ATTR_MANAGER::m_attrNames, and ATTR_MANAGER::m_attrNameVec.
Referenced by ATTR_MANAGER::AddFeatureAttribute().
|
privateinherited |
Definition at line 51 of file odb_attribute.cpp.
References ATTR_MANAGER::GetTextIndex(), ATTR_MANAGER::m_attrTexts, and ATTR_MANAGER::m_attrTextVec.
Referenced by ATTR_MANAGER::AttrValue2String().
|
inlineprivate |
|
inlineprivate |
Definition at line 153 of file odb_feature.h.
References m_allSymMap, and m_symIndex.
Referenced by AddChamferRectSymbol(), AddCircleSymbol(), AddOvalSymbol(), AddRectSymbol(), AddRoundDonutSymbol(), AddRoundRectDonutSymbol(), and AddRoundRectSymbol().
|
privateinherited |
Definition at line 26 of file odb_attribute.cpp.
Referenced by ATTR_MANAGER::GetAttrNameNumber(), and ATTR_MANAGER::GetAttrTextNumber().
void FEATURES_MANAGER::InitFeatureList | ( | PCB_LAYER_ID | aLayer, |
std::vector< BOARD_ITEM * > & | aItems | ||
) |
Definition at line 377 of file odb_feature.cpp.
References add_zone, AddContour(), ATTR_MANAGER::AddFeatureAttribute(), SHAPE_POLY_SET::AddOutline(), AddShape(), AddVia(), AddViaDrillHole(), SHAPE_POLY_SET::CloneDropTriangulation(), ERROR_INSIDE, SHAPE_POLY_SET::Fracture(), BOARD::GetDesignSettings(), PCB_TRACK::GetEnd(), KIFONT::FONT::GetFont(), PCB_ARC::GetMid(), GetODBPlugin(), GetPenSizeForBold(), PCB_IO_ODBPP::GetPlaneSubnetMap(), EDA_TEXT::GetShownText(), PCB_TRACK::GetStart(), PCB_IO_ODBPP::GetViaTraceSubnetMap(), PCB_TRACK::GetWidth(), BOARD_ITEM::IsKnockout(), EDA_TEXT::IsVisible(), TEXT_ATTRIBUTES::m_Angle, m_board, TEXT_ATTRIBUTES::m_Bold, m_featuresList, m_layerName, BOARD_DESIGN_SETTINGS::m_MaxError, TEXT_ATTRIBUTES::m_Multiline, TEXT_ATTRIBUTES::m_Size, TEXT_ATTRIBUTES::m_StrokeWidth, SHAPE_POLY_SET::OutlineCount(), PCB_ARC_T, PCB_FIELD_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_TRACE_T, SHAPE_POLY_SET::PM_FAST, EDA_SHAPE::SetArcGeometry(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetWidth(), text, via, ODB_ATTR::VIA, wxStringSplit(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
protectedinherited |
Definition at line 94 of file odb_attribute.cpp.
References ATTR_MANAGER::WriteAttributesName(), and ATTR_MANAGER::WriteAttributesText().
Referenced by GenerateFeatureFile(), COMPONENTS_MANAGER::Write(), and EDA_DATA::Write().
|
protectedinherited |
Definition at line 76 of file odb_attribute.cpp.
References ATTR_MANAGER::m_attrNameVec, and name.
Referenced by ATTR_MANAGER::WriteAttributes().
|
protectedinherited |
Definition at line 85 of file odb_attribute.cpp.
References ATTR_MANAGER::m_attrTextVec, and name.
Referenced by ATTR_MANAGER::WriteAttributes().
|
private |
Definition at line 178 of file odb_feature.h.
Referenced by GenerateFeatureFile(), and GetSymbolIndex().
|
privateinherited |
Definition at line 332 of file odb_attribute.h.
Referenced by ATTR_MANAGER::GetAttrNameNumber().
|
privateinherited |
Definition at line 333 of file odb_attribute.h.
Referenced by ATTR_MANAGER::GetAttrNameNumber(), and ATTR_MANAGER::WriteAttributesName().
|
privateinherited |
Definition at line 335 of file odb_attribute.h.
Referenced by ATTR_MANAGER::GetAttrTextNumber().
|
privateinherited |
Definition at line 336 of file odb_attribute.h.
Referenced by ATTR_MANAGER::GetAttrTextNumber(), and ATTR_MANAGER::WriteAttributesText().
|
private |
Definition at line 190 of file odb_feature.h.
Referenced by AddPadShape(), AddShape(), and InitFeatureList().
|
private |
Definition at line 176 of file odb_feature.h.
Referenced by AddChamferRectSymbol().
|
private |
Definition at line 169 of file odb_feature.h.
Referenced by AddCircleSymbol().
|
private |
Definition at line 196 of file odb_feature.h.
|
private |
Definition at line 195 of file odb_feature.h.
Referenced by AddFeature(), GenerateFeatureFile(), GenerateProfileFeatures(), InitFeatureList(), and ~FEATURES_MANAGER().
|
private |
Definition at line 192 of file odb_feature.h.
Referenced by InitFeatureList().
|
private |
Definition at line 173 of file odb_feature.h.
Referenced by AddOvalSymbol().
|
private |
Definition at line 171 of file odb_feature.h.
|
private |
Definition at line 191 of file odb_feature.h.
Referenced by GetODBPlugin().
|
private |
Definition at line 172 of file odb_feature.h.
Referenced by AddRectSymbol().
|
private |
Definition at line 170 of file odb_feature.h.
Referenced by AddRoundDonutSymbol().
|
private |
Definition at line 175 of file odb_feature.h.
Referenced by AddRoundRectDonutSymbol().
|
private |
Definition at line 174 of file odb_feature.h.
Referenced by AddRoundRectSymbol().
|
private |
Definition at line 193 of file odb_feature.h.
Referenced by GetSymbolIndex().