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.

112 lines
3.3 KiB

14 years ago
14 years ago
14 years ago
14 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
  5. * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. /**
  25. * @file class_mire.h
  26. * @brief PCB_TARGET class definition. (targets for photo plots).
  27. */
  28. #ifndef MIRE_H
  29. #define MIRE_H
  30. #include <class_board_item.h>
  31. class EDA_RECT;
  32. class LINE_READER;
  33. class EDA_DRAW_PANEL;
  34. class PCB_TARGET : public BOARD_ITEM
  35. {
  36. int m_Shape; // bit 0 : 0 = draw +, 1 = draw X
  37. int m_Size;
  38. int m_Width;
  39. wxPoint m_Pos;
  40. public:
  41. PCB_TARGET( BOARD_ITEM* aParent );
  42. // Do not create a copy constructor. The one generated by the compiler is adequate.
  43. PCB_TARGET( BOARD_ITEM* aParent, int aShape, LAYER_ID aLayer,
  44. const wxPoint& aPos, int aSize, int aWidth );
  45. ~PCB_TARGET();
  46. void SetPosition( const wxPoint& aPos ) { m_Pos = aPos; } // override
  47. const wxPoint& GetPosition() const { return m_Pos; } // override
  48. void SetShape( int aShape ) { m_Shape = aShape; }
  49. int GetShape() const { return m_Shape; }
  50. void SetSize( int aSize ) { m_Size = aSize; }
  51. int GetSize() const { return m_Size; }
  52. void SetWidth( int aWidth ) { m_Width = aWidth; }
  53. int GetWidth() const { return m_Width; }
  54. void Move( const wxPoint& aMoveVector )
  55. {
  56. m_Pos += aMoveVector;
  57. }
  58. void Rotate( const wxPoint& aRotCentre, double aAngle );
  59. void Flip( const wxPoint& aCentre );
  60. void Copy( PCB_TARGET* source );
  61. void Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
  62. GR_DRAWMODE aDrawMode, const wxPoint& offset = ZeroOffset );
  63. bool HitTest( const wxPoint& aPosition ) const;
  64. wxString GetClass() const
  65. {
  66. return wxT( "PCB_TARGET" );
  67. }
  68. /** @copydoc BOARD_ITEM::HitTest(const EDA_RECT& aRect,
  69. * bool aContained = true, int aAccuracy ) const
  70. */
  71. bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const;
  72. // Virtual function
  73. const EDA_RECT GetBoundingBox() const;
  74. wxString GetSelectMenuText() const;
  75. BITMAP_DEF GetMenuImage() const { return add_mires_xpm; }
  76. EDA_ITEM* Clone() const;
  77. #if defined(DEBUG)
  78. void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
  79. #endif
  80. };
  81. #endif // #define MIRE_H