KiCad PCB EDA Suite
plotter.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2017 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 
40 #include <fctsys.h>
41 #include <vector>
42 
43 #include <trigo.h>
44 #include <eda_base_frame.h>
45 #include <base_struct.h>
46 #include <common.h>
47 #include <plotter.h>
48 #include <macros.h>
49 #include <base_screen.h>
50 #include <gr_text.h>
53 #include <bezier_curves.h>
54 #include <math/util.h> // for KiROUND
55 
57 {
58  plotScale = 1;
59  defaultPenWidth = 0;
60  currentPenWidth = -1; // To-be-set marker
61  penState = 'Z'; // End-of-path idle
62  m_plotMirror = false; // Plot mirror option flag
63  m_mirrorIsHorizontal = true;
64  m_yaxisReversed = false;
65  outputFile = 0;
66  colorMode = false; // Starts as a BW plot
67  negativeMode = false;
68  // Temporary init to avoid not initialized vars, will be set later
69  m_IUsPerDecimil = 1; // will be set later to the actual value
70  iuPerDeviceUnit = 1; // will be set later to the actual value
71 }
72 
74 {
75  // Emergency cleanup, but closing the file is
76  // usually made in EndPlot().
77  if( outputFile )
78  fclose( outputFile );
79 }
80 
81 
82 bool PLOTTER::OpenFile( const wxString& aFullFilename )
83 {
84  filename = aFullFilename;
85 
86  wxASSERT( !outputFile );
87 
88  // Open the file in text mode (not suitable for all plotters
89  // but only for most of them
90  outputFile = wxFopen( filename, wxT( "wt" ) );
91 
92  if( outputFile == NULL )
93  return false ;
94 
95  return true;
96 }
97 
98 
100 {
101  wxPoint pos = aCoordinate - plotOffset;
102 
103  double x = pos.x * plotScale;
104  double y = ( paperSize.y - pos.y * plotScale );
105 
106  if( m_plotMirror )
107  {
109  x = ( paperSize.x - pos.x * plotScale );
110  else
111  y = pos.y * plotScale;
112  }
113 
114  if( m_yaxisReversed )
115  y = paperSize.y - y;
116 
117  x *= iuPerDeviceUnit;
118  y *= iuPerDeviceUnit;
119 
120  return DPOINT( x, y );
121 }
122 
123 
124 DPOINT PLOTTER::userToDeviceSize( const wxSize& size )
125 {
126  return DPOINT( size.x * plotScale * iuPerDeviceUnit,
127  size.y * plotScale * iuPerDeviceUnit );
128 }
129 
130 
131 double PLOTTER::userToDeviceSize( double size ) const
132 {
133  return size * plotScale * iuPerDeviceUnit;
134 }
135 
136 
137 #define IU_PER_MILS ( m_IUsPerDecimil * 10 )
138 
140 {
142 }
143 
144 
146 {
148 }
149 
150 
152 {
154 }
155 
156 
157 void PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius,
158  FILL_T fill, int width )
159 {
160  wxPoint start, end;
161  const int delta = 50; // increment (in 0.1 degrees) to draw circles
162 
163  if( StAngle > EndAngle )
164  std::swap( StAngle, EndAngle );
165 
166  SetCurrentLineWidth( width );
167  /* Please NOTE the different sign due to Y-axis flip */
168  start.x = centre.x + KiROUND( cosdecideg( radius, -StAngle ) );
169  start.y = centre.y + KiROUND( sindecideg( radius, -StAngle ) );
170 
171  if( fill != NO_FILL )
172  {
173  MoveTo( centre );
174  LineTo( start );
175  }
176  else
177  {
178  MoveTo( start );
179  }
180 
181  for( int ii = StAngle + delta; ii < EndAngle; ii += delta )
182  {
183  end.x = centre.x + KiROUND( cosdecideg( radius, -ii ) );
184  end.y = centre.y + KiROUND( sindecideg( radius, -ii ) );
185  LineTo( end );
186  }
187 
188  end.x = centre.x + KiROUND( cosdecideg( radius, -EndAngle ) );
189  end.y = centre.y + KiROUND( sindecideg( radius, -EndAngle ) );
190 
191  if( fill != NO_FILL )
192  {
193  LineTo( end );
194  FinishTo( centre );
195  }
196  else
197  {
198  FinishTo( end );
199  }
200 }
201 
202 
203 void PLOTTER::BezierCurve( const wxPoint& aStart, const wxPoint& aControl1,
204  const wxPoint& aControl2, const wxPoint& aEnd,
205  int aTolerance, int aLineThickness )
206 {
207  // Generic fallback: Quadratic Bezier curve plotted as a polyline
208  int minSegLen = aLineThickness; // The segment min length to approximate a bezier curve
209 
210  std::vector<wxPoint> ctrlPoints;
211  ctrlPoints.push_back( aStart );
212  ctrlPoints.push_back( aControl1 );
213  ctrlPoints.push_back( aControl2 );
214  ctrlPoints.push_back( aEnd );
215 
216  BEZIER_POLY bezier_converter( ctrlPoints );
217 
218  std::vector<wxPoint> approxPoints;
219  bezier_converter.GetPoly( approxPoints, minSegLen );
220 
221  SetCurrentLineWidth( aLineThickness );
222  MoveTo( aStart );
223 
224  for( unsigned ii = 1; ii < approxPoints.size()-1; ii++ )
225  LineTo( approxPoints[ii] );
226 
227  FinishTo( aEnd );
228 }
229 
230 
231 void PLOTTER::PlotImage(const wxImage & aImage, const wxPoint& aPos, double aScaleFactor )
232 {
233  wxSize size( aImage.GetWidth() * aScaleFactor,
234  aImage.GetHeight() * aScaleFactor );
235 
236  wxPoint start = aPos;
237  start.x -= size.x / 2;
238  start.y -= size.y / 2;
239 
240  wxPoint end = start;
241  end.x += size.x;
242  end.y += size.y;
243 
244  Rect( start, end, NO_FILL );
245 }
246 
247 
248 void PLOTTER::markerSquare( const wxPoint& position, int radius )
249 {
250  double r = KiROUND( radius / 1.4142 );
251  std::vector< wxPoint > corner_list;
252  wxPoint corner;
253  corner.x = position.x + r;
254  corner.y = position.y + r;
255  corner_list.push_back( corner );
256  corner.x = position.x + r;
257  corner.y = position.y - r;
258  corner_list.push_back( corner );
259  corner.x = position.x - r;
260  corner.y = position.y - r;
261  corner_list.push_back( corner );
262  corner.x = position.x - r;
263  corner.y = position.y + r;
264  corner_list.push_back( corner );
265  corner.x = position.x + r;
266  corner.y = position.y + r;
267  corner_list.push_back( corner );
268 
269  PlotPoly( corner_list, NO_FILL, GetCurrentLineWidth() );
270 }
271 
272 
273 void PLOTTER::markerCircle( const wxPoint& position, int radius )
274 {
275  Circle( position, radius * 2, NO_FILL, GetCurrentLineWidth() );
276 }
277 
278 
279 void PLOTTER::markerLozenge( const wxPoint& position, int radius )
280 {
281  std::vector< wxPoint > corner_list;
282  wxPoint corner;
283  corner.x = position.x;
284  corner.y = position.y + radius;
285  corner_list.push_back( corner );
286  corner.x = position.x + radius;
287  corner.y = position.y,
288  corner_list.push_back( corner );
289  corner.x = position.x;
290  corner.y = position.y - radius;
291  corner_list.push_back( corner );
292  corner.x = position.x - radius;
293  corner.y = position.y;
294  corner_list.push_back( corner );
295  corner.x = position.x;
296  corner.y = position.y + radius;
297  corner_list.push_back( corner );
298 
299  PlotPoly( corner_list, NO_FILL, GetCurrentLineWidth() );
300 }
301 
302 
303 void PLOTTER::markerHBar( const wxPoint& pos, int radius )
304 {
305  MoveTo( wxPoint( pos.x - radius, pos.y ) );
306  FinishTo( wxPoint( pos.x + radius, pos.y ) );
307 }
308 
309 
310 void PLOTTER::markerSlash( const wxPoint& pos, int radius )
311 {
312  MoveTo( wxPoint( pos.x - radius, pos.y - radius ) );
313  FinishTo( wxPoint( pos.x + radius, pos.y + radius ) );
314 }
315 
316 
317 void PLOTTER::markerBackSlash( const wxPoint& pos, int radius )
318 {
319  MoveTo( wxPoint( pos.x + radius, pos.y - radius ) );
320  FinishTo( wxPoint( pos.x - radius, pos.y + radius ) );
321 }
322 
323 
324 void PLOTTER::markerVBar( const wxPoint& pos, int radius )
325 {
326  MoveTo( wxPoint( pos.x, pos.y - radius ) );
327  FinishTo( wxPoint( pos.x, pos.y + radius ) );
328 }
329 
330 
331 void PLOTTER::Marker( const wxPoint& position, int diametre, unsigned aShapeId )
332 {
333  int radius = diametre / 2;
334  /* Marker are composed by a series of 'parts' superimposed; not every
335  combination make sense, obviously. Since they are used in order I
336  tried to keep the uglier/more complex constructions at the end.
337  Also I avoided the |/ |\ -/ -\ construction because they're *very*
338  ugly... if needed they could be added anyway... I'd like to see
339  a board with more than 58 drilling/slotting tools!
340  If Visual C++ supported the 0b literals they would be optimally
341  and easily encoded as an integer array. We have to do with octal */
342  static const unsigned char marker_patterns[MARKER_COUNT] = {
343  // Bit order: O Square Lozenge - | \ /
344  // First choice: simple shapes
345  0003, // X
346  0100, // O
347  0014, // +
348  0040, // Sq
349  0020, // Lz
350  // Two simple shapes
351  0103, // X O
352  0017, // X +
353  0043, // X Sq
354  0023, // X Lz
355  0114, // O +
356  0140, // O Sq
357  0120, // O Lz
358  0054, // + Sq
359  0034, // + Lz
360  0060, // Sq Lz
361  // Three simple shapes
362  0117, // X O +
363  0143, // X O Sq
364  0123, // X O Lz
365  0057, // X + Sq
366  0037, // X + Lz
367  0063, // X Sq Lz
368  0154, // O + Sq
369  0134, // O + Lz
370  0074, // + Sq Lz
371  // Four simple shapes
372  0174, // O Sq Lz +
373  0163, // X O Sq Lz
374  0157, // X O Sq +
375  0137, // X O Lz +
376  0077, // X Sq Lz +
377  // This draws *everything *
378  0177, // X O Sq Lz +
379  // Here we use the single bars... so the cross is forbidden
380  0110, // O -
381  0104, // O |
382  0101, // O /
383  0050, // Sq -
384  0044, // Sq |
385  0041, // Sq /
386  0030, // Lz -
387  0024, // Lz |
388  0021, // Lz /
389  0150, // O Sq -
390  0144, // O Sq |
391  0141, // O Sq /
392  0130, // O Lz -
393  0124, // O Lz |
394  0121, // O Lz /
395  0070, // Sq Lz -
396  0064, // Sq Lz |
397  0061, // Sq Lz /
398  0170, // O Sq Lz -
399  0164, // O Sq Lz |
400  0161, // O Sq Lz /
401  // Last resort: the backlash component (easy to confound)
402  0102, // \ O
403  0042, // \ Sq
404  0022, // \ Lz
405  0142, // \ O Sq
406  0122, // \ O Lz
407  0062, // \ Sq Lz
408  0162 // \ O Sq Lz
409  };
410  if( aShapeId >= MARKER_COUNT )
411  {
412  // Fallback shape
413  markerCircle( position, radius );
414  }
415  else
416  {
417  // Decode the pattern and draw the corresponding parts
418  unsigned char pat = marker_patterns[aShapeId];
419  if( pat & 0001 )
420  markerSlash( position, radius );
421  if( pat & 0002 )
422  markerBackSlash( position, radius );
423  if( pat & 0004 )
424  markerVBar( position, radius );
425  if( pat & 0010 )
426  markerHBar( position, radius );
427  if( pat & 0020 )
428  markerLozenge( position, radius );
429  if( pat & 0040 )
430  markerSquare( position, radius );
431  if( pat & 0100 )
432  markerCircle( position, radius );
433  }
434 }
435 
436 
437 void PLOTTER::segmentAsOval( const wxPoint& start, const wxPoint& end, int width,
438  EDA_DRAW_MODE_T tracemode )
439 {
440  wxPoint center( (start.x + end.x) / 2, (start.y + end.y) / 2 );
441  wxSize size( end.x - start.x, end.y - start.y );
442  double orient;
443 
444  if( size.y == 0 )
445  orient = 0;
446  else if( size.x == 0 )
447  orient = 900;
448  else
449  orient = -ArcTangente( size.y, size.x );
450 
451  size.x = KiROUND( EuclideanNorm( size ) ) + width;
452  size.y = width;
453 
454  FlashPadOval( center, size, orient, tracemode, NULL );
455 }
456 
457 
458 void PLOTTER::sketchOval( const wxPoint& pos, const wxSize& aSize, double orient, int width )
459 {
460  SetCurrentLineWidth( width );
461  width = currentPenWidth;
462  int radius, deltaxy, cx, cy;
463  wxSize size( aSize );
464 
465  if( size.x > size.y )
466  {
467  std::swap( size.x, size.y );
468  orient = AddAngles( orient, 900 );
469  }
470 
471  deltaxy = size.y - size.x; /* distance between centers of the oval */
472  radius = ( size.x - width ) / 2;
473  cx = -radius;
474  cy = -deltaxy / 2;
475  RotatePoint( &cx, &cy, orient );
476  MoveTo( wxPoint( cx + pos.x, cy + pos.y ) );
477  cx = -radius;
478  cy = deltaxy / 2;
479  RotatePoint( &cx, &cy, orient );
480  FinishTo( wxPoint( cx + pos.x, cy + pos.y ) );
481 
482  cx = radius;
483  cy = -deltaxy / 2;
484  RotatePoint( &cx, &cy, orient );
485  MoveTo( wxPoint( cx + pos.x, cy + pos.y ) );
486  cx = radius;
487  cy = deltaxy / 2;
488  RotatePoint( &cx, &cy, orient );
489  FinishTo( wxPoint( cx + pos.x, cy + pos.y ) );
490 
491  cx = 0;
492  cy = deltaxy / 2;
493  RotatePoint( &cx, &cy, orient );
494  Arc( wxPoint( cx + pos.x, cy + pos.y ),
495  orient + 1800, orient + 3600,
496  radius, NO_FILL );
497  cx = 0;
498  cy = -deltaxy / 2;
499  RotatePoint( &cx, &cy, orient );
500  Arc( wxPoint( cx + pos.x, cy + pos.y ),
501  orient, orient + 1800,
502  radius, NO_FILL );
503 }
504 
505 
506 void PLOTTER::ThickSegment( const wxPoint& start, const wxPoint& end, int width,
507  EDA_DRAW_MODE_T tracemode, void* aData )
508 {
509  if( tracemode == FILLED )
510  {
511  SetCurrentLineWidth( width );
512  MoveTo( start );
513  FinishTo( end );
514  }
515  else
516  {
517  SetCurrentLineWidth( -1 );
518  segmentAsOval( start, end, width, tracemode );
519  }
520 }
521 
522 
523 void PLOTTER::ThickArc( const wxPoint& centre, double StAngle, double EndAngle,
524  int radius, int width, EDA_DRAW_MODE_T tracemode, void* aData )
525 {
526  if( tracemode == FILLED )
527  Arc( centre, StAngle, EndAngle, radius, NO_FILL, width );
528  else
529  {
530  SetCurrentLineWidth( -1 );
531  Arc( centre, StAngle, EndAngle,
532  radius - ( width - currentPenWidth ) / 2, NO_FILL, -1 );
533  Arc( centre, StAngle, EndAngle,
534  radius + ( width - currentPenWidth ) / 2, NO_FILL, -1 );
535  }
536 }
537 
538 
539 void PLOTTER::ThickRect( const wxPoint& p1, const wxPoint& p2, int width,
540  EDA_DRAW_MODE_T tracemode, void* aData )
541 {
542  if( tracemode == FILLED )
543  Rect( p1, p2, NO_FILL, width );
544  else
545  {
546  SetCurrentLineWidth( -1 );
547  wxPoint offsetp1( p1.x - (width - currentPenWidth) / 2,
548  p1.y - (width - currentPenWidth) / 2 );
549  wxPoint offsetp2( p2.x + (width - currentPenWidth) / 2,
550  p2.y + (width - currentPenWidth) / 2 );
551  Rect( offsetp1, offsetp2, NO_FILL, -1 );
552  offsetp1.x += (width - currentPenWidth);
553  offsetp1.y += (width - currentPenWidth);
554  offsetp2.x -= (width - currentPenWidth);
555  offsetp2.y -= (width - currentPenWidth);
556  Rect( offsetp1, offsetp2, NO_FILL, -1 );
557  }
558 }
559 
560 
561 void PLOTTER::ThickCircle( const wxPoint& pos, int diametre, int width,
562  EDA_DRAW_MODE_T tracemode, void* aData )
563 {
564  if( tracemode == FILLED )
565  Circle( pos, diametre, NO_FILL, width );
566  else
567  {
568  SetCurrentLineWidth( -1 );
569  Circle( pos, diametre - width + currentPenWidth, NO_FILL, -1 );
570  Circle( pos, diametre + width - currentPenWidth, NO_FILL, -1 );
571  }
572 }
573 
574 
575 void PLOTTER::PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_T aFill,
576  int aWidth, void * aData )
577 {
578  std::vector<wxPoint> cornerList;
579  cornerList.reserve( aCornerList.PointCount() );
580 
581  for( int ii = 0; ii < aCornerList.PointCount(); ii++ )
582  cornerList.emplace_back( aCornerList.CPoint( ii ) );
583 
584  if( aCornerList.IsClosed() && cornerList.front() != cornerList.back() )
585  cornerList.emplace_back( aCornerList.CPoint( 0 ) );
586 
587  PlotPoly( cornerList, aFill, aWidth, aData );
588 }
589 
590 
591 void PLOTTER::SetPageSettings( const PAGE_INFO& aPageSettings )
592 {
593  pageInfo = aPageSettings;
594 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:123
void FinishTo(const wxPoint &pos)
Definition: plotter.h:270
double GetDotMarkLenIU() const
Definition: plotter.cpp:139
void markerHBar(const wxPoint &pos, int radius)
Plot a - bar centered on the position.
Definition: plotter.cpp:303
virtual void ThickCircle(const wxPoint &pos, int diametre, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:561
void GetPoly(std::vector< wxPoint > &aOutput, int aMinSegLen=0)
Converts Bezier curve to a polygon.
static const unsigned MARKER_COUNT
Draw a marker (used for the drill map)
Definition: plotter.h:431
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:82
#define DASH_MARK_LEN(aLineWidth)
virtual void BezierCurve(const wxPoint &aStart, const wxPoint &aControl1, const wxPoint &aControl2, const wxPoint &aEnd, int aTolerance, int aLineThickness=USE_DEFAULT_LINE_WIDTH)
Generic fallback: Cubic Bezier curve rendered as a polyline In Kicad the bezier curves have 4 control...
Definition: plotter.cpp:203
bool colorMode
Definition: plotter.h:587
virtual ~PLOTTER()
Definition: plotter.cpp:73
char penState
Current pen state: 'U', 'D' or 'Z' (see PenTo)
Definition: plotter.h:592
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
double m_IUsPerDecimil
Definition: plotter.h:569
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.cpp:591
int PointCount() const
Function PointCount()
wxPoint plotOffset
Plot offset (in IUs)
Definition: plotter.h:575
PAGE_INFO pageInfo
Definition: plotter.h:598
PLOTTER()
Definition: plotter.cpp:56
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:523
This file contains miscellaneous commonly used macros and functions.
double GetDashGapLenIU() const
Definition: plotter.cpp:151
virtual int GetCurrentLineWidth() const
Definition: plotter.h:158
virtual void ThickRect(const wxPoint &p1, const wxPoint &p2, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:539
bool m_yaxisReversed
true to mirror horizontally (else vertically)
Definition: plotter.h:581
const VECTOR2I & CPoint(int aIndex) const
Function Point()
void LineTo(const wxPoint &pos)
Definition: plotter.h:265
bool m_plotMirror
X axis orientation (SVG) and plot mirrored (only for PS, PDF HPGL and SVG)
Definition: plotter.h:579
#define NULL
T AddAngles(T a1, T2 a2)
Add two angles (keeping the result normalized). T2 is here.
Definition: trigo.h:299
EDA_DRAW_MODE_T
Definition: eda_text.h:59
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
#define DOT_MARK_LEN(aLineWidth)
Base window classes and related definitions.
double plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
Definition: plotter.h:563
a few functions useful in geometry calculations.
virtual DPOINT userToDeviceSize(const wxSize &size)
Modifies size according to the plotter scale factors (wxSize version, returns a DPOINT)
Definition: plotter.cpp:124
void markerSlash(const wxPoint &pos, int radius)
Plot a / bar centered on the position.
Definition: plotter.cpp:310
void Marker(const wxPoint &position, int diametre, unsigned aShapeId)
Draw a pattern shape number aShapeId, to coord position.
Definition: plotter.cpp:331
void MoveTo(const wxPoint &pos)
Definition: plotter.h:260
virtual DPOINT userToDeviceCoordinates(const wxPoint &aCoordinate)
Modifies coordinates according to the orientation, scale factor, and offsets trace.
Definition: plotter.cpp:99
double cosdecideg(double r, double a)
Circle generation utility: computes r * cos(a) Where a is in decidegrees, not in radians.
Definition: trigo.h:365
Bezier curves to polygon converter.
Definition: bezier_curves.h:35
virtual void PlotImage(const wxImage &aImage, const wxPoint &aPos, double aScaleFactor)
Function PlotImage Only Postscript plotters can plot bitmaps for plotters that cannot plot a bitmap,...
Definition: plotter.cpp:231
double sindecideg(double r, double a)
Circle generation utility: computes r * sin(a) Where a is in decidegrees, not in radians.
Definition: trigo.h:356
int currentPenWidth
Definition: plotter.h:590
int defaultPenWidth
true to generate a negative image (PS mode mainly)
Definition: plotter.h:589
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadOval
double GetDashMarkLenIU() const
Definition: plotter.cpp:145
SHAPE_LINE_CHAIN.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:506
void markerLozenge(const wxPoint &position, int radius)
Plot a lozenge centered on the position.
Definition: plotter.cpp:279
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plotter.h:584
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:61
#define DASH_GAP_LEN(aLineWidth)
The common library.
void markerCircle(const wxPoint &pos, int radius)
Plot a circle centered on the position.
Definition: plotter.cpp:273
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
virtual void Arc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)
Generic fallback: arc rendered as a polyline.
Definition: plotter.cpp:157
FILL_T
Enum FILL_T is the set of fill types used in plotting or drawing enclosed areas.
Definition: base_struct.h:42
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:162
bool IsClosed() const
Function IsClosed()
BASE_SCREEN class implementation.
double iuPerDeviceUnit
Device scale (from IUs to plotter device units - usually decimils)
Definition: plotter.h:572
void segmentAsOval(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode)
Cdonvert a thick segment and plot it as an oval.
Definition: plotter.cpp:437
VECTOR2< double > DPOINT
Definition: vector2d.h:599
wxString filename
Definition: plotter.h:596
void markerVBar(const wxPoint &pos, int radius)
Plot a | bar centered on the position.
Definition: plotter.cpp:324
void markerSquare(const wxPoint &position, int radius)
Plot a square centered on the position.
Definition: plotter.cpp:248
void markerBackSlash(const wxPoint &pos, int radius)
Plot a \ bar centered on the position.
Definition: plotter.cpp:317
void sketchOval(const wxPoint &pos, const wxSize &size, double orient, int width)
Definition: plotter.cpp:458
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
wxSize paperSize
Paper size in IU - not in mils.
Definition: plotter.h:600
bool m_mirrorIsHorizontal
Definition: plotter.h:580
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
bool negativeMode
true to plot in color, false to plot in black and white
Definition: plotter.h:588