KiCad PCB EDA Suite
MARKER_BASE Class Reference

#include <marker_base.h>

Inheritance diagram for MARKER_BASE:
MARKER_PCB SCH_MARKER

Public Types

enum  TYPEMARKER { MARKER_UNSPEC, MARKER_ERC, MARKER_PCB, MARKER_SIMUL }
 
enum  MARKER_SEVERITY { MARKER_SEVERITY_UNSPEC, MARKER_SEVERITY_INFO, MARKER_SEVERITY_WARNING, MARKER_SEVERITY_ERROR }
 

Public Member Functions

 MARKER_BASE (int aScalingFactor)
 
 MARKER_BASE (EDA_UNITS_T aUnits, int aErrorCode, const wxPoint &aMarkerPos, EDA_ITEM *aItem, const wxPoint &aPos, EDA_ITEM *bItem, const wxPoint &bPos, int aScalingFactor)
 Constructor. More...
 
 MARKER_BASE (int aErrorCode, const wxPoint &aMarkerPos, const wxString &aText, const wxPoint &aPos, const wxString &bText, const wxPoint &bPos, int aScalingFactor)
 Constructor. More...
 
 MARKER_BASE (int aErrorCode, const wxPoint &aMarkerPos, const wxString &aText, const wxPoint &aPos, int aScalingFactor)
 Constructor. More...
 
 MARKER_BASE (const MARKER_BASE &aMarker)
 Contructor makes a copy of aMarker but does not copy the DRC_ITEM. More...
 
 ~MARKER_BASE ()
 
int MarkerScale () const
 The scaling factor to convert polygonal shape coordinates to internal units. More...
 
void ShapeToPolygon (SHAPE_LINE_CHAIN &aPolygon) const
 Returns the shape polygon in internal units in a SHAPE_LINE_CHAIN the coordinates are relatives to the marker position (are not absolute) More...
 
const VECTOR2IGetShapePolygon () const
 
const VECTOR2IGetShapePolygonCorner (int aIdx) const
 
int GetShapePolygonCornerCount () const
 
void DrawMarker (EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aOffset)
 Function DrawMarker draws the shape is the polygon defined in m_Corners (array of wxPoints). More...
 
const wxPoint & GetPos () const
 Function GetPos. More...
 
void SetColor (COLOR4D aColor)
 Function SetColor Set the color of this marker. More...
 
void SetErrorLevel (MARKER_SEVERITY aErrorLevel)
 accessors to set/get error levels (warning, error, fatal error..) More...
 
MARKER_SEVERITY GetErrorLevel () const
 
void SetMarkerType (enum TYPEMARKER aMarkerType)
 accessors to set/get marker type (DRC, ERC, or other) More...
 
enum TYPEMARKER GetMarkerType () const
 
void SetData (EDA_UNITS_T aUnits, int aErrorCode, const wxPoint &aMarkerPos, EDA_ITEM *aItem, const wxPoint &aPos, EDA_ITEM *bItem=nullptr, const wxPoint &bPos=wxPoint())
 Function SetData fills in all the reportable data associated with a MARKER. More...
 
void SetData (int aErrorCode, const wxPoint &aMarkerPos, const wxString &aText, const wxPoint &aPos, const wxString &bText=wxEmptyString, const wxPoint &bPos=wxPoint())
 Function SetData fills in all the reportable data associated with a MARKER. More...
 
void SetAuxiliaryData (const wxString &aAuxiliaryText, const wxPoint &aAuxiliaryPos)
 Function SetAuxiliaryData initialize data for the second (auxiliary) item. More...
 
void SetShowNoCoordinate ()
 
const DRC_ITEMGetReporter () const
 Function GetReporter returns the DRC_ITEM held within this MARKER so that its interface may be used. More...
 
void DisplayMarkerInfo (EDA_DRAW_FRAME *aFrame)
 Function DisplayMarkerInfo displays the full info of this marker, in a HTML window. More...
 
