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) |
void | AddViaProtection (const PCB_VIA *aVia, bool drill, 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 | AddSystemAttribute (Tr &r, Ta v) |
template<typename Tr, typename Ta> | |
void | AddUserDefAttribute (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.
References m_board, m_layerName, and m_plugin.
|
inlinevirtual |
Definition at line 57 of file odb_feature.h.
References m_featuresList.
|
inlineprivate |
Definition at line 133 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 95 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 69 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 183 of file odb_feature.h.
References m_featuresList.
Referenced by AddFeatureArc(), AddFeatureLine(), AddFeatureSurface(), AddPadCircle(), AddPadShape(), and AddShape().
void FEATURES_MANAGER::AddFeatureArc | ( | const VECTOR2I & | aStart, |
const VECTOR2I & | aEnd, | ||
const VECTOR2I & | aCenter, | ||
uint64_t | aWidth, | ||
ODB_DIRECTION | aDirection ) |
Definition at line 50 of file odb_feature.cpp.
References AddCircleSymbol(), AddFeature(), ODB::AddXY(), and ODB::SymDouble2String().
Referenced by AddShape().
void FEATURES_MANAGER::AddFeatureLine | ( | const VECTOR2I & | aStart, |
const VECTOR2I & | aEnd, | ||
uint64_t | aWidth ) |
Definition at line 42 of file odb_feature.cpp.
References AddCircleSymbol(), AddFeature(), 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 230 of file odb_feature.cpp.
References AddFeature().
Referenced by AddContour().
|
inlineprivate |
Definition at line 112 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 59 of file odb_feature.cpp.
References AddCircleSymbol(), AddFeature(), ODB::AddXY(), and ODB::SymDouble2String().
void FEATURES_MANAGER::AddPadShape | ( | const PAD & | aPad, |
PCB_LAYER_ID | aLayer ) |
Definition at line 237 of file odb_feature.cpp.
References std::abs(), AddChamferRectSymbol(), AddCircleSymbol(), AddContour(), AddFeature(), AddOvalSymbol(), AddRectSymbol(), AddRoundRectSymbol(), ODB::AddXY(), ANGLE_0, B_Mask, B_Paste, center, chamfer, CHAMFERED_RECT, CIRCLE, LSET::Contains(), CUSTOM, ERROR_INSIDE, F_Mask, F_Paste, PAD::GetChamferPositions(), PAD::GetChamferRectRatio(), PAD::GetOrientation(), BOARD_ITEM::GetParentFootprint(), PAD::GetRoundRectCornerRadius(), PAD::GetShape(), PAD::GetSize(), PAD::GetSolderMaskExpansion(), PAD::GetSolderPasteMargin(), SHAPE_POLY_SET::InflateWithLinkedHoles(), FOOTPRINT::IsFlipped(), KiROUND(), m_board, PAD::MergePrimitivesAsPolygon(), SHAPE_POLY_SET::Move(), SHAPE_POLY_SET::OutlineCount(), OVAL, RECTANGLE, SHAPE_POLY_SET::Rotate(), ROUND_ALL_CORNERS, ROUNDRECT, PAD::ShapePos(), ODB::SymDouble2String(), PAD::TransformShapeToPolygon(), TRAPEZOID, UNDEFINED_LAYER, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by AddVia(), AddViaDrillHole(), and InitFeatureList().
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 106 of file odb_feature.h.
References GetSymbolIndex(), m_rectSymMap, and ODB_DIM_X.
Referenced by AddPadShape().
|
inlineprivate |
Definition at line 100 of file odb_feature.h.
References GetSymbolIndex(), m_roundDonutSymMap, and ODB_DIM_X.
Referenced by AddShape().
|
inlineprivate |
Definition at line 125 of file odb_feature.h.
References GetSymbolIndex(), m_roundRectDonutSymMap, ODB_DIM_R, and ODB_DIM_X.
Referenced by AddShape().
|
inlineprivate |
Definition at line 118 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 83 of file odb_feature.cpp.
References SEG::A, std::abs(), AddCircleSymbol(), AddContour(), AddFeature(), AddFeatureArc(), AddFeatureLine(), AddRoundDonutSymbol(), AddRoundRectDonutSymbol(), AddRoundRectSymbol(), ODB::AddXY(), ARC, SEG::B, B_Mask, BEZIER, SHAPE_POLY_SET::BooleanAdd(), CCW, center, CHAMFER_ALL_CORNERS, CIRCLE, SHAPE_POLY_SET::CloneDropTriangulation(), LSET::Contains(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CSegment(), CW, SHAPE_POLY_SET::Deflate(), ERROR_OUTSIDE, F_Mask, FILLED_SHAPE, SHAPE_POLY_SET::Fracture(), EDA_SHAPE::GetBezierPoints(), PCB_SHAPE::GetCenter(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetHatching(), EDA_SHAPE::GetPolyShape(), EDA_SHAPE::GetRadius(), EDA_SHAPE::GetRectangleHeight(), EDA_SHAPE::GetRectangleWidth(), EDA_SHAPE::GetShape(), ODB::GetShapePosition(), EDA_SHAPE::GetStart(), PCB_SHAPE::GetWidth(), EDA_SHAPE::IsClockwiseArc(), EDA_SHAPE::IsHatchedFill(), EDA_SHAPE::IsSolidFill(), m_board, SHAPE_POLY_SET::OutlineCount(), POLY, RECTANGLE, SEGMENT, SHAPE_POLY_SET::Simplify(), ODB::SymDouble2String(), PCB_SHAPE::TransformShapeToPolygon(), and UNDEFINED_LAYER.
Referenced by InitFeatureList().
|
inlineinherited |
Definition at line 307 of file odb_attribute.h.
References AttrValue2String(), GetAttrNameNumber(), and name.
Referenced by COMPONENTS_MANAGER::AddComponent(), and FEATURES_MANAGER::InitFeatureList().
|
inlineinherited |
Definition at line 319 of file odb_attribute.h.
References AttrValue2String(), and GetAttrNameNumber().
void FEATURES_MANAGER::AddVia | ( | const PCB_VIA * | aVia, |
PCB_LAYER_ID | aLayer ) |
Definition at line 796 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 809 of file odb_feature.cpp.
References AddPadShape(), PADSTACK::ALL_LAYERS, dummy, PCB_VIA::GetDrillValue(), and PCB_TRACK::GetStart().
Referenced by InitFeatureList().
void FEATURES_MANAGER::AddViaProtection | ( | const PCB_VIA * | aVia, |
bool | drill, | ||
PCB_LAYER_ID | aLayer ) |
References FILLED_SHAPE.
|
inlineprivateinherited |
Definition at line 350 of file odb_attribute.h.
|
inlineprivateinherited |
Definition at line 344 of file odb_attribute.h.
References ODB_ATTR::FloatAttribute< T, N >::digits, ODB::Double2String(), and ODB_ATTR::AttributeBase< T, AttrType >::value.
Referenced by AddSystemAttribute(), and AddUserDefAttribute().
|
inlineprivateinherited |
Definition at line 356 of file odb_attribute.h.
References GetAttrTextNumber(), and ODB_ATTR::AttributeBase< T, AttrType >::value.
void FEATURES_MANAGER::GenerateFeatureFile | ( | std::ostream & | ost | ) | const |
Definition at line 838 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 820 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 GetTextIndex(), m_attrNames, and m_attrNameVec.
Referenced by AddSystemAttribute(), and AddUserDefAttribute().
|
privateinherited |
Definition at line 51 of file odb_attribute.cpp.
References GetTextIndex(), m_attrTexts, and m_attrTextVec.
Referenced by AttrValue2String().
|
inlineprivate |
|
inlineprivate |
Definition at line 155 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 GetAttrNameNumber(), and GetAttrTextNumber().
void FEATURES_MANAGER::InitFeatureList | ( | PCB_LAYER_ID | aLayer, |
std::vector< BOARD_ITEM * > & | aItems ) |
Definition at line 371 of file odb_feature.cpp.
References add_zone, AddContour(), SHAPE_POLY_SET::AddOutline(), AddPadShape(), AddShape(), ATTR_MANAGER::AddSystemAttribute(), AddVia(), AddViaDrillHole(), PADSTACK::ALL_LAYERS, ARC, CIRCLE, SHAPE_POLY_SET::CloneDropTriangulation(), dummy, end, ERROR_INSIDE, FILLED_SHAPE, SHAPE_POLY_SET::Fracture(), EDA_TEXT::GetAttributes(), EDA_TEXT::GetDrawFont(), EDA_TEXT::GetDrawRotation(), EDA_TEXT::GetEffectiveTextPenWidth(), PCB_TRACK::GetEnd(), EDA_TEXT::GetLinePositions(), PCB_ARC::GetMid(), GetODBPlugin(), PCB_IO_ODBPP::GetPadSubnetMap(), GetPenSizeForBold(), PCB_IO_ODBPP::GetPlaneSubnetMap(), EDA_TEXT::GetShownText(), PCB_TRACK::GetStart(), EDA_TEXT::GetTextPos(), PCB_IO_ODBPP::GetViaTraceSubnetMap(), PCB_TRACK::GetWidth(), EDA_TEXT::IsMultilineAllowed(), EDA_TEXT::IsVisible(), TEXT_ATTRIBUTES::m_Angle, m_board, TEXT_ATTRIBUTES::m_Bold, m_featuresList, m_layerName, TEXT_ATTRIBUTES::m_Multiline, TEXT_ATTRIBUTES::m_Size, TEXT_ATTRIBUTES::m_StrokeWidth, ODB_ATTR::NON_PLATED, PADSTACK::NORMAL, SHAPE_POLY_SET::OutlineCount(), OVAL, pad, PCB_ARC_T, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_DIM_RADIAL_T, PCB_DIMENSION_T, PCB_FIELD_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TARGET_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, ODB_ATTR::PLATED, PTH, SEGMENT, EDA_SHAPE::SetArcGeometry(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetWidth(), text, ODB_ATTR::TOEPRINT, UNDEFINED_LAYER, ODB_ATTR::VIA, via, wxStringSplit(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
protectedinherited |
Definition at line 94 of file odb_attribute.cpp.
References WriteAttributesName(), and WriteAttributesText().
Referenced by FEATURES_MANAGER::GenerateFeatureFile(), COMPONENTS_MANAGER::Write(), and EDA_DATA::Write().
|
protectedinherited |
Definition at line 76 of file odb_attribute.cpp.
References m_attrNameVec, and name.
Referenced by WriteAttributes().
|
protectedinherited |
Definition at line 85 of file odb_attribute.cpp.
References m_attrTextVec, and name.
Referenced by WriteAttributes().
|
private |
Definition at line 180 of file odb_feature.h.
Referenced by GenerateFeatureFile(), and GetSymbolIndex().
|
privateinherited |
Definition at line 362 of file odb_attribute.h.
Referenced by GetAttrNameNumber().
|
privateinherited |
Definition at line 363 of file odb_attribute.h.
Referenced by GetAttrNameNumber(), and WriteAttributesName().
|
privateinherited |
Definition at line 365 of file odb_attribute.h.
Referenced by GetAttrTextNumber().
|
privateinherited |
Definition at line 366 of file odb_attribute.h.
Referenced by GetAttrTextNumber(), and WriteAttributesText().
|
private |
Definition at line 192 of file odb_feature.h.
Referenced by AddPadShape(), AddShape(), FEATURES_MANAGER(), and InitFeatureList().
|
private |
Definition at line 178 of file odb_feature.h.
Referenced by AddChamferRectSymbol().
|
private |
Definition at line 171 of file odb_feature.h.
Referenced by AddCircleSymbol().
|
private |
Definition at line 198 of file odb_feature.h.
|
private |
Definition at line 197 of file odb_feature.h.
Referenced by AddFeature(), GenerateFeatureFile(), GenerateProfileFeatures(), InitFeatureList(), and ~FEATURES_MANAGER().
|
private |
Definition at line 194 of file odb_feature.h.
Referenced by FEATURES_MANAGER(), and InitFeatureList().
|
private |
Definition at line 175 of file odb_feature.h.
Referenced by AddOvalSymbol().
|
private |
Definition at line 173 of file odb_feature.h.
|
private |
Definition at line 193 of file odb_feature.h.
Referenced by FEATURES_MANAGER(), and GetODBPlugin().
|
private |
Definition at line 174 of file odb_feature.h.
Referenced by AddRectSymbol().
|
private |
Definition at line 172 of file odb_feature.h.
Referenced by AddRoundDonutSymbol().
|
private |
Definition at line 177 of file odb_feature.h.
Referenced by AddRoundRectDonutSymbol().
|
private |
Definition at line 176 of file odb_feature.h.
Referenced by AddRoundRectSymbol().
|
private |
Definition at line 195 of file odb_feature.h.
Referenced by GetSymbolIndex().