|
KiCad PCB EDA Suite
|
#include "altium_pcb.h"#include "altium_parser_pcb.h"#include <altium_pcb_compound_file.h>#include <io/altium/altium_ascii_parser.h>#include <io/altium/altium_binary_parser.h>#include <io/altium/altium_parser_utils.h>#include <io/altium/altium_props_utils.h>#include <io/io_utils.h>#include <io/altium/altium_project_variants.h>#include <board.h>#include <board_design_settings.h>#include <board_design_settings_defaults.h>#include <project/net_settings.h>#include <footprint.h>#include <layer_range.h>#include <layer_utils.h>#include <pcb_dimension.h>#include <pad.h>#include <pcb_shape.h>#include <pcb_text.h>#include <pcb_textbox.h>#include <pcb_track.h>#include <pcb_barcode.h>#include <pcb_generator.h>#include <generators_mgr.h>#include <generators/pcb_tuning_pattern.h>#include <router/pns_meander.h>#include <geometry/shape_circle.h>#include <geometry/shape_line_chain.h>#include <core/profile.h>#include <string_utils.h>#include <tools/pad_tool.h>#include <zone.h>#include <board_stackup_manager/stackup_predefined_prms.h>#include <cmath>#include <set>#include <advanced_config.h>#include <compoundfilereader.h>#include <convert_basic_shapes_to_polygon.h>#include <font/outline_font.h>#include <project.h>#include <reporter.h>#include <trigo.h>#include <utf.h>#include <wx/docview.h>#include <wx/log.h>#include <wx/mstream.h>#include <wx/wfstream.h>#include <wx/zstream.h>#include <progress_reporter.h>#include <magic_enum.hpp>#include <thread_pool.h>#include <limits>#include <unordered_set>Go to the source code of this file.
Functions | |
| bool | IsAltiumLayerCopper (ALTIUM_LAYER aLayer) |
| bool | IsAltiumLayerAPlane (ALTIUM_LAYER aLayer) |
| wxString | AltiumUnnamedNetName (const BOARD &aBoard, int &aCounter) |
| Invent a placeholder name for an Altium net that has none. | |
| static bool | IsAltiumScopeAll (const wxString &aExpr) |
| static bool | GetAltiumNetclassScopeName (const ARULE6 &aRule, wxString *aNetclassName) |
| void | ApplyAltiumNetclassRules (const std::map< ALTIUM_RULE_KIND, std::vector< ARULE6 > > &aRulesByKind, NET_SETTINGS &aNetSettings, std::vector< const ARULE6 * > *aUnresolved) |
| Copy the values of Altium rules scoped to a single netclass onto that netclass. | |
| void | HelperShapeLineChainFromAltiumVertices (SHAPE_LINE_CHAIN &aLine, const std::vector< ALTIUM_VERTICE > &aVertices) |
| static void | MoveOpenCourtyardItems (BOARD &aBoard) |
| static void | altiumMakePadLayerCustom (PAD *aPad, PCB_LAYER_ID aLayer, int aMaxError) |
| static void | altiumSplitPadstackPerLayer (PAD *aPad, const LSET &aBoardCopper) |
| static void | altiumIsolatePadLayer (PAD *aPad, PCB_LAYER_ID aLayer, const LSET &aBoardCopper) |
| static LSET | altiumStackupCopper (const LSET &aDrawnCopper, int aMinCopperLayers) |
| static void | altiumSetFootprintStackup (FOOTPRINT *aFootprint, const LSET &aDrawnCopper, int aMinCopperLayers) |
| static bool | IsLayerNameCourtyard (const wxString &aName) |
| static bool | IsLayerNameAssembly (const wxString &aName) |
| static bool | IsLayerNameTopSide (const wxString &aName) |
| double | normalizeAngleDegrees (double Angle, double aMin, double aMax) |
| Normalize angle to be aMin < angle <= aMax angle is in degrees. | |
| static void | altiumCollectSchematicNetNames (const wxString &aFileName, std::map< wxString, wxString > &aNames, std::set< wxString > &aAmbiguous) |
| static PAD * | altiumFindTouchingPad (FOOTPRINT *aFootprint, PCB_LAYER_ID aLayer, int aNetCode, const SHAPE &aShape, const PAD *aExclude=nullptr) |
Variables | |
| constexpr double | BOLD_FACTOR = 1.75 |
| constexpr int | ALTIUM_TOP_PADSTACK_IDX = 0 |
| constexpr int | ALTIUM_MID1_PADSTACK_IDX = 1 |
| constexpr int | ALTIUM_MID2_PADSTACK_IDX = 2 |
| constexpr int | ALTIUM_BOTTOM_PADSTACK_IDX = 31 |
| constexpr int | ALTIUM_PADSTACK_IDX_COUNT = 32 |
|
static |
Definition at line 3400 of file altium_pcb.cpp.
References ALTIUM_ASCII_PARSER::CanRead(), IO_UTILS::COMPOUND_FILE_HEADER, IO_UTILS::fileHasBinaryHeader(), ALTIUM_COMPOUND_FILE::FindStream(), ALTIUM_BINARY_PARSER::GetRemainingBytes(), name, ALTIUM_PROPS_UTILS::ReadInt(), ALTIUM_ASCII_PARSER::ReadProperties(), ALTIUM_BINARY_PARSER::ReadProperties(), and ALTIUM_PROPS_UTILS::ReadString().
Referenced by ALTIUM_PCB::MapSchematicNetNames().
|
static |
Definition at line 6116 of file altium_pcb.cpp.
References SHAPE::BBox(), SHAPE::Collide(), PAD::GetNumber(), BOX2< Vec >::Intersects(), pad, and FOOTPRINT::Pads().
Referenced by ALTIUM_PCB::HelperFoldComponentCopperIntoPads(), and ALTIUM_PCB::HelperFoldPendingCopper().
|
static |
Definition at line 1068 of file altium_pcb.cpp.
References LSET::AllCuMask(), altiumSplitPadstackPerLayer(), B_Cu, PADSTACK::CopperLayer(), PADSTACK::FRONT_INNER_BACK, PAD::GetLayerSet(), PADSTACK::INNER_LAYERS, IsInnerCopperLayer(), PADSTACK::Mode(), PADSTACK::NORMAL, PAD::Padstack(), PAD::SetDirty(), and PADSTACK::SetMode().
Referenced by ALTIUM_PCB::HelperFoldPendingCopper(), and ALTIUM_PCB::ParseFootprint().
|
static |
Definition at line 1003 of file altium_pcb.cpp.
References PAD::AddPrimitive(), CIRCLE, CUSTOM, ERROR_INSIDE, PAD::GetOrientation(), PAD::GetShape(), PAD::GetSize(), PCB_SHAPE::Move(), POLY, RECTANGLE, PCB_SHAPE::Rotate(), PAD::SetAnchorPadShape(), EDA_SHAPE::SetFilled(), PCB_SHAPE::SetPolyShape(), PAD::SetShape(), PAD::SetSize(), PCB_SHAPE::SetStroke(), PAD::ShapePos(), SOLID, PAD::TransformShapeToPolygon(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ALTIUM_PCB::HelperFoldPendingCopper(), and ALTIUM_PCB::ParseFootprint().
|
static |
Definition at line 1099 of file altium_pcb.cpp.
References LSET::AllCuMask(), altiumStackupCopper(), CUSTOM_LAYERS, LAYER_UTILS::GetAllFootprintLayers(), FOOTPRINT::GraphicalItems(), LSET::InternalCuMask(), IsCopperLayer(), FOOTPRINT::Remove(), FOOTPRINT::SetStackupLayers(), FOOTPRINT::SetStackupMode(), LSET::UserDefinedLayersMask(), and FOOTPRINT::Zones().
Referenced by ALTIUM_PCB::HelperSetFootprintStackups().
Definition at line 1036 of file altium_pcb.cpp.
References PADSTACK::CopperLayer(), PADSTACK::CUSTOM, PADSTACK::COPPER_LAYER_PROPS::custom_shapes, PAD::GetLayerSet(), PADSTACK::Mode(), PAD::Padstack(), PAD::SetDirty(), and PADSTACK::SetMode().
Referenced by altiumIsolatePadLayer().
Definition at line 1091 of file altium_pcb.cpp.
References LSET::AllCuMask(), and LAYER_UTILS::MinimalCopperLayerCount().
Referenced by altiumSetFootprintStackup(), and ALTIUM_PCB::ParseFootprint().
| wxString AltiumUnnamedNetName | ( | const BOARD & | aBoard, |
| int & | aCounter ) |
Invent a placeholder name for an Altium net that has none.
NETINFO_LIST keys nets by name and the unconnected net owns the empty string, so a nameless net has to be given one or it is merged into another net. aCounter is advanced past every candidate that is already taken on aBoard.
Definition at line 105 of file altium_pcb.cpp.
References BOARD::FindNet(), and name.
Referenced by BOOST_AUTO_TEST_CASE(), and ALTIUM_PCB::ParseNets6Data().
| void ApplyAltiumNetclassRules | ( | const std::map< ALTIUM_RULE_KIND, std::vector< ARULE6 > > & | aRulesByKind, |
| NET_SETTINGS & | aNetSettings, | ||
| std::vector< const ARULE6 * > * | aUnresolved = nullptr ) |
Copy the values of Altium rules scoped to a single netclass onto that netclass.
Only rules of the form InNetClass('<name>') against All are considered, and only for the clearance, width and routing-via kinds. Each vector in aRulesByKind must be sorted by ARULE6::priority ascending; the first enabled match for a netclass wins, because Altium priority 1 is the most specific. Disabled rules are skipped.
aUnresolved, when given, collects the rules that name a netclass the board does not define. Those constraints are lost, and the pointers alias aRulesByKind.
Definition at line 142 of file altium_pcb.cpp.
References CLEARANCE, GetAltiumNetclassScopeName(), NET_SETTINGS::GetNetclasses(), ROUTING_VIAS, and WIDTH.
Referenced by BOOST_AUTO_TEST_CASE(), and ALTIUM_PCB::ParseRules6Data().
|
static |
Definition at line 125 of file altium_pcb.cpp.
References IsAltiumScopeAll(), ARULE6::scope1expr, and ARULE6::scope2expr.
Referenced by ApplyAltiumNetclassRules(), and ALTIUM_PCB::ParseRules6Data().
| void HelperShapeLineChainFromAltiumVertices | ( | SHAPE_LINE_CHAIN & | aLine, |
| const std::vector< ALTIUM_VERTICE > & | aVertices ) |
Definition at line 265 of file altium_pcb.cpp.
References SHAPE_LINE_CHAIN::Append(), EDA_ANGLE::AsDegrees(), DEG2RAD(), DEGREES_T, VECTOR2< T >::Distance(), KiROUND(), EDA_ANGLE::Normalize(), pcbIUScale, and SHAPE_LINE_CHAIN::SetClosed().
Referenced by ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItem(), ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertShapeBasedRegions6ToFootprintCopper(), ALTIUM_PCB::ConvertShapeBasedRegions6ToFootprintItem(), ALTIUM_PCB::ConvertShapeBasedRegions6ToFootprintItemOnLayer(), ALTIUM_PCB::HelperCreateBoardOutline(), ALTIUM_PCB::ParseBoard6Data(), and ALTIUM_PCB::ParsePolygons6Data().
| bool IsAltiumLayerAPlane | ( | ALTIUM_LAYER | aLayer | ) |
Definition at line 99 of file altium_pcb.cpp.
References INTERNAL_PLANE_1, and INTERNAL_PLANE_16.
Referenced by ALTIUM_PCB::ConvertArcs6ToBoardItem(), ALTIUM_PCB::ConvertArcs6ToFootprintItem(), ALTIUM_PCB::ConvertPads6ToBoardItem(), ALTIUM_PCB::ConvertPads6ToFootprintItem(), ALTIUM_PCB::ConvertTracks6ToBoardItem(), ALTIUM_PCB::ConvertTracks6ToFootprintItem(), ALTIUM_PCB::HelperGetKeepoutRestrictions(), ALTIUM_PCB::ParseBoard6Data(), ALTIUM_PCB::ParsePolygons6Data(), and ALTIUM_PCB::remapUnsureLayers().
| bool IsAltiumLayerCopper | ( | ALTIUM_LAYER | aLayer | ) |
Definition at line 92 of file altium_pcb.cpp.
References BOTTOM_LAYER, MULTI_LAYER, and TOP_LAYER.
Referenced by ALTIUM_PCB::ConvertFills6ToFootprintItem(), ALTIUM_PCB::ConvertPads6ToBoardItem(), and ALTIUM_PCB::ConvertPads6ToFootprintItem().
|
static |
Definition at line 119 of file altium_pcb.cpp.
Referenced by GetAltiumNetclassScopeName(), and ALTIUM_PCB::GetRuleDefault().
|
static |
Definition at line 1817 of file altium_pcb.cpp.
Referenced by ALTIUM_PCB::remapUnsureLayers().
|
static |
Definition at line 1808 of file altium_pcb.cpp.
Referenced by ALTIUM_PCB::remapUnsureLayers().
|
static |
Definition at line 1825 of file altium_pcb.cpp.
Referenced by ALTIUM_PCB::remapUnsureLayers().
|
static |
Definition at line 509 of file altium_pcb.cpp.
References ARC, B_CrtYd, B_Fab, epsilon, F_CrtYd, F_Fab, BOARD::Footprints(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), PCB_SHAPE_T, pcbIUScale, SEGMENT, PCB_SHAPE::SetEnd(), and PCB_SHAPE::SetStart().
Referenced by ALTIUM_PCB::Parse().
| double normalizeAngleDegrees | ( | double | Angle, |
| double | aMin, | ||
| double | aMax ) |
Normalize angle to be aMin < angle <= aMax angle is in degrees.
Definition at line 2676 of file altium_pcb.cpp.
Referenced by ALTIUM_PCB::ConvertComponentBody6ToFootprintItem(), and ALTIUM_PCB::ParseComponentsBodies6Data().
|
constexpr |
Definition at line 88 of file altium_pcb.cpp.
Referenced by ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), ALTIUM_PCB::ConvertVias6ToBoardItem(), ALTIUM_PCB::ConvertVias6ToFootprintItem(), and ALTIUM_PCB::HelperFoldComponentCopperIntoPads().
|
constexpr |
Definition at line 86 of file altium_pcb.cpp.
Referenced by ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), ALTIUM_PCB::ConvertVias6ToBoardItem(), ALTIUM_PCB::ConvertVias6ToFootprintItem(), and ALTIUM_PCB::HelperFoldComponentCopperIntoPads().
|
constexpr |
Definition at line 87 of file altium_pcb.cpp.
Referenced by ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper().
|
constexpr |
Definition at line 89 of file altium_pcb.cpp.
Referenced by ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper().
|
constexpr |
Definition at line 85 of file altium_pcb.cpp.
Referenced by ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), ALTIUM_PCB::ConvertVias6ToBoardItem(), ALTIUM_PCB::ConvertVias6ToFootprintItem(), and ALTIUM_PCB::HelperFoldComponentCopperIntoPads().
|
constexpr |
Definition at line 82 of file altium_pcb.cpp.
Referenced by ALTIUM_PCB::HelperParseDimensions6Linear(), and ALTIUM_PCB::HelperParseDimensions6Radial().