KiCad PCB EDA Suite
|
#include <marker_base.h>
Public Types | |
enum | MARKER_T { MARKER_UNSPEC , MARKER_ERC , MARKER_DRC , MARKER_DRAWING_SHEET , MARKER_RATSNEST , MARKER_PARITY , MARKER_SIMUL } |
Public Member Functions | |
MARKER_BASE (int aScalingFactor, std::shared_ptr< RC_ITEM > aItem, MARKER_T aType=MARKER_UNSPEC) | |
virtual | ~MARKER_BASE () |
int | MarkerScale () const |
The scaling factor to convert polygonal shape coordinates to internal units. | |
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). | |
void | PrintMarker (const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) |
Print the shape is the polygon defined in m_Corners (array of VECTOR2Is). | |
const VECTOR2I & | GetPos () const |
virtual const KIID | GetUUID () const =0 |
void | SetMarkerType (enum MARKER_T aMarkerType) |
Accessors to set/get marker type (DRC, ERC, or other) | |
enum MARKER_T | GetMarkerType () const |
bool | IsExcluded () const |
void | SetExcluded (bool aExcluded, const wxString &aComment=wxEmptyString) |
wxString | GetComment () const |
virtual SEVERITY | GetSeverity () const |
std::shared_ptr< RC_ITEM > | GetRCItem () const |
bool | HitTestMarker (const VECTOR2I &aHitPosition, int aAccuracy) const |
Test if the given VECTOR2I is within the bounds of this object. | |
bool | HitTestMarker (const BOX2I &aRect, bool aContained, int aAccuracy=0) const |
Test if the given BOX2I intersects or contains the bounds of this object. | |
BOX2I | GetBoundingBoxMarker () const |
Return the orthogonal, bounding box of this object for display purposes. | |
Public Attributes | |
VECTOR2I | m_Pos |
position of the marker | |
Protected Member Functions | |
virtual KIGFX::COLOR4D | getColor () const =0 |
Protected Attributes | |
MARKER_T | m_markerType |
bool | m_excluded |
wxString | m_comment |
std::shared_ptr< RC_ITEM > | m_rcItem |
int | m_scalingFactor |
BOX2I | m_shapeBoundingBox |
Definition at line 48 of file marker_base.h.
Enumerator | |
---|---|
MARKER_UNSPEC | |
MARKER_ERC | |
MARKER_DRC | |
MARKER_DRAWING_SHEET | |
MARKER_RATSNEST | |
MARKER_PARITY | |
MARKER_SIMUL |
Definition at line 51 of file marker_base.h.
MARKER_BASE::MARKER_BASE | ( | int | aScalingFactor, |
std::shared_ptr< RC_ITEM > | aItem, | ||
MARKER_T | aType = MARKER_UNSPEC |
||
) |
Definition at line 61 of file marker_base.cpp.
References CORNERS_COUNT, m_shapeBoundingBox, MarkerShapeCorners, BOX2< Vec >::SetEnd(), BOX2< Vec >::SetOrigin(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
virtual |
Definition at line 85 of file marker_base.cpp.
BOX2I 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 133 of file marker_base.cpp.
References BOX2< Vec >::GetPosition(), BOX2< Vec >::GetSize(), m_Pos, m_scalingFactor, and m_shapeBoundingBox.
Referenced by SCH_MARKER::GetBoundingBox(), PCB_MARKER::GetBoundingBox(), and HitTestMarker().
|
protectedpure virtual |
Implemented in SCH_MARKER, and PCB_MARKER.
Referenced by PrintMarker().
|
inline |
Definition at line 105 of file marker_base.h.
References m_comment.
Referenced by ERC_TREE_MODEL::GetValue(), RC_TREE_MODEL::GetValue(), SCHEMATIC::RecordERCExclusions(), RC_ITEM::ShowReport(), and RC_TREE_MODEL::ValueChanged().
|
inline |
Definition at line 96 of file marker_base.h.
References m_markerType.
Referenced by SCH_SCREENS::DeleteMarkers(), SCH_MARKER::GetMsgPanelInfo(), PCB_MARKER::GetMsgPanelInfo(), ERC_REPORT::GetTextReport(), ERC_TREE_MODEL::GetValue(), RC_TREE_MODEL::GetValue(), PCB_MARKER::HitTest(), DIALOG_DRC::SelectMarker(), PCB_MARKER::ViewGetLayers(), SHEETLIST_ERC_ITEMS_PROVIDER::visitMarkers(), and ERC_REPORT::WriteJsonReport().
|
inline |
Definition at line 88 of file marker_base.h.
References m_Pos.
Referenced by PCB_SELECTION_TOOL::hitTestDistance().
|
inline |
Definition at line 112 of file marker_base.h.
References m_rcItem.
Referenced by boost_test_print_type(), CollisionMatchesExpected(), SCH_SCREENS::DeleteMarkers(), SHEETLIST_ERC_ITEMS_PROVIDER::GetCount(), SHEETLIST_ERC_ITEMS_PROVIDER::GetERCItem(), DRC_ITEMS_PROVIDER::GetItem(), ERC_REPORT::GetTextReport(), InvalidMatchesExpected(), KI_TEST::IsDrcMarkerOfType(), DIALOG_ERC::OnERCItemRClick(), BOARD::ResolveDRCExclusions(), SCHEMATIC::ResolveERCExclusions(), SHEETLIST_ERC_ITEMS_PROVIDER::SetSeverities(), SCH_MARKER::ViewGetLayers(), SHEETLIST_ERC_ITEMS_PROVIDER::visitMarkers(), and ERC_REPORT::WriteJsonReport().
|
inlinevirtual |
Reimplemented in SCH_MARKER, and PCB_MARKER.
Definition at line 107 of file marker_base.h.
References RPT_SEVERITY_UNDEFINED.
Referenced by RC_TREE_MODEL::DeleteItems(), and RC_TREE_MODEL::GetValue().
|
pure virtual |
Implemented in SCH_MARKER, and PCB_MARKER.
bool MARKER_BASE::HitTestMarker | ( | const BOX2I & | aRect, |
bool | aContained, | ||
int | aAccuracy = 0 |
||
) | const |
Test if the given BOX2I intersects or contains the bounds of this object.
Definition at line 109 of file marker_base.cpp.
References BOX2< Vec >::Contains(), GetBoundingBoxMarker(), BOX2< Vec >::GetInflated(), and BOX2< Vec >::Intersects().
bool MARKER_BASE::HitTestMarker | ( | const VECTOR2I & | aHitPosition, |
int | aAccuracy | ||
) | const |
Test if the given VECTOR2I is within the bounds of this object.
aHitPosition | is the VECTOR2I to test (in internal units). |
Definition at line 90 of file marker_base.cpp.
References BOX2< Vec >::Contains(), GetBoundingBoxMarker(), BOX2< Vec >::GetInflated(), m_Pos, SHAPE_LINE_CHAIN_BASE::PointInside(), and ShapeToPolygon().
Referenced by SCH_MARKER::HitTest(), and PCB_MARKER::HitTest().
|
inline |
Definition at line 98 of file marker_base.h.
References m_excluded.
Referenced by SCH_SCREENS::DeleteMarkers(), DIALOG_ERC::ExcludeMarker(), SCH_MARKER::GetColorLayer(), SHEETLIST_ERC_ITEMS_PROVIDER::GetCount(), RC_ITEM::GetJsonViolation(), SCH_MARKER::GetMsgPanelInfo(), PCB_MARKER::GetMsgPanelInfo(), SCH_MARKER::GetSeverity(), PCB_MARKER::GetSeverity(), SCHEMATIC::RecordERCExclusions(), SHEETLIST_ERC_ITEMS_PROVIDER::SetSeverities(), RC_ITEM::ShowReport(), RC_TREE_MODEL::ValueChanged(), and SCH_MARKER::ViewGetLayers().
|
inline |
The scaling factor to convert polygonal shape coordinates to internal units.
Definition at line 69 of file marker_base.h.
References m_scalingFactor.
Referenced by KIGFX::PCB_PAINTER::draw(), PrintMarker(), and ShapeToPolygon().
void MARKER_BASE::PrintMarker | ( | const RENDER_SETTINGS * | aSettings, |
const VECTOR2I & | aOffset | ||
) |
Print the shape is the polygon defined in m_Corners (array of VECTOR2Is).
Definition at line 144 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 99 of file marker_base.h.
References m_comment, and m_excluded.
Referenced by DIALOG_DRC::ExcludeMarker(), EE_INSPECTION_TOOL::ExcludeMarker(), DIALOG_ERC::ExcludeMarker(), BOARD::ResolveDRCExclusions(), and SCHEMATIC::ResolveERCExclusions().
|
inline |
Definition at line 70 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 95 of file marker_base.h.
References m_markerType.
Referenced by PCB_MARKER::PCB_MARKER().
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 120 of file marker_base.cpp.
References SHAPE_LINE_CHAIN::Append(), MarkerScale(), MarkerShapeCorners, and SHAPE_LINE_CHAIN::SetClosed().
Referenced by KIGFX::PCB_PAINTER::draw(), KIGFX::SCH_PAINTER::draw(), FOOTPRINT::GetCoverageArea(), PCB_SELECTION_TOOL::hitTestDistance(), and HitTestMarker().
|
protected |
Definition at line 145 of file marker_base.h.
Referenced by GetComment(), SCH_MARKER::GetMsgPanelInfo(), PCB_MARKER::GetMsgPanelInfo(), and SetExcluded().
|
protected |
Definition at line 144 of file marker_base.h.
Referenced by IsExcluded(), SetExcluded(), and SCH_MARKER::SwapData().
|
protected |
Definition at line 143 of file marker_base.h.
Referenced by GetMarkerType(), SetMarkerType(), and SCH_MARKER::SwapData().
VECTOR2I MARKER_BASE::m_Pos |
position of the marker
Definition at line 140 of file marker_base.h.
Referenced by GetBoundingBoxMarker(), GetPos(), SCH_MARKER::GetPosition(), PCB_MARKER::GetPosition(), HitTestMarker(), SCH_MARKER::Move(), PCB_MARKER::Move(), PCB_MARKER::PCB_MARKER(), PrintMarker(), SCH_MARKER::SCH_MARKER(), SCH_MARKER::SerializeToString(), PCB_MARKER::SerializeToString(), PCB_MARKER::SetPosition(), SCH_MARKER::SetPosition(), and SCH_MARKER::SwapData().
|
protected |
Definition at line 146 of file marker_base.h.
Referenced by SCH_MARKER::GetColorLayer(), PCB_MARKER::GetItemDescription(), SCH_MARKER::GetMsgPanelInfo(), PCB_MARKER::GetMsgPanelInfo(), GetRCItem(), SCH_MARKER::GetSeverity(), PCB_MARKER::GetSeverity(), SCH_MARKER::Matches(), PCB_MARKER::Matches(), PCB_MARKER::PCB_MARKER(), SCH_MARKER::SCH_MARKER(), SCH_MARKER::SerializeToString(), PCB_MARKER::SerializeToString(), SCH_MARKER::SwapData(), SCH_MARKER::ViewGetLayers(), PCB_MARKER::~PCB_MARKER(), and SCH_MARKER::~SCH_MARKER().
|
protected |
Definition at line 148 of file marker_base.h.
Referenced by GetBoundingBoxMarker(), MarkerScale(), SetMarkerScale(), and SCH_MARKER::SwapData().
|
protected |
Definition at line 150 of file marker_base.h.
Referenced by GetBoundingBoxMarker(), MARKER_BASE(), and SCH_MARKER::SwapData().