2009-07-07 17:50:02 +00:00
|
|
|
/***************************************************/
|
|
|
|
/* classes to handle markers used in schematic ... */
|
|
|
|
/***************************************************/
|
|
|
|
|
2009-12-02 21:44:03 +00:00
|
|
|
#ifndef _TYPE_SCH_MARKER_H_
|
|
|
|
#define _TYPE_SCH_MARKER_H_
|
2009-07-07 17:50:02 +00:00
|
|
|
|
2009-07-08 15:42:45 +00:00
|
|
|
#include "sch_item_struct.h"
|
2009-07-07 17:50:02 +00:00
|
|
|
#include "class_marker_base.h"
|
|
|
|
|
|
|
|
/* Marker are mainly used to show an ERC error
|
|
|
|
*/
|
|
|
|
|
|
|
|
enum TypeMarker { /* Markers type */
|
|
|
|
MARK_UNSPEC,
|
|
|
|
MARK_ERC,
|
|
|
|
MARK_PCB,
|
|
|
|
MARK_SIMUL,
|
|
|
|
MARK_NMAX /* Lats value: end of list */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Names for corresponding types of markers: */
|
|
|
|
extern const wxChar* NameMarqueurType[];
|
|
|
|
|
|
|
|
|
2009-12-02 21:44:03 +00:00
|
|
|
class SCH_MARKER : public SCH_ITEM , public MARKER_BASE
|
2009-07-07 17:50:02 +00:00
|
|
|
{
|
|
|
|
public:
|
2009-12-02 21:44:03 +00:00
|
|
|
SCH_MARKER( );
|
|
|
|
SCH_MARKER( const wxPoint& aPos, const wxString& aText );
|
|
|
|
~SCH_MARKER();
|
2009-07-07 17:50:02 +00:00
|
|
|
virtual wxString GetClass() const
|
|
|
|
{
|
2009-12-02 21:44:03 +00:00
|
|
|
return wxT( "SCH_MARKER" );
|
2009-07-07 17:50:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-12-02 21:44:03 +00:00
|
|
|
SCH_MARKER* GenCopy();
|
2009-07-07 17:50:02 +00:00
|
|
|
|
|
|
|
virtual void Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
|
|
|
|
const wxPoint& aOffset, int aDraw_mode,
|
|
|
|
int aColor = -1 );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Save
|
|
|
|
* writes the data structures for this object out to a FILE in "*.sch"
|
|
|
|
* format.
|
|
|
|
* @param aFile The FILE to write to.
|
|
|
|
* @return bool - true if success writing else false.
|
|
|
|
*/
|
|
|
|
bool Save( FILE* aFile ) const;
|
|
|
|
|
|
|
|
/** Function GetPenSize
|
|
|
|
* @return the size of the "pen" that be used to draw or plot this item
|
2009-12-02 21:44:03 +00:00
|
|
|
* for a marker, has no meaning, but it is necessary to satisfy the
|
|
|
|
* SCH_ITEM class requirements
|
2009-07-07 17:50:02 +00:00
|
|
|
*/
|
|
|
|
virtual int GetPenSize( ) { return 0; };
|
|
|
|
|
|
|
|
/** Function HitTest
|
|
|
|
* @return true if the point aPosRef is within item area
|
|
|
|
* @param aPosRef = a wxPoint to test
|
|
|
|
*/
|
|
|
|
bool HitTest( const wxPoint& aPosRef )
|
|
|
|
{
|
|
|
|
return HitTestMarker( aPosRef );
|
|
|
|
}
|
2009-07-08 15:42:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetBoundingBox
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
virtual EDA_Rect GetBoundingBox();
|
2009-07-13 15:25:41 +00:00
|
|
|
|
2009-07-08 15:42:45 +00:00
|
|
|
|
2009-07-27 14:32:40 +00:00
|
|
|
// Geometric transforms (used in block operations):
|
|
|
|
/** virtual function Move
|
|
|
|
* move item to a new position.
|
2009-12-02 21:44:03 +00:00
|
|
|
* @param aMoveVector = the displacement vector
|
2009-07-27 14:32:40 +00:00
|
|
|
*/
|
|
|
|
virtual void Move(const wxPoint& aMoveVector)
|
|
|
|
{
|
|
|
|
m_Pos += aMoveVector;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** virtual function Mirror_Y
|
|
|
|
* mirror item relative to an Y axis
|
|
|
|
* @param aYaxis_position = the y axis position
|
|
|
|
*/
|
|
|
|
virtual void Mirror_Y(int aYaxis_position)
|
|
|
|
{
|
|
|
|
m_Pos.x -= aYaxis_position;
|
|
|
|
m_Pos.x = - m_Pos.x;
|
|
|
|
m_Pos.x += aYaxis_position;
|
|
|
|
}
|
|
|
|
|
2009-07-07 17:50:02 +00:00
|
|
|
#if defined(DEBUG)
|
|
|
|
void Show( int nestLevel, std::ostream& os );
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2009-12-02 21:44:03 +00:00
|
|
|
#endif /* _TYPE_SCH_MARKER_H_ */
|