44#define SCALING_FACTOR pcbIUScale.mmToIU( 0.1625 )
106 return wxString::Format( wxT(
"%s|%d|%d|%s|%s" ),
110 m_rcItem->GetMainItemID().AsString(),
120 return wxString::Format( wxT(
"%s|%d|%d|%s|%d|%s|%s" ),
126 m_rcItem->GetMainItemID().AsString(),
127 m_rcItem->GetAuxItemID().AsString() );
131 return wxString::Format( wxT(
"%s|%d|%d|%s|%s|%s" ),
135 m_rcItem->GetMainItemID().AsString(),
136 m_rcItem->GetAuxItemID().AsString(),
142 return wxString::Format( wxT(
"%s|%d|%d|%s|%s" ),
152 return wxString::Format( wxT(
"%s|%d|%d|%s|%s" ),
156 m_rcItem->GetMainItemID().AsString(),
157 m_rcItem->GetAuxItemID().AsString() );
164 auto getMarkerLayer =
165 [](
const wxString& layerName ) ->
int
176 wxArrayString props = wxSplit( data,
'|' );
177 int markerLayer =
F_Cu;
178 VECTOR2I markerPos( (
int) strtol( props[1].c_str(),
nullptr, 10 ),
179 (
int) strtol( props[2].c_str(),
nullptr, 10 ) );
190 drcItem->SetItems(
KIID( props[3] ) );
191 markerLayer = getMarkerLayer( props[4] );
196 if( props.size() < 6 )
197 drcItem->SetItems(
KIID( props[3] ),
KIID( props[4] ) );
199 drcItem->SetItems(
KIID( props[5] ),
KIID( props[6] ) );
203 drcItem->SetItems(
KIID( props[3] ),
KIID( props[4] ) );
206 if( props.size() == 6 )
207 markerLayer = getMarkerLayer( props[5] );
210 && props[3].IsEmpty() && props[4].IsEmpty() )
217 drcItem->SetItems(
KIID( props[3] ),
KIID( props[4] ) );
220 return new PCB_MARKER( drcItem, markerPos, markerLayer );
226 aList.emplace_back(
_(
"Type" ),
_(
"Marker" ) );
227 aList.emplace_back(
_(
"Violation" ),
m_rcItem->GetErrorMessage(
true ) );
232 aList.emplace_back(
_(
"Severity" ),
_(
"Ignore" ) );
235 aList.emplace_back(
_(
"Severity" ),
_(
"Warning" ) );
238 aList.emplace_back(
_(
"Severity" ),
_(
"Error" ) );
246 aList.emplace_back(
_(
"Drawing Sheet" ), wxEmptyString );
261 aList.emplace_back( mainText, auxText );
265 aList.emplace_back(
_(
"Excluded" ),
m_comment );
284 return std::make_shared<SHAPE_NULL>();
289 int aError,
ERROR_LOC aErrorLoc,
bool ignoreLineWidth )
const
297 return wxString::Format(
_(
"Marker (%s)" ), aFull ?
m_rcItem->GetErrorMessage(
true )
375 std::vector<PCB_SHAPE> pathShapes;
387 pathShapes.push_back( s );
391 pathShapes.push_back( s );
398 shape.SetStroke( hairline );
399 pathShapes.push_back( std::move( shape ) );
403 if( pathShapes.size() > 0 )
405 VECTOR2I V1 = pathShapes[0].GetStart() - pathShapes[0].GetEnd();
406 VECTOR2I V2 = pathShapes.back().GetStart() - pathShapes.back().GetEnd();
415 pathShapes.push_back( s );
419 pathShapes.push_back( s );
427 pathShapes.push_back( std::move( shape ) );
439 box.
Merge( s.GetBoundingBox() );
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
BITMAPS
A list of all bitmap identifiers.
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
SEVERITY GetSeverity(int aDRCErrorCode)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
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.
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 * ResolveItem(const KIID &aId, bool aAllowNullptrReturn=false) const
Fetch an item by KIID.
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const
Return a user-visible description string of this item.
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
void SetStart(const VECTOR2I &aStart)
void SetEnd(const VECTOR2I &aEnd)
A color representation with 4 components: red, green, blue, alpha.
Marker are mainly used to show a DRC or ERC error or warning.
void SetMarkerScale(int aScale) const
wxString m_comment
User supplied comment.
int MarkerScale() const
The scaling factor to convert polygonal shape coordinates to internal units.
VECTOR2I m_Pos
Position of the marker.
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
MARKER_BASE(int aScalingFactor, std::shared_ptr< RC_ITEM > aItem, MARKER_T aType=MARKER_UNSPEC)
BOX2I GetBoundingBoxMarker() const
Return the orthogonal, bounding box of this object for display purposes.
void SetZoom(double aZoomFactor) const
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.
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth) const override
Convert the item shape to a closed polygon.
std::vector< PCB_SHAPE > GetShapes() const
std::vector< PCB_SHAPE > m_pathShapes
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.
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.
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
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 Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
void SetStroke(const STROKE_PARAMS &aStroke) override
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.
void Mask(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName)
Sets a base class property as masked in a derived class.
static PROPERTY_MANAGER & Instance()
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
Represent a set of closed polygons.
Simple container to manage line stroke parameters.
constexpr VECTOR2< T > Perpendicular() const
Compute the perpendicular vector.
VECTOR2< T > Resize(T aNewLength) const
Return a vector of the same direction, but length specified in aNewLength.
@ DRCE_SCHEMATIC_FIELDS_PARITY
@ 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_DRAWINGSHEET
Sheet frame and title block.
@ LAYER_DRC_EXCLUSION
Layer for DRC markers which have been individually excluded.
@ LAYER_DRC_SHAPES
Custom shapes for DRC markers.
@ LAYER_DRC_WARNING
Layer for DRC markers with #SEVERITY_WARNING.
@ 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)
static struct PCB_MARKER_DESC _PCB_MARKER_DESC
#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.
VECTOR2< int32_t > VECTOR2I