KiCad PCB EDA Suite
dialog_copper_zones.cpp File Reference
#include <kiface_base.h>
#include <confirm.h>
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <zones.h>
#include <bitmaps.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)
 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 
)

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 131 of file dialog_copper_zones.cpp.

132 {
133  DIALOG_COPPER_ZONE dlg( aCaller, aSettings );
134 
135  return dlg.ShowQuasiModal();
136 }

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 159 of file dialog_copper_zones.cpp.

160 {
161  return a->GetNetname() < b->GetNetname();
162 }
const wxString & GetNetname() const
Definition: netinfo.h:119

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 146 of file dialog_copper_zones.cpp.

147 {
148  int countA = padCountListByNet[a->GetNetCode()];
149  int countB = padCountListByNet[b->GetNetCode()];
150 
151  if( countA == countB )
152  return a->GetNetname() < b->GetNetname();
153  else
154  return countB < countA;
155 }
static std::vector< int > padCountListByNet
const wxString & GetNetname() const
Definition: netinfo.h:119
int GetNetCode() const
Definition: netinfo.h:113

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

Referenced by DIALOG_COPPER_ZONE::sortNetsByPadCount().

Variable Documentation

◆ padCountListByNet

std::vector<int> padCountListByNet
static