KiCad PCB EDA Suite
Loading...
Searching...
No Matches
MODEL_ZONES_OVERVIEW Class Reference

#include <model_zones_overview.h>

Inheritance diagram for MODEL_ZONES_OVERVIEW:

Public Types

enum  { NAME , NET , LAYERS , COL_COUNT }
 

Public Member Functions

 MODEL_ZONES_OVERVIEW (wxWindow *aParent, PCB_BASE_FRAME *aFrame, ZONE_SETTINGS_BAG &aZoneSettingsBag)
 
 ~MODEL_ZONES_OVERVIEW () override=default
 
void EnableFitterByName (bool aEnable)
 
void EnableFitterByNet (bool aEnable)
 
void GetValueByRow (wxVariant &aVariant, unsigned aRow, unsigned aCol) const override
 
bool SetValueByRow (const wxVariant &aVariant, unsigned aRow, unsigned aCol) override
 
unsigned int GetCount () const override
 
ZONEGetZone (wxDataViewItem const &item) const
 
wxDataViewItem GetItemByZone (ZONE *) const
 
std::optional< unsigned > MoveZoneIndex (unsigned aIndex, ZONE_INDEX_MOVEMENT aMovement)
 Move selected zone up/down.
 
std::optional< unsigned > SwapZonePriority (unsigned aDragIndex, unsigned aDropIndex)
 Swap two zone while drag && drop.
 
wxDataViewItem ApplyFilter (wxString const &aFilterText, wxDataViewItem aSelection)
 Filter the zones by the filter text.
 
wxDataViewItem ClearFilter (wxDataViewItem aSelection)
 Clear up the filter.
 

Static Public Member Functions

static std::map< int, wxString > GetColumnNames ()
 

Private Member Functions

void SortFilteredZones ()
 
void OnRowCountChange ()
 

Private Attributes

wxWindow * m_parent
 
PCB_BASE_FRAMEm_frame
 
ZONE_SETTINGS_BAGm_zoneSettingsBag
 
std::vector< ZONE * > m_filteredZones
 
bool m_sortByName
 
bool m_sortByNet
 

Detailed Description

Definition at line 55 of file model_zones_overview.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NAME 
NET 
LAYERS 
COL_COUNT 

Definition at line 58 of file model_zones_overview.h.

Constructor & Destructor Documentation

◆ MODEL_ZONES_OVERVIEW()

MODEL_ZONES_OVERVIEW::MODEL_ZONES_OVERVIEW ( wxWindow * aParent,
PCB_BASE_FRAME * aFrame,
ZONE_SETTINGS_BAG & aZoneSettingsBag )

◆ ~MODEL_ZONES_OVERVIEW()

MODEL_ZONES_OVERVIEW::~MODEL_ZONES_OVERVIEW ( )
overridedefault

Member Function Documentation

◆ ApplyFilter()

wxDataViewItem MODEL_ZONES_OVERVIEW::ApplyFilter ( wxString const & aFilterText,
wxDataViewItem aSelection )

Filter the zones by the filter text.

Parameters
aFilterTextSub text matching zone name, net name or layer name
aSelectionCurrent selection
Returns
unsigned Selection after the filter is applied

Definition at line 239 of file model_zones_overview.cpp.

References ClearFilter(), GetCount(), GetItemByZone(), GetZone(), m_filteredZones, m_sortByName, m_sortByNet, m_zoneSettingsBag, OnRowCountChange(), Reset(), and SortFilteredZones().

◆ ClearFilter()

wxDataViewItem MODEL_ZONES_OVERVIEW::ClearFilter ( wxDataViewItem aSelection)

Clear up the filter.

Parameters
aSelectionCurrent selection
Returns
unsigned

Definition at line 268 of file model_zones_overview.cpp.

References GetCount(), GetItemByZone(), GetZone(), m_filteredZones, m_zoneSettingsBag, OnRowCountChange(), Reset(), and SortFilteredZones().

Referenced by ApplyFilter().

◆ EnableFitterByName()

void MODEL_ZONES_OVERVIEW::EnableFitterByName ( bool aEnable)

Definition at line 144 of file model_zones_overview.cpp.

References m_sortByName.

◆ EnableFitterByNet()

void MODEL_ZONES_OVERVIEW::EnableFitterByNet ( bool aEnable)