bool HitTestMarker (const wxPoint &aHitPosition, int aAccuracy) const
 Tests if the given wxPoint is within the bounds of this object. More...
 
EDA_RECT GetBoundingBoxMarker () const
 Function GetBoundingBoxMarker returns the orthogonal, bounding box of this object for display purposes. More...
 

Public Attributes

wxPoint m_Pos
 position of the marker More...
 

Protected Member Functions

void init ()
 

Protected Attributes

int m_ScalingFactor
 Scaling factor to convert corners coordinates to internat units coordinates. More...
 
TYPEMARKER m_MarkerType
 The type of marker (useful to filter markers) More...
 
MARKER_SEVERITY m_ErrorLevel
 Specify the severity of the error. More...
 
COLOR4D m_Color
 color More...
 
EDA_RECT m_ShapeBoundingBox
 Bounding box of the graphic symbol, relative to the position of the shape, in marker shape units. More...
 
DRC_ITEM m_drc
 

Detailed Description

Definition at line 38 of file marker_base.h.

Member Enumeration Documentation

◆ MARKER_SEVERITY

Enumerator
MARKER_SEVERITY_UNSPEC 
MARKER_SEVERITY_INFO 
MARKER_SEVERITY_WARNING 
MARKER_SEVERITY_ERROR 

Definition at line 47 of file marker_base.h.

◆ TYPEMARKER

Enumerator
MARKER_UNSPEC 
MARKER_ERC 
MARKER_PCB 
MARKER_SIMUL 

Definition at line 41 of file marker_base.h.

41  { // Marker type: can be used to identify the purpose of the marker
43  MARKER_ERC,
44  MARKER_PCB,
46  };

Constructor & Destructor Documentation

◆ MARKER_BASE() [1/5]

MARKER_BASE::MARKER_BASE ( int  aScalingFactor)

Definition at line 99 of file marker_base.cpp.

100 {
101  m_ScalingFactor = aScalingFactor;
102  init();
103 }
int m_ScalingFactor
Scaling factor to convert corners coordinates to internat units coordinates.
Definition: marker_base.h:57

References init(), and m_ScalingFactor.

◆ MARKER_BASE() [2/5]

MARKER_BASE::MARKER_BASE ( EDA_UNITS_T  aUnits,
int  aErrorCode,
const wxPoint &  aMarkerPos,
EDA_ITEM aItem,
const wxPoint &  aPos,
EDA_ITEM bItem,
const wxPoint &  bPos,
int  aScalingFactor 
)

Constructor.

Parameters
aErrorCodeThe categorizing identifier for an error
aMarkerPosThe position of the MARKER on the BOARD
aItemThe first of two objects
aPosThe position of the first of two objects
bItemThe second of the two conflicting objects
bPosThe position of the second of two objects
aScalingFactorthe scaling factor to convert the shape coordinates to IU coordinates

Definition at line 106 of file marker_base.cpp.

109 {
110  m_ScalingFactor = aScalingFactor;
111  init();
112 
113  SetData( aUnits, aErrorCode, aMarkerPos, aItem, aPos, bItem, bPos );
114 }
void SetData(EDA_UNITS_T aUnits, int aErrorCode, const wxPoint &aMarkerPos, EDA_ITEM *aItem, const wxPoint &aPos, EDA_ITEM *bItem=nullptr, const wxPoint &bPos=wxPoint())
Function SetData fills in all the reportable data associated with a MARKER.
int m_ScalingFactor
Scaling factor to convert corners coordinates to internat units coordinates.
Definition: marker_base.h:57

References init(), m_ScalingFactor, and SetData().

◆ MARKER_BASE() [3/5]

MARKER_BASE::MARKER_BASE ( int  aErrorCode,
const wxPoint &  aMarkerPos,
const wxString &  aText,
const wxPoint &  aPos,
const wxString &  bText,
const wxPoint &  bPos,
int  aScalingFactor 
)

