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 );
197 m_hops->Mirror( aCentre, aFlipDirection );
207 cuMask &= board->GetEnabledLayers();
212 layers.push_back( layer );
222 aCommit->
Add( aItem );
243 std::vector<BOARD_ITEM*> members;
249 std::vector<PCB_LAYER_ID> layers;
252 layers.push_back( layer );
254 if( layers.size() < 2 )
257 const int nHops = (int) layers.size() - 1;
273 auto hopPos = [&](
int aIndex ) ->
VECTOR2I
278 return m_hops->CPoint( aIndex );
282 int last =
m_hops->PointCount() - 1;
286 return m_hops->CPoint( last ) + step * ( aIndex - last );
296 for(
int i = 0; i < nHops; ++i )
299 via->SetNetCode( aNetCode );
301 via->SetLayerPair( layers[i], layers[i + 1] );
303 via->SetDrill( viaDrill );
304 via->SetPosition( hopPos( i ) );
308 via->SetSizeFromRules( viaSize, viaDrill );
316 via->Padstack().Drill().is_filled = filled;
317 via->Padstack().Drill().is_capped = capped;
319 members.push_back(
via );
333 for(
int i = 0; i < nHops - 1; ++i )
358 int layerWidth = trackWidth;
365 members.push_back( trace );
380 return std::make_tuple( (
int)
PCB_VIA_T, (
int)
via->TopLayer(), (
int)
via->BottomLayer() );
392 if( aRebuilt.empty() || aRebuilt.size() !=
GetItems().size() )
395 std::map<std::tuple<int, int, int>,
BOARD_ITEM*> live;
399 std::optional<std::tuple<int, int, int>> key =
memberKey( item );
401 if( !key || !live.emplace( *key, item ).second )
405 std::vector<std::pair<BOARD_ITEM*, BOARD_ITEM*>> matched;
409 std::optional<std::tuple<int, int, int>> key =
memberKey( fresh );
414 auto it = live.find( *key );
416 if( it == live.end() )
419 matched.emplace_back( it->second, fresh );
423 for(
const auto& [item, fresh] : matched )
459 std::vector<BOARD_ITEM*> rebuilt =
BuildMembers( aBoard, net );
506 aCommit->
Add(
this );
524 if( !aBoard || !aCommit )
563 for(
PAD*
pad : footprint->Pads() )
569 if(
pad->IsOnLayer( aLayer ) &&
pad->HitTest( aPosition ) )
570 return pad->GetNetCode();
576 if( track->IsOnLayer( aLayer ) && track->HitTest( aPosition ) )
577 return track->GetNetCode();
582 if( !zone->GetIsRuleArea() && zone->IsOnLayer( aLayer ) && zone->HitTestFilledArea( aLayer, aPosition ) )
584 return zone->GetNetCode();
639static void layerOrder(
BOARD* aBoard, std::vector<PCB_LAYER_ID>& aOrder, std::map<int, int>& aOrdinals )
645 aOrder.push_back( layer );
646 aOrdinals[layer] = n++;
652 std::vector<BOARD_ITEM*>* aMembers, wxString* aError )
654 std::vector<PCB_VIA*> vias;
655 std::vector<PCB_TRACK*> traces;
669 if( !vias.empty() &&
via->GetNetCode() != vias.front()->GetNetCode() )
676 ||
via->GetDrillValue() != vias.front()->GetDrillValue() ) )
680 *aError =
_(
"The selected microvias have different diameters or hole sizes. A "
681 "microvia stack uses one size for every hop." );
687 vias.push_back(
via );
691 traces.push_back(
static_cast<PCB_TRACK*
>( item ) );
699 if( vias.size() < 2 )
702 std::vector<PCB_LAYER_ID> order;
703 std::map<int, int> ordinals;
707 std::map<int, PCB_VIA*> hopByUpper;
711 auto top = ordinals.find(
via->TopLayer() );
712 auto bot = ordinals.find(
via->BottomLayer() );
714 if(
top == ordinals.end() || bot == ordinals.end() )
720 int upper = std::min(
top->second, bot->second );
722 if( hopByUpper.count( upper ) )
725 hopByUpper[upper] =
via;
728 int first = hopByUpper.begin()->first;
729 int last = hopByUpper.rbegin()->first;
731 if( (
int) hopByUpper.size() != last - first + 1 )
734 PCB_VIA* topVia = hopByUpper.begin()->second;
759 capped = capped ||
via->Padstack().Drill().is_capped.value_or(
false );
776 for(
const auto& [upper,
via] : hopByUpper )
787 std::set<int> landing;
788 std::set<VECTOR2I> viaPositions;
790 for(
int i = first + 1; i <= last; ++i )
791 landing.insert( order[i] );
794 viaPositions.insert(
via->GetPosition() );
797 aMembers->push_back(
via );
801 if( landing.count( trace->GetLayer() ) && trace->GetStart() != trace->GetEnd()
802 && trace->GetNetCode() == stack->
GetNetCode() && viaPositions.count( trace->GetStart() )
803 && viaPositions.count( trace->GetEnd() ) )
805 aMembers->push_back( trace );
823 if(
top == aOrdinals.end() || bot == aOrdinals.end() )
832 std::vector<PCB_LAYER_ID> order;
833 std::map<int, int> ordinals;
841 ids.insert( track->m_Uuid );
851 std::vector<PCB_LAYER_ID> order;
852 std::map<int, int> ordinals;
855 std::vector<std::pair<PCB_VIA*, const VIA_STACK_PRESET*>>
candidates;
871 preset = aMatcher(
via );
884 via->LayerPair( &
top, &bottom );
903 aCommit->
Add( stack );
945 for(
int i = 1; i <
m_hops->PointCount(); ++i )
952 rescaled.
Append( rescaled.
CPoint( i - 1 ) + dir,
true );
1009 if( aProps.
get_to(
"start_layer", layerName ) )
1012 if( aProps.
get_to(
"end_layer", layerName ) )
1017 if( aProps.
get_to(
"style", style ) )
1041 stack.mutable_id()->set_value(
m_Uuid.AsStdString() );
1061 stack.mutable_net()->set_name( net->GetNetname().ToUTF8() );
1064 stack.set_locked(
IsLocked() ? LockedState::LS_LOCKED : LockedState::LS_UNLOCKED );
1067 stack.mutable_parent()->set_value(
board->m_Uuid.AsStdString() );
1070 stack.add_members()->set_value( member->m_Uuid.AsStdString() );
1073 aContainer.PackFrom( stack );
1082 kiapi::board::types::ViaStack stack;
1084 if( !aContainer.UnpackTo( &stack ) )
1096 if( stack.has_preset_name() )
1097 m_presetName = wxString( stack.preset_name().c_str(), wxConvUTF8 );
1101 if( stack.has_hops() )
1106 if( stack.net().name().empty() )
1109 SetLocked( stack.locked() == LockedState::LS_LOCKED );
1120 for(
const kiapi::common::types::KIID& memberId : stack.members() )
1162 const std::vector<VIA_STACK_PRESET>& presets =
board->GetDesignSettings().m_ViaStackPresets;
1163 int idx =
board->GetDesignSettings().GetViaStackIndex();
1165 if( !presets.empty() )
1167 settings.
ApplyPreset( presets[std::clamp( idx, 0, (
int) presets.size() - 1 )] );
1192 m_frame->ShowInfoBarError(
_(
"The microvia stack layers are not present on this board." ) );
1197 std::vector<PCB_LAYER_ID> spanLayers;
1201 spanLayers.push_back( layer );
1206 spanSet.
set( layer );
1208 int nHops = (int) spanLayers.size() - 1;
1211 if( staggered && settings.
GetPitch() <= 0 )
1225 std::vector<BOARD_ITEM*> previewItems;
1226 std::vector<VECTOR2I> hops;
1228 bool resumeRouting =
false;
1234 hops.push_back( seedPos );
1238 auto clearPreview = [&]()
1245 previewItems.clear();
1251 int drcEpsilon =
board->GetDesignSettings().GetDRCEpsilon();
1253 bool allowDRCViolations =
false;
1256 allowDRCViolations = router->Router()->Settings().AllowDRCViolations();
1258 auto updatePreview =
1268 chain.Append( p,
true );
1270 chain.Append( aCursor,
true );
1272 settings.
SetPosition( hops.empty() ? aCursor : hops.front() );
1276 int previewHops = std::min( (
int) hops.size() + 1, nHops );
1287 preview.
Add( item );
1289 m_view->Update( &preview );
1293 [&](
const VECTOR2I& aCursor ) ->
bool
1311 chain.Append( p,
true );
1329 bool violates =
false;
1349 if( violates && !allowDRCViolations )
1351 m_frame->ShowInfoBarError(
_(
"Microvia stack location violates DRC." ),
true,
1352 WX_INFOBAR::MESSAGE_TYPE::DRC_VIOLATION );
1370 lastViaPos =
via->GetPosition();
1375 commit.
Push(
_(
"Place Microvia Stack" ) );
1383 :
board->GetDesignSettings().GetCurrentViaSize();
1397 grid.SetSnap( aItemSnap );
1399 if( aItemSnap && mag )
1406 return grid.AlignToSegment( aCursor,
SEG( track->GetStart(), track->GetEnd() ) );
1413 return pad->GetPosition();
1417 return grid.ResolveSnap( aCursor,
nullptr ).position;
1436 grid.SetSnap(
false );
1437 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
1439 bool allowItemSnap = !evt->Modifier(
MD_SHIFT );
1443 if( staggered && !hops.empty() )
1447 VECTOR2I dir = rawCursor - hops.back();
1454 if( evt->Modifier(
MD_CTRL ) )
1460 double ang = atan2( (
double) dir.
y, (
double) dir.
x );
1461 ang = round( ang / step ) * step;
1463 cursorPos = hops.back()
1472 lastDir = cursorPos - hops.back();
1476 cursorPos = snapToCopper( rawCursor, allowItemSnap );
1482 if( staggered && !hops.empty() )
1483 m_controls->ForceCursorPosition(
true, cursorPos );
1487 if( evt->IsCancelInteractive() || evt->IsActivate() )
1498 hops.push_back( cursorPos );
1500 if( (
int) hops.size() >= nHops )
1502 if( !placeStack( cursorPos ) )
1515 resumeRouting =
true;
1516 resumePos = lastViaPos;
1526 m_controls->ForceCursorPosition(
true, cursorPos );
1527 updatePreview( cursorPos );
1532 if( placeStack( cursorPos ) )
1538 resumeRouting =
true;
1539 resumePos = lastViaPos;
1549 if( staggered && hops.size() > ( seeded ? 1u : 0u ) )
1553 updatePreview( cursorPos );
1563 updatePreview( cursorPos );
1567 evt->SetPassEvent();
1572 m_view->Remove( &preview );
1586 router->SetViaStackResumeLayer( settings.
GetEndLayer() );
1588 m_controls->WarpMouseCursor( resumePos,
true,
false );
1620 if( layerEnum.
Choices().GetCount() == 0 )
1633 const wxString groupStack =
_HKI(
"Microvia Stack Properties" );
1637 startLayer->SetChoices( layerEnum.
Choices() );
1642 endLayer->SetChoices( layerEnum.
Choices() );
1666 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
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
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
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