![]() |
KiCad PCB EDA Suite
|
#include <marker_base.h>
Public Types | |
enum | TYPEMARKER { MARKER_UNSPEC, MARKER_ERC, MARKER_PCB, MARKER_SIMUL } |
Public Member Functions | |
MARKER_BASE (int aScalingFactor, std::shared_ptr< RC_ITEM > aItem, TYPEMARKER aType=MARKER_UNSPEC) | |
virtual | ~MARKER_BASE () |
int | MarkerScale () const |
The scaling factor to convert polygonal shape coordinates to internal units. More... | |
void | SetMarkerScale (int aScale) |
void | ShapeToPolygon (SHAPE_LINE_CHAIN &aPolygon, int aScale=-1) const |
Return the shape polygon in internal units in a SHAPE_LINE_CHAIN the coordinates are relatives to the marker position (are not absolute). More... | |
void | PrintMarker (const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) |
Print the shape is the polygon defined in m_Corners (array of wxPoints). More... | |
const wxPoint & | GetPos () const |
virtual const KIID | GetUUID () const =0 |
void | SetMarkerType (enum TYPEMARKER aMarkerType) |
Accessors to set/get marker type (DRC, ERC, or other) More... | |
enum TYPEMARKER | GetMarkerType () const |
bool | IsExcluded () const |
void | SetExcluded (bool aExcluded) |
std::shared_ptr< RC_ITEM > | GetRCItem () const |
bool | HitTestMarker (const wxPoint &aHitPosition, int aAccuracy) const |
Test if the given wxPoint is within the bounds of this object. More... | |
EDA_RECT | GetBoundingBoxMarker () const |
Return the orthogonal, bounding box of this object for display purposes. More... | |
Public Attributes | |
wxPoint | m_Pos |
position of the marker More... | |
Protected Member Functions | |
virtual KIGFX::COLOR4D | getColor () const =0 |
Protected Attributes | |
TYPEMARKER | m_markerType |
bool | m_excluded |
std::shared_ptr< RC_ITEM > | m_rcItem |
int | m_scalingFactor |
EDA_RECT | m_shapeBoundingBox |
Definition at line 49 of file marker_base.h.
Enumerator | |
---|---|
MARKER_UNSPEC | |
MARKER_ERC | |
MARKER_PCB | |
MARKER_SIMUL |
Definition at line 52 of file marker_base.h.
MARKER_BASE::MARKER_BASE | ( | int | aScalingFactor, |
std::shared_ptr< RC_ITEM > | aItem, | ||
TYPEMARKER | aType = MARKER_UNSPEC |
||
) |
Definition at line 61 of file marker_base.cpp.
References CORNERS_COUNT, m_shapeBoundingBox, MarkerShapeCorners, EDA_RECT::SetEnd(), EDA_RECT::SetOrigin(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
virtual |
Definition at line 85 of file marker_base.cpp.
EDA_RECT MARKER_BASE::GetBoundingBoxMarker | ( | ) | const |
Return the orthogonal, bounding box of this object for display purposes.
This box should be an enclosing perimeter for visible components of this object, and the units should be in the pcb or schematic coordinate system. It is OK to overestimate the size by a few counts.
Definition at line 123 of file marker_base.cpp.
References EDA_RECT::GetPosition(), EDA_RECT::GetSize(), m_Pos, m_scalingFactor, and m_shapeBoundingBox.
Referenced by SCH_MARKER::GetBoundingBox(), and HitTestMarker().
|
protectedpure virtual |
Implemented in PCB_MARKER, and SCH_MARKER.
Referenced by PrintMarker().
|
inline |
Definition at line 93 of file marker_base.h.
References m_markerType.
Referenced by SCH_SCREENS::DeleteMarkers(), SHEETLIST_ERC_ITEMS_PROVIDER::visitMarkers(), and DIALOG_ERC::writeReport().
|
inline |
Definition at line 85 of file marker_base.h.
References m_Pos.
Referenced by PCB_SELECTION_TOOL::hitTestDistance().
|
inline |
Definition at line 101 of file marker_base.h.
References m_rcItem.
Referenced by CollisionMatchesExpected(), SCH_SCREENS::DeleteMarkers(), SHEETLIST_ERC_ITEMS_PROVIDER::GetCount(), SHEETLIST_ERC_ITEMS_PROVIDER::GetERCItem(), BOARD_DRC_ITEMS_PROVIDER::GetItem(), InvalidMatchesExpected(), KI_TEST::IsDrcMarkerOfType(), DIALOG_ERC::OnERCItemRClick(), operator<<(), SHEETLIST_ERC_ITEMS_PROVIDER::SetSeverities(), SHEETLIST_ERC_ITEMS_PROVIDER::visitMarkers(), and DIALOG_ERC::writeReport().
|
pure virtual |
Implemented in PCB_MARKER, and SCH_MARKER.
bool MARKER_BASE::HitTestMarker | ( | const wxPoint & | aHitPosition, |
int | aAccuracy | ||
) | const |
Test if the given wxPoint is within the bounds of this object.
aHitPosition | is the wxPoint to test (in internal units). |
Definition at line 90 of file marker_base.cpp.
References EDA_RECT::Contains(), GetBoundingBoxMarker(), EDA_RECT::Inflate(), m_Pos, SHAPE_LINE_CHAIN_BASE::PointInside(), and ShapeToPolygon().
Referenced by PCB_MARKER::HitTest(), and SCH_MARKER::HitTest().
|
inline |
Definition at line 95 of file marker_base.h.
References m_excluded.
Referenced by RC_TREE_MODEL::DeleteItems(), SCH_SCREENS::DeleteMarkers(), DIALOG_ERC::ExcludeMarker(), SCH_MARKER::GetColorLayer(), PCB_MARKER::GetColorLayer(), SHEETLIST_ERC_ITEMS_PROVIDER::GetCount(), SCH_EDIT_FRAME::RecordERCExclusions(), SHEETLIST_ERC_ITEMS_PROVIDER::SetSeverities(), RC_ITEM::ShowReport(), and PCB_MARKER::ViewGetLayers().
|
inline |
The scaling factor to convert polygonal shape coordinates to internal units.
Definition at line 66 of file marker_base.h.
References m_scalingFactor.
Referenced by KIGFX::PCB_PAINTER::draw(), PCB_MARKER::GetBoundingBox(), PrintMarker(), and ShapeToPolygon().
void MARKER_BASE::PrintMarker | ( | const RENDER_SETTINGS * | aSettings, |
const wxPoint & | aOffset | ||
) |
Print the shape is the polygon defined in m_Corners (array of wxPoints).
Definition at line 137 of file marker_base.cpp.
References CORNERS_COUNT, getColor(), KIGFX::RENDER_SETTINGS::GetPrintDC(), GRClosedPoly(), m_Pos, MarkerScale(), and MarkerShapeCorners.
Referenced by SCH_MARKER::Print().
|
inline |
Definition at line 96 of file marker_base.h.
References m_excluded.
Referenced by EE_INSPECTION_TOOL::ExcludeMarker(), DIALOG_DRC::ExcludeMarker(), DIALOG_ERC::ExcludeMarker(), DIALOG_DRC::OnDRCItemRClick(), DIALOG_ERC::OnERCItemRClick(), BOARD::ResolveDRCExclusions(), and SCHEMATIC::ResolveERCExclusions().
|
inline |
Definition at line 67 of file marker_base.h.
References m_scalingFactor.
Referenced by PCB_MARKER::SetZoom().
|
inline |
Accessors to set/get marker type (DRC, ERC, or other)
Definition at line 92 of file marker_base.h.
References m_markerType.
void MARKER_BASE::ShapeToPolygon | ( | SHAPE_LINE_CHAIN & | aPolygon, |
int | aScale = -1 |
||
) | const |
Return the shape polygon in internal units in a SHAPE_LINE_CHAIN the coordinates are relatives to the marker position (are not absolute).
aPolygon | is the SHAPE_LINE_CHAIN to fill with the shape. |
Definition at line 110 of file marker_base.cpp.
References SHAPE_LINE_CHAIN::Append(), MarkerScale(), MarkerShapeCorners, and SHAPE_LINE_CHAIN::SetClosed().
Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), FOOTPRINT::GetCoverageArea(), PCB_SELECTION_TOOL::hitTestDistance(), and HitTestMarker().
|
protected |
Definition at line 128 of file marker_base.h.
Referenced by IsExcluded(), and SetExcluded().
|
protected |
Definition at line 127 of file marker_base.h.
Referenced by GetMarkerType(), and SetMarkerType().
wxPoint MARKER_BASE::m_Pos |
position of the marker
Definition at line 124 of file marker_base.h.
Referenced by PCB_MARKER::GetBoundingBox(), GetBoundingBoxMarker(), GetPos(), PCB_MARKER::GetPosition(), SCH_MARKER::GetPosition(), HitTestMarker(), PCB_MARKER::Move(), SCH_MARKER::Move(), PCB_MARKER::PCB_MARKER(), PrintMarker(), SCH_MARKER::SCH_MARKER(), PCB_MARKER::Serialize(), SCH_MARKER::Serialize(), PCB_MARKER::SetPosition(), and SCH_MARKER::SetPosition().
|
protected |
Definition at line 129 of file marker_base.h.
Referenced by SCH_MARKER::GetColorLayer(), PCB_MARKER::GetColorLayer(), PCB_MARKER::GetMsgPanelInfo(), SCH_MARKER::GetMsgPanelInfo(), GetRCItem(), PCB_MARKER::GetSelectMenuText(), SCH_MARKER::Matches(), PCB_MARKER::Matches(), PCB_MARKER::PCB_MARKER(), SCH_MARKER::SCH_MARKER(), SCH_MARKER::Serialize(), PCB_MARKER::Serialize(), SCH_MARKER::ViewGetLayers(), and PCB_MARKER::ViewGetLayers().
|
protected |
Definition at line 131 of file marker_base.h.
Referenced by GetBoundingBoxMarker(), MarkerScale(), and SetMarkerScale().
|
protected |
Definition at line 133 of file marker_base.h.
Referenced by PCB_MARKER::GetBoundingBox(), GetBoundingBoxMarker(), and MARKER_BASE().