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 );
155 return present( aStart ) && present( aEnd ) && aStart != aEnd;
164 m_hops->Move( aMoveVector );
173 m_hops->Rotate( aAngle, aRotCentre );
182 m_hops->Mirror( aCentre, aFlipDirection );
194 m_hops->Mirror( aCentre, aFlipDirection );
204 cuMask &= board->GetEnabledLayers();
209 layers.push_back( layer );
219 aCommit->
Add( aItem );
240 std::vector<BOARD_ITEM*> members;
246 std::vector<PCB_LAYER_ID> layers;
249 layers.push_back( layer );
251 if( layers.size() < 2 )
254 const int nHops = (int) layers.size() - 1;
270 auto hopPos = [&](
int aIndex ) ->
VECTOR2I
275 return m_hops->CPoint( aIndex );
279 int last =
m_hops->PointCount() - 1;
283 return m_hops->CPoint( last ) + step * ( aIndex - last );
293 for(
int i = 0; i < nHops; ++i )
296 via->SetNetCode( aNetCode );
298 via->SetLayerPair( layers[i], layers[i + 1] );
300 via->SetDrill( viaDrill );
301 via->SetPosition( hopPos( i ) );
305 via->SetSizeFromRules( viaSize, viaDrill );
313 via->Padstack().Drill().is_filled = filled;
314 via->Padstack().Drill().is_capped = capped;
316 members.push_back(
via );
330 for(
int i = 0; i < nHops - 1; ++i )
355 int layerWidth = trackWidth;
362 members.push_back( trace );
377 return std::make_tuple( (
int)
PCB_VIA_T, (
int)
via->TopLayer(), (
int)
via->BottomLayer() );
389 if( aRebuilt.empty() || aRebuilt.size() !=
GetItems().size() )
392 std::map<std::tuple<int, int, int>,
BOARD_ITEM*> live;
396 std::optional<std::tuple<int, int, int>> key =
memberKey( item );
398 if( !key || !live.emplace( *key, item ).second )
402 std::vector<std::pair<BOARD_ITEM*, BOARD_ITEM*>> matched;
406 std::optional<std::tuple<int, int, int>> key =
memberKey( fresh );
411 auto it = live.find( *key );
413 if( it == live.end() )
416 matched.emplace_back( it->second, fresh );
420 for(
const auto& [item, fresh] : matched )
456 std::vector<BOARD_ITEM*> rebuilt =
BuildMembers( aBoard, net );
503 aCommit->
Add(
this );
521 if( !aBoard || !aCommit )
560 for(
PAD*
pad : footprint->Pads() )
566 if(
pad->IsOnLayer( aLayer ) &&
pad->HitTest( aPosition ) )
567 return pad->GetNetCode();
573 if( track->IsOnLayer( aLayer ) && track->HitTest( aPosition ) )
574 return track->GetNetCode();
579 if( !zone->GetIsRuleArea() && zone->IsOnLayer( aLayer ) && zone->HitTestFilledArea( aLayer, aPosition ) )
581 return zone->GetNetCode();
636static void layerOrder(
BOARD* aBoard, std::vector<PCB_LAYER_ID>& aOrder, std::map<int, int>& aOrdinals )
642 aOrder.push_back( layer );
643 aOrdinals[layer] = n++;
649 std::vector<BOARD_ITEM*>* aMembers, wxString* aError )
651 std::vector<PCB_VIA*> vias;
652 std::vector<PCB_TRACK*> traces;
666 if( !vias.empty() &&
via->GetNetCode() != vias.front()->GetNetCode() )
673 ||
via->GetDrillValue() != vias.front()->GetDrillValue() ) )
677 *aError =
_(
"The selected microvias have different diameters or hole sizes. A "
678 "microvia stack uses one size for every hop." );
684 vias.push_back(
via );
688 traces.push_back(
static_cast<PCB_TRACK*
>( item ) );
696 if( vias.size() < 2 )
699 std::vector<PCB_LAYER_ID> order;
700 std::map<int, int> ordinals;
704 std::map<int, PCB_VIA*> hopByUpper;
708 auto top = ordinals.find(
via->TopLayer() );
709 auto bot = ordinals.find(
via->BottomLayer() );
711 if(
top == ordinals.end() || bot == ordinals.end() )
717 int upper = std::min(
top->second, bot->second );
719 if( hopByUpper.count( upper ) )
722 hopByUpper[upper] =
via;
725 int first = hopByUpper.begin()->first;
726 int last = hopByUpper.rbegin()->first;
728 if( (
int) hopByUpper.size() != last - first + 1 )
731 PCB_VIA* topVia = hopByUpper.begin()->second;
756 capped = capped ||
via->Padstack().Drill().is_capped.value_or(
false );
773 for(
const auto& [upper,
via] : hopByUpper )
784 std::set<int> landing;
785 std::set<VECTOR2I> viaPositions;
787 for(
int i = first + 1; i <= last; ++i )
788 landing.insert( order[i] );
791 viaPositions.insert(
via->GetPosition() );
794 aMembers->push_back(
via );
798 if( landing.count( trace->GetLayer() ) && trace->GetStart() != trace->GetEnd()
799 && trace->GetNetCode() == stack->
GetNetCode() && viaPositions.count( trace->GetStart() )
800 && viaPositions.count( trace->GetEnd() ) )
802 aMembers->push_back( trace );
820 if(
top == aOrdinals.end() || bot == aOrdinals.end() )
829 std::vector<PCB_LAYER_ID> order;
830 std::map<int, int> ordinals;
838 ids.insert( track->m_Uuid );
848 std::vector<PCB_LAYER_ID> order;
849 std::map<int, int> ordinals;
852 std::vector<std::pair<PCB_VIA*, const VIA_STACK_PRESET*>>
candidates;
868 preset = aMatcher(
via );
881 via->LayerPair( &
top, &bottom );
900 aCommit->
Add( stack );
942 for(
int i = 1; i <
m_hops->PointCount(); ++i )
949 rescaled.
Append( rescaled.
CPoint( i - 1 ) + dir,
true );
1006 if( aProps.
get_to(
"start_layer", layerName ) )
1009 if( aProps.
get_to(
"end_layer", layerName ) )
1014 if( aProps.
get_to(
"style", style ) )
1038 stack.mutable_id()->set_value(
m_Uuid.AsStdString() );
1058 stack.mutable_net()->set_name( net->GetNetname().ToUTF8() );
1061 stack.set_locked(
IsLocked() ? LockedState::LS_LOCKED : LockedState::LS_UNLOCKED );
1064 stack.mutable_parent()->set_value(
board->m_Uuid.AsStdString() );
1067 stack.add_members()->set_value( member->m_Uuid.AsStdString() );
1070 aContainer.PackFrom( stack );
1079 kiapi::board::types::ViaStack stack;
1081 if( !aContainer.UnpackTo( &stack ) )
1093 if( stack.has_preset_name() )
1094 m_presetName = wxString( stack.preset_name().c_str(), wxConvUTF8 );
1098 if( stack.has_hops() )
1103 if( stack.net().name().empty() )
1106 SetLocked( stack.locked() == LockedState::LS_LOCKED );
1117 for(
const kiapi::common::types::KIID& memberId : stack.members() )
1159 const std::vector<VIA_STACK_PRESET>& presets =
board->GetDesignSettings().m_ViaStackPresets;
1160 int idx =
board->GetDesignSettings().GetViaStackIndex();
1162 if( !presets.empty() )
1164 settings.
ApplyPreset( presets[std::clamp( idx, 0, (
int) presets.size() - 1 )] );
1189 m_frame->ShowInfoBarError(
_(
"The microvia stack layers are not present on this board." ) );
1194 std::vector<PCB_LAYER_ID> spanLayers;
1198 spanLayers.push_back( layer );
1203 spanSet.
set( layer );
1205 int nHops = (int) spanLayers.size() - 1;
1208 if( staggered && settings.
GetPitch() <= 0 )
1222 std::vector<BOARD_ITEM*> previewItems;
1223 std::vector<VECTOR2I> hops;
1225 bool resumeRouting =
false;
1231 hops.push_back( seedPos );
1235 auto clearPreview = [&]()
1242 previewItems.clear();
1247 std::shared_ptr<DRC_ENGINE> drcEngine =
board->GetDesignSettings().m_DRCEngine;
1248 int drcEpsilon =
board->GetDesignSettings().GetDRCEpsilon();
1250 bool allowDRCViolations =
false;
1253 allowDRCViolations = router->Router()->Settings().AllowDRCViolations();
1255 auto updatePreview = [&](
const VECTOR2I& aCursor )
1264 chain.Append( p,
true );
1266 chain.Append( aCursor,
true );
1268 settings.
SetPosition( hops.empty() ? aCursor : hops.front() );
1272 int previewHops = std::min( (
int) hops.size() + 1, nHops );
1283 preview.
Add( item );
1285 m_view->Update( &preview );
1288 auto placeStack = [&](
const VECTOR2I& aCursor ) ->
bool
1306 chain.Append( p,
true );
1324 bool violates =
false;
1344 if( violates && !allowDRCViolations )
1346 m_frame->ShowInfoBarError(
_(
"Microvia stack location violates DRC." ),
true,
1347 WX_INFOBAR::MESSAGE_TYPE::DRC_VIOLATION );
1365 lastViaPos =
via->GetPosition();
1370 commit.
Push(
_(
"Place Microvia Stack" ) );
1384 auto snapToCopper = [&](
const VECTOR2I& aCursor,
bool aItemSnap ) ->
VECTOR2I
1390 grid.SetSnap( aItemSnap );
1392 if( aItemSnap && mag )
1397 return grid.AlignToSegment( aCursor,
SEG( track->GetStart(), track->GetEnd() ) );
1403 return pad->GetPosition();
1407 return grid.ResolveSnap( aCursor,
nullptr ).position;
1410 auto setCursor = [&]()
1425 grid.SetSnap(
false );
1426 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
1428 bool allowItemSnap = !evt->Modifier(
MD_SHIFT );
1432 if( staggered && !hops.empty() )
1436 VECTOR2I dir = rawCursor - hops.back();
1443 if( evt->Modifier(
MD_CTRL ) )
1449 double ang = atan2( (
double) dir.
y, (
double) dir.
x );
1450 ang = round( ang / step ) * step;
1452 cursorPos = hops.back()
1461 lastDir = cursorPos - hops.back();
1465 cursorPos = snapToCopper( rawCursor, allowItemSnap );
1471 if( staggered && !hops.empty() )
1472 m_controls->ForceCursorPosition(
true, cursorPos );
1476 if( evt->IsCancelInteractive() || evt->IsActivate() )
1487 hops.push_back( cursorPos );
1489 if( (
int) hops.size() >= nHops )
1491 if( !placeStack( cursorPos ) )
1504 resumeRouting =
true;
1505 resumePos = lastViaPos;
1515 m_controls->ForceCursorPosition(
true, cursorPos );
1516 updatePreview( cursorPos );
1521 if( placeStack( cursorPos ) )
1527 resumeRouting =
true;
1528 resumePos = lastViaPos;
1538 if( staggered && hops.size() > ( seeded ? 1u : 0u ) )
1542 updatePreview( cursorPos );
1552 updatePreview( cursorPos );
1556 evt->SetPassEvent();
1561 m_view->Remove( &preview );
1575 router->SetViaStackResumeLayer( settings.
GetEndLayer() );
1577 m_controls->WarpMouseCursor( resumePos,
true,
false );
1609 if( layerEnum.
Choices().GetCount() == 0 )
1622 const wxString groupStack =
_HKI(
"Microvia Stack Properties" );
1626 startLayer->SetChoices( layerEnum.
Choices() );
1631 endLayer->SetChoices( layerEnum.
Choices() );
1655 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.
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
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayer) 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