30#include <wx/dcmemory.h>
32#include <wx/variant.h>
42 []( std::shared_ptr<ZONE_PRIORITY_CONTAINER>
const& l,
43 std::shared_ptr<ZONE_PRIORITY_CONTAINER>
const& r
47 return l->GetCurrentPriority() > r->GetCurrentPriority();
53 wxCommandEvent rowCountChange( EVT_ZONES_OVERVIEW_COUNT_CHANGE );
55 wxPostEvent(
m_dialog, rowCountChange );
61 wxBitmap bitmap( aSize );
66 iconDC.SelectObject( bitmap );
67 brush.SetStyle( wxBRUSHSTYLE_SOLID );
68 const int layer_cout = layers.size();
69 std::vector<PCB_LAYER_ID> layersToDraw;
74 { layers[0], layers[1], layers[layer_cout - 1], layers[layer_cout - 2] } )
75 layersToDraw.push_back( i );
79 layersToDraw = layers;
82 const int step =
static_cast<int>( aSize.x / layersToDraw.size() );
84 for(
size_t i = 0; i < layersToDraw.size(); ++i )
87 brush.SetColour(
color.ToColour() );
88 pen.SetColour(
color.ToColour() );
89 iconDC.SetBrush( brush );
91 iconDC.DrawRectangle( 0, i * step, aSize.x, step );
100 wxWindow* a_dialog ) :
101 m_allZoneContainers( aZones ),
102 m_filteredZoneContainers(
std::
move( aZones ) ), m_pcb( a_pcb ), m_PCB_FRAME( aPCB_FRAME ),
103 m_dialog( a_dialog ), m_sortByName( true ), m_sortByNet( true )
111 unsigned aCol )
const
124 wxArrayString layers;
129 aVariant << wxDataViewIconText(
130 wxJoin( layers,
',' ),
133 { LAYER_BAR_WIDTH, ZONE_MANAGER_PREFERENCE::LAYER_ICON_SIZE::HEIGHT } ) );
169 unsigned int aRow = GetRow( aItem );
197 case ZONE_INDEX_MOVEMENT::MOVE_UP:
200 : std::optional<unsigned>{};
202 case ZONE_INDEX_MOVEMENT::MOVE_DOWN:
205 : std::optional<unsigned>{};
212 unsigned aDropIndex )
214 for(
const unsigned i : { aDragIndex, aDropIndex } )
220 if( aDragIndex == aDropIndex )
227 for(
const unsigned int row : { aDragIndex, aDropIndex } )
235 wxDataViewItem aSelection )
240 wxString lowerFilterText = aFilterText.Strip( wxString::both ).Lower();
242 if( lowerFilterText.empty() )
250 const ZONE zone = container->GetZone();
wxString GetNetname() const
NETINFO_ITEM * GetNet() const
Return #NET_INFO object for a given item.
Information pertinent to a Pcbnew printed circuit board.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
A color representation with 4 components: red, green, blue, alpha.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
void EnableFitterByNet(bool aEnable)
bool SetValueByRow(const wxVariant &aVariant, unsigned aRow, unsigned aCol) override
std::optional< unsigned > MoveZoneIndex(unsigned aIndex, ZONE_INDEX_MOVEMENT aMovement)
Move selected zone up/down.
~MODEL_ZONES_OVERVIEW_TABLE() override
wxDataViewItem ApplyFilter(wxString const &aFilterText, wxDataViewItem aSelection)
Filter the zones by the filter text.
void GetValueByRow(wxVariant &aVariant, unsigned aRow, unsigned aCol) const override
void SortZoneContainers()
ZONE * GetZone(wxDataViewItem const &item) const
MODEL_ZONES_OVERVIEW_TABLE(ZONE_PRIORITY_CONTAINER_LIST aZones, BOARD *a_pcb, PCB_BASE_FRAME *aPCB_FRAME, wxWindow *a_dialog)
ZONE_PRIORITY_CONTAINER_LIST m_allZoneContainers
unsigned int GetAllZonesCount() const
ZONE_PRIORITY_CONTAINER_LIST m_filteredZoneContainers
std::optional< unsigned > SwapZonePriority(unsigned aDragIndex, unsigned aDropIndex)
Swap two zone while drag && drop.
wxDataViewItem GetItemByZone(ZONE *) const
wxDataViewItem ClearFilter(wxDataViewItem aSelection)
Clear up the filter.
PCB_BASE_FRAME * m_PCB_FRAME
void EnableFitterByName(bool aEnable)
unsigned int GetCount() const override
const wxString & GetNetname() const
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
Handle a list of polygons defining a copper zone.
const wxString & GetZoneName() const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
PCB_LAYER_ID
A quick note on layer IDs:
wxDEFINE_EVENT(EVT_ZONES_OVERVIEW_COUNT_CHANGE, wxCommandEvent)
static wxBitmap MakeBitmapForLayers(LSEQ const &layers, COLOR_SETTINGS const &settings, const wxSize &aSize)
std::vector< std::shared_ptr< ZONE_PRIORITY_CONTAINER > > ZONE_PRIORITY_CONTAINER_LIST