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.

64 lines
1.9 KiB

11 years ago
11 years ago
  1. /*
  2. * KiRouter - a push-and-(sometimes-)shove PCB router
  3. *
  4. * Copyright (C) 2013-2014 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();
  31. void Reset( RESET_REASON aReason );
  32. int RouteSingleTrace ( const TOOL_EVENT& aEvent );
  33. int RouteDiffPair ( const TOOL_EVENT& aEvent );
  34. int InlineDrag ( const TOOL_EVENT& aEvent );
  35. int DpDimensionsDialog ( const TOOL_EVENT& aEvent );
  36. int SettingsDialog ( const TOOL_EVENT& aEvent );
  37. private:
  38. int mainLoop( PNS::ROUTER_MODE aMode );
  39. int getDefaultWidth( int aNetCode );
  40. void performRouting();
  41. void performDragging();
  42. void getNetclassDimensions( int aNetCode, int& aWidth, int& aViaDiameter, int& aViaDrill );
  43. void handleCommonEvents( const TOOL_EVENT& evt );
  44. int getStartLayer( const PNS::ITEM* aItem );
  45. void switchLayerOnViaPlacement();
  46. bool onViaCommand( TOOL_EVENT& aEvent, VIATYPE_T aType );
  47. bool prepareInteractive();
  48. bool finishInteractive();
  49. };
  50. #endif