Constructor.

Parameters
aErrorCodeThe categorizing identifier for an error
aMarkerPosThe position of the MARKER on the BOARD
aTextText describing the first of two objects
aPosThe position of the first of two objects
bTextText describing the second of the two conflicting objects
bPosThe position of the second of two objects
aScalingFactorthe scaling factor to convert the shape coordinates to IU coordinates

Definition at line 117 of file marker_base.cpp.

120 {
121  m_ScalingFactor = aScalingFactor;
122  init();
123 
124  SetData( aErrorCode, aMarkerPos, aText, aPos, bText, bPos );
125 }
void SetData(EDA_UNITS_T aUnits, int aErrorCode, const wxPoint &aMarkerPos, EDA_ITEM *aItem, const wxPoint &aPos, EDA_ITEM *bItem=nullptr, const wxPoint &bPos=wxPoint())
Function SetData fills in all the reportable data associated with a MARKER.
int m_ScalingFactor
Scaling factor to convert corners coordinates to internat units coordinates.
Definition: marker_base.h:57

References init(), m_ScalingFactor, and SetData().

◆ MARKER_BASE() [4/5]

MARKER_BASE::MARKER_BASE ( int  aErrorCode,
const wxPoint &  aMarkerPos,
const wxString &  aText,
const wxPoint &  aPos,
int  aScalingFactor 
)

Constructor.

Parameters
aErrorCodeThe categorizing identifier for an error
aMarkerPosThe position of the MARKER on the BOARD
aTextText describing the object
aPosThe position of the object
aScalingFactorthe scaling factor to convert the shape coordinates to IU coordinates

Definition at line 128 of file marker_base.cpp.

130 {
131  m_ScalingFactor = aScalingFactor;
132  init();
133 
134  SetData( aErrorCode, aMarkerPos, aText, aPos );
135 }
void SetData(EDA_UNITS_T aUnits, int aErrorCode, const wxPoint &aMarkerPos, EDA_ITEM *aItem, const wxPoint &aPos, EDA_ITEM *bItem=nullptr, const wxPoint &bPos=wxPoint())
Function SetData fills in all the reportable data associated with a MARKER.
int m_ScalingFactor
Scaling factor to convert corners coordinates to internat units coordinates.
Definition: marker_base.h:57

References init(), m_ScalingFactor, and SetData().

◆ MARKER_BASE() [5/5]

MARKER_BASE::MARKER_BASE ( const MARKER_BASE aMarker)

Contructor makes a copy of aMarker but does not copy the DRC_ITEM.

Parameters
aMarkerThe marker to copy.

Definition at line 88 of file marker_base.cpp.

89 {
90  m_Pos = aMarker.m_Pos;
91  m_ErrorLevel = aMarker.m_ErrorLevel;
92  m_MarkerType = aMarker.m_MarkerType;
93  m_Color = aMarker.m_Color;
96 }
MARKER_SEVERITY m_ErrorLevel
Specify the severity of the error.
Definition: marker_base.h:60
wxPoint m_Pos
position of the marker
Definition: marker_base.h:54
TYPEMARKER m_MarkerType
The type of marker (useful to filter markers)
Definition: marker_base.h:59
COLOR4D m_Color
color
Definition: marker_base.h:61
int m_ScalingFactor
Scaling factor to convert corners coordinates to internat units coordinates.
Definition: marker_base.h:57
EDA_RECT m_ShapeBoundingBox
Bounding box of the graphic symbol, relative to the position of the shape, in marker shape units.
Definition: marker_base.h:62

References m_Color, m_ErrorLevel, m_MarkerType, m_Pos, m_ScalingFactor, and m_ShapeBoundingBox.

◆ ~MARKER_BASE()

MARKER_BASE::~MARKER_BASE ( )

Definition at line 138 of file marker_base.cpp.

139 {
140 }

Member Function Documentation

◆ DisplayMarkerInfo()

