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  TYPEMARKER {
  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, 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 VECTOR2I &aOffset)
 Print the shape is the polygon defined in m_Corners (array of VECTOR2Is). More...
 
const VECTOR2IGetPos () 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)
 
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. More...
 
BOX2I GetBoundingBoxMarker () const
 Return the orthogonal, bounding box of this object for display purposes. More...
 

Public Attributes

VECTOR2I 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_ITEMm_rcItem
 
int m_scalingFactor
 
BOX2I m_shapeBoundingBox
 

Detailed Description

Definition at line 48 of file marker_base.h.

Member Enumeration Documentation

◆ TYPEMARKER

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,
TYPEMARKER  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 123 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().

◆ GetMarkerType()

◆ GetPos()

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

Definition at line 87 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 100 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 >::Inflate(), 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 68 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 134 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()

◆ SetMarkerScale()

void MARKER_BASE::SetMarkerScale ( int  aScale)
inline

Definition at line 69 of file marker_base.h.

References m_scalingFactor.

Referenced by PCB_MARKER::SetZoom().

◆ SetMarkerType()

void MARKER_BASE::SetMarkerType ( enum TYPEMARKER  aMarkerType)
inline

Accessors to set/get marker type (DRC, ERC, or other)

Definition at line 94 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 110 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_excluded

bool MARKER_BASE::m_excluded
protected

Definition at line 132 of file marker_base.h.

Referenced by IsExcluded(), and SetExcluded().

◆ m_markerType

TYPEMARKER MARKER_BASE::m_markerType
protected

Definition at line 131 of file marker_base.h.

Referenced by GetMarkerType(), and SetMarkerType().

◆ m_Pos

◆ m_rcItem

◆ m_scalingFactor

int MARKER_BASE::m_scalingFactor
protected

Definition at line 135 of file marker_base.h.

Referenced by GetBoundingBoxMarker(), MarkerScale(), and SetMarkerScale().

◆ m_shapeBoundingBox

BOX2I MARKER_BASE::m_shapeBoundingBox
protected

Definition at line 137 of file marker_base.h.

Referenced by GetBoundingBoxMarker(), and MARKER_BASE().


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