You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.8 KiB

18 years ago
18 years ago
  1. /**************************************************************/
  2. /* class_edge_module.h : description des contours d'un module */
  3. /**************************************************************/
  4. class Pcb3D_GLCanvas;
  5. /* description des contours (empreintes ) et TYPES des CONTOURS : */
  6. class EDGE_MODULE : public BOARD_ITEM
  7. {
  8. public:
  9. int m_Width; // 0 = line, > 0 = tracks, bus ...
  10. wxPoint m_Start; // Line start point
  11. wxPoint m_End; // Line end point
  12. int m_Shape; // voir "enum Track_Shapes"
  13. wxPoint m_Start0; // coord relatives a l'ancre du point de depart(Orient 0)
  14. wxPoint m_End0; // coord relatives a l'ancre du point de fin (Orient 0)
  15. int m_Angle; // pour les arcs de cercle: longueur de l'arc en 0,1 degres
  16. int m_PolyCount; // For polygons: number of points (> 2)
  17. int* m_PolyList; // For polygons: coord list (1 point = 2 coord)
  18. // Coord are relative to Origin, orient 0
  19. public:
  20. EDGE_MODULE( MODULE* parent );
  21. EDGE_MODULE( EDGE_MODULE* edge );
  22. ~EDGE_MODULE();
  23. /* supprime du chainage la structure Struct */
  24. void UnLink();
  25. void Copy( EDGE_MODULE* source ); // copy structure
  26. /* Reading and writing data on files */
  27. int WriteDescr( FILE* File );
  28. int ReadDescr( char* Line, FILE* File, int* LineNum = NULL );
  29. // Mise a jour des coordon�s pour l'affichage
  30. void SetDrawCoord();
  31. /* drawing functions */
  32. void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
  33. int draw_mode );
  34. void Draw3D( Pcb3D_GLCanvas* glcanvas );
  35. /**
  36. * Function Display_Infos
  37. * has knowledge about the frame and how and where to put status information
  38. * about this object into the frame's message panel.
  39. * Is virtual from EDA_BaseStruct.
  40. * @param frame A WinEDA_DrawFrame in which to print status information.
  41. */
  42. void Display_Infos( WinEDA_DrawFrame* frame );
  43. /**
  44. * Function HitTest
  45. * tests if the given wxPoint is within the bounds of this object.
  46. * @param refPos A wxPoint to test
  47. * @return bool - true if a hit, else false
  48. */
  49. bool HitTest( const wxPoint& refPos );
  50. /**
  51. * Function GetClass
  52. * returns the class name.
  53. * @return wxString
  54. */
  55. virtual wxString GetClass() const
  56. {
  57. return wxT( "MGRAPHIC" );
  58. // return wxT( "EDGE" ); ?
  59. }
  60. #if defined(DEBUG)
  61. /**
  62. * Function Show
  63. * is used to output the object tree, currently for debugging only.
  64. * @param nestLevel An aid to prettier tree indenting, and is the level
  65. * of nesting of this object within the overall tree.
  66. * @param os The ostream& to output to.
  67. */
  68. virtual void Show( int nestLevel, std::ostream& os );
  69. #endif
  70. };