void MARKER_BASE::DisplayMarkerInfo ( EDA_DRAW_FRAME aFrame)

Function DisplayMarkerInfo displays the full info of this marker, in a HTML window.

Definition at line 229 of file marker_base.cpp.

230 {
231  wxString msg = m_drc.ShowHtml( aFrame->GetUserUnits() );
232  DIALOG_DISPLAY_HTML_TEXT_BASE infodisplay( (wxWindow*)aFrame, wxID_ANY, _( "Marker Info" ),
233  wxGetMousePosition(), wxSize( 550, 140 ) );
234 
235  infodisplay.m_htmlWindow->SetPage( msg );
236  infodisplay.ShowModal();
237 }
Class DIALOG_DISPLAY_HTML_TEXT_BASE.
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:289
wxString ShowHtml(EDA_UNITS_T aUnits) const
Function ShowHtml translates this object into a fragment of HTML suitable for the wxWidget's wxHtmlLi...
Definition: drc_item.cpp:182
DRC_ITEM m_drc
Definition: marker_base.h:64

References EDA_DRAW_FRAME::GetUserUnits(), m_drc, DIALOG_DISPLAY_HTML_TEXT_BASE::m_htmlWindow, and DRC_ITEM::ShowHtml().

Referenced by EE_INSPECTION_TOOL::ShowMarkerInfo().

◆ DrawMarker()

void MARKER_BASE::DrawMarker ( EDA_DRAW_PANEL aPanel,
wxDC *  aDC,
const wxPoint &  aOffset 
)

Function DrawMarker draws the shape is the polygon defined in m_Corners (array of wxPoints).

Definition at line 8 of file legacy_gal/other.cpp.

9 {
10 }

Referenced by SCH_MARKER::Draw(), and MARKER_PCB::Draw().

◆ GetBoundingBoxMarker()

EDA_RECT MARKER_BASE::GetBoundingBoxMarker ( ) const

Function GetBoundingBoxMarker returns 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 214 of file marker_base.cpp.

215 {
216  wxSize size_iu = m_ShapeBoundingBox.GetSize();
217  wxPoint position_iu = m_ShapeBoundingBox.GetPosition();
218  size_iu.x *= m_ScalingFactor;
219  size_iu.y *= m_ScalingFactor;
220  position_iu.x *= m_ScalingFactor;
221  position_iu.y *= m_ScalingFactor;
222  position_iu += m_Pos;
223 
224  return EDA_RECT( position_iu, size_iu );
225 }
wxPoint m_Pos
position of the marker
Definition: marker_base.h:54
const wxPoint GetPosition() const
Definition: eda_rect.h:113
int m_ScalingFactor
Scaling factor to convert corners coordinates to internat units coordinates.
Definition: marker_base.h:57
EDA_RECT m_ShapeBoundingBox
Bounding box of the graphic symbol, relative to the position of the shape, in marker shape units.
Definition: marker_base.h:62
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
const wxSize GetSize() const
Definition: eda_rect.h:101

References EDA_RECT::GetPosition(), EDA_RECT::GetSize(), m_Pos, m_ScalingFactor, and m_ShapeBoundingBox.

Referenced by SCH_MARKER::GetBoundingBox(), and HitTestMarker().

◆ GetErrorLevel()

MARKER_SEVERITY MARKER_BASE::GetErrorLevel ( ) const
inline

Definition at line 175 of file marker_base.h.

176  {
177  return m_ErrorLevel;
178  }
MARKER_SEVERITY m_ErrorLevel
Specify the severity of the error.
Definition: marker_base.h:60

References m_ErrorLevel.

Referenced by SCH_MARKER::Draw(), KIGFX::SCH_PAINTER::draw(), SCH_SCREENS::GetMarkerCount(), and WriteDiagnosticERC().

◆ GetMarkerType()

enum TYPEMARKER MARKER_BASE::GetMarkerType ( ) const
inline

Definition at line 187 of file marker_base.h.

