35#include <wx/dataview.h>
314 return defaultSettings;
325 wxDataViewColumn* checkColumn = aList->AppendToggleColumn( wxEmptyString, wxDATAVIEW_CELL_ACTIVATABLE,
326 wxCOL_WIDTH_DEFAULT, wxALIGN_CENTER );
328 wxDataViewColumn* layerColumn = aList->AppendIconTextColumn( wxEmptyString );
329 wxDataViewColumn* layerIDColumn = aList->AppendTextColumn( wxEmptyString );
330 layerIDColumn->SetHidden(
true );
345 icon.CopyFromBitmap( bitmap );
347 wxVector<wxVariant> row;
348 row.push_back( wxVariant(
m_Layers.test( layerID ) ) );
349 row.push_back( wxVariant( wxDataViewIconText( layerName, icon ) ) );
350 row.push_back( wxVariant( wxString::Format( wxT(
"%i" ), layerID ) ) );
351 aList->AppendItem( row );
354 aList->SetToggleValue(
true, (
unsigned) aList->GetItemCount() - 1, 0 );
357 int checkColSize = aList->FromDIP( 22 );
362 aList->SetIndent( 0 );
364 checkColumn->SetWidth( checkColSize );
365 layerColumn->SetWidth( layerColSize );
374 aList->SetMinClientSize( wxSize( checkColSize + layerColSize, aList->GetMinClientSize().y ) );
398 case 1:
return m_frame->StringFromValue( offset.
x,
true );
399 case 2:
return m_frame->StringFromValue( offset.
y,
true );
404 return wxT(
"bad wxWidgets!" );
415 case 1: offset.
x =
m_frame->ValueFromString( aValue );
break;
416 case 2: offset.
y =
m_frame->ValueFromString( aValue );
break;
417 default: wxFAIL_MSG( wxString::Format( wxT(
"column %d isn't a long" ), aCol ) );
break;
420 m_items[aRow].second.hatching_offset = offset;
428 case 0:
return m_items[aRow].first;
429 default: wxFAIL_MSG( wxString::Format( wxT(
"column %d isn't a long" ), aCol ) );
return -1;
439 default: wxFAIL_MSG( wxString::Format( wxT(
"column %d isn't a long" ), aCol ) );
break;
446 m_items.emplace_back( std::make_pair( aLayer, aProps ) );
450 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
451 GetView()->ProcessTableMessage( msg );
463 for(
const auto& [l, props] :
m_items )
474 if( !contains( layer ) )
481 for(
int jj = 0; jj < (int) aNumRows; ++jj )
498 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, (
int) aPos, (
int) aNumRows );
499 GetView()->ProcessTableMessage( msg );
512 GetView()->ForceRefresh();
constexpr EDA_IU_SCALE pcbIUScale
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
void SetLocked(bool aLocked) override
bool IsLocked() const override
Information pertinent to a Pcbnew printed circuit board.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
COLOR4D GetColor(int aLayer) const
static wxBitmap MakeBitmap(const KIGFX::COLOR4D &aColor, const KIGFX::COLOR4D &aBackground, const wxSize &aSize, const wxSize &aCheckerboardSize, const KIGFX::COLOR4D &aCheckerboardBackground, const std::vector< int > &aMargins={ 0, 0, 0, 0 })
A color representation with 4 components: red, green, blue, alpha.
~LAYER_PROPERTIES_GRID_TABLE() override
wxString GetValue(int aRow, int aCol) override
void SetValueAsLong(int aRow, int aCol, long aValue) override
void SetValue(int aRow, int aCol, const wxString &aValue) override
std::function< LSET()> m_getLayersFunc
void AddItem(PCB_LAYER_ID aLayer, const ZONE_LAYER_PROPERTIES &aProps)
std::vector< std::pair< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > > m_items
long GetValueAsLong(int aRow, int aCol) override
bool AppendRows(size_t aNumRows=1) override
bool DeleteRows(size_t aPos, size_t aNumRows) override
void onUnitsChanged(wxCommandEvent &aEvent)
LAYER_PROPERTIES_GRID_TABLE(PCB_BASE_FRAME *aFrame, std::function< LSET()> getLayers)
LSET is a set of PCB_LAYER_IDs.
LSEQ UIOrder() const
Return the copper, technical and user layers in the order shown in layer widget.
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.
bool m_keepoutDoNotAllowPads
void SetIsRuleArea(bool aEnable)
bool operator==(const ZONE_SETTINGS &aOther) const
unsigned int m_cornerRadius
bool GetDoNotAllowTracks() const
wxString GetPlacementAreaSource() const
EDA_ANGLE m_HatchOrientation
int m_HatchBorderAlgorithm
void SetDoNotAllowVias(bool aEnable)
bool GetDoNotAllowFootprints() const
long long int m_minIslandArea
bool m_keepoutDoNotAllowTracks
bool GetDoNotAllowPads() const
double m_HatchSmoothingValue
PLACEMENT_SOURCE_T GetPlacementAreaSourceType() const
PLACEMENT_SOURCE_T m_placementAreaSourceType
void ExportSetting(ZONE &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
bool GetIsRuleArea() const
bool GetDoNotAllowZoneFills() const
int m_cornerSmoothingType
void SetDoNotAllowTracks(bool aEnable)
bool m_keepoutDoNotAllowZoneFills
bool GetDoNotAllowVias() const
wxString m_placementAreaSource
ISLAND_REMOVAL_MODE m_removeIslands
double m_HatchHoleMinArea
long long int GetMinIslandArea() const
long m_ThermalReliefSpokeWidth
TEARDROP_TYPE m_TeardropType
bool m_placementAreaEnabled
Placement rule area data.
static const ZONE_SETTINGS & GetDefaultSettings()
void SetCornerRadius(int aRadius)
bool GetPlacementAreaEnabled() const
Accessors to parameters used in Rule Area zones:
std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > m_LayerProperties
ZONE_FILL_MODE m_FillMode
ZONE_CONNECTION m_padConnection
void SetDoNotAllowFootprints(bool aEnable)
void SetDoNotAllowPads(bool aEnable)
ZONE_SETTINGS & operator<<(const ZONE &aSource)
operator << ( const ZONE& ) was Function ImportSetting copies settings from a given zone into this ob...
void CopyFrom(const ZONE_SETTINGS &aOther, bool aCopyFull=true)
Function CopyFrom copy settings from a different ZONE_SETTINGS object.
int m_HatchSmoothingLevel
void SetDoNotAllowZoneFills(bool aEnable)
void SetupLayersList(wxDataViewListCtrl *aList, PCB_BASE_FRAME *aFrame, LSET aLayers)
A helper routine for the various zone dialogs (copper, non-copper, keepout).
ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
ZONE_BORDER_DISPLAY_STYLE m_ZoneBorderDisplayStyle
Option to show the zone area (outlines only, short hatches or full hatches.
bool m_keepoutDoNotAllowFootprints
bool m_keepoutDoNotAllowVias
void SetPlacementAreaSourceType(PLACEMENT_SOURCE_T aType)
Handle a list of polygons defining a copper zone.
void SetHatchThickness(int aThickness)
void SetHatchBorderAlgorithm(int aAlgo)
void SetDoNotAllowPads(bool aEnable)
void SetLayerProperties(const std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > &aOther)
int GetHatchBorderAlgorithm() const
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
std::optional< int > GetLocalClearance() const override
void SetLocalClearance(std::optional< int > aClearance)
bool GetDoNotAllowVias() const
void SetCornerRadius(unsigned int aRadius)
ZONE_LAYER_PROPERTIES & LayerProperties(PCB_LAYER_ID aLayer)
void SetCornerSmoothingType(int aType)
wxString GetPlacementAreaSource() const
void SetBorderDisplayStyle(ZONE_BORDER_DISPLAY_STYLE aBorderHatchStyle, int aBorderHatchPitch, bool aRebuilBorderdHatch)
Set all hatch parameters for the zone.
bool GetDoNotAllowPads() const
void SetMinThickness(int aMinThickness)
void SetPlacementAreaSource(const wxString &aSource)
PLACEMENT_SOURCE_T GetPlacementAreaSourceType() const
bool GetDoNotAllowTracks() const
void SetHatchOrientation(const EDA_ANGLE &aStep)
void SetHatchSmoothingValue(double aValue)
void SetHatchSmoothingLevel(int aLevel)
void SetThermalReliefSpokeWidth(int aThermalReliefSpokeWidth)
void SetPlacementAreaSourceType(PLACEMENT_SOURCE_T aType)
ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
long long int GetMinIslandArea() const
void SetIsRuleArea(bool aEnable)
void SetDoNotAllowTracks(bool aEnable)
const wxString & GetZoneName() const
int GetMinThickness() const
void SetFillMode(ZONE_FILL_MODE aFillMode)
ZONE_CONNECTION GetPadConnection() const
int GetHatchThickness() const
double GetHatchHoleMinArea() const
void SetLayerSet(const LSET &aLayerSet) override
bool GetPlacementAreaEnabled() const
void SetDoNotAllowVias(bool aEnable)
int GetThermalReliefSpokeWidth() const
int GetBorderHatchPitch() const
HatchBorder related methods.
ZONE_BORDER_DISPLAY_STYLE GetHatchStyle() const
void SetThermalReliefGap(int aThermalReliefGap)
EDA_ANGLE GetHatchOrientation() const
bool GetDoNotAllowFootprints() const
ZONE_FILL_MODE GetFillMode() const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
void SetDoNotAllowFootprints(bool aEnable)
void SetHatchHoleMinArea(double aPct)
TEARDROP_TYPE GetTeardropAreaType() const
double GetHatchSmoothingValue() const
bool GetDoNotAllowZoneFills() const
int GetHatchSmoothingLevel() const
unsigned int GetCornerRadius() const
int GetCornerSmoothingType() const
void SetDoNotAllowZoneFills(bool aEnable)
void SetAssignedPriority(unsigned aPriority)
void SetPadConnection(ZONE_CONNECTION aPadConnection)
void SetZoneName(const wxString &aName)
void SetTeardropAreaType(TEARDROP_TYPE aType)
Set the type of teardrop if the zone is a teardrop area for non teardrop area, the type must be TEARD...
void SetIslandRemovalMode(ISLAND_REMOVAL_MODE aRemove)
void SetMinIslandArea(long long int aArea)
int GetThermalReliefGap() const
void SetHatchGap(int aStep)
void SetPlacementAreaEnabled(bool aEnabled)
unsigned GetAssignedPriority() const
static constexpr EDA_ANGLE ANGLE_0
@ LAYER_PCB_BACKGROUND
PCB background color.
PCB_LAYER_ID
A quick note on layer IDs:
PCB_LAYER_ID ToLAYER_ID(int aLayer)
KICOMMON_API wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...
std::optional< VECTOR2I > hatching_offset
bool operator==(const ZONE_LAYER_PROPERTIES &aOther) const
VECTOR2< int32_t > VECTOR2I
static const wxSize CHECKERBOARD_SIZE(8, 8)
static const wxSize LAYER_BITMAP_SIZE(24, 16)
Class ZONE_SETTINGS used to handle zones parameters in dialogs.
#define ZONE_THERMAL_RELIEF_GAP_MM
@ THERMAL
Use thermal relief for pads.
#define ZONE_BORDER_HATCH_DIST_MM
#define ZONE_THERMAL_RELIEF_COPPER_WIDTH_MM
#define ZONE_CLEARANCE_MM
#define ZONE_THICKNESS_MM