KiCad PCB EDA Suite
Loading...
Searching...
No Matches
MARKER_BASE Class Referenceabstract

#include <marker_base.h>

Inheritance diagram for MARKER_BASE:
PCB_MARKER SCH_MARKER

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 VECTOR2IGetPos () 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_ITEMGetRCItem () const
 
bool HitTestMarker (const VECTOR2I &aHitPosition, int aAccuracy) const
 Test if the given VECTOR2I is within 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_ITEMm_rcItem
 
int m_scalingFactor
 
BOX2I m_shapeBoundingBox
 

Detailed Description

Definition at line 48 of file marker_base.h.

Member Enumeration Documentation

◆ MARKER_T

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.

Constructor & Destructor Documentation

◆ MARKER_BASE()

MARKER_BASE::MARKER_BASE ( int  aScalingFactor,
std::shared_ptr< RC_ITEM aItem,
MARKER_T  aType = MARKER_UNSPEC 
)

◆ ~MARKER_BASE()

MARKER_BASE::~MARKER_BASE ( )
virtual

Definition at line 85 of file marker_base.cpp.

Member Function Documentation

◆ GetBoundingBoxMarker()

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 122 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().

◆ getColor()

virtual KIGFX::COLOR4D MARKER_BASE::getColor ( ) const
protectedpure virtual

Implemented in SCH_MARKER, and PCB_MARKER.

Referenced by PrintMarker().

◆ GetComment()

wxString MARKER_BASE::GetComment ( ) const
inline

◆ GetMarkerType()

◆ GetPos()

const VECTOR2I & MARKER_BASE::GetPos ( ) const
inline
Returns
the position of this marker in internal units.

Definition at line 88 of file marker_base.h.

References m_Pos.

Referenced by PCB_SELECTION_TOOL::hitTestDistance().

◆ GetRCItem()

◆ GetSeverity()

virtual SEVERITY MARKER_BASE::GetSeverity ( ) const
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().

◆ GetUUID()

virtual const KIID MARKER_BASE::GetUUID ( ) const
pure virtual

Implemented in SCH_MARKER, and PCB_MARKER.

◆ HitTestMarker()

bool MARKER_BASE::HitTestMarker ( const VECTOR2I aHitPosition,
int  aAccuracy 
) const

Test if the given VECTOR2I is within the bounds of this object.

Parameters
aHitPositionis the VECTOR2I to test (in internal units).
Returns
true if a hit, else false.

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().

◆ IsExcluded()

◆ MarkerScale()

int MARKER_BASE::MarkerScale ( ) const
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().

◆ PrintMarker()

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 133 of file marker_base.cpp.

References CORNERS_COUNT, getColor(), KIGFX::RENDER_SETTINGS::GetPrintDC(), GRClosedPoly(), m_Pos, MarkerScale(), and MarkerShapeCorners.

Referenced by SCH_MARKER::Print().

◆ SetExcluded()

void MARKER_BASE::SetExcluded ( bool  aExcluded,
const wxString &  aComment = wxEmptyString 
)
inline

◆ SetMarkerScale()

void MARKER_BASE::SetMarkerScale ( int  aScale)
inline

Definition at line 70 of file marker_base.h.

References m_scalingFactor.

Referenced by PCB_MARKER::SetZoom().

◆ SetMarkerType()

void MARKER_BASE::SetMarkerType ( enum MARKER_T  aMarkerType)
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().

◆ ShapeToPolygon()

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).

Parameters
aPolygonis the SHAPE_LINE_CHAIN to fill with the shape.

Definition at line 109 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().

Member Data Documentation

◆ m_comment

wxString MARKER_BASE::m_comment
protected

◆ m_excluded

bool MARKER_BASE::m_excluded
protected

Definition at line 139 of file marker_base.h.

Referenced by IsExcluded(), SetExcluded(), and SCH_MARKER::SwapData().

◆ m_markerType

MARKER_T MARKER_BASE::m_markerType
protected

Definition at line 138 of file marker_base.h.

Referenced by GetMarkerType(), SetMarkerType(), and SCH_MARKER::SwapData().

◆ m_Pos

◆ m_rcItem

◆ m_scalingFactor

int MARKER_BASE::m_scalingFactor
protected

◆ m_shapeBoundingBox

BOX2I MARKER_BASE::m_shapeBoundingBox
protected

Definition at line 145 of file marker_base.h.

Referenced by GetBoundingBoxMarker(), MARKER_BASE(), and SCH_MARKER::SwapData().


The documentation for this class was generated from the following files: