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.

72 lines
2.3 KiB

9 years ago
9 years ago
11 years ago
  1. /*
  2. * KiRouter - a push-and-(sometimes-)shove PCB router
  3. *
  4. * Copyright (C) 2013-2017 CERN
  5. * Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
  6. * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
  7. * Author: Maciej Suminski <maciej.suminski@cern.ch>
  8. *
  9. * This program is free software: you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation, either version 3 of the License, or (at your
  12. * option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License along
  20. * with this program. If not, see <http://www.gnu.org/licenses/>.
  21. */
  22. #ifndef __ROUTER_TOOL_H
  23. #define __ROUTER_TOOL_H
  24. #include "pns_tool_base.h"
  25. class APIEXPORT ROUTER_TOOL : public PNS::TOOL_BASE
  26. {
  27. public:
  28. ROUTER_TOOL();
  29. ~ROUTER_TOOL();
  30. bool Init() override;
  31. void Reset( RESET_REASON aReason ) override;
  32. int RouteSingleTrace( const TOOL_EVENT& aEvent );
  33. int RouteDiffPair( const TOOL_EVENT& aEvent );
  34. bool CanInlineDrag();
  35. int InlineDrag( const TOOL_EVENT& aEvent );
  36. // TODO make this private?
  37. int DpDimensionsDialog( const TOOL_EVENT& aEvent );
  38. int SettingsDialog( const TOOL_EVENT& aEvent );
  39. int CustomTrackWidthDialog( const TOOL_EVENT& aEvent );
  40. void setTransitions() override;
  41. // A filter for narrowing a collection representing a simple corner
  42. // or a non-fanout-via to a single TRACK item.
  43. static void NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector );
  44. private:
  45. int mainLoop( PNS::ROUTER_MODE aMode );
  46. void performRouting();
  47. void performDragging( int aMode = PNS::DM_ANY );
  48. void breakTrack();
  49. void handleCommonEvents( const TOOL_EVENT& evt );
  50. int getStartLayer( const PNS::ITEM* aItem );
  51. void switchLayerOnViaPlacement();
  52. int onViaCommand( const TOOL_EVENT& aEvent );
  53. int onTrackViaSizeChanged( const TOOL_EVENT& aEvent );
  54. bool prepareInteractive();
  55. bool finishInteractive();
  56. };
  57. #endif