2007-08-06 20:26:59 +00:00
|
|
|
|
/**************************************************************/
|
|
|
|
|
/* class_edge_module.h : description des contours d'un module */
|
|
|
|
|
/**************************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
class Pcb3D_GLCanvas;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* description des contours (empreintes ) et TYPES des CONTOURS : */
|
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
class EDGE_MODULE : public BOARD_ITEM
|
2007-08-06 20:26:59 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-23 04:28:46 +00:00
|
|
|
|
int m_Width; // 0 = line, > 0 = tracks, bus ...
|
|
|
|
|
wxPoint m_Start; // Line start point
|
|
|
|
|
wxPoint m_End; // Line end point
|
|
|
|
|
|
2007-08-06 20:26:59 +00:00
|
|
|
|
int m_Shape; // voir "enum Track_Shapes"
|
|
|
|
|
wxPoint m_Start0; // coord relatives a l'ancre du point de depart(Orient 0)
|
|
|
|
|
wxPoint m_End0; // coord relatives a l'ancre du point de fin (Orient 0)
|
|
|
|
|
|
|
|
|
|
int m_Angle; // pour les arcs de cercle: longueur de l'arc en 0,1 degres
|
|
|
|
|
|
2007-08-08 03:50:44 +00:00
|
|
|
|
int m_PolyCount; // For polygons: number of points (> 2)
|
2007-08-06 20:26:59 +00:00
|
|
|
|
int* m_PolyList; // For polygons: coord list (1 point = 2 coord)
|
|
|
|
|
// Coord are relative to Origin, orient 0
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
EDGE_MODULE( MODULE* parent );
|
|
|
|
|
EDGE_MODULE( EDGE_MODULE* edge );
|
|
|
|
|
~EDGE_MODULE();
|
|
|
|
|
|
|
|
|
|
/* supprime du chainage la structure Struct */
|
2007-09-01 12:00:30 +00:00
|
|
|
|
void UnLink();
|
2007-08-06 20:26:59 +00:00
|
|
|
|
|
|
|
|
|
void Copy( EDGE_MODULE* source ); // copy structure
|
|
|
|
|
|
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;
|
|
|
|
|
|
2007-08-06 20:26:59 +00:00
|
|
|
|
int ReadDescr( char* Line, FILE* File, int* LineNum = NULL );
|
|
|
|
|
|
|
|
|
|
// Mise a jour des coordon<6F>s pour l'affichage
|
2007-09-01 12:00:30 +00:00
|
|
|
|
void SetDrawCoord();
|
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-08 20:51:08 +00:00
|
|
|
|
|
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
|
|
|
|
*/
|
2007-08-30 22:20:52 +00:00
|
|
|
|
void Display_Infos( WinEDA_DrawFrame* frame );
|
2007-08-20 19:33:15 +00:00
|
|
|
|
|
|
|
|
|
|
2007-08-08 20:51:08 +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-06 20:26:59 +00:00
|
|
|
|
|
2007-08-07 06:21:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* Function GetClass
|
|
|
|
|
* returns the class name.
|
|
|
|
|
* @return wxString
|
|
|
|
|
*/
|
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
2007-08-08 20:51:08 +00:00
|
|
|
|
return wxT( "MGRAPHIC" );
|
2007-08-07 06:21:19 +00:00
|
|
|
|
// return wxT( "EDGE" ); ?
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-13 11:28:58 +00:00
|
|
|
|
#if defined(DEBUG)
|
2007-08-06 20:26:59 +00:00
|
|
|
|
/**
|
|
|
|
|
* Function Show
|
|
|
|
|
* is used to output the object tree, currently for debugging only.
|
|
|
|
|
* @param nestLevel An aid to prettier tree indenting, and is the level
|
|
|
|
|
* of nesting of this object within the overall tree.
|
|
|
|
|
* @param os The ostream& to output to.
|
|
|
|
|
*/
|
|
|
|
|
virtual void Show( int nestLevel, std::ostream& os );
|
|
|
|
|
#endif
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|