43#define SCALING_FACTOR pcbIUScale.mmToIU( 0.1625 )
103 return wxString::Format( wxT(
"%s|%d|%d|%s|%s" ),
107 m_rcItem->GetMainItemID().AsString(),
112 return wxString::Format( wxT(
"%s|%d|%d|%s|%s|%s" ),
116 m_rcItem->GetMainItemID().AsString(),
117 m_rcItem->GetAuxItemID().AsString(),
123 return wxString::Format( wxT(
"%s|%d|%d|%s|%s" ),
133 return wxString::Format( wxT(
"%s|%d|%d|%s|%s" ),
137 m_rcItem->GetMainItemID().AsString(),
138 m_rcItem->GetAuxItemID().AsString() );
145 auto getMarkerLayer =
146 [](
const wxString& layerName ) ->
int
157 wxArrayString props = wxSplit( data,
'|' );
158 int markerLayer =
F_Cu;
159 VECTOR2I markerPos( (
int) strtol( props[1].c_str(),
nullptr, 10 ),
160 (
int) strtol( props[2].c_str(),
nullptr, 10 ) );
171 drcItem->SetItems(
KIID( props[3] ) );
172 markerLayer = getMarkerLayer( props[4] );
176 drcItem->SetItems(
KIID( props[3] ),
KIID( props[4] ) );
179 if( props.size() == 6 )
180 markerLayer = getMarkerLayer( props[5] );
183 && props[3].IsEmpty() && props[4].IsEmpty() )
190 drcItem->SetItems(
KIID( props[3] ),
KIID( props[4] ) );
193 return new PCB_MARKER( drcItem, markerPos, markerLayer );
199 aList.emplace_back(
_(
"Type" ),
_(
"Marker" ) );
200 aList.emplace_back(
_(
"Violation" ),
m_rcItem->GetErrorMessage() );
205 aList.emplace_back(
_(
"Severity" ),
_(
"Ignore" ) );
208 aList.emplace_back(
_(
"Severity" ),
_(
"Warning" ) );
211 aList.emplace_back(
_(
"Severity" ),
_(
"Error" ) );
219 aList.emplace_back(
_(
"Drawing Sheet" ), wxEmptyString );
240 aList.emplace_back( mainText, auxText );
244 aList.emplace_back(
_(
"Excluded" ),
m_comment );
264 return std::make_shared<SHAPE_NULL>();
270 return wxString::Format(
_(
"Marker (%s)" ),
319 case SEVERITY::RPT_SEVERITY_ERROR: aLayers[0] =
LAYER_DRC_ERROR;
break;
356 box.
Merge( s.GetBoundingBox() );
BITMAPS
A list of all bitmap identifiers.
SEVERITY GetSeverity(int aDRCErrorCode)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
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
DRC_RULE * GetViolatingRule() const
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
The base class for create windows for drawing purpose.
virtual EDA_ITEM * GetItem(const KIID &aId) const
Fetch an item by KIID.
A base class for most all the KiCad significant classes used in schematics and boards.
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const
Return a user-visible description string of this item.
Class that other classes need to inherit from, in order to be inspectable.
A color representation with 4 components: red, green, blue, alpha.
VECTOR2I m_Pos
position of the marker
void SetMarkerScale(int aScale)
void SetMarkerType(enum MARKER_T aMarkerType)
Accessors to set/get marker type (DRC, ERC, or other)
std::shared_ptr< RC_ITEM > m_rcItem
enum MARKER_T GetMarkerType() const
BOX2I GetBoundingBoxMarker() const
Return the orthogonal, bounding box of this object for display purposes.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
std::vector< PCB_SHAPE > m_shapes1
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
SEVERITY GetSeverity() const override
static PCB_MARKER * DeserializeFromString(const wxString &data)
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
wxString SerializeToString() const
GAL_LAYER_ID GetColorLayer() const
PCB_MARKER(std::shared_ptr< RC_ITEM > aItem, const VECTOR2I &aPos, int aLayer=F_Cu)
KIGFX::COLOR4D getColor() const override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
void SetZoom(double aZoomFactor)
virtual SETTINGS_MANAGER & GetSettingsManager() const
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
void OverrideAvailability(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName, std::function< bool(INSPECTABLE *)> aFunc)
Sets an override availability functor for a base class property of a given derived class.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
@ DRCE_UNRESOLVED_VARIABLE
@ DRCE_DUPLICATE_FOOTPRINT
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
@ LAYER_DRC_SHAPE1
Custom shape for DRC marker.
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
@ LAYER_DRC_EXCLUSION
layer for drc markers which have been individually excluded
@ LAYER_DRC_WARNING
layer for drc markers with SEVERITY_WARNING
@ LAYER_DRC_SHAPE2
Custom shape for DRC marker.
@ LAYER_MARKER_SHADOWS
shadows for drc markers
@ LAYER_DRC_ERROR
layer for drc markers with SEVERITY_ERROR
PCB_LAYER_ID
A quick note on layer IDs:
PCB_LAYER_ID ToLAYER_ID(int aLayer)
#define SCALING_FACTOR
Factor to convert the maker unit shape to internal units:
static struct PCB_MARKER_DESC _PCB_MARKER_DESC
PGM_BASE & Pgm()
The global Program "get" accessor.
#define SCALING_FACTOR
Factor to convert the maker unit shape to internal units:
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
Functions to provide common constants and other functions to assist in making a consistent UI.