188  {
189  return m_MarkerType;
190  }
TYPEMARKER m_MarkerType
The type of marker (useful to filter markers)
Definition: marker_base.h:59

References m_MarkerType.

Referenced by SCH_SCREENS::DeleteAllMarkers(), DIALOG_ERC::DisplayERC_MarkersList(), SCH_MARKER::Draw(), SCH_SCREENS::GetMarkerCount(), and WriteDiagnosticERC().

◆ GetPos()

const wxPoint& MARKER_BASE::GetPos ( ) const
inline

Function GetPos.

Returns
the position of this MARKER in internal units.

Definition at line 153 of file marker_base.h.

154  {
155  return m_Pos;
156  }
wxPoint m_Pos
position of the marker
Definition: marker_base.h:54

References m_Pos.

◆ GetReporter()

const DRC_ITEM& MARKER_BASE::GetReporter ( ) const
inline

Function GetReporter returns the DRC_ITEM held within this MARKER so that its interface may be used.

Returns
const& DRC_ITEM

Definition at line 243 of file marker_base.h.

244  {
245  return m_drc;
246  }
DRC_ITEM m_drc
Definition: marker_base.h:64

References m_drc.

Referenced by DRC_LIST_MARKERS::GetItem(), SCH_MARKER::GetMsgPanelInfo(), and WriteDiagnosticERC().

◆ GetShapePolygon()

const VECTOR2I * MARKER_BASE::GetShapePolygon ( ) const
Returns
the shape corner list

Definition at line 196 of file marker_base.cpp.

197 {
198  return MarkerShapeCorners;
199 }
static const VECTOR2I MarkerShapeCorners[]
Definition: marker_base.cpp:47

References MarkerShapeCorners.

Referenced by init().

◆ GetShapePolygonCorner()

const VECTOR2I & MARKER_BASE::GetShapePolygonCorner ( int  aIdx) const
Returns
the shape polygon corner aIdx

Definition at line 202 of file marker_base.cpp.

203 {
204  return MarkerShapeCorners[aIdx];
205 }
static const VECTOR2I MarkerShapeCorners[]
Definition: marker_base.cpp:47

References MarkerShapeCorners.

Referenced by ShapeToPolygon().

◆ GetShapePolygonCornerCount()

int MARKER_BASE::GetShapePolygonCornerCount ( ) const
Returns
the default shape polygon corner count

Definition at line 208 of file marker_base.cpp.

209 {
210  return CORNERS_COUNT;
211 }
const unsigned CORNERS_COUNT
Definition: marker_base.cpp:59

References CORNERS_COUNT.

Referenced by init(), and ShapeToPolygon().

◆ HitTestMarker()

bool MARKER_BASE::HitTestMarker ( const wxPoint &  aHitPosition,
int  aAccuracy 
) const

Tests if the given wxPoint is within the bounds of this object.

Parameters
aHitPositionis the wxPoint to test (in internal units)
Returns
bool - true if a hit, else false

Definition at line 163 of file marker_base.cpp.

164 {
166  bbox.Inflate( aAccuracy );
167 
168  // Fast hit test using boundary box. A finer test will be made if requested
169  bool hit = bbox.Contains( aHitPosition );
170 
171  if( hit ) // Fine test
172  {
173  SHAPE_LINE_CHAIN polygon;
174  ShapeToPolygon( polygon );
175  VECTOR2I rel_pos( aHitPosition - m_Pos );
176  hit = polygon.PointInside( rel_pos, aAccuracy );
177  }
178 
179  return hit;
180 }
wxPoint m_Pos
position of the marker
Definition: marker_base.h:54
bool Contains(const wxPoint &aPoint) const
Function Contains.
EDA_RECT GetBoundingBoxMarker() const
Function GetBoundingBoxMarker returns the orthogonal, bounding box of this object for display purpose...
void ShapeToPolygon(SHAPE_LINE_CHAIN &aPolygon) const
Returns the shape polygon in internal units in a SHAPE_LINE_CHAIN the coordinates are relatives to th...
Class SHAPE_LINE_CHAIN.
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
bool PointInside(const VECTOR2I &aPt, int aAccuracy=0) const
Function PointInside()
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.

