KiCad PCB EDA Suite
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  * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
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 #include <functional>
26 using namespace std::placeholders;
27 
28 #include <pcb_edit_frame.h>
29 
30 #include <class_board.h>
31 #include <class_dimension.h>
32 #include <class_draw_panel_gal.h>
33 #include <class_edge_mod.h>
34 #include <class_module.h>
35 #include <class_zone.h>
36 
37 #include <painter.h>
38 #include <view/view.h>
39 #include <view/view_controls.h>
41 
43 
44 #include "grid_helper.h"
45 
46 
48  m_frame( aFrame )
49 {
51  m_enableSnap = true;
52  m_enableGrid = true;
53  m_snapSize = 100;
55 
56  m_viewAxis.SetSize( 20000 );
58  m_viewAxis.SetColor( COLOR4D( 1.0, 1.0, 1.0, 0.4 ) );
59  m_viewAxis.SetDrawAtZero( true );
60  view->Add( &m_viewAxis );
61  view->SetVisible( &m_viewAxis, false );
62 
64  m_viewSnapPoint.SetColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
66  view->Add( &m_viewSnapPoint );
67  view->SetVisible( &m_viewSnapPoint, false );
68 }
69 
70 
72 {
73 }
74 
75 
76 void GRID_HELPER::SetGrid( int aSize )
77 {
78  assert( false );
79 }
80 
81 
82 void GRID_HELPER::SetOrigin( const VECTOR2I& aOrigin )
83 {
84  assert( false );
85 }
86 
87 
89 {
90  PCB_SCREEN* screen = m_frame->GetScreen();
91 
92  const wxRealPoint& size = screen->GetGridSize();
93 
94  return VECTOR2I( KiROUND( size.x ), KiROUND( size.y ) );
95 }
96 
97 
99 {
100  return VECTOR2I( m_frame->GetGridOrigin() );
101 }
102 
103 
104 void GRID_HELPER::SetAuxAxes( bool aEnable, const VECTOR2I& aOrigin, bool aEnableDiagonal )
105 {
106  KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
107 
108  if( aEnable )
109  {
110  m_auxAxis = aOrigin;
111  m_viewAxis.SetPosition( aOrigin );
112  view->SetVisible( &m_viewAxis, true );
113  }
114  else
115  {
117  view->SetVisible( &m_viewAxis, false );
118  }
119 
120  m_diagonalAuxAxesEnable = aEnable;
121 }
122 
123 
124 VECTOR2I GRID_HELPER::Align( const VECTOR2I& aPoint ) const
125 {
126  if( !m_enableGrid )
127  return aPoint;
128 
129  const VECTOR2D gridOffset( GetOrigin() );
130  const VECTOR2D gridSize( GetGrid() );
131 
132  VECTOR2I nearest( KiROUND( ( aPoint.x - gridOffset.x ) / gridSize.x ) * gridSize.x + gridOffset.x,
133  KiROUND( ( aPoint.y - gridOffset.y ) / gridSize.y ) * gridSize.y + gridOffset.y );
134 
135  if( !m_auxAxis )
136  return nearest;
137 
138  if( std::abs( m_auxAxis->x - aPoint.x ) < std::abs( nearest.x - aPoint.x ) )
139  nearest.x = m_auxAxis->x;
140 
141  if( std::abs( m_auxAxis->y - aPoint.y ) < std::abs( nearest.y - aPoint.y ) )
142  nearest.y = m_auxAxis->y;
143 
144  return nearest;
145 }
146 
147 
148 VECTOR2I GRID_HELPER::AlignToSegment( const VECTOR2I& aPoint, const SEG& aSeg )
149 {
150  OPT_VECTOR2I pts[6];
151 
152  if( !m_enableSnap )
153  return aPoint;
154 
155  const VECTOR2D gridOffset( GetOrigin() );
156  const VECTOR2D gridSize( GetGrid() );
157 
158  VECTOR2I nearest( KiROUND( ( aPoint.x - gridOffset.x ) / gridSize.x ) * gridSize.x + gridOffset.x,
159  KiROUND( ( aPoint.y - gridOffset.y ) / gridSize.y ) * gridSize.y + gridOffset.y );
160 
161  pts[0] = aSeg.A;
162  pts[1] = aSeg.B;
163  pts[2] = aSeg.IntersectLines( SEG( nearest, nearest + VECTOR2I( 1, 0 ) ) );
164  pts[3] = aSeg.IntersectLines( SEG( nearest, nearest + VECTOR2I( 0, 1 ) ) );
165 
166  int min_d = std::numeric_limits<int>::max();
167 
168  for( int i = 0; i < 4; i++ )
169  {
170  if( pts[i] && aSeg.Contains( *pts[i] ) )
171  {
172  int d = (*pts[i] - aPoint).EuclideanNorm();
173 
174  if( d < min_d )
175  {
176  min_d = d;
177  nearest = *pts[i];
178  }
179  }
180  }
181 
182  return nearest;
183 }
184 
185 
187 {
188  clearAnchors();
189  computeAnchors( aItem, aMousePos );
190 
191  double worldScale = m_frame->GetGalCanvas()->GetGAL()->GetWorldScale();
192  double lineSnapMinCornerDistance = 50.0 / worldScale;
193 
194  ANCHOR* nearestOutline = nearestAnchor( aMousePos, OUTLINE, LSET::AllLayersMask() );
195  ANCHOR* nearestCorner = nearestAnchor( aMousePos, CORNER, LSET::AllLayersMask() );
196  ANCHOR* nearestOrigin = nearestAnchor( aMousePos, ORIGIN, LSET::AllLayersMask() );
197  ANCHOR* best = NULL;
198  double minDist = std::numeric_limits<double>::max();
199 
200  if( nearestOrigin )
201  {
202  minDist = nearestOrigin->Distance( aMousePos );
203  best = nearestOrigin;
204  }
205 
206  if( nearestCorner )
207  {
208  double dist = nearestCorner->Distance( aMousePos );
209 
210  if( dist < minDist )
211  {
212  minDist = dist;
213  best = nearestCorner;
214  }
215  }
216 
217  if( nearestOutline )
218  {
219  double dist = nearestOutline->Distance( aMousePos );
220 
221  if( minDist > lineSnapMinCornerDistance && dist < minDist )
222  best = nearestOutline;
223  }
224 
225  return best ? best->pos : aMousePos;
226 }
227 
228 
229 std::set<BOARD_ITEM*> GRID_HELPER::queryVisible( const BOX2I& aArea,
230  const std::vector<BOARD_ITEM*> aSkip ) const
231 {
232  std::set<BOARD_ITEM*> items;
233  std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> selectedItems;
234 
235  auto view = m_frame->GetGalCanvas()->GetView();
236  auto activeLayers = view->GetPainter()->GetSettings()->GetActiveLayers();
237  bool isHighContrast = view->GetPainter()->GetSettings()->GetHighContrast();
238  view->Query( aArea, selectedItems );
239 
240  for( auto it : selectedItems )
241  {
242  BOARD_ITEM* item = static_cast<BOARD_ITEM*>( it.first );
243 
244  // The item must be visible and on an active layer
245  if( view->IsVisible( item )
246  && ( !isHighContrast || activeLayers.count( it.second ) ) )
247  items.insert ( item );
248  }
249 
250 
251  for( auto ii : aSkip )
252  items.erase( ii );
253 
254  return items;
255 }
256 
257 
258 VECTOR2I GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, BOARD_ITEM* aDraggedItem )
259 {
260  LSET layers;
261  std::vector<BOARD_ITEM*> item;
262 
263  if( aDraggedItem )
264  {
265  layers = aDraggedItem->GetLayerSet();
266  item.push_back( aDraggedItem );
267  }
268  else
269  layers = LSET::AllLayersMask();
270 
271  return BestSnapAnchor( aOrigin, layers, item );
272 }
273 
274 
275 VECTOR2I GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, const LSET& aLayers,
276  const std::vector<BOARD_ITEM*> aSkip )
277 {
278  double worldScale = m_frame->GetGalCanvas()->GetGAL()->GetWorldScale();
279  int snapRange = (int) ( m_snapSize / worldScale );
280 
281  BOX2I bb( VECTOR2I( aOrigin.x - snapRange / 2, aOrigin.y - snapRange / 2 ), VECTOR2I( snapRange, snapRange ) );
282 
283  clearAnchors();
284 
285  for( BOARD_ITEM* item : queryVisible( bb, aSkip ) )
286  {
287  computeAnchors( item, aOrigin );
288  }
289 
290  ANCHOR* nearest = nearestAnchor( aOrigin, SNAPPABLE, aLayers );
291  VECTOR2I nearestGrid = Align( aOrigin );
292  double gridDist = ( nearestGrid - aOrigin ).EuclideanNorm();
293 
294  if( nearest && m_enableSnap )
295  {
296  double snapDist = nearest->Distance( aOrigin );
297 
298  if( !m_enableGrid || snapDist <= gridDist )
299  {
300  m_viewSnapPoint.SetPosition( nearest->pos );
301 
304  else
306 
307  return nearest->pos;
308  }
309  }
310 
312  return nearestGrid;
313 }
314 
315 
316 void GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos )
317 {
318  VECTOR2I origin;
319 
320  switch( aItem->Type() )
321  {
322  case PCB_MODULE_T:
323  {
324  MODULE* mod = static_cast<MODULE*>( aItem );
325 
326  for( auto pad : mod->Pads() )
327  {
328  if( pad->GetBoundingBox().Contains( wxPoint( aRefPos.x, aRefPos.y ) ) )
329  {
330  addAnchor( pad->GetPosition(), CORNER | SNAPPABLE, pad );
331  break;
332  }
333  }
334 
335  // if the cursor is not over a pad, then drag the module by its origin
336  addAnchor( mod->GetPosition(), ORIGIN | SNAPPABLE, mod );
337  break;
338  }
339 
340  case PCB_PAD_T:
341  {
342  D_PAD* pad = static_cast<D_PAD*>( aItem );
343  addAnchor( pad->GetPosition(), CORNER | SNAPPABLE, pad );
344  break;
345  }
346 
347  case PCB_MODULE_EDGE_T:
348  case PCB_LINE_T:
349  {
350  DRAWSEGMENT* dseg = static_cast<DRAWSEGMENT*>( aItem );
351  VECTOR2I start = dseg->GetStart();
352  VECTOR2I end = dseg->GetEnd();
353 
354  switch( dseg->GetShape() )
355  {
356  case S_CIRCLE:
357  {
358  int r = ( start - end ).EuclideanNorm();
359 
360  addAnchor( start, ORIGIN | SNAPPABLE, dseg );
361  addAnchor( start + VECTOR2I( -r, 0 ), OUTLINE | SNAPPABLE, dseg );
362  addAnchor( start + VECTOR2I( r, 0 ), OUTLINE | SNAPPABLE, dseg );
363  addAnchor( start + VECTOR2I( 0, -r ), OUTLINE | SNAPPABLE, dseg );
364  addAnchor( start + VECTOR2I( 0, r ), OUTLINE | SNAPPABLE, dseg );
365  break;
366  }
367 
368  case S_ARC:
369  origin = dseg->GetCenter();
370  addAnchor( dseg->GetArcStart(), CORNER | SNAPPABLE, dseg );
371  addAnchor( dseg->GetArcEnd(), CORNER | SNAPPABLE, dseg );
372  addAnchor( origin, ORIGIN | SNAPPABLE, dseg );
373  break;
374 
375  case S_RECT:
376  addAnchor( start, CORNER | SNAPPABLE, dseg );
377  addAnchor( VECTOR2I( end.x, start.y ), CORNER | SNAPPABLE, dseg );
378  addAnchor( VECTOR2I( start.x, end.y ), CORNER | SNAPPABLE, dseg );
379  addAnchor( end, CORNER | SNAPPABLE, dseg );
380  break;
381 
382  case S_SEGMENT:
383  origin.x = start.x + ( start.x - end.x ) / 2;
384  origin.y = start.y + ( start.y - end.y ) / 2;
385  addAnchor( start, CORNER | SNAPPABLE, dseg );
386  addAnchor( end, CORNER | SNAPPABLE, dseg );
387  addAnchor( origin, ORIGIN, dseg );
388  break;
389 
390  case S_POLYGON:
391  for( const auto& p : dseg->BuildPolyPointsList() )
392  addAnchor( p, CORNER | SNAPPABLE, dseg );
393 
394  break;
395 
396  case S_CURVE:
397  addAnchor( start, CORNER | SNAPPABLE, dseg );
398  addAnchor( end, CORNER | SNAPPABLE, dseg );
399  //Fallthrough
400  default:
401  origin = dseg->GetStart();
402  addAnchor( origin, ORIGIN | SNAPPABLE, dseg );
403  break;
404  }
405  break;
406  }
407 
408  case PCB_TRACE_T:
409  {
410  TRACK* track = static_cast<TRACK*>( aItem );
411  VECTOR2I start = track->GetStart();
412  VECTOR2I end = track->GetEnd();
413  origin.x = start.x + ( start.x - end.x ) / 2;
414  origin.y = start.y + ( start.y - end.y ) / 2;
415  addAnchor( start, CORNER | SNAPPABLE, track );
416  addAnchor( end, CORNER | SNAPPABLE, track );
417  addAnchor( origin, ORIGIN, track);
418  break;
419  }
420 
421  case PCB_MARKER_T:
422  case PCB_TARGET_T:
423  case PCB_VIA_T:
424  addAnchor( aItem->GetPosition(), ORIGIN | CORNER | SNAPPABLE, aItem );
425  break;
426 
427  case PCB_ZONE_AREA_T:
428  {
429  const SHAPE_POLY_SET* outline = static_cast<const ZONE_CONTAINER*>( aItem )->Outline();
430 
431  SHAPE_LINE_CHAIN lc;
432  lc.SetClosed( true );
433 
434  for( auto iter = outline->CIterateWithHoles(); iter; iter++ )
435  {
436  addAnchor( *iter, CORNER, aItem );
437  lc.Append( *iter );
438  }
439 
440  addAnchor( lc.NearestPoint( aRefPos ), OUTLINE, aItem );
441 
442  break;
443  }
444 
445  case PCB_DIMENSION_T:
446  {
447  const DIMENSION* dim = static_cast<const DIMENSION*>( aItem );
448  addAnchor( dim->m_crossBarF, CORNER | SNAPPABLE, aItem );
449  addAnchor( dim->m_crossBarO, CORNER | SNAPPABLE, aItem );
450  addAnchor( dim->m_featureLineGO, CORNER | SNAPPABLE, aItem );
451  addAnchor( dim->m_featureLineDO, CORNER | SNAPPABLE, aItem );
452  break;
453  }
454 
455  case PCB_MODULE_TEXT_T:
456  case PCB_TEXT_T:
457  addAnchor( aItem->GetPosition(), ORIGIN, aItem );
458  break;
459 
460  default:
461  break;
462  }
463 }
464 
465 
466 GRID_HELPER::ANCHOR* GRID_HELPER::nearestAnchor( const VECTOR2I& aPos, int aFlags, LSET aMatchLayers )
467 {
468  double minDist = std::numeric_limits<double>::max();
469  ANCHOR* best = NULL;
470 
471  for( ANCHOR& a : m_anchors )
472  {
473  if( ( aMatchLayers & a.item->GetLayerSet() ) == 0 )
474  continue;
475 
476  if( ( aFlags & a.flags ) != aFlags )
477  continue;
478 
479  double dist = a.Distance( aPos );
480 
481  if( dist < minDist )
482  {
483  minDist = dist;
484  best = &a;
485  }
486  }
487 
488  return best;
489 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:112
VECTOR2I BestDragOrigin(const VECTOR2I &aMousePos, BOARD_ITEM *aItem)
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
OPT< VECTOR2I > m_auxAxis
Definition: grid_helper.h:116
const std::vector< wxPoint > BuildPolyPointsList() const
Build and return the list of corners in a std::vector<wxPoint> It must be used only to convert the SH...
static const int dist[10][10]
Definition: ar_matrix.cpp:320
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:120
wxPoint m_crossBarF
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
void SetGrid(int aSize)
Definition: grid_helper.cpp:76
const wxPoint GetCenter() const override
Function GetCenter()
double GetWorldScale() const
Get the world scale.
VECTOR2I Align(const VECTOR2I &aPoint) const
VIEW_CONTROLS class definition.
GRID_HELPER(PCB_BASE_FRAME *aFrame)
Definition: grid_helper.cpp:47
Class BOARD to handle a board.
OPT_VECTOR2I IntersectLines(const SEG &aSeg) const
Function IntersectLines()
Definition: seg.h:179
polygon (not yet used for tracks, but could be in microwave apps)
CONST_ITERATOR CIterateWithHoles(int aOutline) const
KIGFX::ORIGIN_VIEWITEM m_viewAxis
Definition: grid_helper.h:124
const wxPoint & GetGridOrigin() const override
Return the absolute coordinates of the origin of the snap grid.
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:102
DLIST_ITERATOR_WRAPPER< D_PAD > Pads()
Definition: class_module.h:169
VECTOR2I AlignToSegment(const VECTOR2I &aPoint, const SEG &aSeg)
bool m_diagonalAuxAxesEnable
If true, use the aux axis for snapping as well.
Definition: grid_helper.h:118
const VECTOR2I NearestPoint(const VECTOR2I &aP) const
Function NearestPoint()
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:92
Classes to handle copper zones.
usual segment : line with rounded ends
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
VECTOR2I BestSnapAnchor(const VECTOR2I &aOrigin, BOARD_ITEM *aDraggedItem)
VECTOR2I GetGrid() const
Definition: grid_helper.cpp:88
void SetOrigin(const VECTOR2I &aOrigin)
Definition: grid_helper.cpp:82
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
#define abs(a)
Definition: auxiliary.h:84
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
const wxPoint & GetEnd() const
Definition: class_track.h:119
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
double Distance(const VECTOR2I &aP) const
Definition: grid_helper.h:90
const wxPoint & GetArcStart() const
wxPoint m_featureLineGO
KIGFX::ORIGIN_VIEWITEM m_viewSnapPoint
Definition: grid_helper.h:123
DIMENSION class definition.
segment with non rounded ends
class MODULE, a footprint
Definition: typeinfo.h:89
void SetClosed(bool aClosed)
Function SetClosed()
KIGFX::GAL * GetGAL() const
Function GetGAL() Returns a pointer to the GAL instance used in the panel.
STROKE_T GetShape() const
Class LSET is a set of PCB_LAYER_IDs.
ANCHOR * nearestAnchor(const VECTOR2I &aPos, int aFlags, LSET aMatchLayers)
const wxPoint & GetEnd() const
Function GetEnd returns the ending point of the graphic.
OPT< VECTOR2I > OPT_VECTOR2I
Definition: seg.h:34
std::set< BOARD_ITEM * > queryVisible(const BOX2I &aArea, const std::vector< BOARD_ITEM * > aSkip) const
void SetPosition(const VECTOR2D &aPosition)
Class SHAPE_POLY_SET.
const wxPoint & GetStart() const
Definition: class_track.h:122
void SetSize(int aSize)
Arcs (with rounded ends)
void SetDrawAtZero(bool aDrawFlag)
Function SetDrawAtZero() Set the draw at zero flag.
virtual LSET GetLayerSet() const
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
VECTOR2I GetOrigin() const
Definition: grid_helper.cpp:98
static LSET AllLayersMask()
Definition: lset.cpp:710
bool m_enableSnap
If true, allow snapping to other items on the layers.
Definition: grid_helper.h:119
Bezier Curve.
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1521
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:100
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:101
virtual const wxPoint GetPosition() const =0
void addAnchor(const VECTOR2I &aPos, int aFlags=CORNER|SNAPPABLE, BOARD_ITEM *aItem=NULL)
Definition: grid_helper.h:101
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
Definition: seg.h:36
virtual RENDER_SETTINGS * GetSettings()=0
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:99
#define max(a, b)
Definition: auxiliary.h:86
Class SHAPE_LINE_CHAIN.
PCB_BASE_FRAME * m_frame
Definition: grid_helper.h:115
size_t i
Definition: json11.cpp:597
const wxPoint GetArcEnd() const
const wxRealPoint & GetGridSize() const
Return the grid size of the currently selected grid.
Definition: base_screen.h:410
VECTOR2I A
Definition: seg.h:46
int m_snapSize
Sets the radius in screen units for snapping to items.
Definition: grid_helper.h:121
void SetColor(const KIGFX::COLOR4D &aColor)
void SetAuxAxes(bool aEnable, const VECTOR2I &aOrigin=VECTOR2I(0, 0), bool aEnableDiagonal=false)
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void computeAnchors(BOARD_ITEM *aItem, const VECTOR2I &aRefPos)
boost::optional< T > OPT
Definition: optional.h:7
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Sets the item visibility.
Definition: view.cpp:1467
wxPoint m_crossBarO
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:921
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
bool m_enableGrid
If true, allow snapping to grid.
Definition: grid_helper.h:120
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:335
Module description (excepted pads)
Class VIEW.
Definition: view.h:61
bool IsVisible(const VIEW_ITEM *aItem) const
Returns information if the item is visible (or not).
Definition: view.cpp:1507
void SetStyle(MARKER_STYLE aStyle)
const wxPoint GetPosition() const override
Definition: class_pad.h:220
EDGE_MODULE class definition.
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:91
bool Contains(const VECTOR2I &aP) const
Definition: seg.cpp:155
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
std::vector< ANCHOR > m_anchors
Definition: grid_helper.h:96
wxPoint m_featureLineDO
const wxPoint GetPosition() const override
Definition: class_module.h:184
#define mod(a, n)
Definition: greymap.cpp:24
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
Class DIMENSION.
void clearAnchors()
Definition: grid_helper.h:110
Color has changed.
Definition: view_item.h:57
const std::set< unsigned int > GetActiveLayers()
Function GetActiveLayers() Returns the set of currently active layers.
Definition: painter.h:89
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
VECTOR2I B
Definition: seg.h:47