55 virtual bool Run()
override;
57 virtual const wxString
GetName()
const override
59 return wxT(
"text_mirroring" );
64 return wxT(
"Tests mirrored text on top layer and non-mirrored text on bottom layer" );
74 reportAux( wxT(
"Text mirroring violations ignored. Tests not run." ) );
84 auto checkTextMirroring =
90 bool layerMatch = ( isMirrored && topLayers.Contains( item->
GetLayer() ) )
91 || ( !isMirrored && bottomLayers.Contains( item->
GetLayer() ) );
93 if( layerMatch &&
text->IsMirrored() == isMirrored )
97 drcItem->SetErrorMessage( drcItem->GetErrorText() );
98 drcItem->SetItems( item );
104 const int progressDelta = 500;
106 int progressIndex = 0;
108 static const std::vector<KICAD_T> itemTypes = {
129 if( !
text->IsVisible()
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
bool IsLayerEnabled(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
bool IsErrorLimitExceeded(int error_code)
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
virtual const wxString GetDescription() const override
virtual ~DRC_TEST_PROVIDER_TEXT_MIRRORING()
virtual const wxString GetName() const override
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
DRC_TEST_PROVIDER_TEXT_MIRRORING()
Represent a DRC "provider" which runs some DRC functions over a BOARD and spits out DRC_ITEM and posi...
virtual bool reportPhase(const wxString &aStageName)
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer, DRC_CUSTOM_MARKER_HANDLER *aCustomHandler=nullptr)
int forEachGeometryItem(const std::vector< KICAD_T > &aTypes, const LSET &aLayers, const std::function< bool(BOARD_ITEM *)> &aFunc)
void reportAux(const wxString &aMsg)
virtual void reportRuleStatistics()
virtual bool reportProgress(size_t aCount, size_t aSize, size_t aDelta=1)
virtual VECTOR2I GetPosition() const
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
LSET is a set of PCB_LAYER_IDs.
@ DRCE_MIRRORED_TEXT_ON_FRONT_LAYER
@ DRCE_NONMIRRORED_TEXT_ON_BACK_LAYER
This file contains miscellaneous commonly used macros and functions.
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULAR_WIDTH > dummy
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type