References EDA_RECT::Contains(), GetBoundingBoxMarker(), EDA_RECT::Inflate(), m_Pos, SHAPE_LINE_CHAIN::PointInside(), and ShapeToPolygon().

Referenced by SCH_MARKER::HitTest(), and MARKER_PCB::HitTest().

◆ init()

void MARKER_BASE::init ( )
protected

Definition at line 65 of file marker_base.cpp.

66 {
69  m_Color = RED;
70  const VECTOR2I* point_shape = GetShapePolygon();
71  wxPoint start( point_shape->x, point_shape->y );
72  wxPoint end = start;
73 
74  for( int ii = 1; ii < GetShapePolygonCornerCount(); ii++ )
75  {
76  ++point_shape;
77  start.x = std::min( start.x, point_shape->x);
78  start.y = std::min( start.y, point_shape->y);
79  end.x = std::max( end.x, point_shape->x);
80  end.y = std::max( end.y, point_shape->y);
81  }
82 
85 }
MARKER_SEVERITY m_ErrorLevel
Specify the severity of the error.
Definition: marker_base.h:60
int GetShapePolygonCornerCount() const
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:124
const VECTOR2I * GetShapePolygon() const
TYPEMARKER m_MarkerType
The type of marker (useful to filter markers)
Definition: marker_base.h:59
void SetEnd(int x, int y)
Definition: eda_rect.h:134
COLOR4D m_Color
color
Definition: marker_base.h:61
Definition: colors.h:60
EDA_RECT m_ShapeBoundingBox
Bounding box of the graphic symbol, relative to the position of the shape, in marker shape units.
Definition: marker_base.h:62
#define max(a, b)
Definition: auxiliary.h:86
#define min(a, b)
Definition: auxiliary.h:85

