KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ee_grid_helper.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) 2014 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Tomasz Wlostowski <[email protected]>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include <functional>
27#include <macros.h>
29#include <sch_group.h>
30#include <sch_item.h>
31#include <sch_line.h>
32#include <sch_table.h>
33#include <sch_tablecell.h>
34#include <sch_painter.h>
35#include <tool/tool_manager.h>
36#include <sch_tool_base.h>
38#include <trigo.h>
39#include <view/view.h>
40#include "ee_grid_helper.h"
41
46
47
50{
51 if( !m_toolMgr )
52 return;
53
54 KIGFX::VIEW* view = m_toolMgr->GetView();
55
56 m_viewAxis.SetSize( 20000 );
58 m_viewAxis.SetColor( COLOR4D( 0.0, 0.1, 0.4, 0.8 ) );
59 m_viewAxis.SetDrawAtZero( true );
60 view->Add( &m_viewAxis );
61 view->SetVisible( &m_viewAxis, false );
62
64 m_viewSnapPoint.SetColor( COLOR4D( 0.0, 0.1, 0.4, 1.0 ) );
65 m_viewSnapPoint.SetDrawAtZero( true );
66 view->Add( &m_viewSnapPoint );
67 view->SetVisible( &m_viewSnapPoint, false );
68}
69
70
72{
73 if( !m_toolMgr )
74 return;
75
76 KIGFX::VIEW* view = m_toolMgr->GetView();
77
78 view->Remove( &m_viewAxis );
79 view->Remove( &m_viewSnapPoint );
80}
81
82
84 const SCH_SELECTION& aItems )
85{
87
88 // If we're working with any connectable objects, skip non-connectable objects
89 // since they are often off-grid, e.g. text anchors
90 bool hasConnectables = false;
91
92 for( EDA_ITEM* item : aItems )
93 {
94 GRID_HELPER_GRIDS grid = GetItemGrid( static_cast<SCH_ITEM*>( item ) );
96 {
97 hasConnectables = true;
98 break;
99 }
100 }
101
102 for( EDA_ITEM* item : aItems )
103 computeAnchors( static_cast<SCH_ITEM*>( item ), aMousePos, true, !hasConnectables );
104
105 double worldScale = m_toolMgr->GetView()->GetGAL()->GetWorldScale();
106 double lineSnapMinCornerDistance = 50.0 / worldScale;
107
108 ANCHOR* nearestOutline = nearestAnchor( aMousePos, OUTLINE, aGrid );
109 ANCHOR* nearestCorner = nearestAnchor( aMousePos, CORNER, aGrid );
110 ANCHOR* nearestOrigin = nearestAnchor( aMousePos, ORIGIN, aGrid );
111 ANCHOR* best = nullptr;
112 double minDist = std::numeric_limits<double>::max();
113
114 if( nearestOrigin )
115 {
116 minDist = nearestOrigin->Distance( aMousePos );
117 best = nearestOrigin;
118 }
119
120 if( nearestCorner )
121 {
122 double dist = nearestCorner->Distance( aMousePos );
123
124 if( dist < minDist )
125 {
126 minDist = dist;
127 best = nearestCorner;
128 }
129 }
130
131 if( nearestOutline )
132 {
133 double dist = nearestOutline->Distance( aMousePos );
134
135 if( minDist > lineSnapMinCornerDistance && dist < minDist )
136 best = nearestOutline;
137 }
138
139 return best ? best->pos : aMousePos;
140}
141
142
144 SCH_ITEM* aSkip )
145{
146 SCH_SELECTION skipItems;
147 skipItems.Add( aSkip );
148
149 return BestSnapAnchor( aOrigin, aGrid, skipItems );
150}
151
152
154 const SCH_SELECTION& aSkip )
155{
156 constexpr int snapRange = SNAP_RANGE * schIUScale.IU_PER_MILS;
157
158 VECTOR2I pt = aOrigin;
159 VECTOR2I snapDist( snapRange, snapRange );
160 bool gridChecked = false;
161 bool snappedToAnchor = false;
162
163 BOX2I bb( VECTOR2I( aOrigin.x - snapRange / 2, aOrigin.y - snapRange / 2 ),
164 VECTOR2I( snapRange, snapRange ) );
165
166 clearAnchors();
167 m_snapItem = std::nullopt;
168
169 for( SCH_ITEM* item : queryVisible( bb, aSkip ) )
170 computeAnchors( item, aOrigin );
171
172 ANCHOR* nearest = nearestAnchor( aOrigin, SNAPPABLE, aGrid );
173 VECTOR2I nearestGrid = Align( aOrigin, aGrid );
174
176 {
177 ad->ClearAnchors();
178 for( const ANCHOR& a : m_anchors )
179 ad->AddAnchor( a.pos );
180
181 ad->SetNearest( nearest ? OPT_VECTOR2I( nearest->pos ) : std::nullopt );
182 m_toolMgr->GetView()->Update( ad, KIGFX::GEOMETRY );
183 }
184
186
188 const VECTOR2D gridSize = GetGridSize( aGrid );
189
190 std::optional<VECTOR2I> guideSnap;
191
192 if( m_enableSnapLine )
193 guideSnap = SnapToConstructionLines( aOrigin, nearestGrid, gridSize, snapRange );
194
195 if( m_enableSnap && nearest && nearest->Distance( aOrigin ) < snapDist.EuclideanNorm() )
196 {
197
198 if( canUseGrid() && ( nearestGrid - aOrigin ).EuclideanNorm() < snapDist.EuclideanNorm() )
199 {
200 pt = nearestGrid;
201 snapDist.x = std::abs( nearestGrid.x - aOrigin.x );
202 snapDist.y = std::abs( nearestGrid.y - aOrigin.y );
203 gridChecked = true;
204 }
205 else
206 {
207 pt = nearest->pos;
208 snapDist.x = std::abs( nearest->pos.x - aOrigin.x );
209 snapDist.y = std::abs( nearest->pos.y - aOrigin.y );
210 snappedToAnchor = true;
211 gridChecked = true;
212 }
213 }
214
215 if( guideSnap && m_skipPoint != *guideSnap )
216 {
217 snapLineManager.SetSnapLineEnd( *guideSnap );
218 m_toolMgr->GetView()->SetVisible( &m_viewSnapPoint, false );
219 m_snapItem = std::nullopt;
220 return *guideSnap;
221 }
222
223 if( snappedToAnchor )
224 {
225 m_snapItem = *nearest;
226 m_viewSnapPoint.SetPosition( pt );
227
228 snapLineManager.SetSnapLineOrigin( pt );
229 snapLineManager.SetSnapLineEnd( std::nullopt );
230
231 if( m_toolMgr->GetView()->IsVisible( &m_viewSnapPoint ) )
232 m_toolMgr->GetView()->Update( &m_viewSnapPoint, KIGFX::GEOMETRY );
233 else
234 m_toolMgr->GetView()->SetVisible( &m_viewSnapPoint, true );
235
236 return pt;
237 }
238
239 m_snapItem = std::nullopt;
240
241 if( canUseGrid() && !gridChecked )
242 pt = nearestGrid;
243
244 snapLineManager.SetSnapLineEnd( std::nullopt );
245 m_toolMgr->GetView()->SetVisible( &m_viewSnapPoint, false );
246
247 return pt;
248}
249
250
252{
253 const GRID_SETTINGS& grid = m_toolMgr->GetSettings()->m_Window.grid;
254 int idx = -1;
255
256 VECTOR2D g = m_toolMgr->GetView()->GetGAL()->GetGridSize();
257
258 if( !grid.overrides_enabled )
259 return g;
260
261 switch( aGrid )
262 {
263 case GRID_CONNECTABLE:
264 if( grid.override_connected )
265 idx = grid.override_connected_idx;
266
267 break;
268
269 case GRID_WIRES:
270 if( grid.override_wires )
271 idx = grid.override_wires_idx;
272
273 break;
274
275 case GRID_TEXT:
276 if( grid.override_text )
277 idx = grid.override_text_idx;
278
279 break;
280
281 case GRID_GRAPHICS:
282 if( grid.override_graphics )
283 idx = grid.override_graphics_idx;
284
285 break;
286
287 default:
288 break;
289 }
290
291 if( idx >= 0 && idx < (int) grid.grids.size() )
292 g = grid.grids[idx].ToDouble( schIUScale );
293
294 return g;
295}
296
297
299{
300 if( !m_snapItem )
301 return nullptr;
302
303 if( m_snapItem->items.empty() )
304 return nullptr;
305
306 return static_cast<SCH_ITEM*>( m_snapItem->items[0] );
307}
308
309
310std::set<SCH_ITEM*> EE_GRID_HELPER::queryVisible( const BOX2I& aArea,
311 const SCH_SELECTION& aSkipList ) const
312{
313 std::set<SCH_ITEM*> items;
314 std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> selectedItems;
315
316 EDA_DRAW_FRAME* frame = dynamic_cast<EDA_DRAW_FRAME*>( m_toolMgr->GetToolHolder() );
317 KIGFX::VIEW* view = m_toolMgr->GetView();
318
319 view->Query( aArea, selectedItems );
320
321 for( const KIGFX::VIEW::LAYER_ITEM_PAIR& it : selectedItems )
322 {
323 if( !it.first->IsSCH_ITEM() )
324 continue;
325
326 SCH_ITEM* item = static_cast<SCH_ITEM*>( it.first );
327
328 if( frame && frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
329 {
330 // If we are in the symbol editor, don't use the symbol itself
331 if( item->Type() == LIB_SYMBOL_T )
332 continue;
333 }
334 else
335 {
336 // If we are not in the symbol editor, don't use symbol-editor-private items
337 if( item->IsPrivate() )
338 continue;
339 }
340
341 // The item must be visible and on an active layer
342 if( view->IsVisible( item ) && item->ViewGetLOD( it.second, view ) < view->GetScale() )
343 items.insert ( item );
344 }
345
346 for( EDA_ITEM* skipItem : aSkipList )
347 items.erase( static_cast<SCH_ITEM*>( skipItem ) );
348
349 return items;
350}
351
352
354{
355 GRID_HELPER_GRIDS grid = GetItemGrid( aSelection.Front() );
356
357 // Find the largest grid of all the items and use that
358 for( EDA_ITEM* item : aSelection )
359 {
360 GRID_HELPER_GRIDS itemGrid = GetItemGrid( item );
361
362 if( GetGridSize( itemGrid ) > GetGridSize( grid ) )
363 grid = itemGrid;
364 }
365
366 return grid;
367}
368
369
371{
372 if( !aItem )
373 return GRID_CURRENT;
374
375 switch( aItem->Type() )
376 {
377 case LIB_SYMBOL_T:
378 case SCH_SYMBOL_T:
379 case SCH_PIN_T:
380 case SCH_SHEET_PIN_T:
381 case SCH_SHEET_T:
382 case SCH_NO_CONNECT_T:
384 case SCH_HIER_LABEL_T:
385 case SCH_LABEL_T:
387 case SCH_RULE_AREA_T:
388 return GRID_CONNECTABLE;
389
390 case SCH_FIELD_T:
391 case SCH_TEXT_T:
392 return GRID_TEXT;
393
394 case SCH_SHAPE_T:
395 // The text box's border lines are what need to be on the graphic grid
396 case SCH_TEXTBOX_T:
397 case SCH_BITMAP_T:
398 return GRID_GRAPHICS;
399
400 case SCH_JUNCTION_T:
401 return GRID_WIRES;
402
403 case SCH_LINE_T:
404 if( static_cast<const SCH_LINE*>( aItem )->IsConnectable() )
405 return GRID_WIRES;
406 else
407 return GRID_GRAPHICS;
408
411 return GRID_WIRES;
412
413 // Groups need to get the grid of their children
414 case SCH_GROUP_T:
415 {
416 const SCH_GROUP* group = static_cast<const SCH_GROUP*>( aItem );
417
418 // Shouldn't happen
419 if( group->GetItems().empty() )
420 return GRID_CURRENT;
421
422 GRID_HELPER_GRIDS grid = GetItemGrid( *group->GetItems().begin() );
423
424 for( EDA_ITEM* item : static_cast<const SCH_GROUP*>( aItem )->GetItems() )
425 {
426 GRID_HELPER_GRIDS itemGrid = GetItemGrid( item );
427
428 if( GetGridSize( itemGrid ) > GetGridSize( grid ) )
429 grid = itemGrid;
430 }
431
432 return grid;
433 }
434
435 default:
436 return GRID_CURRENT;
437 }
438}
439
440
441void EE_GRID_HELPER::computeAnchors( SCH_ITEM *aItem, const VECTOR2I &aRefPos, bool aFrom,
442 bool aIncludeText )
443{
444 bool isGraphicLine =
445 aItem->Type() == SCH_LINE_T && static_cast<SCH_LINE*>( aItem )->IsGraphicLine();
446
447 switch( aItem->Type() )
448 {
449 case SCH_TEXT_T:
450 case SCH_FIELD_T:
451 {
452 if( aIncludeText )
453 addAnchor( aItem->GetPosition(), ORIGIN, aItem );
454
455 break;
456 }
457
458 case SCH_TABLE_T:
459 {
460 if( aIncludeText )
461 {
462 addAnchor( aItem->GetPosition(), SNAPPABLE | CORNER, aItem );
463 addAnchor( static_cast<SCH_TABLE*>( aItem )->GetEnd(), SNAPPABLE | CORNER, aItem );
464 }
465
466 break;
467 }
468
469 case SCH_TEXTBOX_T:
470 case SCH_TABLECELL_T:
471 {
472 if( aIncludeText )
473 {
474 addAnchor( aItem->GetPosition(), SNAPPABLE | CORNER, aItem );
475 addAnchor( static_cast<SCH_SHAPE*>( aItem )->GetEnd(), SNAPPABLE | CORNER, aItem );
476 }
477
478 break;
479 }
480
481 case SCH_SYMBOL_T:
482 case SCH_SHEET_T:
483 addAnchor( aItem->GetPosition(), ORIGIN, aItem );
485
486 case SCH_JUNCTION_T:
487 case SCH_NO_CONNECT_T:
488 case SCH_LINE_T:
489 // Don't add anchors for graphic lines unless we're including text,
490 // they may be on a non-connectable grid
491 if( isGraphicLine && !aIncludeText )
492 break;
493
496 case SCH_HIER_LABEL_T:
497 case SCH_LABEL_T:
500 case SCH_SHEET_PIN_T:
501 {
502 std::vector<VECTOR2I> pts = aItem->GetConnectionPoints();
503
504 for( const VECTOR2I& pt : pts )
505 addAnchor( VECTOR2I( pt ), SNAPPABLE | CORNER, aItem );
506
507 break;
508 }
509 case SCH_PIN_T:
510 {
511 SCH_PIN* pin = static_cast<SCH_PIN*>( aItem );
512 addAnchor( pin->GetPosition(), SNAPPABLE | ORIGIN, aItem );
513 break;
514 }
515
516 case SCH_GROUP_T:
517 for( EDA_ITEM* item : static_cast<SCH_GROUP*>( aItem )->GetItems() )
518 {
519 computeAnchors( static_cast<SCH_ITEM*>( item ), aRefPos, aFrom, aIncludeText );
520 }
521
522 break;
523
524 default:
525 break;
526 }
527
528 // Don't add anchors for graphic lines unless we're including text,
529 // they may be on a non-connectable grid
530 if( aItem->Type() == SCH_LINE_T && ( aIncludeText || !isGraphicLine ) )
531 {
532 SCH_LINE* line = static_cast<SCH_LINE*>( aItem );
533 VECTOR2I pt = Align( aRefPos );
534
535 if( line->GetStartPoint().x == line->GetEndPoint().x )
536 {
537 VECTOR2I possible( line->GetStartPoint().x, pt.y );
538
539 if( TestSegmentHit( possible, line->GetStartPoint(), line->GetEndPoint(), 0 ) )
540 addAnchor( possible, SNAPPABLE | VERTICAL, aItem );
541 }
542 else if( line->GetStartPoint().y == line->GetEndPoint().y )
543 {
544 VECTOR2I possible( pt.x, line->GetStartPoint().y );
545
546 if( TestSegmentHit( possible, line->GetStartPoint(), line->GetEndPoint(), 0 ) )
547 addAnchor( possible, SNAPPABLE | HORIZONTAL, aItem );
548 }
549 }
550}
551
552
554 GRID_HELPER_GRIDS aGrid )
555{
556 double minDist = std::numeric_limits<double>::max();
557 ANCHOR* best = nullptr;
558
559 for( ANCHOR& a : m_anchors )
560 {
561 if( ( aFlags & a.flags ) != aFlags )
562 continue;
563
564 // A "virtual" anchor with no real items associated shouldn't be filtered out
565 if( !a.items.empty() )
566 {
567 // Filter using the first item
568 SCH_ITEM* item = static_cast<SCH_ITEM*>( a.items[0] );
569
570 if( aGrid == GRID_CONNECTABLE && !item->IsConnectable() )
571 continue;
572 else if( aGrid == GRID_GRAPHICS && item->IsConnectable() )
573 continue;
574 }
575
576 double dist = a.Distance( aPos );
577
578 if( dist < minDist )
579 {
580 minDist = dist;
581 best = &a;
582 }
583 }
584
585 return best;
586}
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:114
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
bool IsType(FRAME_T aType) const
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:99
virtual VECTOR2I GetPosition() const
Definition eda_item.h:278
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:111
GRID_HELPER_GRIDS GetSelectionGrid(const SELECTION &aItem) const override
Gets the coarsest grid that applies to a selecion of items.
~EE_GRID_HELPER() override
GRID_HELPER_GRIDS GetItemGrid(const EDA_ITEM *aItem) const override
Get the coarsest grid that applies to an item.
VECTOR2I BestDragOrigin(const VECTOR2I &aMousePos, GRID_HELPER_GRIDS aGrid, const SCH_SELECTION &aItems)
std::set< SCH_ITEM * > queryVisible(const BOX2I &aArea, const SCH_SELECTION &aSkipList) const
VECTOR2I BestSnapAnchor(const VECTOR2I &aOrigin, GRID_HELPER_GRIDS aGrid, SCH_ITEM *aSkip)
ANCHOR * nearestAnchor(const VECTOR2I &aPos, int aFlags, GRID_HELPER_GRIDS aGrid)
VECTOR2D GetGridSize(GRID_HELPER_GRIDS aGrid) const override
Return the size of the specified grid.
SCH_ITEM * GetSnapped() const
Function GetSnapped If the EE_GRID_HELPER has highlighted a snap point (target shown),...
void computeAnchors(SCH_ITEM *aItem, const VECTOR2I &aRefPos, bool aFrom=false, bool aIncludeText=false)
Insert the local anchor points in to the grid helper for the specified schematic item,...
std::optional< VECTOR2I > SnapToConstructionLines(const VECTOR2I &aPoint, const VECTOR2I &aNearestGrid, const VECTOR2D &aGrid, double aSnapRange) const
void addAnchor(const VECTOR2I &aPos, int aFlags, EDA_ITEM *aItem, int aPointTypes=POINT_TYPE::PT_NONE)
SNAP_MANAGER & getSnapManager()
VECTOR2I m_skipPoint
void showConstructionGeometry(bool aShow)
TOOL_MANAGER * m_toolMgr
bool m_enableSnapLine
bool m_enableSnap
bool canUseGrid() const
Check whether it is possible to use the grid – this depends both on local grid helper settings and gl...
void clearAnchors()
std::optional< ANCHOR > m_snapItem
KIGFX::ANCHOR_DEBUG * enableAndGetAnchorDebug()
Enable the anchor debug if permitted and return it.
KIGFX::SNAP_INDICATOR m_viewSnapPoint
virtual VECTOR2I Align(const VECTOR2I &aPoint, GRID_HELPER_GRIDS aGrid) const
Definition grid_helper.h:86
KIGFX::ORIGIN_VIEWITEM m_viewAxis
std::vector< ANCHOR > m_anchors
View item to draw debug items for anchors.
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:105
virtual double ViewGetLOD(int aLayer, const VIEW *aView) const
Return the level of detail (LOD) of the item.
Definition view_item.h:155
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:67
double GetScale() const
Definition view.h:277
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition view.cpp:299
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Definition view.cpp:342
int Query(const BOX2I &aRect, std::vector< LAYER_ITEM_PAIR > &aResult) const
Find all visible items that touch or are within the rectangle aRect.
Definition view.cpp:425
std::pair< VIEW_ITEM *, int > LAYER_ITEM_PAIR
Definition view.h:71
bool IsVisible(const VIEW_ITEM *aItem) const
Return information if the item is visible (or not).
Definition view.cpp:1670
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
Definition view.cpp:1627
A set of SCH_ITEMs (i.e., without duplicates).
Definition sch_group.h:52
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:168
virtual bool IsConnectable() const
Definition sch_item.h:527
bool IsPrivate() const
Definition sch_item.h:254
virtual std::vector< VECTOR2I > GetConnectionPoints() const
Add all the connection points for this item to aPoints.
Definition sch_item.h:542
Segment description base class to describe items which have 2 end points (track, wire,...
Definition sch_line.h:42
VECTOR2I GetEndPoint() const
Definition sch_line.h:148
VECTOR2I GetStartPoint() const
Definition sch_line.h:139
virtual void Add(EDA_ITEM *aItem)
Definition selection.cpp:42
EDA_ITEM * Front() const
Definition selection.h:177
void SetSnapLineOrigin(const VECTOR2I &aOrigin)
The snap point is a special point that is located at the last point the cursor snapped to.
void SetSnapLineEnd(const OPT_VECTOR2I &aSnapPoint)
Set the end point of the snap line.
SNAP_LINE_MANAGER & GetSnapLineManager()
Master controller class:
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
Definition vector2d.h:283
#define SNAP_RANGE
@ FRAME_SCH_SYMBOL_EDITOR
Definition frame_type.h:35
GRID_HELPER_GRIDS
Definition grid_helper.h:44
@ GRID_TEXT
Definition grid_helper.h:51
@ GRID_CURRENT
Definition grid_helper.h:46
@ GRID_GRAPHICS
Definition grid_helper.h:52
@ GRID_CONNECTABLE
Definition grid_helper.h:48
@ GRID_WIRES
Definition grid_helper.h:49
@ LAYER_SCHEMATIC_ANCHOR
Definition layer_ids.h:500
This file contains miscellaneous commonly used macros and functions.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition macros.h:83
@ GEOMETRY
Position or shape has changed.
Definition view_item.h:55
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition eda_angle.h:400
Class to handle a set of SCH_ITEMs.
std::optional< VECTOR2I > OPT_VECTOR2I
Definition seg.h:39
double Distance(const VECTOR2I &aP) const
KIBIS_PIN * pin
bool TestSegmentHit(const VECTOR2I &aRefPoint, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
Definition trigo.cpp:175
@ SCH_GROUP_T
Definition typeinfo.h:177
@ SCH_TABLE_T
Definition typeinfo.h:169
@ SCH_LINE_T
Definition typeinfo.h:167
@ LIB_SYMBOL_T
Definition typeinfo.h:152
@ SCH_NO_CONNECT_T
Definition typeinfo.h:164
@ SCH_SYMBOL_T
Definition typeinfo.h:176
@ SCH_TABLECELL_T
Definition typeinfo.h:170
@ SCH_FIELD_T
Definition typeinfo.h:154
@ SCH_DIRECTIVE_LABEL_T
Definition typeinfo.h:175
@ SCH_LABEL_T
Definition typeinfo.h:171
@ SCH_SHEET_T
Definition typeinfo.h:179
@ SCH_SHAPE_T
Definition typeinfo.h:153
@ SCH_RULE_AREA_T
Definition typeinfo.h:174
@ SCH_HIER_LABEL_T
Definition typeinfo.h:173
@ SCH_BUS_BUS_ENTRY_T
Definition typeinfo.h:166
@ SCH_SHEET_PIN_T
Definition typeinfo.h:178
@ SCH_TEXT_T
Definition typeinfo.h:155
@ SCH_BUS_WIRE_ENTRY_T
Definition typeinfo.h:165
@ SCH_BITMAP_T
Definition typeinfo.h:168
@ SCH_TEXTBOX_T
Definition typeinfo.h:156
@ SCH_GLOBAL_LABEL_T
Definition typeinfo.h:172
@ SCH_JUNCTION_T
Definition typeinfo.h:163
@ SCH_PIN_T
Definition typeinfo.h:157
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695
VECTOR2< double > VECTOR2D
Definition vector2d.h:694