45#include <wx/choicdlg.h>
54#include <api/board/board_types.pb.h>
55#include <google/protobuf/any.pb.h>
94 wxString
name = aName;
127 return bci->GetNetCode();
141 bci->SetNetCode( aNet );
158 return present( aStart ) && present( aEnd ) && aStart != aEnd;
167 m_hops->Move( aMoveVector );
176 m_hops->Rotate( aAngle, aRotCentre );
185 m_hops->Mirror( aCentre, aFlipDirection );
216 cuMask &= board->GetEnabledLayers();
221 layers.push_back( layer );
231 aCommit->
Add( aItem );
252 std::vector<BOARD_ITEM*> members;
258 std::vector<PCB_LAYER_ID> layers;
261 layers.push_back( layer );
263 if( layers.size() < 2 )
266 const int nHops = (int) layers.size() - 1;
282 auto hopPos = [&](
int aIndex ) ->
VECTOR2I
287 return m_hops->CPoint( aIndex );
291 int last =
m_hops->PointCount() - 1;
295 return m_hops->CPoint( last ) + step * ( aIndex - last );
305 for(
int i = 0; i < nHops; ++i )
308 via->SetNetCode( aNetCode );
310 via->SetLayerPair( layers[i], layers[i + 1] );
312 via->SetDrill( viaDrill );
313 via->SetPosition( hopPos( i ) );
317 via->SetSizeFromRules( viaSize, viaDrill );
325 via->Padstack().Drill().is_filled = filled;
326 via->Padstack().Drill().is_capped = capped;
328 members.push_back(
via );
342 for(
int i = 0; i < nHops - 1; ++i )
367 int layerWidth = trackWidth;
374 members.push_back( trace );
389 return std::make_tuple( (
int)
PCB_VIA_T, (
int)
via->TopLayer(), (
int)
via->BottomLayer() );
401 if( aRebuilt.empty() || aRebuilt.size() !=
GetItems().size() )
404 std::map<std::tuple<int, int, int>,
BOARD_ITEM*> live;
408 std::optional<std::tuple<int, int, int>> key =
memberKey( item );
410 if( !key || !live.emplace( *key, item ).second )
414 std::vector<std::pair<BOARD_ITEM*, BOARD_ITEM*>> matched;
418 std::optional<std::tuple<int, int, int>> key =
memberKey( fresh );
423 auto it = live.find( *key );
425 if( it == live.end() )
428 matched.emplace_back( it->second, fresh );
432 for(
const auto& [item, fresh] : matched )
468 std::vector<BOARD_ITEM*> rebuilt =
BuildMembers( aBoard, net );
515 aCommit->
Add(
this );
533 if( !aBoard || !aCommit )
572 for(
PAD*
pad : footprint->Pads() )
578 if(
pad->IsOnLayer( aLayer ) &&
pad->HitTest( aPosition ) )
579 return pad->GetNetCode();
585 if( track->IsOnLayer( aLayer ) && track->HitTest( aPosition ) )
586 return track->GetNetCode();
591 if( !zone->GetIsRuleArea() && zone->IsOnLayer( aLayer ) && zone->HitTestFilledArea( aLayer, aPosition ) )
593 return zone->GetNetCode();
648static void layerOrder(
BOARD* aBoard, std::vector<PCB_LAYER_ID>& aOrder, std::map<int, int>& aOrdinals )
654 aOrder.push_back( layer );
655 aOrdinals[layer] = n++;
661 std::vector<BOARD_ITEM*>* aMembers, wxString* aError )
663 std::vector<PCB_VIA*> vias;
664 std::vector<PCB_TRACK*> traces;
678 if( !vias.empty() &&
via->GetNetCode() != vias.front()->GetNetCode() )
685 ||
via->GetDrillValue() != vias.front()->GetDrillValue() ) )
689 *aError =
_(
"The selected microvias have different diameters or hole sizes. A "
690 "microvia stack uses one size for every hop." );
696 vias.push_back(
via );
700 traces.push_back(
static_cast<PCB_TRACK*
>( item ) );
708 if( vias.size() < 2 )
711 std::vector<PCB_LAYER_ID> order;
712 std::map<int, int> ordinals;
716 std::map<int, PCB_VIA*> hopByUpper;
720 auto top = ordinals.find(
via->TopLayer() );
721 auto bot = ordinals.find(
via->BottomLayer() );
723 if(
top == ordinals.end() || bot == ordinals.end() )
729 int upper = std::min(
top->second, bot->second );
731 if( hopByUpper.count( upper ) )
734 hopByUpper[upper] =
via;
737 int first = hopByUpper.begin()->first;
738 int last = hopByUpper.rbegin()->first;
740 if( (
int) hopByUpper.size() != last - first + 1 )
743 PCB_VIA* topVia = hopByUpper.begin()->second;
768 capped = capped ||
via->Padstack().Drill().is_capped.value_or(
false );
785 for(
const auto& [upper,
via] : hopByUpper )
796 std::set<int> landing;
797 std::set<VECTOR2I> viaPositions;
799 for(
int i = first + 1; i <= last; ++i )
800 landing.insert( order[i] );
803 viaPositions.insert(
via->GetPosition() );
806 aMembers->push_back(
via );
810 if( landing.count( trace->GetLayer() ) && trace->GetStart() != trace->GetEnd()
811 && trace->GetNetCode() == stack->
GetNetCode() && viaPositions.count( trace->GetStart() )
812 && viaPositions.count( trace->GetEnd() ) )
814 aMembers->push_back( trace );
832 if(
top == aOrdinals.end() || bot == aOrdinals.end() )
841 std::vector<PCB_LAYER_ID> order;
842 std::map<int, int> ordinals;
850 ids.insert( track->m_Uuid );
860 std::vector<PCB_LAYER_ID> order;
861 std::map<int, int> ordinals;
864 std::vector<std::pair<PCB_VIA*, const VIA_STACK_PRESET*>>
candidates;
880 preset = aMatcher(
via );
893 via->LayerPair( &
top, &bottom );
912 aCommit->
Add( stack );
954 for(
int i = 1; i <
m_hops->PointCount(); ++i )
961 rescaled.
Append( rescaled.
CPoint( i - 1 ) + dir,
true );
1018 if( aProps.
get_to(
"start_layer", layerName ) )
1021 if( aProps.
get_to(
"end_layer", layerName ) )
1026 if( aProps.
get_to(
"style", style ) )
1050 stack.mutable_id()->set_value(
m_Uuid.AsStdString() );
1070 stack.mutable_net()->set_name( net->GetNetname().ToUTF8() );
1073 stack.set_locked(
IsLocked() ? LockedState::LS_LOCKED : LockedState::LS_UNLOCKED );
1076 stack.mutable_parent()->set_value(
board->m_Uuid.AsStdString() );
1079 stack.add_members()->set_value( member->m_Uuid.AsStdString() );
1083 if( !aContainer.PackFrom( stack ) )
1084 wxFAIL_MSG( wxT(
"Failed to pack PCB_VIA_STACK" ) );
1093 kiapi::board::types::ViaStack stack;
1095 if( !aContainer.UnpackTo( &stack ) )
1107 if( stack.has_preset_name() )
1108 m_presetName = wxString( stack.preset_name().c_str(), wxConvUTF8 );
1112 if( stack.has_hops() )
1117 if( stack.net().name().empty() )
1120 SetLocked( stack.locked() == LockedState::LS_LOCKED );
1131 for(
const kiapi::common::types::KIID& memberId : stack.members() )
1173 const std::vector<VIA_STACK_PRESET>& presets =
board->GetDesignSettings().m_ViaStackPresets;
1174 int idx =
board->GetDesignSettings().GetViaStackIndex();
1176 if( !presets.empty() )
1178 settings.
ApplyPreset( presets[std::clamp( idx, 0, (
int) presets.size() - 1 )] );
1203 m_frame->ShowInfoBarError(
_(
"The microvia stack layers are not present on this board." ) );
1208 std::vector<PCB_LAYER_ID> spanLayers;
1212 spanLayers.push_back( layer );
1217 spanSet.
set( layer );
1219 int nHops = (int) spanLayers.size() - 1;
1222 if( staggered && settings.
GetPitch() <= 0 )
1236 std::vector<BOARD_ITEM*> previewItems;
1237 std::vector<VECTOR2I> hops;
1239 bool resumeRouting =
false;
1245 hops.push_back( seedPos );
1249 auto clearPreview = [&]()
1256 previewItems.clear();
1262 int drcEpsilon =
board->GetDesignSettings().GetDRCEpsilon();
1264 bool allowDRCViolations =
false;
1267 allowDRCViolations = router->Router()->Settings().AllowDRCViolations();
1269 auto updatePreview =
1279 chain.Append( p,
true );
1281 chain.Append( aCursor,
true );
1283 settings.
SetPosition( hops.empty() ? aCursor : hops.front() );
1287 int previewHops = std::min( (
int) hops.size() + 1, nHops );
1298 preview.
Add( item );
1300 m_view->Update( &preview );
1304 [&](
const VECTOR2I& aCursor ) ->
bool
1322 chain.Append( p,
true );
1340 bool violates =
false;
1360 if( violates && !allowDRCViolations )
1362 m_frame->ShowInfoBarError(
_(
"Microvia stack location violates DRC." ),
true,
1363 WX_INFOBAR::MESSAGE_TYPE::DRC_VIOLATION );
1381 lastViaPos =
via->GetPosition();
1386 commit.
Push(
_(
"Place Microvia Stack" ) );
1394 :
board->GetDesignSettings().GetCurrentViaSize();
1408 grid.SetSnap( aItemSnap );
1410 if( aItemSnap && mag )
1417 return grid.AlignToSegment( aCursor,
SEG( track->GetStart(), track->GetEnd() ) );
1424 return pad->GetPosition();
1428 return grid.ResolveSnap( aCursor,
nullptr ).position;
1447 grid.SetSnap(
false );
1448 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
1450 bool allowItemSnap = !evt->Modifier(
MD_SHIFT );
1454 if( staggered && !hops.empty() )
1458 VECTOR2I dir = rawCursor - hops.back();
1465 if( evt->Modifier(
MD_CTRL ) )
1471 double ang = atan2( (
double) dir.
y, (
double) dir.
x );
1472 ang = round( ang / step ) * step;
1474 cursorPos = hops.back()
1483 lastDir = cursorPos - hops.back();
1487 cursorPos = snapToCopper( rawCursor, allowItemSnap );
1493 if( staggered && !hops.empty() )
1494 m_controls->ForceCursorPosition(
true, cursorPos );
1498 if( evt->IsCancelInteractive() || evt->IsActivate() )
1509 hops.push_back( cursorPos );
1511 if( (
int) hops.size() >= nHops )
1513 if( !placeStack( cursorPos ) )
1526 resumeRouting =
true;
1527 resumePos = lastViaPos;
1537 m_controls->ForceCursorPosition(
true, cursorPos );
1538 updatePreview( cursorPos );
1543 if( placeStack( cursorPos ) )
1549 resumeRouting =
true;
1550 resumePos = lastViaPos;
1560 if( staggered && hops.size() > ( seeded ? 1u : 0u ) )
1564 updatePreview( cursorPos );
1574 updatePreview( cursorPos );
1578 evt->SetPassEvent();
1583 m_view->Remove( &preview );
1597 router->SetViaStackResumeLayer( settings.
GetEndLayer() );
1599 m_controls->WarpMouseCursor( resumePos,
true,
false );
1631 if( layerEnum.
Choices().GetCount() == 0 )
1644 const wxString groupStack =
_HKI(
"Microvia Stack Properties" );
1648 startLayer->SetChoices( layerEnum.
Choices() );
1653 endLayer->SetChoices( layerEnum.
Choices() );
1677 auto isStaggered = [](
INSPECTABLE* aItem ) ->
bool
KICOMMON_API types::KiCadObjectType ToProtoEnum(KICAD_T aValue)
KICOMMON_API KICAD_T FromProtoEnum(types::KiCadObjectType aValue)
constexpr EDA_IU_SCALE pcbIUScale
SEG MIRROR_AXIS(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection)
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static TOOL_ACTION cursorDblClick
static TOOL_ACTION doDelete
static TOOL_ACTION cursorClick
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION refreshPreview
BASE_SET & set(size_t pos)
void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
bool RemoveOrDiscard(BOARD_ITEM *aItem)
Remove aItem, or free it if it was added earlier in this commit and never reached the board.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
virtual bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
Container for design settings for a BOARD object.
int GetCurrentViaSize() const
std::shared_ptr< DRC_ENGINE > m_DRCEngine
int GetCurrentTrackWidth() const
int GetCurrentViaDrill() const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
void SetUuidDirect(const KIID &aUuid)
Raw UUID assignment.
PCB_LAYER_ID GetFlippedLayer(PCB_LAYER_ID aLayer) const
Return the layer paired with aLayer on the opposite side of the board.
bool IsLocked() const override
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
const ZONES & Zones() const
int GetCopperLayerCount() const
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
BOARD_DESIGN_SETTINGS & GetDesignSettings()
COMMIT & Remove(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Remove a new item from the model.
void Unmodify(EDA_ITEM *aItem, BASE_SCREEN *aScreen)
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Add a new item to the model.
SEVERITY GetSeverity() const
const MINOPTMAX< int > & GetValue() const
Design Rule Checker object that performs all the DRC tests.
DRC_CONSTRAINT EvalRules(DRC_CONSTRAINT_T aConstraintType, const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr)
std::unordered_set< EDA_ITEM * > m_items
std::unordered_set< EDA_ITEM * > & GetItems()
void RemoveItem(EDA_ITEM *aItem)
Remove item from group.
void AddItem(EDA_ITEM *aItem)
Add item to group.
std::unordered_set< EDA_ITEM * > m_deserializedItems
A base class for most all the KiCad significant classes used in schematics and boards.
void SetFlags(EDA_ITEM_FLAGS aMask)
virtual EDA_GROUP * GetParentGroup() const
KICAD_T Type() const
Returns the type of object.
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
virtual void SetParent(EDA_ITEM *aParent)
EDA_ITEM_FLAGS GetFlags() const
ENUM_MAP & Map(T aValue, const wxString &aName)
static ENUM_MAP< T > & Instance()
ENUM_MAP & Undefined(T aValue)
Class that other classes need to inherit from, in order to be inspectable.
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
static int NameToLayer(wxString &aName)
Return the layer number from a layer name.
static const LSET & AllLayersMask()
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
A collection of nets and the parameters used to route or test these nets.
bool HasuViaDrill() const
bool HasuViaDiameter() const
int GetuViaDiameter() const
bool HasTrackWidth() const
int GetTrackWidth() const
Handle the data for a net.
static constexpr PCB_LAYER_ID ALL_LAYERS
! The layer identifier to use for the single defintion on normal padstacks
static TOOL_ACTION routeSingleTrack
Activation of the Push and Shove router.
Common, abstract interface for edit frames.
virtual void SetProperties(const STRING_ANY_MAP &aProps)
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
PCB_GENERATOR(BOARD_ITEM *aParent, PCB_LAYER_ID aLayer)
void Mirror(const VECTOR2I &aCentre, FLIP_DIRECTION aMirrorDirection) override
Mirror this object relative to a given horizontal axis the layer is not changed.
void SetPosition(const VECTOR2I &aPos) override
VECTOR2I GetPosition() const override
void Move(const VECTOR2I &aMoveVector) override
Move this object.
virtual const STRING_ANY_MAP GetProperties() const
std::unordered_set< BOARD_ITEM * > GetBoardItems() const
void SetLocked(bool aLocked) override
void SetEnd(const VECTOR2I &aEnd)
void SetStart(const VECTOR2I &aStart)
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
virtual void SetWidth(int aWidth)
virtual int GetWidth() const
A microvia stack: several single hop microvias, plus connecting traces for staggered stacks,...
VIA_STACK_PRESET ToPreset() const
void SetHops(const SHAPE_LINE_CHAIN &aHops)
void EditCancel(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
bool Update(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
void ApplyPreset(const VIA_STACK_PRESET &aPreset)
static int ExpandMultiHopMicrovias(BOARD *aBoard, BOARD_COMMIT *aCommit, const std::function< const VIA_STACK_PRESET *(PCB_VIA *)> &aMatcher=nullptr)
Replace loose microvias spanning more than one hop with stacks of single hop microvias.
void SetProperties(const STRING_ANY_MAP &aProps) override
void SetPitch(int aPitch)
static PCB_VIA_STACK * CreateFromItems(const std::vector< BOARD_ITEM * > &aItems, BOARD *aBoard, std::vector< BOARD_ITEM * > *aMembers=nullptr, wxString *aError=nullptr)
Build a stack from existing board items (microvias plus optional connecting traces).
static std::set< KIID > CollectExpandableMicrovias(BOARD *aBoard)
Ids of the vias ExpandMultiHopMicrovias would consider right now.
static const wxString GENERATOR_TYPE
void EditStart(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
void Mirror(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Mirror this object relative to a given horizontal axis the layer is not changed.
static int FindNetAtPosition(BOARD *aBoard, const VECTOR2I &aPosition, PCB_LAYER_ID aLayer)
Net of the copper under a point on the given layer, pads first, then tracks, then filled zones.
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
std::optional< SHAPE_LINE_CHAIN > m_hops
void EditFinish(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
void Remove(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
void Regenerate(BOARD *aBoard, BOARD_COMMIT *aCommit)
Rebuild the member vias (and, for a staggered stack, the connecting traces) from the current stack se...
void addMember(BOARD *aBoard, BOARD_COMMIT *aCommit, BOARD_ITEM *aItem)
bool reuseMembers(BOARD_COMMIT *aCommit, const std::vector< BOARD_ITEM * > &aRebuilt)
static const wxString DISPLAY_NAME
VIA_STACK_STYLE GetStyle() const
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
void SetFilled(bool aFilled)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
PCB_LAYER_ID m_startLayer
PCB_LAYER_ID GetStartLayer() const
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void SetStartLayer(PCB_LAYER_ID aLayer)
PCB_LAYER_ID GetEndLayer() const
bool GetUseNetclass() const
std::vector< BOARD_ITEM * > BuildMembers(BOARD *aBoard, int aNetCode) const
Build the member vias/traces for the current settings and return them without adding them anywhere.
static bool IsSpanValid(BOARD *aBoard, PCB_LAYER_ID aStart, PCB_LAYER_ID aEnd)
True when both span ends are copper layers within the board's copper layer count.
void SetViaSize(int aSize)
void SetCapped(bool aCapped)
void SetViaDrill(int aDrill)
void ShowPropertiesDialog(PCB_BASE_EDIT_FRAME *aEditFrame) override
const STRING_ANY_MAP GetProperties() const override
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void SetStyle(VIA_STACK_STYLE aStyle)
wxString GetCommitMessage() const override
PCB_VIA_STACK(BOARD_ITEM *aParent=nullptr, PCB_LAYER_ID aLayer=F_Cu)
void Move(const VECTOR2I &aMoveVector) override
Move this object.
void SetEndLayer(PCB_LAYER_ID aLayer)
void SetNetCode(int aNet)
static std::pair< int, int > GetNetclassViaSize(BOARD *aBoard, int aNetCode)
The microvia diameter and drill that "use netclass values" gives hops on aNetCode,...
PCB_LAYER_ID BottomLayer() const
VECTOR2I GetPosition() const override
const PADSTACK & Padstack() const
void SetLayerPair(PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)
For a via m_layer contains the top layer, the other layer is in m_bottomLayer/.
int GetWidth() const override
void SetViaType(VIATYPE aViaType)
PCB_LAYER_ID TopLayer() const
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
VIATYPE GetViaType() const
void SetWidth(int aWidth) override
PROPERTY_BASE & SetAvailableFunc(std::function< bool(INSPECTABLE *)> aFunc)
Set a callback function to determine whether an object provides this property.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
void Mask(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName)
Sets a base class property as masked in a derived class.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
RAII class that sets an value at construction and resets it to the original value at destruction.
virtual void Add(EDA_ITEM *aItem)
A null aItem is ignored; the selection never holds null members.
virtual void Clear() override
Remove all the stored items from the group.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
A name/value tuple with unique names and wxAny values.
void set_iu(const std::string &aKey, const T &aVar)
bool get_to(const std::string &aKey, T &aVar) const
std::optional< T > get_opt(const std::string &aKey) const
void set(const std::string &aKey, const T &aVar)
bool get_to_iu(const std::string &aKey, T &aVar) const
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
VECTOR2< T > Resize(T aNewLength) const
Return a vector of the same direction, but length specified in aNewLength.
Handle a list of polygons defining a copper zone.
static bool empty(const wxTextEntryBase *aCtrl)
#define IS_NEW
New item, just created.
#define ROUTER_TRANSIENT
transient items that should NOT be cached
#define IN_EDIT
Item currently edited.
a few functions useful in geometry calculations.
LEADER_MODE
The kind of the leader line.
@ DIRECT
Unconstrained point-to-point.
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
@ LAYER_ANCHOR
Anchor of items having an anchor point (texts, footprints).
bool IsExternalCopperLayer(int aLayerId)
Test whether a layer is an external (F_Cu or B_Cu) copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
PCB_LAYER_ID ToLAYER_ID(int aLayer)
KICOMMON_API void PackCustomProperties(google::protobuf::RepeatedPtrField< types::CustomProperty > *aOutput, const EDA_ITEM &aItem)
KICOMMON_API SHAPE_LINE_CHAIN UnpackPolyLine(const types::PolyLine &aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API void UnpackCustomProperties(const google::protobuf::RepeatedPtrField< types::CustomProperty > &aInput, EDA_ITEM &aItem)
KICOMMON_API void PackPolyLine(types::PolyLine &aOutput, const SHAPE_LINE_CHAIN &aSlc, const EDA_IU_SCALE &aScale)
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
static GENERATORS_MGR::REGISTER< PCB_TUNING_PATTERN > registerMe
static VIA_STACK_STYLE styleFromString(const wxString &aStr)
static struct PCB_VIA_STACK_DESC _PCB_VIA_STACK_DESC
static PCB_LAYER_ID layerFromName(const wxString &aName, PCB_LAYER_ID aFallback)
static wxString styleToString(VIA_STACK_STYLE aStyle)
static void layerOrder(BOARD *aBoard, std::vector< PCB_LAYER_ID > &aOrder, std::map< int, int > &aOrdinals)
static std::optional< std::tuple< int, int, int > > memberKey(BOARD_ITEM *aItem)
static bool isExpandableMicrovia(const std::map< int, int > &aOrdinals, PCB_VIA *aVia)
#define TYPE_HASH(x)
Macro to generate unique identifier for a type.
#define IMPLEMENT_ENUM_TO_WXANY(type)
#define NO_SETTER(owner, type)
Macro to define read-only fields (no setter method available)
@ PT_SIZE
Size expressed in distance units (mm/inch)
@ PT_NET
Net selection property.
#define REGISTER_TYPE(x)
Helper macro to map type hashes to names.
Static helper to register a generator.
std::optional< bool > is_capped
True if the drill hole should be capped.
std::optional< bool > is_filled
True if the drill hole should be filled completely.
A named microvia stack definition, chosen while routing instead of entering the values each time.
PCB_LAYER_ID m_StartLayer
KIBIS top(path, &reporter)
static std::vector< int > candidates(const SEGMENT_INDEX &aIndex, const SEG &aQuery, int aPadding)
const SHAPE_LINE_CHAIN chain
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
VECTOR2< int32_t > VECTOR2I