References GetShapePolygon(), GetShapePolygonCornerCount(), m_Color, m_ErrorLevel, m_MarkerType, m_ShapeBoundingBox, MARKER_SEVERITY_UNSPEC, MARKER_UNSPEC, max, min, RED, EDA_RECT::SetEnd(), EDA_RECT::SetOrigin(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by MARKER_BASE().

◆ MarkerScale()

int MARKER_BASE::MarkerScale ( ) const
inline

The scaling factor to convert polygonal shape coordinates to internal units.

Definition at line 123 of file marker_base.h.

123 { return m_ScalingFactor; }
int m_ScalingFactor
Scaling factor to convert corners coordinates to internat units coordinates.
Definition: marker_base.h:57

References m_ScalingFactor.

Referenced by MARKER_PCB::GetBoundingBox(), and ShapeToPolygon().

◆ SetAuxiliaryData()

void MARKER_BASE::SetAuxiliaryData ( const wxString &  aAuxiliaryText,
const wxPoint &  aAuxiliaryPos 
)
inline

Function SetAuxiliaryData initialize data for the second (auxiliary) item.

Parameters
aAuxiliaryText= the second text (main text) concerning the second schematic or board item
aAuxiliaryPos= position the second item

Definition at line 227 of file marker_base.h.

228  {
229  m_drc.SetAuxiliaryData( aAuxiliaryText, aAuxiliaryPos );
230  }
void SetAuxiliaryData(const wxString &aAuxiliaryText, const wxPoint &aAuxiliaryPos)
Function SetAuxiliaryData initialize data for the second (auxiliary) item.
Definition: drc_item.h:149
DRC_ITEM m_drc
Definition: marker_base.h:64

References m_drc, and DRC_ITEM::SetAuxiliaryData().

Referenced by Diagnose(), and SimilarLabelsDiagnose().

◆ SetColor()

void MARKER_BASE::SetColor ( COLOR4D  aColor)
inline

Function SetColor Set the color of this marker.

Definition at line 162 of file marker_base.h.

163  {
164  m_Color = aColor;
165  }
COLOR4D m_Color
color
Definition: marker_base.h:61

References m_Color.

◆ SetData() [1/2]

void MARKER_BASE::SetData ( EDA_UNITS_T  aUnits,
int  aErrorCode,
const wxPoint &  aMarkerPos,
EDA_ITEM aItem,
const wxPoint &  aPos,
EDA_ITEM bItem = nullptr,
const wxPoint &  bPos = wxPoint() 
)

Function SetData fills in all the reportable data associated with a MARKER.

Parameters
aErrorCodeThe categorizing identifier for an error
aMarkerPosThe position of the MARKER on the BOARD
aItemThe first of two objects
aPosThe position of the first of two objects
bItemThe second of the two conflicting objects
bPosThe position of the second of two objects

Definition at line 143 of file marker_base.cpp.

146 {
147  m_Pos = aMarkerPos;
148  m_drc.SetData( aUnits, aErrorCode, aItem, aPos, bItem, bPos );
149  m_drc.SetParent( this );
150 }
wxPoint m_Pos
position of the marker
Definition: marker_base.h:54
void SetParent(MARKER_BASE *aMarker)
Definition: drc_item.h:158
void SetData(EDA_UNITS_T aUnits, int aErrorCode, EDA_ITEM *aMainItem, const wxPoint &aMainPos, EDA_ITEM *bAuxiliaryItem=nullptr, const wxPoint &bAuxiliaryPos=wxPoint())
Function SetData initialize all data in item.
Definition: drc_item.h:98
DRC_ITEM m_drc
Definition: marker_base.h:64

References m_drc, m_Pos, DRC_ITEM::SetData(), and DRC_ITEM::SetParent().

Referenced by Diagnose(), MARKER_BASE(), SimilarLabelsDiagnose(), TestDuplicateSheetNames(), DIALOG_ERC::TestErc(), and TestMultiunitFootprints().

◆ SetData() [2/2]

void MARKER_BASE::SetData ( int  aErrorCode,
const wxPoint &  aMarkerPos,
const wxString &  aText,
const wxPoint &  aPos,
const wxString &  bText = wxEmptyString,
const wxPoint &  bPos = wxPoint() 
)

Function SetData fills in all the reportable data associated with a MARKER.

Parameters
aErrorCodeThe categorizing identifier for an error
aMarkerPosThe position of the MARKER on the BOARD
aTextText describing the first of two objects
aPosThe position of the first of two objects
bTextText describing the second of the two conflicting objects
bPosThe position of the second of two objects

Definition at line 153 of file marker_base.cpp.

156 {
157  m_Pos = aMarkerPos;
158  m_drc.SetData( aErrorCode, aText, aPos, bText, bPos );
159  m_drc.SetParent( this );
160 }
wxPoint m_Pos
position of the marker
Definition: marker_base.h:54
void SetParent(MARKER_BASE *aMarker)
Definition: drc_item.h:158
void SetData(EDA_UNITS_T aUnits, int aErrorCode, EDA_ITEM *aMainItem, const wxPoint &aMainPos, EDA_ITEM *bAuxiliaryItem=nullptr, const wxPoint &bAuxiliaryPos=wxPoint())
Function SetData initialize all data in item.
Definition: drc_item.h:98
DRC_ITEM m_drc
Definition: marker_base.h:64

References m_drc, m_Pos, DRC_ITEM::SetData(), and DRC_ITEM::SetParent().

◆ SetErrorLevel()

void MARKER_BASE::SetErrorLevel ( MARKER_SEVERITY  aErrorLevel)
inline

accessors to set/get error levels (warning, error, fatal error..)

Definition at line 170 of file marker_base.h.

171  {
172  m_ErrorLevel = aErrorLevel;
173  }
MARKER_SEVERITY m_ErrorLevel
Specify the severity of the error.
Definition: marker_base.h:60

References m_ErrorLevel.

Referenced by Diagnose(), SimilarLabelsDiagnose(), TestDuplicateSheetNames(), DIALOG_ERC::TestErc(), and TestMultiunitFootprints().

◆ SetMarkerType()

void MARKER_BASE::SetMarkerType ( enum TYPEMARKER  aMarkerType)
inline

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

Definition at line 182 of file marker_base.h.

183  {
184  m_MarkerType = aMarkerType;
185  }
TYPEMARKER m_MarkerType
The type of marker (useful to filter markers)
Definition: marker_base.h:59

References m_MarkerType.

Referenced by Diagnose(), SimilarLabelsDiagnose(), TestDuplicateSheetNames(), DIALOG_ERC::TestErc(), and TestMultiunitFootprints().

◆ SetShowNoCoordinate()

void MARKER_BASE::SetShowNoCoordinate ( )
inline

Definition at line 232 of file marker_base.h.

233  {
235  }
void SetShowNoCoordinate()
Definition: drc_item.h:164
DRC_ITEM m_drc
Definition: marker_base.h:64

References m_drc, and DRC_ITEM::SetShowNoCoordinate().

Referenced by DRC_MARKER_FACTORY::NewMarker().

◆ ShapeToPolygon()

void MARKER_BASE::ShapeToPolygon ( SHAPE_LINE_CHAIN aPolygon) const

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

184 {
185  // Build the marker shape polygon in internal units:
186  const int ccount = GetShapePolygonCornerCount();
187 
188  for( int ii = 0; ii < ccount; ii++ )
189  aPolygon.Append( GetShapePolygonCorner( ii ) * MarkerScale() );
190 
191  // Be sure aPolygon is seen as a closed polyline:
192  aPolygon.SetClosed( true );
193 }
int GetShapePolygonCornerCount() const
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
void SetClosed(bool aClosed)
Function SetClosed()
int MarkerScale() const
The scaling factor to convert polygonal shape coordinates to internal units.
Definition: marker_base.h:123
const VECTOR2I & GetShapePolygonCorner(int aIdx) const

References SHAPE_LINE_CHAIN::Append(), GetShapePolygonCorner(), GetShapePolygonCornerCount(), MarkerScale(), and SHAPE_LINE_CHAIN::SetClosed().

Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), and HitTestMarker().

