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.

51 lines
1.6 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
  5. *
  6. * This program is free software: you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation, either version 3 of the License, or (at your
  9. * option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include <math/vector2d.h>
  20. #include <sch_rtree.h>
  21. namespace JUNCTION_HELPERS
  22. {
  23. /**
  24. * A selection of information about a point in the schematic that might
  25. * be eligible for turning into a junction.
  26. */
  27. struct POINT_INFO
  28. {
  29. /// True if the point has 3+ wires and/or 3+ buses meeting there
  30. bool isJunction;
  31. /// True if there is already junction dot at the point
  32. bool hasExplicitJunctionDot;
  33. /// True if there is a bus entry at the point (either end)
  34. bool hasBusEntry;
  35. /// True if there is a bus entry at the point and it connects to more than one wire
  36. bool hasBusEntryToMultipleWires;
  37. };
  38. /**
  39. * Check a tree of items for a confluence at a given point and work out what kind of junction
  40. * it is, if any.
  41. */
  42. POINT_INFO AnalyzePoint( const EE_RTREE& aItem, const VECTOR2I& aPosition, bool aBreakCrossings );
  43. } // namespace JUNCTION_HELPERS