KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_shape.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 The 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, see <https://www.gnu.org/licenses/>.
19 */
20
21#include <sch_render_settings.h>
22#include <sch_draw_panel.h>
23#include <macros.h>
24#include <plotters/plotter.h>
25#include <base_units.h>
26#include <widgets/msgpanel.h>
27#include <bitmaps.h>
28#include <eda_draw_frame.h>
29#include <gr_basic.h>
31#include <geometry/shape_arc.h>
34#include <schematic.h>
35#include <api/api_utils.h>
36#include <api/schematic/schematic_types.pb.h>
37#include <sch_shape.h>
38#include <properties/property.h>
40
41
42SCH_SHAPE::SCH_SHAPE( SHAPE_T aShape, SCH_LAYER_ID aLayer, int aLineWidth, FILL_T aFillType,
43 KICAD_T aType ) :
44 SCH_ITEM( nullptr, aType ),
45 EDA_SHAPE( aShape, aLineWidth, aFillType )
46{
47 SetLayer( aLayer );
48}
49
50
52{
53 return new SCH_SHAPE( *this );
54}
55
56
57void SCH_SHAPE::Serialize( google::protobuf::Any& aContainer ) const
58{
59 using namespace kiapi::common;
60
61 kiapi::schematic::types::SchematicGraphicShape msg;
62
63 msg.mutable_id()->set_value( m_Uuid.AsStdString() );
64 msg.set_locked( IsLocked() ? types::LockedState::LS_LOCKED : types::LockedState::LS_UNLOCKED );
65
66 EDA_SHAPE::Serialize( *msg.mutable_shape(), schIUScale );
67
68 kiapi::common::PackCustomProperties( msg.mutable_custom_properties(), *this );
69
70 if( !aContainer.PackFrom( msg ) )
71 wxFAIL_MSG( wxT( "Failed to pack SCH_SHAPE" ) );
72}
73
74
75bool SCH_SHAPE::Deserialize( const google::protobuf::Any& aContainer )
76{
77 using namespace kiapi::common;
78
79 kiapi::schematic::types::SchematicGraphicShape msg;
80
81 if( !aContainer.UnpackTo( &msg ) )
82 return false;
83
84 const_cast<KIID&>( m_Uuid ) = KIID( msg.id().value() );
85 SetLocked( msg.locked() == types::LockedState::LS_LOCKED );
86 kiapi::common::UnpackCustomProperties( msg.custom_properties(), *this );
87
88 return EDA_SHAPE::Deserialize( msg.shape(), schIUScale );
89}
90
91
93{
94 SCH_SHAPE* shape = static_cast<SCH_SHAPE*>( aItem );
95
96 EDA_SHAPE::SwapShape( shape );
97}
98
99
101{
102 m_stroke = aStroke;
103}
104
105
106void SCH_SHAPE::SetFilled( bool aFilled )
107{
108 if( !aFilled )
110 else if( GetParentSymbol() )
112 else
114}
115
116
118{
119 if( !IsMoving() )
120 {
122 return;
123 }
124
125 SCH_SHAPE* movingShape = const_cast<SCH_SHAPE*>( this );
126 movingShape->ClearFlags( IS_MOVING );
128 movingShape->SetFlags( IS_MOVING );
129}
130
131
132void SCH_SHAPE::Move( const VECTOR2I& aOffset )
133{
134 move( aOffset );
135}
136
137
139{
141 {
142 VECTOR2I size = GetEnd() - GetPosition();
143
144 if( size.y < 0 )
145 {
146 SetStartY( GetStartY() + size.y );
147 SetEndY( GetStartY() - size.y );
148 }
149
150 if( size.x < 0 )
151 {
152 SetStartX( GetStartX() + size.x );
153 SetEndX( GetStartX() - size.x );
154 }
155 }
156}
157
158
160{
161 flip( VECTOR2I( aCenter, 0 ), FLIP_DIRECTION::LEFT_RIGHT );
162}
163
164
166{
167 flip( VECTOR2I( 0, aCenter ), FLIP_DIRECTION::TOP_BOTTOM );
168}
169
170
171void SCH_SHAPE::Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
172{
173 rotate( aCenter, aRotateCCW ? ANGLE_90 : ANGLE_270 );
174}
175
176
177bool SCH_SHAPE::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
178{
179 return hitTest( aPosition, aAccuracy );
180}
181
182
183bool SCH_SHAPE::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
184{
186 return false;
187
188 return hitTest( aRect, aContained, aAccuracy );
189}
190
191
192bool SCH_SHAPE::HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const
193{
195 return false;
196
197 std::vector<SHAPE*> shapes = MakeEffectiveShapes( false );
198
199 for( SHAPE* shape : shapes )
200 {
201 bool hit = KIGEOM::ShapeHitTest( aPoly, *shape, aContained );
202
203 if( hit )
204 {
205 for( SHAPE* s : shapes )
206 delete s;
207 return true;
208 }
209 }
210
211 for( SHAPE* shape : shapes )
212 delete shape;
213
214 return false;
215}
216
217
218bool SCH_SHAPE::IsEndPoint( const VECTOR2I& aPt ) const
219{
220 SHAPE_T shape = GetShape();
221
222 if( shape == SHAPE_T::ARC || shape == SHAPE_T::BEZIER || shape == SHAPE_T::SEGMENT )
223 return ( aPt == GetStart() ) || ( aPt == GetEnd() );
224
225 if( shape == SHAPE_T::RECTANGLE )
226 {
227 for( const VECTOR2I& corner : GetRectCorners() )
228 {
229 if( corner == aPt )
230 return true;
231 }
232
233 return false;
234 }
235
236 if( shape == SHAPE_T::POLY )
237 {
238 for( const VECTOR2I& pt : GetPolyPoints() )
239 {
240 if( pt == aPt )
241 return true;
242 }
243
244 return false;
245 }
246
247 return false;
248}
249
250
251void SCH_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
252 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
253{
254 if( IsPrivate() )
255 return;
256
257 // note: if aBodyStyle == -1 the outline shape is not plotted. Only the filled area
258 // is plotted (used to plot cells for SCH_TABLE items
259
260 SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
261 int pen_size = GetEffectivePenWidth( renderSettings );
262
263 static std::vector<VECTOR2I> ptList;
264
265 COLOR4D color = GetStroke().GetColor();
266 COLOR4D bg = renderSettings->GetBackgroundColor();
267 LINE_STYLE lineStyle = GetStroke().GetLineStyle();
268 FILL_T fill = m_fill;
269
270 if( aBackground )
271 {
272 switch( m_fill )
273 {
275 // Fill in the foreground layer
276 return;
277
278 case FILL_T::HATCH:
281 if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
282 color = renderSettings->GetLayerColor( m_layer );
283
284 color.a = color.a * 0.4;
285 break;
286
288 // drop separate fills in B&W mode
289 if( !aPlotter->GetColorMode() && pen_size > 0 )
290 return;
291
292 color = GetFillColor();
293
294 if( color == COLOR4D::UNSPECIFIED )
295 color = renderSettings->GetLayerColor( m_layer );
296
297 break;
298
300 // drop fill in B&W mode
301 if( !aPlotter->GetColorMode() )
302 return;
303
304 color = renderSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
305 break;
306
307 default:
308 return;
309 }
310
311 pen_size = 0;
312 lineStyle = LINE_STYLE::SOLID;
313 }
314 else /* if( aForeground ) */
315 {
316 if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
317 color = renderSettings->GetLayerColor( m_layer );
318
319 if( lineStyle == LINE_STYLE::DEFAULT )
320 lineStyle = LINE_STYLE::SOLID;
321
323 fill = m_fill;
324 else
325 fill = FILL_T::NO_FILL;
326
327 pen_size = aBodyStyle == -1 ? 0 : GetEffectivePenWidth( renderSettings );
328 }
329
330 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
331 bg = COLOR4D::WHITE;
332
333 if( color.m_text && Schematic() )
334 color = COLOR4D( ResolveText( *color.m_text, &Schematic()->CurrentSheet() ) );
335
336 if( aDimmed )
337 {
338 color.Desaturate( );
339 color = color.Mix( bg, 0.5f );
340 }
341
342 aPlotter->SetColor( color );
343
344 if( aBackground && IsHatchedFill() )
345 {
346 for( int ii = 0; ii < GetHatching().OutlineCount(); ++ii )
347 {
348 SHAPE_LINE_CHAIN outline = GetHatching().COutline( ii );
349
350 for( int jj = 0; jj < outline.PointCount(); ++jj )
351 outline.SetPoint( jj, renderSettings->TransformCoordinate( outline.CPoint( jj ) ) + aOffset );
352
353 aPlotter->PlotPoly( outline, FILL_T::FILLED_SHAPE, 0, nullptr );
354 }
355
356 return;
357 }
358
359 aPlotter->SetCurrentLineWidth( pen_size );
360 aPlotter->SetDash( pen_size, lineStyle );
361
362 VECTOR2I start = renderSettings->TransformCoordinate( m_start ) + aOffset;
363 VECTOR2I end = renderSettings->TransformCoordinate( m_end ) + aOffset;
364 VECTOR2I mid, center;
365
366 auto transformBezierPoint =
367 [&]( const VECTOR2D& aPoint )
368 {
369 return renderSettings->TransformCoordinate( VECTOR2I( aPoint ) ) + aOffset;
370 };
371
372 std::vector<VECTOR2I> lineEndingPlotPoints;
373
374 switch( GetShape() )
375 {
376 case SHAPE_T::ARC:
377 {
378 mid = renderSettings->TransformCoordinate( GetArcMid() ) + aOffset;
379
380 // Save original endpoints before shortening.
381 VECTOR2I origArcStart = start;
382 VECTOR2I origArcEnd = end;
383
384 SHAPE_ARC arc( start, mid, end, 0 );
385 VECTOR2I c = arc.GetCenter();
386 EDA_ANGLE startAngle = arc.GetStartAngle();
387 EDA_ANGLE arcAngle = arc.GetCentralAngle();
388
389 // Determine arc direction from start/mid/end.
390 EDA_ANGLE origStart = startAngle;
391
392 if( ShortenArcForEndings( startAngle, arcAngle, arc.GetRadius(), pen_size ) )
393 {
394 RotatePoint( start, c, origStart - startAngle );
395
396 VECTOR2I newEnd = start;
397 RotatePoint( newEnd, c, -arcAngle );
398
399 VECTOR2I newMid = start;
400 RotatePoint( newMid, c, -arcAngle / 2 );
401
402 aPlotter->Arc( start, newMid, newEnd, fill, pen_size );
403 }
404
405 // Restore original endpoints for ending placement.
406 start = origArcStart;
407 end = origArcEnd;
408
409 break;
410 }
411
412 case SHAPE_T::CIRCLE:
413 center = renderSettings->TransformCoordinate( getCenter() ) + aOffset;
414 aPlotter->Circle( center, GetRadius() * 2, fill, pen_size );
415 break;
416
418 aPlotter->Rect( start, end, fill, pen_size, GetCornerRadius() );
419 break;
420
421 case SHAPE_T::SEGMENT:
423 aPlotter->ThickSegment( start, end, pen_size, nullptr );
424
425 break;
426
427 case SHAPE_T::POLY:
428 ptList.clear(); // clear every time; it's static
429
430 if( !GetPolyShape().IsEmpty() )
431 {
432 for( const VECTOR2I& pt : GetPolyShape().Outline( 0 ).CPoints() )
433 ptList.push_back( renderSettings->TransformCoordinate( pt ) + aOffset );
434
435 if( ShortenBodyPolyPoints( ptList, 0, pen_size ) )
436 aPlotter->PlotPoly( ptList, fill, pen_size, nullptr );
437 }
438
439 lineEndingPlotPoints = ptList;
440 break;
441
442 case SHAPE_T::BEZIER:
443 if( std::optional<BEZIER<double>> curve = ShortenedBezierCurve( pen_size ) )
444 {
445 if( aPlotter->GetPlotterType() == PLOT_FORMAT::SVG )
446 {
447 aPlotter->BezierCurve( transformBezierPoint( curve->Start ), transformBezierPoint( curve->C1 ),
448 transformBezierPoint( curve->C2 ), transformBezierPoint( curve->End ),
449 GetMaxError(), pen_size );
450 }
451 else
452 {
453 std::vector<VECTOR2D> pts = ShortenedBezierPolyline( pen_size );
454 std::vector<VECTOR2I> plotPts;
455
456 plotPts.reserve( pts.size() );
457
458 for( const VECTOR2D& pt : pts )
459 plotPts.push_back( transformBezierPoint( pt ) );
460
461 aPlotter->PlotPoly( plotPts, fill, pen_size, nullptr );
462 }
463 }
464
465 break;
466
467 case SHAPE_T::ELLIPSE:
469 {
470 ptList.clear(); // clear every time; it's static
471
473
474 for( const VECTOR2I& pt : ellipsePoly.CPoints() )
475 ptList.push_back( renderSettings->TransformCoordinate( pt ) + aOffset );
476
477 if( ShortenBodyPolyPoints( ptList, 0, pen_size ) )
478 {
479 if( GetShape() == SHAPE_T::ELLIPSE )
480 ptList.push_back( ptList.front() );
481
482 aPlotter->PlotPoly( ptList, fill, pen_size, nullptr );
483 }
484
485 break;
486 }
487
488 default:
490 }
491
492 aPlotter->SetDash( pen_size, LINE_STYLE::SOLID );
493
494 // Plot line endings
495 if( GetStartEnding().GetStyle() != LINE_ENDING_STYLE::NONE
496 || GetEndEnding().GetStyle() != LINE_ENDING_STYLE::NONE )
497 {
498 VECTOR2I startPt, endPt;
499
500 if( !GetLineEndingEndpoints( startPt, endPt ) )
501 return;
502
503 startPt = renderSettings->TransformCoordinate( startPt ) + aOffset;
504 endPt = renderSettings->TransformCoordinate( endPt ) + aOffset;
505
506 EDA_SHAPE endingShape( *this );
507
508 switch( GetShape() )
509 {
510 case SHAPE_T::ARC:
511 endingShape.SetArcGeometry( startPt, mid, endPt );
512 break;
513
514 case SHAPE_T::POLY:
515 if( lineEndingPlotPoints.size() >= 2 )
516 {
517 SHAPE_POLY_SET plotPoly;
518 plotPoly.NewOutline();
519
520 for( const VECTOR2I& pt : lineEndingPlotPoints )
521 plotPoly.Append( pt );
522
523 if( GetPolyShape().OutlineCount() > 0 )
524 plotPoly.Outline( 0 ).SetClosed( GetPolyShape().COutline( 0 ).IsClosed() );
525
526 endingShape.SetPolyShape( plotPoly );
527 }
528
529 break;
530
531 case SHAPE_T::BEZIER:
532 endingShape.SetStart( startPt );
533 endingShape.SetBezierC1( transformBezierPoint( GetBezierC1() ) );
534 endingShape.SetBezierC2( transformBezierPoint( GetBezierC2() ) );
535 endingShape.SetEnd( endPt );
537 break;
538
539 case SHAPE_T::SEGMENT:
540 endingShape.SetStart( startPt );
541 endingShape.SetEnd( endPt );
542 break;
543
544 default: break;
545 }
546
547 EDA_ANGLE startTangent;
548 EDA_ANGLE endTangent;
549
550 endingShape.GetEndingTangents( startTangent, endTangent, pen_size );
551 GetStartEnding().Plot( aPlotter, startPt, startTangent, pen_size );
552 GetEndEnding().Plot( aPlotter, endPt, endTangent, pen_size );
553 }
554}
555
556
558{
559 if( GetPenWidth() > 0 )
560 return GetPenWidth();
561
562 // Historically 0 meant "default width" and negative numbers meant "don't stroke".
563 if( GetPenWidth() < 0 )
564 return 0;
565
567
568 if( schematic )
569 return schematic->Settings().m_DefaultLineWidth;
570
571 return schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS );
572}
573
574
576{
577 return getBoundingBox();
578}
579
580
581void SCH_SHAPE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
582{
583 SCH_ITEM::GetMsgPanelInfo( aFrame, aList );
584
585 ShapeGetMsgPanelInfo( aFrame, aList );
586}
587
588
589wxString SCH_SHAPE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
590{
591 switch( GetShape() )
592 {
593 case SHAPE_T::ARC:
594 return wxString::Format( _( "Arc, radius %s" ),
595 aUnitsProvider->MessageTextFromValue( GetRadius() ) );
596
597 case SHAPE_T::CIRCLE:
598 return wxString::Format( _( "Circle, radius %s" ),
599 aUnitsProvider->MessageTextFromValue( GetRadius() ) );
600
602 return wxString::Format( _( "Rectangle, width %s height %s" ),
603 aUnitsProvider->MessageTextFromValue( std::abs( m_start.x - m_end.x ) ),
604 aUnitsProvider->MessageTextFromValue( std::abs( m_start.y - m_end.y ) ) );
605
606 case SHAPE_T::SEGMENT:
607 return wxString::Format( _( "Line, length %s" ),
608 aUnitsProvider->MessageTextFromValue( GetLength() ) );
609
610 case SHAPE_T::POLY:
611 return wxString::Format( _( "Polyline, %d points" ),
612 int( GetPolyShape().IsEmpty() ? 0 : GetPolyShape().Outline( 0 ).GetPointCount() ) );
613
614 case SHAPE_T::BEZIER:
615 return wxString::Format( _( "Bezier Curve, %d points" ),
616 int( m_bezierPoints.size() ) );
617
618 case SHAPE_T::ELLIPSE:
619 return wxString::Format( _( "Ellipse, %s x %s" ),
620 aUnitsProvider->MessageTextFromValue( GetEllipseMajorRadius() ),
621 aUnitsProvider->MessageTextFromValue( GetEllipseMinorRadius() ) );
622
624 return wxString::Format( _( "Elliptical Arc, %s x %s" ),
625 aUnitsProvider->MessageTextFromValue( GetEllipseMajorRadius() ),
626 aUnitsProvider->MessageTextFromValue( GetEllipseMinorRadius() ) );
627
628 default:
630 return wxEmptyString;
631 }
632}
633
634
653
654
655std::vector<int> SCH_SHAPE::ViewGetLayers() const
656{
657 std::vector<int> layers( 3 );
658
659 layers[0] = IsPrivate() ? LAYER_PRIVATE_NOTES : m_layer;
660
661 if( m_layer == LAYER_DEVICE )
662 {
664 layers[1] = LAYER_DEVICE_BACKGROUND;
665 else
666 layers[1] = LAYER_SHAPES_BACKGROUND;
667 }
668 else
669 {
670 layers[1] = LAYER_SHAPES_BACKGROUND;
671 }
672
673 layers[2] = LAYER_SELECTION_SHADOWS;
674
675 return layers;
676}
677
678
679void SCH_SHAPE::SetArcOrLine( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd )
680{
681 if( IsStraightArc( aStart, aMid, aEnd ) )
682 {
684 AddPoint( aStart );
685 AddPoint( aEnd );
686 }
687 else
688 {
689 SetArcGeometry( aStart, aMid, aEnd );
690 }
691}
692
693
694void SCH_SHAPE::AddPoint( const VECTOR2I& aPosition )
695{
696 if( GetShape() == SHAPE_T::POLY )
697 {
698 if( GetPolyShape().IsEmpty() )
699 {
701 GetPolyShape().Outline( 0 ).SetClosed( false );
702 }
703
704 GetPolyShape().Outline( 0 ).Append( aPosition, true );
705 }
706 else
707 {
709 }
710}
711
712
713bool SCH_SHAPE::operator==( const SCH_ITEM& aOther ) const
714{
715 if( aOther.Type() != Type() )
716 return false;
717
718 const SCH_SHAPE& other = static_cast<const SCH_SHAPE&>( aOther );
719
720 return SCH_ITEM::operator==( aOther ) && EDA_SHAPE::operator==( other );
721}
722
723
724double SCH_SHAPE::Similarity( const SCH_ITEM& aOther ) const
725{
726 if( m_Uuid == aOther.m_Uuid )
727 return 1.0;
728
729 if( aOther.Type() != Type() )
730 return 0.0;
731
732 const SCH_SHAPE& other = static_cast<const SCH_SHAPE&>( aOther );
733
734 double similarity = SimilarityBase( other );
735
736 similarity *= EDA_SHAPE::Similarity( other );
737
738 return similarity;
739}
740
741
742int SCH_SHAPE::compare( const SCH_ITEM& aOther, int aCompareFlags ) const
743{
744 // The object UUIDs must be compared after the shape coordinates because shapes do not
745 // have immutable UUIDs.
746 int retv = SCH_ITEM::compare( aOther, aCompareFlags & ~COMPARE_FLAGS::UUID );
747
748 if( retv )
749 return retv;
750
751 retv = EDA_SHAPE::Compare( &static_cast<const SCH_SHAPE&>( aOther ) );
752
753 if( retv )
754 return retv;
755
756 if( aCompareFlags & COMPARE_FLAGS::UUID )
757 {
758 if( m_Uuid < aOther.m_Uuid )
759 return -1;
760
761 if( m_Uuid > aOther.m_Uuid )
762 return 1;
763 }
764
765 return 0;
766}
767
768
769static struct SCH_SHAPE_DESC
770{
772 {
774
775 if( fillEnum.Choices().GetCount() == 0 )
776 {
777 fillEnum.Map( FILL_T::NO_FILL, _HKI( "None" ) )
778 .Map( FILL_T::FILLED_SHAPE, _HKI( "Body outline color" ) )
779 .Map( FILL_T::FILLED_WITH_BG_BODYCOLOR, _HKI( "Body background color" ) )
780 .Map( FILL_T::FILLED_WITH_COLOR, _HKI( "Fill color" ) )
781 .Map( FILL_T::HATCH, _HKI( "Hatch" ) )
782 .Map( FILL_T::REVERSE_HATCH, _HKI( "Reverse hatch" ) )
783 .Map( FILL_T::CROSS_HATCH, _HKI( "Cross hatch" ) );
784 }
785
792
793 // Polygons and ellipses have meaningful Position properties (first vertex / center).
794 // On other shapes, Position duplicates the Start properties.
795 auto isPolygonOrEllipse =
796 []( INSPECTABLE* aItem ) -> bool
797 {
798 if( SCH_SHAPE* shape = dynamic_cast<SCH_SHAPE*>( aItem ) )
799 {
800 const SHAPE_T t = shape->GetShape();
801 return t == SHAPE_T::POLY || t == SHAPE_T::ELLIPSE || t == SHAPE_T::ELLIPSE_ARC;
802 }
803 return false;
804 };
805
806 // Hide Start/End for shapes that don't use them directly
807 // (polygon uses first vertex via Position; circle uses Center; ellipse uses Center + radii).
808 auto isNotPolygonOrCircleOrEllipse =
809 []( INSPECTABLE* aItem ) -> bool
810 {
811 if( SCH_SHAPE* shape = dynamic_cast<SCH_SHAPE*>( aItem ) )
812 {
813 const SHAPE_T t = shape->GetShape();
814 return t != SHAPE_T::POLY
815 && t != SHAPE_T::CIRCLE
816 && t != SHAPE_T::ELLIPSE
817 && t != SHAPE_T::ELLIPSE_ARC;
818 }
819 return true;
820 };
821
822 auto isSymbolItem =
823 []( INSPECTABLE* aItem ) -> bool
824 {
825 if( SCH_SHAPE* shape = dynamic_cast<SCH_SHAPE*>( aItem ) )
826 return shape->GetLayer() == LAYER_DEVICE;
827
828 return false;
829 };
830
831 auto isSchematicItem =
832 []( INSPECTABLE* aItem ) -> bool
833 {
834 if( SCH_SHAPE* shape = dynamic_cast<SCH_SHAPE*>( aItem ) )
835 return shape->GetLayer() != LAYER_DEVICE;
836
837 return false;
838 };
839
840 auto isFillColorEditable =
841 []( INSPECTABLE* aItem ) -> bool
842 {
843 if( SCH_SHAPE* shape = dynamic_cast<SCH_SHAPE*>( aItem ) )
844 {
845 if( shape->GetParentSymbol() )
846 return shape->GetFillMode() == FILL_T::FILLED_WITH_COLOR;
847 else
848 return shape->IsSolidFill();
849 }
850
851 return true;
852 };
853
854 const wxString shapeProps = _HKI( "Shape Properties" );
855
856 propMgr.AddProperty( new PROPERTY<SCH_SHAPE, int>( _HKI( "Position X" ),
859 shapeProps )
860 .SetAvailableFunc( isPolygonOrEllipse );
861
862 propMgr.AddProperty( new PROPERTY<SCH_SHAPE, int>( _HKI( "Position Y" ),
865 shapeProps )
866 .SetAvailableFunc( isPolygonOrEllipse );
867
868 propMgr.OverrideAvailability( TYPE_HASH( SCH_SHAPE ), TYPE_HASH( EDA_SHAPE ), _HKI( "Start X" ),
869 isNotPolygonOrCircleOrEllipse );
870 propMgr.OverrideAvailability( TYPE_HASH( SCH_SHAPE ), TYPE_HASH( EDA_SHAPE ), _HKI( "Start Y" ),
871 isNotPolygonOrCircleOrEllipse );
873 isNotPolygonOrCircleOrEllipse );
875 isNotPolygonOrCircleOrEllipse );
876
877 propMgr.OverrideAvailability( TYPE_HASH( SCH_SHAPE ), TYPE_HASH( EDA_SHAPE ), _HKI( "Filled" ),
878 isSchematicItem );
879
880 propMgr.OverrideWriteability( TYPE_HASH( SCH_SHAPE ), TYPE_HASH( EDA_SHAPE ), _HKI( "Fill Color" ),
881 isFillColorEditable );
882
883 void ( SCH_SHAPE::*fillModeSetter )( FILL_T ) = &SCH_SHAPE::SetFillMode;
884 FILL_T ( SCH_SHAPE::*fillModeGetter )() const = &SCH_SHAPE::GetFillMode;
885
886 propMgr.AddProperty( new PROPERTY_ENUM<SCH_SHAPE, FILL_T>( _HKI( "Fill Mode" ),
887 fillModeSetter, fillModeGetter ),
888 _HKI( "Shape Properties" ) )
889 .SetAvailableFunc( isSymbolItem );
890 }
892
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:130
BITMAPS
A list of all bitmap identifiers.
@ add_rectangle
@ add_ellipse_arc
@ add_graphical_segments
BOX2< VECTOR2I > BOX2I
Definition box2.h:917
Generic cubic Bezier representation.
static const COLOR4D WHITE
Definition color4d.h:403
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition color4d.h:400
The base class for create windows for drawing purpose.
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition eda_item.h:158
const KIID m_Uuid
Definition eda_item.h:599
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition eda_item.h:160
EDA_ITEM_FLAGS m_flags
Definition eda_item.h:608
bool IsMoving() const
Definition eda_item.h:132
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:84
static bool ShortenSegmentForEndings(VECTOR2I &aStart, VECTOR2I &aEnd, const LINE_ENDING &aStartEnding, const LINE_ENDING &aEndEnding, int aLineWidth)
Shorten a segment body for line endings.
virtual void SetEnd(const VECTOR2I &aEnd)
Definition eda_shape.h:338
void SetStartX(int x)
Definition eda_shape.h:302
int GetEllipseMinorRadius() const
Definition eda_shape.h:404
const VECTOR2I & GetBezierC2() const
Definition eda_shape.h:377
VECTOR2I getCenter() const
int GetStartY() const
Definition eda_shape.h:285
void rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle)
const SHAPE_POLY_SET & GetHatching() const
FILL_T GetFillMode() const
Definition eda_shape.h:151
int GetEllipseMajorRadius() const
Definition eda_shape.h:395
void SetEndY(int aY)
Definition eda_shape.h:345
std::vector< VECTOR2I > GetPolyPoints() const
Duplicate the polygon outlines into a flat list of VECTOR2I points.
bool ShortenBodyPolyPoints(std::vector< VECTOR2I > &aPoints, int aOutlineIdx, int aLineWidth) const
Apply line-ending body shortening to copied/generated polyline points.
SHAPE_ELLIPSE buildShapeEllipse() const
void SetStartY(int y)
Definition eda_shape.h:295
SHAPE_POLY_SET & GetPolyShape()
void GetEndingTangents(EDA_ANGLE &aStartTangent, EDA_ANGLE &aEndTangent, int aLineWidth=0) const
Compute outward-facing tangent angles at the start and end of the shape.
void ShapeGetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
bool operator==(const EDA_SHAPE &aOther) const
int GetRadius() const
SHAPE_T GetShape() const
Definition eda_shape.h:178
virtual void SetBezierC2(const VECTOR2I &aPt)
Definition eda_shape.h:376
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
bool IsHatchedFill() const
Definition eda_shape.h:133
virtual void SetBezierC1(const VECTOR2I &aPt)
Definition eda_shape.h:373
bool GetLineEndingEndpoints(VECTOR2I &aStartPoint, VECTOR2I &aEndPoint) const
Return the source endpoints used to place line endings.
bool hitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
void SetEndX(int aX)
Definition eda_shape.h:352
void RebuildBezierToSegmentsPointsList(int aMaxError)
Rebuild the m_bezierPoints vertex list that approximate the Bezier curve by a list of segments.
void flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection)
EDA_SHAPE(SHAPE_T aType, int aLineWidth, FILL_T aFill)
Definition eda_shape.cpp:56
VECTOR2I m_start
Definition eda_shape.h:769
int GetPointCount() const
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition eda_shape.h:334
bool IsClosed() const
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
Definition eda_shape.h:284
COLOR4D GetFillColor() const
Definition eda_shape.h:162
virtual void SetShape(SHAPE_T aShape)
Definition eda_shape.h:177
void SwapShape(EDA_SHAPE *aImage)
std::vector< VECTOR2I > GetRectCorners() const
std::vector< VECTOR2I > m_bezierPoints
Definition eda_shape.h:778
const LINE_ENDING & GetStartEnding() const
Definition eda_shape.h:180
virtual void UpdateHatching() const
virtual void SetArcGeometry(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Set the three controlling points for an arc.
double GetLength() const
wxString SHAPE_T_asString() const
int GetStartX() const
Definition eda_shape.h:286
double Similarity(const EDA_SHAPE &aOther) const
const VECTOR2I & GetBezierC1() const
Definition eda_shape.h:374
std::optional< BEZIER< double > > ShortenedBezierCurve(int aLineWidth) const
Return the cubic Bezier curve shortened for line endings.
VECTOR2I m_end
Definition eda_shape.h:770
const BOX2I getBoundingBox() const
bool ShortenArcForEndings(EDA_ANGLE &aStartAngle, EDA_ANGLE &aArcAngle, double aRadius, int aLineWidth) const
Shorten an arc body for line endings.
std::vector< VECTOR2D > ShortenedBezierPolyline(int aLineWidth) const
Return the flattened Bezier polyline after line-ending shortening.
STROKE_PARAMS m_stroke
Definition eda_shape.h:755
const LINE_ENDING & GetEndEnding() const
Definition eda_shape.h:186
FILL_T m_fill
Definition eda_shape.h:759
int GetCornerRadius() const
void SetFillMode(FILL_T aFill)
virtual void SetPolyShape(const SHAPE_POLY_SET &aShape)
Definition eda_shape.h:529
virtual void SetStart(const VECTOR2I &aStart)
Definition eda_shape.h:288
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
int Compare(const EDA_SHAPE *aOther) const
VECTOR2I GetArcMid() const
ENUM_MAP & Map(T aValue, const wxString &aName)
Definition property.h:817
static ENUM_MAP< T > & Instance()
Definition property.h:811
wxPGChoices & Choices()
Definition property.h:862
Class that other classes need to inherit from, in order to be inspectable.
Definition inspectable.h:39
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
std::shared_ptr< wxString > m_text
Definition color4d.h:397
double a
Alpha component.
Definition color4d.h:394
COLOR4D & Desaturate()
Removes color (in HSL model)
Definition color4d.cpp:530
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Return a color that is mixed with the input by a factor.
Definition color4d.h:293
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
Definition kiid.h:46
void Plot(PLOTTER *aPlotter, const VECTOR2I &aPoint, const EDA_ANGLE &aTangent, int aLineWidth, void *aData=nullptr) const
Base plotter engine class.
Definition plotter.h:138
virtual void Circle(const VECTOR2I &pos, int diametre, FILL_T fill, int width)=0
virtual void SetDash(int aLineWidth, LINE_STYLE aLineStyle)=0
virtual PLOT_FORMAT GetPlotterType() const =0
Return the effective plot engine in use.
virtual void Rect(const VECTOR2I &p1, const VECTOR2I &p2, FILL_T fill, int width, int aCornerRadius=0)=0
virtual void BezierCurve(const VECTOR2I &aStart, const VECTOR2I &aControl1, const VECTOR2I &aControl2, const VECTOR2I &aEnd, int aTolerance, int aLineThickness)
Generic fallback: Cubic Bezier curve rendered as a polyline.
Definition plotter.cpp:230
bool GetColorMode() const
Definition plotter.h:166
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
virtual void ThickSegment(const VECTOR2I &start, const VECTOR2I &end, int width, void *aData)
Definition plotter.cpp:442
virtual void PlotPoly(const std::vector< VECTOR2I > &aCornerList, FILL_T aFill, int aWidth, void *aData)=0
Draw a polygon ( filled or not ).
virtual void SetColor(const COLOR4D &color)=0
virtual void Arc(const VECTOR2D &aStart, const VECTOR2D &aMid, const VECTOR2D &aEnd, FILL_T aFill, int aWidth)
Definition plotter.cpp:150
PROPERTY_BASE & SetAvailableFunc(std::function< bool(INSPECTABLE *)> aFunc)
Set a callback function to determine whether an object provides this property.
Definition property.h:275
Provide class metadata.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void OverrideAvailability(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName, std::function< bool(INSPECTABLE *)> aFunc)
Sets an override availability functor for a base class property of a given derived class.
void OverrideWriteability(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName, std::function< bool(INSPECTABLE *)> aFunc)
Sets an override writeability functor for a base class property of a given derived class.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
Holds all the data relating to one schematic.
Definition schematic.h:155
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:170
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
void SetLocked(bool aLocked) override
Definition sch_item.h:262
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
Definition sch_item.cpp:46
const SYMBOL * GetParentSymbol() const
Definition sch_item.cpp:350
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition sch_item.cpp:302
bool IsLocked() const override
Definition sch_item.cpp:179
virtual bool operator==(const SCH_ITEM &aOther) const
Definition sch_item.cpp:911
bool IsPrivate() const
Definition sch_item.h:259
void SetLayer(SCH_LAYER_ID aLayer)
Definition sch_item.h:354
int GetMaxError() const
Definition sch_item.cpp:999
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
Definition sch_item.cpp:65
wxString ResolveText(const wxString &aText, const SCH_SHEET_PATH *aPath, int aDepth=0) const
Definition sch_item.cpp:464
virtual int compare(const SCH_ITEM &aOther, int aCompareFlags=~COMPARE_FLAGS::UNIT) const
Provide the draw object specific comparison called by the == and < operators.
Definition sch_item.cpp:935
int GetEffectivePenWidth(const SCH_RENDER_SETTINGS *aSettings) const
SCH_LAYER_ID m_layer
Definition sch_item.h:843
double SimilarityBase(const SCH_ITEM &aItem) const
Calculate the boilerplate similarity for all LIB_ITEMs without preventing the use above of a pure vir...
Definition sch_item.h:403
VECTOR2I TransformCoordinate(const VECTOR2I &aPoint) const
const KIGFX::COLOR4D & GetBackgroundColor() const override
Return current background color settings.
void SetArcOrLine(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Set the arc from three points, or a two-point polyline when they are collinear.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
void SetPositionX(int aX)
Definition sch_shape.h:93
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition sch_shape.cpp:75
std::vector< SHAPE * > MakeEffectiveShapes(bool aEdgeOnly=false) const override
Make a set of SHAPE objects representing the SCH_SHAPE.
Definition sch_shape.h:126
void SetFilled(bool aFilled) override
void Move(const VECTOR2I &aOffset) override
Move the item by aMoveVector to a new position.
void UpdateHatching() const override
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition sch_shape.cpp:51
void SetStroke(const STROKE_PARAMS &aStroke) override
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition sch_shape.cpp:92
void Normalize()
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
SCH_SHAPE(SHAPE_T aShape=SHAPE_T::UNDEFINED, SCH_LAYER_ID aLayer=LAYER_NOTES, int aLineWidth=0, FILL_T aFillType=FILL_T::NO_FILL, KICAD_T aType=SCH_SHAPE_T)
Definition sch_shape.cpp:42
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
void AddPoint(const VECTOR2I &aPosition)
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
bool operator==(const SCH_ITEM &aOther) const override
void SetPositionY(int aY)
Definition sch_shape.h:94
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
int GetPenWidth() const override
Definition sch_shape.h:56
bool IsEndPoint(const VECTOR2I &aPoint) const override
Test if aPt is an end point of this schematic object.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition sch_shape.cpp:57
STROKE_PARAMS GetStroke() const override
Definition sch_shape.h:59
int GetPositionX() const
Definition sch_shape.h:91
VECTOR2I GetPosition() const override
Definition sch_shape.h:88
int GetEffectiveWidth() const override
int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const override
Provide the draw object specific comparison called by the == and < operators.
int GetPositionY() const
Definition sch_shape.h:92
int getMaxError() const override
Definition sch_shape.h:162
EDA_ANGLE GetCentralAngle() const
Get the "central angle" of the arc - this is the angle at the point of the "pie slice".
double GetRadius() const
EDA_ANGLE GetStartAngle() const
const VECTOR2I & GetCenter() const
SHAPE_LINE_CHAIN ConvertToPolyline(int aMaxError) const
Build a polyline approximation of the ellipse or arc.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
void SetPoint(int aIndex, const VECTOR2I &aPos)
Move a point to a specific location.
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
int PointCount() const
Return the number of points (vertices) in this line chain.
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
const std::vector< VECTOR2I > & CPoints() const
Represent a set of closed polygons.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
int NewOutline()
Creates a new empty polygon in the set and returns its index.
int OutlineCount() const
Return the number of outlines in the set.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
An abstract shape on 2D plane.
Definition shape.h:124
Simple container to manage line stroke parameters.
LINE_STYLE GetLineStyle() const
KIGFX::COLOR4D GetColor() const
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
#define DEFAULT_LINE_WIDTH_MILS
The default line width in mils. (can be changed in preference menu)
#define _(s)
static constexpr EDA_ANGLE ANGLE_90
Definition eda_angle.h:474
static constexpr EDA_ANGLE ANGLE_270
Definition eda_angle.h:477
FILL_T
Definition eda_fill.h:29
@ FILLED_WITH_COLOR
Definition eda_fill.h:33
@ NO_FILL
Definition eda_fill.h:30
@ REVERSE_HATCH
Definition eda_fill.h:35
@ HATCH
Definition eda_fill.h:34
@ FILLED_WITH_BG_BODYCOLOR
Definition eda_fill.h:32
@ FILLED_SHAPE
Fill with object color.
Definition eda_fill.h:31
@ CROSS_HATCH
Definition eda_fill.h:36
#define STRUCT_DELETED
flag indication structures to be erased
#define SKIP_STRUCT
flag indicating that the structure should be ignored
#define IS_MOVING
Item being moved.
SHAPE_T
Definition eda_shape.h:55
@ ELLIPSE
Definition eda_shape.h:63
@ SEGMENT
Definition eda_shape.h:57
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
Definition eda_shape.h:58
@ ELLIPSE_ARC
Definition eda_shape.h:64
a few functions useful in geometry calculations.
SCH_LAYER_ID
Eeschema drawing layers.
Definition layer_ids.h:480
@ LAYER_SHAPES_BACKGROUND
Definition layer_ids.h:514
@ LAYER_DEVICE
Definition layer_ids.h:497
@ LAYER_PRIVATE_NOTES
Definition layer_ids.h:499
@ LAYER_DEVICE_BACKGROUND
Definition layer_ids.h:515
@ LAYER_SELECTION_SHADOWS
Definition layer_ids.h:526
This file contains miscellaneous commonly used macros and functions.
#define UNIMPLEMENTED_FOR(type)
Definition macros.h:92
@ LEFT_RIGHT
Flip left to right (around the Y axis)
Definition mirror.h:27
@ TOP_BOTTOM
Flip top to bottom (around the X axis)
Definition mirror.h:28
Message panel definition file.
bool ShapeHitTest(const SHAPE_LINE_CHAIN &aHitter, const SHAPE &aHittee, bool aHitteeContained)
Perform a shape-to-shape hit test.
KICOMMON_API void PackCustomProperties(google::protobuf::RepeatedPtrField< types::CustomProperty > *aOutput, const EDA_ITEM &aItem)
KICOMMON_API void UnpackCustomProperties(const google::protobuf::RepeatedPtrField< types::CustomProperty > &aInput, EDA_ITEM &aItem)
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition eda_angle.h:461
#define _HKI(x)
Definition page_info.cpp:40
#define TYPE_HASH(x)
Macro to generate unique identifier for a type.
Definition property.h:74
#define ENUM_TO_WXANY(type)
Definition property.h:918
@ PT_COORD
Coordinate expressed in distance units (mm/inch)
Definition property.h:65
#define REGISTER_TYPE(x)
Helper macro to map type hashes to names.
static struct SCH_SHAPE_DESC _SCH_SHAPE_DESC
LINE_STYLE
Dashed line types.
VECTOR2I center
VECTOR2I end
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
Definition trigo.cpp:227
bool IsStraightArc(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Definition trigo.cpp:549
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:70
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708
VECTOR2< double > VECTOR2D
Definition vector2d.h:707