Member Data Documentation

◆ m_Color

COLOR4D MARKER_BASE::m_Color
protected

color

Definition at line 61 of file marker_base.h.

Referenced by SCH_MARKER::Draw(), init(), MARKER_BASE(), MARKER_PCB::MARKER_PCB(), and SetColor().

◆ m_drc

◆ m_ErrorLevel

MARKER_SEVERITY MARKER_BASE::m_ErrorLevel
protected

Specify the severity of the error.

Definition at line 60 of file marker_base.h.

Referenced by GetErrorLevel(), init(), MARKER_BASE(), SetErrorLevel(), and SCH_MARKER::ViewGetLayers().

◆ m_MarkerType

TYPEMARKER MARKER_BASE::m_MarkerType
protected

The type of marker (useful to filter markers)

Definition at line 59 of file marker_base.h.

Referenced by GetMarkerType(), init(), MARKER_BASE(), and SetMarkerType().

◆ m_Pos

◆ m_ScalingFactor

int MARKER_BASE::m_ScalingFactor
protected

Scaling factor to convert corners coordinates to internat units coordinates.

Definition at line 57 of file marker_base.h.

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

◆ m_ShapeBoundingBox

EDA_RECT MARKER_BASE::m_ShapeBoundingBox
protected

Bounding box of the graphic symbol, relative to the position of the shape, in marker shape units.

Definition at line 62 of file marker_base.h.

Referenced by MARKER_PCB::GetBoundingBox(), GetBoundingBoxMarker(), init(), and MARKER_BASE().


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