54 virtual bool Run()
override;
56 virtual const wxString
GetName()
const override
58 return wxT(
"text_mirroring" );
63 return wxT(
"Tests mirrored text on top layer and non-mirrored text on bottom layer" );
73 reportAux( wxT(
"Text mirroring violations ignored. Tests not run." ) );
84 bool isMirrored,
int errorCode ) ->
bool
89 bool layerMatch = ( isMirrored && topLayers.Contains( layerId ) )
90 || ( !isMirrored && bottomLayers.Contains( layerId ) );
92 if( layerMatch &&
text->IsMirrored() == isMirrored )
96 drcItem->SetErrorMessage( drcItem->GetErrorText() );
97 drcItem->SetItems( item );
105 const int progressDelta = 250;
107 int progressIndex = 0;
125 switch( item->
Type() )
127 case PCB_FIELD_T: text = static_cast<PCB_FIELD*>( item ); break;
128 case PCB_TEXT_T: text = static_cast<PCB_TEXT*>( item ); break;
129 case PCB_TEXTBOX_T: text = static_cast<PCB_TEXTBOX*>( item ); break;
130 default: UNIMPLEMENTED_FOR( item->GetClass() ); break;
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)
int forEachGeometryItem(const std::vector< KICAD_T > &aTypes, LSET aLayers, const std::function< bool(BOARD_ITEM *)> &aFunc)
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer, DRC_CUSTOM_MARKER_HANDLER *aCustomHandler=nullptr)
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
KICAD_T Type() const
Returns the type of object.
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
PCB_LAYER_ID
A quick note on layer IDs:
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