2007-10-26 09:41:25 +00:00
|
|
|
/***************************************/
|
|
|
|
/* Markers: used to show a drc problem */
|
|
|
|
/***************************************/
|
|
|
|
|
|
|
|
#ifndef CLASS_MARKER_H
|
|
|
|
#define CLASS_MARKER_H
|
|
|
|
|
|
|
|
#include "base_struct.h"
|
|
|
|
|
2007-12-01 03:42:52 +00:00
|
|
|
#include "drc_stuff.h"
|
2007-10-26 09:41:25 +00:00
|
|
|
|
2007-11-27 22:49:35 +00:00
|
|
|
class MARKER : public BOARD_ITEM
|
2007-10-26 09:41:25 +00:00
|
|
|
{
|
2007-12-01 03:42:52 +00:00
|
|
|
protected:
|
|
|
|
char* m_Bitmap; ///< Shape (bitmap)
|
2007-10-26 09:41:25 +00:00
|
|
|
int m_Type;
|
2007-12-01 03:42:52 +00:00
|
|
|
int m_Color; ///< color
|
|
|
|
wxSize m_Size; ///< Size of the graphic symbol
|
2007-10-26 09:41:25 +00:00
|
|
|
|
2007-12-01 03:42:52 +00:00
|
|
|
DRC_ITEM m_drc;
|
|
|
|
|
|
|
|
void init();
|
|
|
|
|
2007-10-26 09:41:25 +00:00
|
|
|
public:
|
2007-12-01 03:42:52 +00:00
|
|
|
|
2007-11-27 22:49:35 +00:00
|
|
|
MARKER( BOARD_ITEM* StructFather );
|
2007-12-01 03:42:52 +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( int aErrorCode, const wxPoint& aMarkerPos,
|
|
|
|
const wxString& aText, const wxPoint& aPos,
|
|
|
|
const wxString& bText, const wxPoint& bPos );
|
|
|
|
|
2007-11-27 22:49:35 +00:00
|
|
|
~MARKER();
|
|
|
|
|
2007-10-26 09:41:25 +00:00
|
|
|
void UnLink();
|
|
|
|
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode );
|
2007-11-27 22:49:35 +00:00
|
|
|
|
2007-12-01 03:42:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetPosition
|
|
|
|
* returns the position of this MARKER.
|
|
|
|
*/
|
|
|
|
wxPoint& GetPosition()
|
|
|
|
{
|
|
|
|
return (wxPoint&) m_drc.GetPosition();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetPos
|
|
|
|
* returns the position of this MARKER, const.
|
|
|
|
*/
|
|
|
|
const wxPoint& GetPos() const
|
|
|
|
{
|
|
|
|
return m_drc.GetPosition();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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,
|
|
|
|
const wxString& aText, const wxPoint& aPos,
|
|
|
|
const wxString& bText, const wxPoint& bPos );
|
2007-11-27 22:49:35 +00:00
|
|
|
|
2007-12-01 03:42:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetReporter
|
2007-12-01 05:37:44 +00:00
|
|
|
* returns the DRC_ITEM held within this MARKER so that its
|
2007-12-01 03:42:52 +00:00
|
|
|
* interface may be used.
|
2007-12-01 05:37:44 +00:00
|
|
|
* @return const& DRC_ITEM
|
2007-12-01 03:42:52 +00:00
|
|
|
*/
|
2007-12-01 05:37:44 +00:00
|
|
|
const DRC_ITEM& GetReporter() const
|
2007-12-01 03:42:52 +00:00
|
|
|
{
|
|
|
|
return m_drc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-26 09:41:25 +00:00
|
|
|
/**
|
|
|
|
* Function Display_Infos
|
|
|
|
* has knowledge about the frame and how and where to put status information
|
|
|
|
* about this object into the frame's message panel.
|
|
|
|
* @param frame A WinEDA_DrawFrame in which to print status information.
|
|
|
|
*/
|
|
|
|
void Display_Infos( WinEDA_DrawFrame* frame );
|
|
|
|
|
|
|
|
|
2007-10-30 21:30:58 +00:00
|
|
|
/**
|
|
|
|
* Function Save
|
2007-10-31 14:14:21 +00:00
|
|
|
* writes the data structures for this object out to a FILE in "*.brd" format.
|
2007-10-30 21:30:58 +00:00
|
|
|
* @param aFile The FILE to write to.
|
|
|
|
* @return bool - true if success writing else false.
|
|
|
|
*/
|
|
|
|
bool Save( FILE* aFile ) const
|
|
|
|
{
|
|
|
|
// not implemented, this is here to satisfy BOARD_ITEM::Save()
|
|
|
|
// "pure" virtual-ness
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-26 09:41:25 +00:00
|
|
|
/**
|
|
|
|
* Function HitTest
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
bool HitTest( const wxPoint& ref_pos );
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-12-01 03:42:52 +00:00
|
|
|
#endif // CLASS_MARKER_H
|