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.

77 lines
2.5 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2004-2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 2019-2022 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. #ifndef DRC_INTERACTIVE_COURTYARD_CLEARANCE_H
  25. #define DRC_INTERACTIVE_COURTYARD_CLEARANCE_H
  26. #include <drc/drc_test_provider_clearance_base.h>
  27. class DRC_INTERACTIVE_COURTYARD_CLEARANCE : public DRC_TEST_PROVIDER_CLEARANCE_BASE
  28. {
  29. public:
  30. DRC_INTERACTIVE_COURTYARD_CLEARANCE( const std::shared_ptr<DRC_ENGINE>& aDRCEngine ) :
  31. DRC_TEST_PROVIDER_CLEARANCE_BASE(),
  32. m_largestCourtyardClearance( 0 )
  33. {
  34. m_isRuleDriven = false;
  35. SetDRCEngine( aDRCEngine.get() );
  36. }
  37. virtual ~DRC_INTERACTIVE_COURTYARD_CLEARANCE ()
  38. {
  39. }
  40. void Init( BOARD* aBoard );
  41. virtual bool Run() override;
  42. virtual const wxString GetName() const override
  43. {
  44. return wxT( "interactive_courtyard_clearance" );
  45. }
  46. virtual const wxString GetDescription() const override
  47. {
  48. return wxT( "Tests footprints' courtyard collisions" );
  49. }
  50. void UpdateConflicts( KIGFX::VIEW* aView, bool aHighlightMoved );
  51. void ClearConflicts( KIGFX::VIEW* aView );
  52. public:
  53. std::vector<FOOTPRINT*> m_FpInMove; // The list of moved footprints
  54. private:
  55. void testCourtyardClearances();
  56. private:
  57. int m_largestCourtyardClearance;
  58. std::set<BOARD_ITEM*> m_itemsInConflict; // The list of items in conflict
  59. std::vector<BOARD_ITEM*> m_lastItemsInConflict; // The list of items last highlighted
  60. };
  61. #endif // DRC_INTERACTIVE_COURTYARD_CLEARANCE_H