Definition at line 150 of file model_zones_overview.cpp.

References m_sortByNet.

◆ GetColumnNames()

static std::map< int, wxString > MODEL_ZONES_OVERVIEW::GetColumnNames ( )
inlinestatic

Definition at line 67 of file model_zones_overview.h.

References _, LAYERS, NAME, and NET.

◆ GetCount()

unsigned int MODEL_ZONES_OVERVIEW::GetCount ( ) const
override

◆ GetItemByZone()

wxDataViewItem MODEL_ZONES_OVERVIEW::GetItemByZone ( ZONE * aZone) const

Definition at line 182 of file model_zones_overview.cpp.

References m_filteredZones.

Referenced by ApplyFilter(), and ClearFilter().

◆ GetValueByRow()

void MODEL_ZONES_OVERVIEW::GetValueByRow ( wxVariant & aVariant,
unsigned aRow,
unsigned aCol ) const
override

◆ GetZone()

ZONE * MODEL_ZONES_OVERVIEW::GetZone ( wxDataViewItem const & item) const

Definition at line 168 of file model_zones_overview.cpp.

References GetCount(), and m_filteredZones.

Referenced by ApplyFilter(), and ClearFilter().

◆ MoveZoneIndex()

std::optional< unsigned > MODEL_ZONES_OVERVIEW::MoveZoneIndex ( unsigned aIndex,
ZONE_INDEX_MOVEMENT aMovement )

Move selected zone up/down.

Returns
std::optional<unsigned> the new index for selected one if success

Definition at line 197 of file model_zones_overview.cpp.

References GetCount(), MOVE_DOWN, MOVE_UP, and SwapZonePriority().

◆ OnRowCountChange()

void MODEL_ZONES_OVERVIEW::OnRowCountChange ( )
private

Definition at line 49 of file model_zones_overview.cpp.

References GetCount(), and m_parent.

Referenced by ApplyFilter(), and ClearFilter().

◆ SetValueByRow()

bool MODEL_ZONES_OVERVIEW::SetValueByRow ( const wxVariant & aVariant,
unsigned aRow,
unsigned aCol )
override

Definition at line 156 of file model_zones_overview.cpp.

◆ SortFilteredZones()

void MODEL_ZONES_OVERVIEW::SortFilteredZones ( )
private

Definition at line 39 of file model_zones_overview.cpp.

References m_filteredZones.

Referenced by ApplyFilter(), and ClearFilter().

◆ SwapZonePriority()

std::optional< unsigned > MODEL_ZONES_OVERVIEW::SwapZonePriority ( unsigned aDragIndex,
unsigned aDropIndex )

Swap two zone while drag && drop.

Returns
std::optional<unsigned> the new index for the dragged one if success

Definition at line 218 of file model_zones_overview.cpp.

References GetCount(), m_filteredZones, and m_zoneSettingsBag.

Referenced by MoveZoneIndex().

Member Data Documentation

◆ m_filteredZones

std::vector<ZONE*> MODEL_ZONES_OVERVIEW::m_filteredZones
private

◆ m_frame

PCB_BASE_FRAME* MODEL_ZONES_OVERVIEW::m_frame
private

Definition at line 135 of file model_zones_overview.h.

Referenced by GetValueByRow(), and MODEL_ZONES_OVERVIEW().

◆ m_parent

wxWindow* MODEL_ZONES_OVERVIEW::m_parent
private

Definition at line 134 of file model_zones_overview.h.

Referenced by MODEL_ZONES_OVERVIEW(), and OnRowCountChange().

◆ m_sortByName

bool MODEL_ZONES_OVERVIEW::m_sortByName
private

Definition at line 138 of file model_zones_overview.h.

Referenced by ApplyFilter(), EnableFitterByName(), and MODEL_ZONES_OVERVIEW().

◆ m_sortByNet

bool MODEL_ZONES_OVERVIEW::m_sortByNet
private

Definition at line 139 of file model_zones_overview.h.

Referenced by ApplyFilter(), EnableFitterByNet(), and MODEL_ZONES_OVERVIEW().

◆ m_zoneSettingsBag

ZONE_SETTINGS_BAG& MODEL_ZONES_OVERVIEW::m_zoneSettingsBag
private

The documentation for this class was generated from the following files: