30#include <wx/dcmemory.h>
32#include <wx/variant.h>
42 []( std::shared_ptr<MANAGED_ZONE>
const& l, std::shared_ptr<MANAGED_ZONE>
const& r )
44 return l->GetCurrentPriority() > r->GetCurrentPriority();
51 wxCommandEvent rowCountChange( EVT_ZONES_OVERVIEW_COUNT_CHANGE );
53 wxPostEvent(
m_dialog, rowCountChange );
60 wxBitmap bitmap( aSize );
65 iconDC.SelectObject( bitmap );
66 brush.SetStyle( wxBRUSHSTYLE_SOLID );
67 const int layer_cout = layers.size();
68 std::vector<PCB_LAYER_ID> layersToDraw;
72 for(
const PCB_LAYER_ID& i : { layers[0], layers[1], layers[layer_cout - 1], layers[layer_cout - 2] } )
73 layersToDraw.push_back( i );
77 layersToDraw = layers;
80 const int step =
static_cast<int>( aSize.x / layersToDraw.size() );
82 for(
size_t i = 0; i < layersToDraw.size(); ++i )
85 brush.SetColour(
color.ToColour() );
86 pen.SetColour(
color.ToColour() );
87 iconDC.SetBrush( brush );
89 iconDC.DrawRectangle( 0, i * step, aSize.x, step );
129 wxArrayString layers;
133 layers.Add(
m_pcb->GetLayerName( layer ) );
176 unsigned int aRow = GetRow( aItem );
217 return std::optional<unsigned>{};
223 for(
const unsigned i : { aDragIndex, aDropIndex } )
229 if( aDragIndex == aDropIndex )
235 for(
const unsigned int row : { aDragIndex, aDropIndex } )
247 wxString lowerFilterText = aFilterText.Strip( wxString::both ).Lower();
249 if( lowerFilterText.empty() )
257 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.
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 UIOrder() const
Return the copper, technical and user layers in the order shown in layer widget.
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
bool SetValueByRow(const wxVariant &aVariant, unsigned aRow, unsigned aCol) override
void EnableFitterByNet(bool aEnable)
void GetValueByRow(wxVariant &aVariant, unsigned aRow, unsigned aCol) const override
std::optional< unsigned > SwapZonePriority(unsigned aDragIndex, unsigned aDropIndex)
Swap two zone while drag && drop.
unsigned int GetAllZonesCount() const
wxDataViewItem ClearFilter(wxDataViewItem aSelection)
Clear up the filter.
ZONE * GetZone(wxDataViewItem const &item) const
MODEL_ZONES_OVERVIEW(std::vector< std::shared_ptr< MANAGED_ZONE > > aZones, BOARD *a_pcb, PCB_BASE_FRAME *aPCB_FRAME, wxWindow *a_dialog)
wxDataViewItem GetItemByZone(ZONE *) const
std::vector< std::shared_ptr< MANAGED_ZONE > > m_allZones
PCB_BASE_FRAME * m_PCB_FRAME
std::optional< unsigned > MoveZoneIndex(unsigned aIndex, ZONE_INDEX_MOVEMENT aMovement)
Move selected zone up/down.
void EnableFitterByName(bool aEnable)
unsigned int GetCount() const override
void SortZoneContainers()
wxDataViewItem ApplyFilter(wxString const &aFilterText, wxDataViewItem aSelection)
Filter the zones by the filter text.
std::vector< std::shared_ptr< MANAGED_ZONE > > m_filteredZones
const wxString & GetNetname() const
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
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)