2007-08-06 20:26:59 +00:00
|
|
|
/**********************************/
|
|
|
|
/* class_pad.h : Pads description */
|
|
|
|
/**********************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
class Pcb3D_GLCanvas;
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
/* Pad shape id : ( .m_PadShape member) */
|
2007-08-06 20:26:59 +00:00
|
|
|
#define CIRCLE 1
|
|
|
|
#define RECT 2
|
|
|
|
#define OVALE 3
|
2007-08-30 08:15:05 +00:00
|
|
|
#define TRAPEZE 4 // trapezoid
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
/* PADS attributes */
|
|
|
|
#define STANDARD 0 // Usual pad
|
|
|
|
#define SMD 1 // Smd pad, appears on the layer paste (default)
|
|
|
|
#define CONN 2 // Like smd, does not appear on the layer paste (default)
|
|
|
|
// reserved, but not yet really used:
|
2007-08-06 20:26:59 +00:00
|
|
|
#define P_HOLE 3 // trou simple, utile sur pad stack
|
|
|
|
#define MECA 4 // PAD "mecanique" (fixation, zone cuivre...)
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
/* Definition type Structure d'un pad */
|
2007-08-23 04:28:46 +00:00
|
|
|
class D_PAD : public BOARD_ITEM
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-10-13 06:18:44 +00:00
|
|
|
private:
|
|
|
|
int m_NetCode; // Net number for fast comparisons
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
public:
|
2007-08-06 20:26:59 +00:00
|
|
|
union
|
|
|
|
{
|
|
|
|
unsigned long m_NumPadName;
|
2007-08-30 08:15:05 +00:00
|
|
|
char m_Padname[4]; /* Pad name (4 char) or a long identifier
|
|
|
|
* (used in pad name comparisons because this is faster than string comparison)
|
|
|
|
*/
|
2007-08-06 20:26:59 +00:00
|
|
|
};
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2007-08-08 03:50:44 +00:00
|
|
|
wxString m_Netname; /* Net Name */
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
int m_Masque_Layer; // Bitwise layer :1= copper layer, 15= cmp,
|
|
|
|
// 2..14 = internal layers
|
|
|
|
// 16 .. 31 = technical layers
|
|
|
|
|
|
|
|
int m_PadShape; // Shape: CIRCLE, RECT, OVAL, TRAPEZOID
|
|
|
|
int m_DrillShape; // Shape CIRCLE, OVAL
|
|
|
|
|
|
|
|
wxPoint m_Pos; // pad Position on board
|
|
|
|
wxSize m_Drill; // Drill diam (drill shape = CIRCLE) or drill size(shape = OVAL)
|
2007-08-06 20:26:59 +00:00
|
|
|
// for drill shape = CIRCLE, drill diam = m_Drill.x
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
wxSize m_Offset; // Offset de la forme (pastilles excentrees)
|
|
|
|
wxSize m_Size; // X and Y size ( relative to orient 0)
|
|
|
|
|
|
|
|
wxSize m_DeltaSize; // delta sur formes rectangle -> trapezes
|
|
|
|
|
|
|
|
wxPoint m_Pos0; // Initial Pad position (i.e. pas position relative to the module anchor, orientation 0
|
|
|
|
|
|
|
|
int m_Rayon; // rayon du cercle exinscrit du pad
|
|
|
|
int m_Attribut; // NORMAL, SMD, CONN
|
|
|
|
int m_Orient; // in 1/10 degrees
|
|
|
|
|
|
|
|
int m_logical_connexion; // variable used in rastnest computations
|
|
|
|
// handle block number in ratsnet connection
|
|
|
|
|
|
|
|
int m_physical_connexion; // variable used in rastnest computations
|
|
|
|
// handle block number in track connection
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
public:
|
2007-08-06 20:26:59 +00:00
|
|
|
D_PAD( MODULE* parent );
|
|
|
|
D_PAD( D_PAD* pad );
|
2007-09-01 12:00:30 +00:00
|
|
|
~D_PAD();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-06 20:26:59 +00:00
|
|
|
void Copy( D_PAD* source );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
D_PAD* Next() { return (D_PAD*) Pnext; }
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
/* remove from linked list */
|
2007-09-01 12:00:30 +00:00
|
|
|
void UnLink();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-07 06:21:19 +00:00
|
|
|
/* Reading and writing data on files */
|
2007-08-06 20:26:59 +00:00
|
|
|
int ReadDescr( FILE* File, int* LineNum = NULL );
|
|
|
|
int WriteDescr( FILE* File );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-06 20:26:59 +00:00
|
|
|
/* drawing functions */
|
|
|
|
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode );
|
|
|
|
void Draw3D( Pcb3D_GLCanvas* glcanvas );
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
// others
|
2007-08-07 06:21:19 +00:00
|
|
|
void SetPadName( const wxString& name ); // Change pad name
|
2007-09-01 12:00:30 +00:00
|
|
|
wxString ReturnStringPadName(); // Return pad name as string in a wxString
|
2007-08-06 20:26:59 +00:00
|
|
|
void ReturnStringPadName( wxString& text ); // Return pad name as string in a buffer
|
2007-09-01 12:00:30 +00:00
|
|
|
void ComputeRayon(); // compute m_Rayon, rayon du cercle exinscrit
|
|
|
|
const wxPoint ReturnShapePos(); // retourne la position
|
2007-08-06 20:26:59 +00:00
|
|
|
|
2007-10-13 06:18:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetNet
|
|
|
|
* @return int - the netcode
|
|
|
|
*/
|
|
|
|
int GetNet() const { return m_NetCode; }
|
|
|
|
void SetNet( int aNetCode ) { m_NetCode = aNetCode; }
|
|
|
|
|
|
|
|
|
2007-08-20 19:33:15 +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.
|
|
|
|
* Is virtual from EDA_BaseStruct.
|
2007-08-30 22:20:52 +00:00
|
|
|
* @param frame A WinEDA_DrawFrame in which to print status information.
|
|
|
|
*/
|
2007-08-20 19:33:15 +00:00
|
|
|
void Display_Infos( WinEDA_DrawFrame* frame );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2007-08-30 22:20:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function IsOnLayer
|
|
|
|
* tests to see if this object is on the given layer. Is virtual so
|
|
|
|
* objects like D_PAD, which reside on multiple layers can do their own
|
|
|
|
* form of testing.
|
|
|
|
* @param aLayer The layer to test for.
|
|
|
|
* @return bool - true if on given layer, else false.
|
|
|
|
*/
|
|
|
|
bool IsOnLayer( int aLayer ) const;
|
|
|
|
|
|
|
|
|
2007-08-08 03:50:44 +00:00
|
|
|
/**
|
|
|
|
* Function HitTest
|
|
|
|
* tests if the given wxPoint is within the bounds of this object.
|
|
|
|
* @param refPos A wxPoint to test
|
|
|
|
* @return bool - true if a hit, else false
|
|
|
|
*/
|
|
|
|
bool HitTest( const wxPoint& refPos );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2007-08-07 06:21:19 +00:00
|
|
|
/**
|
|
|
|
* Function GetClass
|
|
|
|
* returns the class name.
|
|
|
|
* @return wxString
|
|
|
|
*/
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
{
|
|
|
|
return wxT( "PAD" );
|
|
|
|
}
|
|
|
|
|
2007-09-13 11:28:58 +00:00
|
|
|
#if defined (DEBUG)
|
2007-08-07 06:21:19 +00:00
|
|
|
/**
|
|
|
|
* Function Show
|
|
|
|
* is used to output the object tree, currently for debugging only.
|
2007-08-30 08:15:05 +00:00
|
|
|
* @param nestLevel An aid to prettier tree indenting, and is the level
|
2007-08-07 06:21:19 +00:00
|
|
|
* of nesting of this object within the overall tree.
|
|
|
|
* @param os The ostream& to output to.
|
|
|
|
*/
|
|
|
|
virtual void Show( int nestLevel, std::ostream& os );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2007-08-07 06:21:19 +00:00
|
|
|
#endif
|
2007-06-05 12:10:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef class D_PAD * LISTE_PAD;
|