KiCad PCB EDA Suite
dialog_copper_zones.cpp File Reference
#include <wx/radiobut.h>
#include <kiface_base.h>
#include <confirm.h>
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <zones.h>
#include <widgets/unit_binder.h>
#include <zone.h>
#include <pad.h>
#include <board.h>
#include <trigo.h>
#include <eda_pattern_match.h>
#include <dialog_copper_zones_base.h>
#include <string_utils.h>

Go to the source code of this file.

Classes

class  DIALOG_COPPER_ZONE
 

Functions

int InvokeCopperZonesEditor (PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings)
 Function InvokeCopperZonesEditor invokes up a modal dialog window for copper zone editing. More...
 
static bool sortNetsByNodes (const NETINFO_ITEM *a, const NETINFO_ITEM *b)
 
static bool sortNetsByNames (const NETINFO_ITEM *a, const NETINFO_ITEM *b)
 

Variables

static std::vector< int > padCountListByNet
 

Function Documentation

◆ InvokeCopperZonesEditor()

int InvokeCopperZonesEditor ( PCB_BASE_FRAME aCaller,
ZONE_SETTINGS aSettings,
CONVERT_SETTINGS aConvertSettings = nullptr 
)

Function InvokeCopperZonesEditor invokes up a modal dialog window for copper zone editing.

Parameters
aCalleris the PCB_BASE_FRAME calling parent window for the modal dialog, and it gives access to the BOARD through PCB_BASE_FRAME::GetBoard().
aSettingspoints to the ZONE_SETTINGS to edit.
Returns
int - tells if user aborted, changed only one zone, or all of them.

Definition at line 134 of file dialog_copper_zones.cpp.

136{
137 DIALOG_COPPER_ZONE dlg( aCaller, aSettings, aConvertSettings );
138
139 return dlg.ShowQuasiModal();
140}

References DIALOG_SHIM::ShowQuasiModal().

Referenced by ZONE_CREATE_HELPER::createNewZone(), CONVERT_TOOL::CreatePolys(), PCB_EDIT_FRAME::Edit_Zone_Params(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), and BOARD_EDITOR_CONTROL::ZoneDuplicate().

◆ sortNetsByNames()

static bool sortNetsByNames ( const NETINFO_ITEM a,
const NETINFO_ITEM b 
)
static

Definition at line 163 of file dialog_copper_zones.cpp.

164{
165 return a->GetNetname() < b->GetNetname();
166}
const wxString & GetNetname() const
Definition: netinfo.h:125

References NETINFO_ITEM::GetNetname().

Referenced by DIALOG_COPPER_ZONE::sortNetsIfRequired().

◆ sortNetsByNodes()

static bool sortNetsByNodes ( const NETINFO_ITEM a,
const NETINFO_ITEM b 
)
static

Definition at line 150 of file dialog_copper_zones.cpp.

151{
152 int countA = padCountListByNet[a->GetNetCode()];
153 int countB = padCountListByNet[b->GetNetCode()];
154
155 if( countA == countB )
156 return a->GetNetname() < b->GetNetname();
157 else
158 return countB < countA;
159}
int GetNetCode() const
Definition: netinfo.h:119
static std::vector< int > padCountListByNet

References NETINFO_ITEM::GetNetCode(), NETINFO_ITEM::GetNetname(), and padCountListByNet.

Referenced by DIALOG_COPPER_ZONE::sortNetsByPadCount().

Variable Documentation

◆ padCountListByNet

std::vector<int> padCountListByNet
static