2009-07-06 18:02:26 +00:00
|
|
|
/***************************************/
|
|
|
|
/* Markers: used to show a drc problem */
|
|
|
|
/***************************************/
|
|
|
|
|
|
|
|
#ifndef _CLASS_MARKER_BASE_H
|
|
|
|
#define _CLASS_MARKER_BASE_H
|
|
|
|
|
|
|
|
#include "class_drc_item.h"
|
|
|
|
|
|
|
|
class MARKER_BASE
|
|
|
|
{
|
|
|
|
public:
|
2009-07-09 17:02:15 +00:00
|
|
|
wxPoint m_Pos; ///< position of the marker
|
2009-07-06 18:02:26 +00:00
|
|
|
protected:
|
2009-07-09 17:02:15 +00:00
|
|
|
std::vector <wxPoint> m_Corners; ///< Corner list for shape definition (a polygon)
|
|
|
|
int m_MarkerType; ///< Can be used as a flag
|
|
|
|
EDA_Colors m_Color; ///< color
|
|
|
|
EDA_Rect m_ShapeBoundingBox; ///< Bounding box of the graphic symbol, relative to the position of the shape, used for Hit Tests
|
|
|
|
int m_ScalingFactor; ///< Scaling factor for m_Size and m_Corners (can set the physical size
|
|
|
|
DRC_ITEM m_drc;
|
2009-07-06 18:02:26 +00:00
|
|
|
|
2009-07-09 17:02:15 +00:00
|
|
|
void init();
|
2009-07-06 18:02:26 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2009-07-09 17:02:15 +00:00
|
|
|
MARKER_BASE();
|
2009-07-06 18:02:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
* @param aErrorCode The categorizing identifier for an error
|
|
|
|
* @param aMarkerPos The position of the MARKER on the BOARD
|
|
|
|
* @param aText Text describing the first of two objects
|
|
|
|
* @param aPos The position of the first of two objects
|
|
|
|
* @param bText Text describing the second of the two conflicting objects
|
|
|
|
* @param bPos The position of the second of two objects
|
|
|
|
*/
|
|
|
|
MARKER_BASE( int aErrorCode, const wxPoint& aMarkerPos,
|
2009-07-09 17:02:15 +00:00
|
|
|
const wxString& aText, const wxPoint& aPos,
|
|
|
|
const wxString& bText, const wxPoint& bPos );
|
|
|
|
|
|
|
|
/**
|
2009-07-06 18:02:26 +00:00
|
|
|
* Constructor
|
|
|
|
* @param aErrorCode The categorizing identifier for an error
|
|
|
|
* @param aMarkerPos The position of the MARKER on the BOARD
|
|
|
|
* @param aText Text describing the object
|
|
|
|
* @param aPos The position of the object
|
|
|
|
*/
|
|
|
|
MARKER_BASE( int aErrorCode, const wxPoint& aMarkerPos,
|
2009-07-09 17:02:15 +00:00
|
|
|
const wxString& aText, const wxPoint& aPos );
|
2009-07-06 18:02:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
~MARKER_BASE();
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function DrawMarker
|
2009-07-06 18:02:26 +00:00
|
|
|
*/
|
2009-07-09 17:02:15 +00:00
|
|
|
void DrawMarker( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode, const wxPoint& offset );
|
2009-07-06 18:02:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetPos
|
|
|
|
* returns the position of this MARKER, const.
|
|
|
|
*/
|
|
|
|
const wxPoint& GetPos() const
|
|
|
|
{
|
|
|
|
return m_Pos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function SetColor
|
2009-07-07 17:50:02 +00:00
|
|
|
* Set the color of this marker
|
|
|
|
*/
|
2009-07-09 17:02:15 +00:00
|
|
|
void SetColor( EDA_Colors aColor )
|
2009-07-07 17:50:02 +00:00
|
|
|
{
|
|
|
|
m_Color = aColor;
|
|
|
|
}
|
|
|
|
|
2009-07-09 17:02:15 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function to set/get error levels (warning, fatal ..)
|
2009-07-06 18:02:26 +00:00
|
|
|
* this value is stored in m_MarkerType
|
|
|
|
*/
|
2009-07-09 17:02:15 +00:00
|
|
|
void SetErrorLevel( int aErrorLevel )
|
2009-07-06 18:02:26 +00:00
|
|
|
{
|
2009-07-07 17:50:02 +00:00
|
|
|
m_MarkerType &= ~0xFF00;
|
2009-07-09 17:02:15 +00:00
|
|
|
aErrorLevel &= 0xFF;
|
2009-07-06 18:02:26 +00:00
|
|
|
m_MarkerType |= aErrorLevel << 8;
|
|
|
|
}
|
|
|
|
|
2009-07-09 17:02:15 +00:00
|
|
|
|
|
|
|
int GetErrorLevel() const
|
2009-07-06 18:02:26 +00:00
|
|
|
{
|
|
|
|
return (m_MarkerType >> 8) & 0xFF;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** Functions to set/get marker type (DRC, ERC, or other)
|
|
|
|
* this value is stored in m_MarkerType
|
|
|
|
*/
|
2009-07-09 17:02:15 +00:00
|
|
|
void SetMarkerType( int aMarkerType )
|
2009-07-06 18:02:26 +00:00
|
|
|
{
|
2009-07-07 17:50:02 +00:00
|
|
|
m_MarkerType &= ~0xFF;
|
2009-07-09 17:02:15 +00:00
|
|
|
aMarkerType &= 0xFF;
|
2009-07-06 18:02:26 +00:00
|
|
|
m_MarkerType |= aMarkerType;
|
|
|
|
}
|
|
|
|
|
2009-07-09 17:02:15 +00:00
|
|
|
|
|
|
|
int GetMarkerType() const
|
2009-07-06 18:02:26 +00:00
|
|
|
{
|
|
|
|
return m_MarkerType & 0xFF;
|
|
|
|
}
|
|
|
|
|
2009-07-09 17:02:15 +00:00
|
|
|
|
2009-07-06 18:02:26 +00:00
|
|
|
/**
|
|
|
|
* Function SetData
|
|
|
|
* fills in all the reportable data associated with a MARKER.
|
|
|
|
* @param aErrorCode The categorizing identifier for an error
|
|
|
|
* @param aMarkerPos The position of the MARKER on the BOARD
|
|
|
|
* @param aText Text describing the first of two objects
|
|
|
|
* @param aPos The position of the first of two objects
|
|
|
|
* @param bText Text describing the second of the two conflicting objects
|
|
|
|
* @param bPos The position of the second of two objects
|
|
|
|
*/
|
|
|
|
void SetData( int aErrorCode, const wxPoint& aMarkerPos,
|
2009-07-09 17:02:15 +00:00
|
|
|
const wxString& aText, const wxPoint& aPos,
|
|
|
|
const wxString& bText, const wxPoint& bPos );
|
2009-07-06 18:02:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetData
|
|
|
|
* fills in all the reportable data associated with a MARKER.
|
|
|
|
* @param aErrorCode The categorizing identifier for an error
|
|
|
|
* @param aMarkerPos The position of the MARKER on the BOARD
|
|
|
|
* @param aText Text describing the object
|
|
|
|
* @param aPos The position of the object
|
|
|
|
*/
|
|
|
|
void SetData( int aErrorCode, const wxPoint& aMarkerPos,
|
2009-07-09 17:02:15 +00:00
|
|
|
const wxString& aText, const wxPoint& aPos );
|
2009-07-06 18:02:26 +00:00
|
|
|
|
|
|
|
|
2009-09-10 15:22:26 +00:00
|
|
|
/**
|
|
|
|
* Function SetAuxiliaryData
|
2009-07-08 15:42:45 +00:00
|
|
|
* initialize data for the second (auxiliary) item
|
|
|
|
* @param aAuxiliaryText = the second text (main text) concerning the second schematic or board item
|
|
|
|
* @param aAuxiliaryPos = position the second item
|
|
|
|
*/
|
|
|
|
void SetAuxiliaryData( const wxString& aAuxiliaryText, const wxPoint& aAuxiliaryPos )
|
|
|
|
{
|
|
|
|
m_drc.SetAuxiliaryData( aAuxiliaryText, aAuxiliaryPos );
|
|
|
|
}
|
|
|
|
|
2009-09-10 15:22:26 +00:00
|
|
|
void SetShowNoCoordinate()
|
|
|
|
{
|
|
|
|
m_drc.SetShowNoCoordinate();
|
|
|
|
}
|
2009-07-09 17:02:15 +00:00
|
|
|
|
2009-07-06 18:02:26 +00:00
|
|
|
/**
|
|
|
|
* Function GetReporter
|
|
|
|
* returns the DRC_ITEM held within this MARKER so that its
|
|
|
|
* interface may be used.
|
|
|
|
* @return const& DRC_ITEM
|
|
|
|
*/
|
|
|
|
const DRC_ITEM& GetReporter() const
|
|
|
|
{
|
|
|
|
return m_drc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2010-11-12 16:59:16 +00:00
|
|
|
* Function DisplayMarkerInfo
|
2009-07-13 15:25:41 +00:00
|
|
|
* Displays the full info of this marker, in a HTML window
|
|
|
|
*/
|
|
|
|
void DisplayMarkerInfo(WinEDA_DrawFrame * aFrame);
|
|
|
|
|
2009-07-06 18:02:26 +00:00
|
|
|
/**
|
|
|
|
* Function HitTestMarker
|
|
|
|
* tests if the given wxPoint is within the bounds of this object.
|
|
|
|
* @param ref_pos A wxPoint to test
|
|
|
|
* @return bool - true if a hit, else false
|
|
|
|
*/
|
2009-07-09 17:02:15 +00:00
|
|
|
bool HitTestMarker( const wxPoint& ref_pos );
|
|
|
|
|
2009-07-08 15:42:45 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
EDA_Rect GetBoundingBoxMarker();
|
2009-07-06 18:02:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _CLASS_MARKER_BASE_H
|