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.

82 lines
2.7 KiB

18 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) 2007 Jean-Pierre Charras, jp.charras@wanadoo.fr
  5. * Copyright (C) 1992-2012 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 pcbnew/protos.h
  26. */
  27. #ifndef PROTO_H
  28. #define PROTO_H
  29. #include <gr_basic.h>
  30. class wxDC;
  31. class wxPoint;
  32. class EDA_DRAW_PANEL;
  33. class BOARD_ITEM;
  34. class TRACK;
  35. class MODULE;
  36. /***************/
  37. /* TRPISTE.CPP */
  38. /***************/
  39. /**
  40. * Function DrawTraces
  41. * Draws n consecutive track segments in list.
  42. * Useful to show a track when it is a chain of segments
  43. * (for instance when creating a new track)
  44. *
  45. * @param panel A EDA_DRAW_ITEM pointer to the canvas.
  46. * @param DC A wxDC pointer of the device context used for drawing.
  47. * @param aStartTrace First segment
  48. * @param nbsegment Number of segments in list
  49. * @param mode_color Drawing mode (GRXOR, GROR ..)
  50. */
  51. void DrawTraces( EDA_DRAW_PANEL* panel,
  52. wxDC* DC,
  53. TRACK* aStartTrace,
  54. int nbsegment,
  55. GR_DRAWMODE mode_color );
  56. void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
  57. bool aErase );
  58. /**
  59. * Determine end point for a segment direction 0, 90, or 45 degrees
  60. * depending on it's position from the origin \a aOrigin and \a aPosition.
  61. */
  62. wxPoint CalculateSegmentEndPoint( const wxPoint& aPosition, const wxPoint& aOrigin );
  63. /**
  64. * Finds the projection of a grid point on a track. This is the point
  65. * from where we want to draw new orthogonal tracks when starting on a track.
  66. */
  67. bool FindBestGridPointOnTrack( wxPoint* res, wxPoint on_grid, const TRACK* track );
  68. TRACK* LocateIntrusion( TRACK* listStart, TRACK* aTrack, LAYER_NUM aLayer, const wxPoint& aRef );
  69. #endif /* #define PROTO_H */