KiCad PCB EDA Suite
GRID_HELPER Class Reference

#include <grid_helper.h>

Classes

struct  ANCHOR
 

Public Member Functions

 GRID_HELPER (PCB_BASE_FRAME *aFrame)
 
 ~GRID_HELPER ()
 
VECTOR2I GetGrid () const
 
VECTOR2I GetOrigin () const
 
BOARD_ITEMGetSnapped () const
 Function GetSnapped If the GRID_HELPER has highlighted a snap point (target shown), this function will return a pointer to the item to which it snapped. More...
 
void SetAuxAxes (bool aEnable, const VECTOR2I &aOrigin=VECTOR2I(0, 0))
 
VECTOR2I Align (const VECTOR2I &aPoint) const
 
VECTOR2I AlignToSegment (const VECTOR2I &aPoint, const SEG &aSeg)
 
VECTOR2I BestDragOrigin (const VECTOR2I &aMousePos, std::vector< BOARD_ITEM * > &aItem)
 
VECTOR2I BestSnapAnchor (const VECTOR2I &aOrigin, BOARD_ITEM *aDraggedItem)
 
VECTOR2I BestSnapAnchor (const VECTOR2I &aOrigin, const LSET &aLayers, const std::vector< BOARD_ITEM * > &aSkip={})
 
void SetSkipPoint (const VECTOR2I &aPoint)
 
void ClearSkipPoint ()
 We clear the skip point by setting it to an unreachable position, thereby preventing matching. More...
 
void SetSnap (bool aSnap)
 
void SetSnapLine (bool aSnap)
 
void SetUseGrid (bool aGrid=true)
 

Private Types

enum  ANCHOR_FLAGS { CORNER = 0x1, OUTLINE = 0x2, SNAPPABLE = 0x4, ORIGIN = 0x8 }
 

Private Member Functions

std::set< BOARD_ITEM * > queryVisible (const BOX2I &aArea, const std::vector< BOARD_ITEM * > &aSkip) const
 
void addAnchor (const VECTOR2I &aPos, int aFlags, BOARD_ITEM *aItem)
 
ANCHORnearestAnchor (const VECTOR2I &aPos, int aFlags, LSET aMatchLayers)
 
void computeAnchors (BOARD_ITEM *aItem, const VECTOR2I &aRefPos, bool aFrom=false)
 computeAnchors inserts the local anchor points in to the grid helper for the specified board item, given the reference point and the direction of use for the point. More...
 
void clearAnchors ()
 

Private Attributes

std::vector< ANCHORm_anchors
 
PCB_BASE_FRAMEm_frame
 
OPT< VECTOR2Im_auxAxis
 
bool m_enableSnap
 If true, allow snapping to other items on the layers. More...
 
bool m_enableGrid
 If true, allow snapping to grid. More...
 
bool m_enableSnapLine
 If true, allow drawing lines from snap points. More...
 
int m_snapSize
 Sets the radius in screen units for snapping to items. More...
 
ANCHORm_snapItem
 Pointer to the currently snapped item in m_anchors (NULL if not snapped) More...
 
VECTOR2I m_skipPoint
 When drawing a line, we avoid snapping to the source point. More...
 
KIGFX::ORIGIN_VIEWITEM m_viewSnapPoint
 
KIGFX::ORIGIN_VIEWITEM m_viewSnapLine
 
KIGFX::ORIGIN_VIEWITEM m_viewAxis
 

Detailed Description

Definition at line 38 of file grid_helper.h.

Member Enumeration Documentation

◆ ANCHOR_FLAGS

Enumerator
CORNER 
OUTLINE 
SNAPPABLE 
ORIGIN 

Definition at line 96 of file grid_helper.h.

96  {
97  CORNER = 0x1,
98  OUTLINE = 0x2,
99  SNAPPABLE = 0x4,
100  ORIGIN = 0x8
101  };

Constructor & Destructor Documentation

◆ GRID_HELPER()

GRID_HELPER::GRID_HELPER ( PCB_BASE_FRAME aFrame)

Definition at line 49 of file grid_helper.cpp.

49  :
50  m_frame( aFrame )
51 {
52  m_enableSnap = true;
53  m_enableGrid = true;
54  m_enableSnapLine = true;
55  m_snapSize = 100;
56  m_snapItem = nullptr;
57  KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
58 
59  m_viewAxis.SetSize( 20000 );
61  m_viewAxis.SetColor( COLOR4D( 1.0, 1.0, 1.0, 0.4 ) );
62  m_viewAxis.SetDrawAtZero( true );
63  view->Add( &m_viewAxis );
64  view->SetVisible( &m_viewAxis, false );
65 
67  m_viewSnapPoint.SetColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
69  view->Add( &m_viewSnapPoint );
70  view->SetVisible( &m_viewSnapPoint, false );
71 
73  m_viewSnapLine.SetColor( COLOR4D( 0.33, 0.55, 0.95, 1.0 ) );
75  view->Add( &m_viewSnapLine );
76  view->SetVisible( &m_viewSnapLine, false );
77 }
ANCHOR * m_snapItem
Pointer to the currently snapped item in m_anchors (NULL if not snapped)
Definition: grid_helper.h:155
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
KIGFX::ORIGIN_VIEWITEM m_viewAxis
Definition: grid_helper.h:160
KIGFX::ORIGIN_VIEWITEM m_viewSnapPoint
Definition: grid_helper.h:158
void SetSize(int aSize)
void SetDrawAtZero(bool aDrawFlag)
Function SetDrawAtZero() Set the draw at zero flag.
bool m_enableSnap
If true, allow snapping to other items on the layers.
Definition: grid_helper.h:151
bool m_enableSnapLine
If true, allow drawing lines from snap points.
Definition: grid_helper.h:153
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
PCB_BASE_FRAME * m_frame
Definition: grid_helper.h:148
int m_snapSize
Sets the radius in screen units for snapping to items.
Definition: grid_helper.h:154
void SetColor(const KIGFX::COLOR4D &aColor)
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Sets the item visibility.
Definition: view.cpp:1486
bool m_enableGrid
If true, allow snapping to grid.
Definition: grid_helper.h:152
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:346
KIGFX::ORIGIN_VIEWITEM m_viewSnapLine
Definition: grid_helper.h:159
VIEW.
Definition: view.h:61
void SetStyle(MARKER_STYLE aStyle)
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References KIGFX::VIEW::Add(), KIGFX::ORIGIN_VIEWITEM::CIRCLE_CROSS, KIGFX::ORIGIN_VIEWITEM::CROSS, KIGFX::ORIGIN_VIEWITEM::DASH_LINE, PCB_BASE_FRAME::GetCanvas(), PCB_DRAW_PANEL_GAL::GetView(), m_enableGrid, m_enableSnap, m_enableSnapLine, m_frame, m_snapItem, m_snapSize, m_viewAxis, m_viewSnapLine, m_viewSnapPoint, KIGFX::ORIGIN_VIEWITEM::SetColor(), KIGFX::ORIGIN_VIEWITEM::SetDrawAtZero(), KIGFX::ORIGIN_VIEWITEM::SetSize(), KIGFX::ORIGIN_VIEWITEM::SetStyle(), and KIGFX::VIEW::SetVisible().

◆ ~GRID_HELPER()

GRID_HELPER::~GRID_HELPER ( )

Definition at line 80 of file grid_helper.cpp.

81 {
82 }

Member Function Documentation

◆ addAnchor()

void GRID_HELPER::addAnchor ( const VECTOR2I aPos,
int  aFlags,
BOARD_ITEM aItem 
)
inlineprivate

Definition at line 126 of file grid_helper.h.

127  {
128  m_anchors.emplace_back( ANCHOR( aPos, aFlags, aItem ) );
129  }
std::vector< ANCHOR > m_anchors
Definition: grid_helper.h:121

References m_anchors.

Referenced by computeAnchors().

◆ Align()

VECTOR2I GRID_HELPER::Align ( const VECTOR2I aPoint) const

Definition at line 117 of file grid_helper.cpp.

118 {
119  if( !m_enableGrid )
120  return aPoint;
121 
122  const VECTOR2D gridOffset( GetOrigin() );
123  const VECTOR2D grid( GetGrid() );
124 
125  VECTOR2I nearest( KiROUND( ( aPoint.x - gridOffset.x ) / grid.x ) * grid.x + gridOffset.x,
126  KiROUND( ( aPoint.y - gridOffset.y ) / grid.y ) * grid.y + gridOffset.y );
127 
128  if( !m_auxAxis )
129  return nearest;
130 
131  if( std::abs( m_auxAxis->x - aPoint.x ) < std::abs( nearest.x - aPoint.x ) )
132  nearest.x = m_auxAxis->x;
133 
134  if( std::abs( m_auxAxis->y - aPoint.y ) < std::abs( nearest.y - aPoint.y ) )
135  nearest.y = m_auxAxis->y;
136 
137  return nearest;
138 }
OPT< VECTOR2I > m_auxAxis
Definition: grid_helper.h:149
VECTOR2I GetOrigin() const
Definition: grid_helper.cpp:95
VECTOR2I GetGrid() const
Definition: grid_helper.cpp:85
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
bool m_enableGrid
If true, allow snapping to grid.
Definition: grid_helper.h:152

References GetGrid(), GetOrigin(), KiROUND(), m_auxAxis, m_enableGrid, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BestSnapAnchor(), PNS::TOOL_BASE::snapToItem(), and PNS::TOOL_BASE::updateEndItem().

◆ AlignToSegment()

VECTOR2I GRID_HELPER::AlignToSegment ( const VECTOR2I aPoint,
const SEG aSeg 
)

Definition at line 141 of file grid_helper.cpp.

142 {
143  OPT_VECTOR2I pts[6];
144 
145  if( !m_enableSnap )
146  return aPoint;
147 
148  const VECTOR2D gridOffset( GetOrigin() );
149  const VECTOR2D gridSize( GetGrid() );
150 
151  VECTOR2I nearest( KiROUND( ( aPoint.x - gridOffset.x ) / gridSize.x ) * gridSize.x + gridOffset.x,
152  KiROUND( ( aPoint.y - gridOffset.y ) / gridSize.y ) * gridSize.y + gridOffset.y );
153 
154  pts[0] = aSeg.A;
155  pts[1] = aSeg.B;
156  pts[2] = aSeg.IntersectLines( SEG( nearest + VECTOR2I( -1, 1 ), nearest + VECTOR2I( 1, -1 ) ) );
157  pts[3] = aSeg.IntersectLines( SEG( nearest + VECTOR2I( -1, -1 ), nearest + VECTOR2I( 1, 1 ) ) );
158 
159  int min_d = std::numeric_limits<int>::max();
160 
161  for( int i = 0; i < 4; i++ )
162  {
163  if( pts[i] && aSeg.Contains( *pts[i] ) )
164  {
165  int d = (*pts[i] - aPoint).EuclideanNorm();
166 
167  if( d < min_d )
168  {
169  min_d = d;
170  nearest = *pts[i];
171  }
172  }
173  }
174 
175  return nearest;
176 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:123
VECTOR2I GetOrigin() const
Definition: grid_helper.cpp:95
OPT_VECTOR2I IntersectLines(const SEG &aSeg) const
Function IntersectLines()
Definition: seg.h:186
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
VECTOR2I GetGrid() const
Definition: grid_helper.cpp:85
OPT< VECTOR2I > OPT_VECTOR2I
Definition: seg.h:37
bool Contains(const VECTOR2I &aP) const
Definition: seg.cpp:200
bool m_enableSnap
If true, allow snapping to other items on the layers.
Definition: grid_helper.h:151
Definition: seg.h:39
VECTOR2I A
Definition: seg.h:47
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
VECTOR2I B
Definition: seg.h:48

References SEG::A, SEG::B, SEG::Contains(), EuclideanNorm(), GetGrid(), GetOrigin(), SEG::IntersectLines(), KiROUND(), m_enableSnap, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by DRAWING_TOOL::DrawVia(), and PNS::TOOL_BASE::snapToItem().

◆ BestDragOrigin()

VECTOR2I GRID_HELPER::BestDragOrigin ( const VECTOR2I aMousePos,
std::vector< BOARD_ITEM * > &  aItem 
)

Definition at line 179 of file grid_helper.cpp.

180 {
181  clearAnchors();
182 
183  for( auto item : aItems )
184  computeAnchors( item, aMousePos, true );
185 
186  double worldScale = m_frame->GetCanvas()->GetGAL()->GetWorldScale();
187  double lineSnapMinCornerDistance = 50.0 / worldScale;
188 
189  ANCHOR* nearestOutline = nearestAnchor( aMousePos, OUTLINE, LSET::AllLayersMask() );
190  ANCHOR* nearestCorner = nearestAnchor( aMousePos, CORNER, LSET::AllLayersMask() );
191  ANCHOR* nearestOrigin = nearestAnchor( aMousePos, ORIGIN, LSET::AllLayersMask() );
192  ANCHOR* best = NULL;
193  double minDist = std::numeric_limits<double>::max();
194 
195  if( nearestOrigin )
196  {
197  minDist = nearestOrigin->Distance( aMousePos );
198  best = nearestOrigin;
199  }
200 
201  if( nearestCorner )
202  {
203  double dist = nearestCorner->Distance( aMousePos );
204 
205  if( dist < minDist )
206  {
207  minDist = dist;
208  best = nearestCorner;
209  }
210  }
211 
212  if( nearestOutline )
213  {
214  double dist = nearestOutline->Distance( aMousePos );
215 
216  if( minDist > lineSnapMinCornerDistance && dist < minDist )
217  best = nearestOutline;
218  }
219 
220  return best ? best->pos : aMousePos;
221 }
static const int dist[10][10]
Definition: ar_matrix.cpp:326
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void computeAnchors(BOARD_ITEM *aItem, const VECTOR2I &aRefPos, bool aFrom=false)
computeAnchors inserts the local anchor points in to the grid helper for the specified board item,...
ANCHOR * nearestAnchor(const VECTOR2I &aPos, int aFlags, LSET aMatchLayers)
#define NULL
KIGFX::GAL * GetGAL() const
Function GetGAL() Returns a pointer to the GAL instance used in the panel.
static LSET AllLayersMask()
Definition: lset.cpp:723
PCB_BASE_FRAME * m_frame
Definition: grid_helper.h:148
double GetWorldScale() const
Get the world scale.
void clearAnchors()
Definition: grid_helper.h:143

References LSET::AllLayersMask(), clearAnchors(), computeAnchors(), CORNER, dist, GRID_HELPER::ANCHOR::Distance(), PCB_BASE_FRAME::GetCanvas(), EDA_DRAW_PANEL_GAL::GetGAL(), KIGFX::GAL::GetWorldScale(), m_frame, nearestAnchor(), NULL, ORIGIN, OUTLINE, and GRID_HELPER::ANCHOR::pos.

Referenced by EDIT_TOOL::Move().

◆ BestSnapAnchor() [1/2]

VECTOR2I GRID_HELPER::BestSnapAnchor ( const VECTOR2I aOrigin,
BOARD_ITEM aDraggedItem 
)

Definition at line 253 of file grid_helper.cpp.

254 {
255  LSET layers;
256  std::vector<BOARD_ITEM*> item;
257 
258  if( aDraggedItem )
259  {
260  layers = aDraggedItem->GetLayerSet();
261  item.push_back( aDraggedItem );
262  }
263  else
264  layers = LSET::AllLayersMask();
265 
266  return BestSnapAnchor( aOrigin, layers, item );
267 }
VECTOR2I BestSnapAnchor(const VECTOR2I &aOrigin, BOARD_ITEM *aDraggedItem)
LSET is a set of PCB_LAYER_IDs.
static LSET AllLayersMask()
Definition: lset.cpp:723
virtual LSET GetLayerSet() const
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...

References LSET::AllLayersMask(), and BOARD_ITEM::GetLayerSet().

Referenced by DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::DrawZone(), PCBNEW_PICKER_TOOL::Main(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), POINT_EDITOR::OnSelectionChange(), and DRAWING_TOOL::SetAnchor().

◆ BestSnapAnchor() [2/2]

VECTOR2I GRID_HELPER::BestSnapAnchor ( const VECTOR2I aOrigin,
const LSET aLayers,
const std::vector< BOARD_ITEM * > &  aSkip = {} 
)

Definition at line 270 of file grid_helper.cpp.

272 {
273  double worldScale = m_frame->GetCanvas()->GetGAL()->GetWorldScale();
274  int snapRange = (int) ( m_snapSize / worldScale );
275 
276  BOX2I bb( VECTOR2I( aOrigin.x - snapRange / 2, aOrigin.y - snapRange / 2 ), VECTOR2I( snapRange, snapRange ) );
277 
278  clearAnchors();
279 
280  for( BOARD_ITEM* item : queryVisible( bb, aSkip ) )
281  computeAnchors( item, aOrigin );
282 
283  ANCHOR* nearest = nearestAnchor( aOrigin, SNAPPABLE, aLayers );
284  VECTOR2I nearestGrid = Align( aOrigin );
285  double gridDist = ( nearestGrid - aOrigin ).EuclideanNorm();
286 
287  if( nearest && m_enableSnap )
288  {
289  double snapDist = nearest->Distance( aOrigin );
290 
291  if( !m_enableGrid || snapDist <= gridDist )
292  {
293  m_viewSnapPoint.SetPosition( nearest->pos );
294  m_viewSnapLine.SetPosition( nearest->pos );
296 
299  else
301 
302  m_snapItem = nearest;
303  return nearest->pos;
304  }
305  }
306 
308  {
309  bool snapLine = false;
310 
311  if( std::abs( m_viewSnapLine.GetPosition().x - aOrigin.x ) < GetGrid().x )
312  {
313  nearestGrid.x = m_viewSnapLine.GetPosition().x;
314  snapLine = true;
315  }
316 
317  if( std::abs( m_viewSnapLine.GetPosition().y - aOrigin.y ) < GetGrid().y )
318  {
319  nearestGrid.y = m_viewSnapLine.GetPosition().y;
320  snapLine = true;
321  }
322 
323  if( snapLine && m_skipPoint != VECTOR2I( m_viewSnapLine.GetPosition() ) )
324  {
325  m_viewSnapLine.SetEndPosition( nearestGrid );
327 
330  else
332 
333  return nearestGrid;
334  }
335  }
336 
337  m_snapItem = nullptr;
340  return nearestGrid;
341 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:123
ANCHOR * m_snapItem
Pointer to the currently snapped item in m_anchors (NULL if not snapped)
Definition: grid_helper.h:155
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags) override
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: pcb_view.cpp:91
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
void SetEndPosition(const VECTOR2D &aPosition)
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
VECTOR2I GetGrid() const
Definition: grid_helper.cpp:85
KIGFX::ORIGIN_VIEWITEM m_viewSnapPoint
Definition: grid_helper.h:158
void computeAnchors(BOARD_ITEM *aItem, const VECTOR2I &aRefPos, bool aFrom=false)
computeAnchors inserts the local anchor points in to the grid helper for the specified board item,...
ANCHOR * nearestAnchor(const VECTOR2I &aPos, int aFlags, LSET aMatchLayers)
void SetPosition(const VECTOR2D &aPosition)
bool IsVisible(const VIEW_ITEM *aItem) const
Returns information if the item is visible (or not).
Definition: view.cpp:1526
KIGFX::GAL * GetGAL() const
Function GetGAL() Returns a pointer to the GAL instance used in the panel.
bool m_enableSnap
If true, allow snapping to other items on the layers.
Definition: grid_helper.h:151
bool m_enableSnapLine
If true, allow drawing lines from snap points.
Definition: grid_helper.h:153
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
const wxPoint GetPosition() const override
VECTOR2I Align(const VECTOR2I &aPoint) const
PCB_BASE_FRAME * m_frame
Definition: grid_helper.h:148
int m_snapSize
Sets the radius in screen units for snapping to items.
Definition: grid_helper.h:154
VECTOR2I m_skipPoint
When drawing a line, we avoid snapping to the source point.
Definition: grid_helper.h:156
std::set< BOARD_ITEM * > queryVisible(const BOX2I &aArea, const std::vector< BOARD_ITEM * > &aSkip) const
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Sets the item visibility.
Definition: view.cpp:1486
bool m_enableGrid
If true, allow snapping to grid.
Definition: grid_helper.h:152
KIGFX::ORIGIN_VIEWITEM m_viewSnapLine
Definition: grid_helper.h:159
double GetWorldScale() const
Get the world scale.
void clearAnchors()
Definition: grid_helper.h:143
Color has changed.
Definition: view_item.h:57

References Align(), clearAnchors(), computeAnchors(), GRID_HELPER::ANCHOR::Distance(), EuclideanNorm(), KIGFX::GEOMETRY, PCB_BASE_FRAME::GetCanvas(), EDA_DRAW_PANEL_GAL::GetGAL(), GetGrid(), KIGFX::ORIGIN_VIEWITEM::GetPosition(), PCB_DRAW_PANEL_GAL::GetView(), KIGFX::GAL::GetWorldScale(), KIGFX::VIEW::IsVisible(), m_enableGrid, m_enableSnap, m_enableSnapLine, m_frame, m_skipPoint, m_snapItem, m_snapSize, m_viewSnapLine, m_viewSnapPoint, nearestAnchor(), GRID_HELPER::ANCHOR::pos, queryVisible(), KIGFX::ORIGIN_VIEWITEM::SetEndPosition(), KIGFX::ORIGIN_VIEWITEM::SetPosition(), KIGFX::VIEW::SetVisible(), SNAPPABLE, KIGFX::PCB_VIEW::Update(), wxPoint::x, VECTOR2< T >::x, wxPoint::y, and VECTOR2< T >::y.

◆ clearAnchors()

void GRID_HELPER::clearAnchors ( )
inlineprivate

Definition at line 143 of file grid_helper.h.

144  {
145  m_anchors.clear();
146  }
std::vector< ANCHOR > m_anchors
Definition: grid_helper.h:121

References m_anchors.

Referenced by BestDragOrigin(), and BestSnapAnchor().

◆ ClearSkipPoint()

void GRID_HELPER::ClearSkipPoint ( )
inline

We clear the skip point by setting it to an unreachable position, thereby preventing matching.

Definition at line 75 of file grid_helper.h.

76  {
77  m_skipPoint = VECTOR2I( std::numeric_limits<int>::min(), std::numeric_limits<int>::min() );
78  }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
VECTOR2I m_skipPoint
When drawing a line, we avoid snapping to the source point.
Definition: grid_helper.h:156

References m_skipPoint.

Referenced by DRAWING_TOOL::DrawZone().

◆ computeAnchors()

void GRID_HELPER::computeAnchors ( BOARD_ITEM aItem,
const VECTOR2I aRefPos,
bool  aFrom = false 
)
private

computeAnchors inserts the local anchor points in to the grid helper for the specified board item, given the reference point and the direction of use for the point.

Parameters
aItemThe board item for which to compute the anchors
aRefPosThe point for which to compute the anchors (if used by the component)
aFromIs this for an anchor that is designating a source point (aFrom=true) or not

Definition at line 353 of file grid_helper.cpp.

354 {
355  VECTOR2I origin;
356  auto view = m_frame->GetCanvas()->GetView();
357  auto activeLayers = view->GetPainter()->GetSettings()->GetActiveLayers();
358  bool isHighContrast = view->GetPainter()->GetSettings()->GetHighContrast();
359 
360  switch( aItem->Type() )
361  {
362  case PCB_MODULE_T:
363  {
364  MODULE* mod = static_cast<MODULE*>( aItem );
365 
366  for( auto pad : mod->Pads() )
367  {
368  // Getting pads from the module requires re-checking that the pad is shown
369  if( ( aFrom || m_frame->Settings().m_MagneticPads == CAPTURE_ALWAYS )
370  && pad->GetBoundingBox().Contains( wxPoint( aRefPos.x, aRefPos.y ) )
371  && view->IsVisible( pad )
372  && ( !isHighContrast || activeLayers.count( pad->GetLayer() ) )
373  && pad->ViewGetLOD( pad->GetLayer(), view ) < view->GetScale() )
374  {
375  addAnchor( pad->GetPosition(), CORNER | SNAPPABLE, pad );
376  break;
377  }
378  }
379 
380  // if the cursor is not over a pad, then drag the module by its origin
381  addAnchor( mod->GetPosition(), ORIGIN | SNAPPABLE, mod );
382  break;
383  }
384 
385  case PCB_PAD_T:
386  {
387  if( aFrom || m_frame->Settings().m_MagneticPads == CAPTURE_ALWAYS )
388  {
389  D_PAD* pad = static_cast<D_PAD*>( aItem );
390  addAnchor( pad->GetPosition(), CORNER | SNAPPABLE, pad );
391  }
392 
393  break;
394  }
395 
396  case PCB_MODULE_EDGE_T:
397  case PCB_LINE_T:
398  {
400  break;
401 
402  DRAWSEGMENT* dseg = static_cast<DRAWSEGMENT*>( aItem );
403  VECTOR2I start = dseg->GetStart();
404  VECTOR2I end = dseg->GetEnd();
405 
406  switch( dseg->GetShape() )
407  {
408  case S_CIRCLE:
409  {
410  int r = ( start - end ).EuclideanNorm();
411 
412  addAnchor( start, ORIGIN | SNAPPABLE, dseg );
413  addAnchor( start + VECTOR2I( -r, 0 ), OUTLINE | SNAPPABLE, dseg );
414  addAnchor( start + VECTOR2I( r, 0 ), OUTLINE | SNAPPABLE, dseg );
415  addAnchor( start + VECTOR2I( 0, -r ), OUTLINE | SNAPPABLE, dseg );
416  addAnchor( start + VECTOR2I( 0, r ), OUTLINE | SNAPPABLE, dseg );
417  break;
418  }
419 
420  case S_ARC:
421  origin = dseg->GetCenter();
422  addAnchor( dseg->GetArcStart(), CORNER | SNAPPABLE, dseg );
423  addAnchor( dseg->GetArcEnd(), CORNER | SNAPPABLE, dseg );
424  addAnchor( origin, ORIGIN | SNAPPABLE, dseg );
425  break;
426 
427  case S_RECT:
428  addAnchor( start, CORNER | SNAPPABLE, dseg );
429  addAnchor( VECTOR2I( end.x, start.y ), CORNER | SNAPPABLE, dseg );
430  addAnchor( VECTOR2I( start.x, end.y ), CORNER | SNAPPABLE, dseg );
431  addAnchor( end, CORNER | SNAPPABLE, dseg );
432  break;
433 
434  case S_SEGMENT:
435  origin.x = start.x + ( start.x - end.x ) / 2;
436  origin.y = start.y + ( start.y - end.y ) / 2;
437  addAnchor( start, CORNER | SNAPPABLE, dseg );
438  addAnchor( end, CORNER | SNAPPABLE, dseg );
439  addAnchor( origin, ORIGIN, dseg );
440  break;
441 
442  case S_POLYGON:
443  for( const auto& p : dseg->BuildPolyPointsList() )
444  addAnchor( p, CORNER | SNAPPABLE, dseg );
445 
446  break;
447 
448  case S_CURVE:
449  addAnchor( start, CORNER | SNAPPABLE, dseg );
450  addAnchor( end, CORNER | SNAPPABLE, dseg );
451  //Fallthrough
452  default:
453  origin = dseg->GetStart();
454  addAnchor( origin, ORIGIN | SNAPPABLE, dseg );
455  break;
456  }
457  break;
458  }
459 
460  case PCB_TRACE_T:
461  {
462  if( aFrom || m_frame->Settings().m_MagneticTracks == CAPTURE_ALWAYS )
463  {
464  TRACK* track = static_cast<TRACK*>( aItem );
465  VECTOR2I start = track->GetStart();
466  VECTOR2I end = track->GetEnd();
467  origin.x = start.x + ( start.x - end.x ) / 2;
468  origin.y = start.y + ( start.y - end.y ) / 2;
469  addAnchor( start, CORNER | SNAPPABLE, track );
470  addAnchor( end, CORNER | SNAPPABLE, track );
471  addAnchor( origin, ORIGIN, track);
472  }
473 
474  break;
475  }
476 
477  case PCB_MARKER_T:
478  case PCB_TARGET_T:
479  addAnchor( aItem->GetPosition(), ORIGIN | CORNER | SNAPPABLE, aItem );
480  break;
481 
482  case PCB_VIA_T:
483  {
484  if( aFrom || m_frame->Settings().m_MagneticTracks == CAPTURE_ALWAYS )
485  addAnchor( aItem->GetPosition(), ORIGIN | CORNER | SNAPPABLE, aItem );
486 
487  break;
488  }
489 
490  case PCB_ZONE_AREA_T:
491  {
492  const SHAPE_POLY_SET* outline = static_cast<const ZONE_CONTAINER*>( aItem )->Outline();
493 
494  SHAPE_LINE_CHAIN lc;
495  lc.SetClosed( true );
496 
497  for( auto iter = outline->CIterateWithHoles(); iter; iter++ )
498  {
499  addAnchor( *iter, CORNER, aItem );
500  lc.Append( *iter );
501  }
502 
503  addAnchor( lc.NearestPoint( aRefPos ), OUTLINE, aItem );
504 
505  break;
506  }
507 
508  case PCB_DIMENSION_T:
509  {
510  const DIMENSION* dim = static_cast<const DIMENSION*>( aItem );
511  addAnchor( dim->m_crossBarF, CORNER | SNAPPABLE, aItem );
512  addAnchor( dim->m_crossBarO, CORNER | SNAPPABLE, aItem );
513  addAnchor( dim->m_featureLineGO, CORNER | SNAPPABLE, aItem );
514  addAnchor( dim->m_featureLineDO, CORNER | SNAPPABLE, aItem );
515  break;
516  }
517 
518  case PCB_MODULE_TEXT_T:
519  case PCB_TEXT_T:
520  addAnchor( aItem->GetPosition(), ORIGIN, aItem );
521  break;
522 
523  default:
524  break;
525  }
526 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:123
const VECTOR2I NearestPoint(const VECTOR2I &aP) const
Function NearestPoint()
wxPoint m_crossBarF
const wxPoint GetCenter() const override
Function GetCenter()
const wxPoint & GetStart() const
Definition: class_track.h:109
STROKE_T GetShape() const
const wxPoint GetArcEnd() const
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
polygon (not yet used for tracks, but could be in microwave apps)
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:101
VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
PADS & Pads()
Definition: class_module.h:173
MAGNETIC_OPTIONS m_MagneticTracks
CONST_ITERATOR CIterateWithHoles(int aOutline) const
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:92
usual segment : line with rounded ends
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
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...
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
const wxPoint & GetEnd() const
Function GetEnd returns the ending point of the graphic.
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
wxPoint m_featureLineGO
segment with non rounded ends
class MODULE, a footprint
Definition: typeinfo.h:89
void SetClosed(bool aClosed)
Function SetClosed()
MAGNETIC_OPTIONS m_MagneticPads
SHAPE_POLY_SET.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
PCB_GENERAL_SETTINGS & Settings()
Arcs (with rounded ends)
const wxPoint & GetArcStart() const
Bezier Curve.
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:99
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:100
virtual const wxPoint GetPosition() const =0
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
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:98
SHAPE_LINE_CHAIN.
PCB_BASE_FRAME * m_frame
Definition: grid_helper.h:148
const wxPoint & GetEnd() const
Definition: class_track.h:106
void addAnchor(const VECTOR2I &aPos, int aFlags, BOARD_ITEM *aItem)
Definition: grid_helper.h:126
wxPoint m_crossBarO
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
const wxPoint GetPosition() const override
Definition: class_pad.h:241
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:91
wxPoint m_featureLineDO
const wxPoint GetPosition() const override
Definition: class_module.h:210
DIMENSION.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:207
const std::set< unsigned int > GetActiveLayers()
Function GetActiveLayers() Returns the set of currently active layers.
Definition: painter.h:89

References addAnchor(), SHAPE_LINE_CHAIN::Append(), DRAWSEGMENT::BuildPolyPointsList(), CAPTURE_ALWAYS, SHAPE_POLY_SET::CIterateWithHoles(), CORNER, EuclideanNorm(), KIGFX::RENDER_SETTINGS::GetActiveLayers(), DRAWSEGMENT::GetArcEnd(), DRAWSEGMENT::GetArcStart(), PCB_BASE_FRAME::GetCanvas(), DRAWSEGMENT::GetCenter(), TRACK::GetEnd(), DRAWSEGMENT::GetEnd(), KIGFX::VIEW::GetPainter(), BOARD_ITEM::GetPosition(), MODULE::GetPosition(), D_PAD::GetPosition(), KIGFX::PAINTER::GetSettings(), DRAWSEGMENT::GetShape(), TRACK::GetStart(), DRAWSEGMENT::GetStart(), PCB_DRAW_PANEL_GAL::GetView(), DIMENSION::m_crossBarF, DIMENSION::m_crossBarO, DIMENSION::m_featureLineDO, DIMENSION::m_featureLineGO, m_frame, PCB_GENERAL_SETTINGS::m_MagneticGraphics, PCB_GENERAL_SETTINGS::m_MagneticPads, PCB_GENERAL_SETTINGS::m_MagneticTracks, SHAPE_LINE_CHAIN::NearestPoint(), ORIGIN, OUTLINE, SHAPE_POLY_SET::Outline(), MODULE::Pads(), PCB_DIMENSION_T, PCB_LINE_T, PCB_MARKER_T, PCB_MODULE_EDGE_T, PCB_MODULE_T, PCB_MODULE_TEXT_T, PCB_PAD_T, PCB_TARGET_T, PCB_TEXT_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_AREA_T, S_ARC, S_CIRCLE, S_CURVE, S_POLYGON, S_RECT, S_SEGMENT, SHAPE_LINE_CHAIN::SetClosed(), PCB_BASE_FRAME::Settings(), SNAPPABLE, EDA_ITEM::Type(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BestDragOrigin(), and BestSnapAnchor().

◆ GetGrid()

VECTOR2I GRID_HELPER::GetGrid ( ) const

Definition at line 85 of file grid_helper.cpp.

86 {
87  PCB_SCREEN* screen = m_frame->GetScreen();
88 
89  const wxRealPoint& size = screen->GetGridSize();
90 
91  return VECTOR2I( KiROUND( size.x ), KiROUND( size.y ) );
92 }
const wxRealPoint & GetGridSize() const
Return the grid size of the currently selected grid.
Definition: base_screen.h:279
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
PCB_BASE_FRAME * m_frame
Definition: grid_helper.h:148
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
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.

References BASE_SCREEN::GetGridSize(), PCB_BASE_FRAME::GetScreen(), KiROUND(), and m_frame.

Referenced by Align(), AlignToSegment(), and BestSnapAnchor().

◆ GetOrigin()

VECTOR2I GRID_HELPER::GetOrigin ( ) const

Definition at line 95 of file grid_helper.cpp.

96 {
97  return VECTOR2I( m_frame->GetGridOrigin() );
98 }
const wxPoint & GetGridOrigin() const override
Return the absolute coordinates of the origin of the snap grid.
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
PCB_BASE_FRAME * m_frame
Definition: grid_helper.h:148

References PCB_BASE_FRAME::GetGridOrigin(), and m_frame.

Referenced by Align(), and AlignToSegment().

◆ GetSnapped()

BOARD_ITEM * GRID_HELPER::GetSnapped ( void  ) const

Function GetSnapped If the GRID_HELPER has highlighted a snap point (target shown), this function will return a pointer to the item to which it snapped.

Returns
NULL if not snapped. Pointer to snapped item otherwise

Definition at line 344 of file grid_helper.cpp.

345 {
346  if( !m_snapItem )
347  return nullptr;
348 
349  return m_snapItem->item;
350 }
ANCHOR * m_snapItem
Pointer to the currently snapped item in m_anchors (NULL if not snapped)
Definition: grid_helper.h:155
BOARD_ITEM * item
Definition: grid_helper.h:113

References GRID_HELPER::ANCHOR::item, and m_snapItem.

Referenced by DRAWING_TOOL::drawSegment().

◆ nearestAnchor()

GRID_HELPER::ANCHOR * GRID_HELPER::nearestAnchor ( const VECTOR2I aPos,
int  aFlags,
LSET  aMatchLayers 
)
private

Definition at line 529 of file grid_helper.cpp.

530 {
531  double minDist = std::numeric_limits<double>::max();
532  ANCHOR* best = NULL;
533 
534  for( ANCHOR& a : m_anchors )
535  {
536  if( ( aMatchLayers & a.item->GetLayerSet() ) == 0 )
537  continue;
538 
539  if( ( aFlags & a.flags ) != aFlags )
540  continue;
541 
542  double dist = a.Distance( aPos );
543 
544  if( dist < minDist )
545  {
546  minDist = dist;
547  best = &a;
548  }
549  }
550 
551  return best;
552 }
static const int dist[10][10]
Definition: ar_matrix.cpp:326
#define NULL
std::vector< ANCHOR > m_anchors
Definition: grid_helper.h:121

References dist, m_anchors, and NULL.

Referenced by BestDragOrigin(), and BestSnapAnchor().

◆ queryVisible()

std::set< BOARD_ITEM * > GRID_HELPER::queryVisible ( const BOX2I aArea,
const std::vector< BOARD_ITEM * > &  aSkip 
) const
private

Definition at line 224 of file grid_helper.cpp.

226 {
227  std::set<BOARD_ITEM*> items;
228  std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> selectedItems;
229 
230  auto view = m_frame->GetCanvas()->GetView();
231  auto activeLayers = view->GetPainter()->GetSettings()->GetActiveLayers();
232  bool isHighContrast = view->GetPainter()->GetSettings()->GetHighContrast();
233  view->Query( aArea, selectedItems );
234 
235  for( auto it : selectedItems )
236  {
237  BOARD_ITEM* item = static_cast<BOARD_ITEM*>( it.first );
238 
239  // The item must be visible and on an active layer
240  if( view->IsVisible( item ) && ( !isHighContrast || activeLayers.count( it.second ) )
241  && item->ViewGetLOD( it.second, view ) < view->GetScale() )
242  items.insert ( item );
243  }
244 
245 
246  for( auto ii : aSkip )
247  items.erase( ii );
248 
249  return items;
250 }
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
virtual unsigned int ViewGetLOD(int aLayer, VIEW *aView) const
Function ViewGetLOD() Returns the level of detail (LOD) of the item.
Definition: view_item.h:140
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
virtual RENDER_SETTINGS * GetSettings()=0
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
PCB_BASE_FRAME * m_frame
Definition: grid_helper.h:148
const std::set< unsigned int > GetActiveLayers()
Function GetActiveLayers() Returns the set of currently active layers.
Definition: painter.h:89

References KIGFX::RENDER_SETTINGS::GetActiveLayers(), PCB_BASE_FRAME::GetCanvas(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), PCB_DRAW_PANEL_GAL::GetView(), m_frame, and KIGFX::VIEW_ITEM::ViewGetLOD().

Referenced by BestSnapAnchor().

◆ SetAuxAxes()

void GRID_HELPER::SetAuxAxes ( bool  aEnable,
const VECTOR2I aOrigin = VECTOR2I( 0, 0 ) 
)

Definition at line 101 of file grid_helper.cpp.

102 {
103  if( aEnable )
104  {
105  m_auxAxis = aOrigin;
106  m_viewAxis.SetPosition( aOrigin );
107  m_frame->GetCanvas()->GetView()->SetVisible( &m_viewAxis, true );
108  }
109  else
110  {
112  m_frame->GetCanvas()->GetView()->SetVisible( &m_viewAxis, false );
113  }
114 }
OPT< VECTOR2I > m_auxAxis
Definition: grid_helper.h:149
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
KIGFX::ORIGIN_VIEWITEM m_viewAxis
Definition: grid_helper.h:160
void SetPosition(const VECTOR2D &aPosition)
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
PCB_BASE_FRAME * m_frame
Definition: grid_helper.h:148
boost::optional< T > OPT
Definition: optional.h:7
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Sets the item visibility.
Definition: view.cpp:1486

References PCB_BASE_FRAME::GetCanvas(), PCB_DRAW_PANEL_GAL::GetView(), m_auxAxis, m_frame, m_viewAxis, KIGFX::ORIGIN_VIEWITEM::SetPosition(), and KIGFX::VIEW::SetVisible().

Referenced by ROUTER_TOOL::InlineDrag(), EDIT_TOOL::Move(), POINT_EDITOR::OnSelectionChange(), and ROUTER_TOOL::performDragging().

◆ SetSkipPoint()

void GRID_HELPER::SetSkipPoint ( const VECTOR2I aPoint)
inline

Definition at line 67 of file grid_helper.h.

68  {
69  m_skipPoint = aPoint;
70  }
VECTOR2I m_skipPoint
When drawing a line, we avoid snapping to the source point.
Definition: grid_helper.h:156

References m_skipPoint.

Referenced by DRAWING_TOOL::drawSegment().

◆ SetSnap()

◆ SetSnapLine()

void GRID_HELPER::SetSnapLine ( bool  aSnap)
inline

Definition at line 85 of file grid_helper.h.

86  {
87  m_enableSnapLine = aSnap;
88  }
bool m_enableSnapLine
If true, allow drawing lines from snap points.
Definition: grid_helper.h:153

References m_enableSnapLine.

◆ SetUseGrid()

Member Data Documentation

◆ m_anchors

std::vector<ANCHOR> GRID_HELPER::m_anchors
private

Definition at line 121 of file grid_helper.h.

Referenced by addAnchor(), clearAnchors(), and nearestAnchor().

◆ m_auxAxis

OPT<VECTOR2I> GRID_HELPER::m_auxAxis
private

Definition at line 149 of file grid_helper.h.

Referenced by Align(), and SetAuxAxes().

◆ m_enableGrid

bool GRID_HELPER::m_enableGrid
private

If true, allow snapping to grid.

Definition at line 152 of file grid_helper.h.

Referenced by Align(), BestSnapAnchor(), GRID_HELPER(), and SetUseGrid().

◆ m_enableSnap

bool GRID_HELPER::m_enableSnap
private

If true, allow snapping to other items on the layers.

Definition at line 151 of file grid_helper.h.

Referenced by AlignToSegment(), BestSnapAnchor(), GRID_HELPER(), and SetSnap().

◆ m_enableSnapLine

bool GRID_HELPER::m_enableSnapLine
private

If true, allow drawing lines from snap points.

Definition at line 153 of file grid_helper.h.

Referenced by BestSnapAnchor(), GRID_HELPER(), and SetSnapLine().

◆ m_frame

PCB_BASE_FRAME* GRID_HELPER::m_frame
private

◆ m_skipPoint

VECTOR2I GRID_HELPER::m_skipPoint
private

When drawing a line, we avoid snapping to the source point.

Definition at line 156 of file grid_helper.h.

Referenced by BestSnapAnchor(), ClearSkipPoint(), and SetSkipPoint().

◆ m_snapItem

ANCHOR* GRID_HELPER::m_snapItem
private

Pointer to the currently snapped item in m_anchors (NULL if not snapped)

Definition at line 155 of file grid_helper.h.

Referenced by BestSnapAnchor(), GetSnapped(), and GRID_HELPER().

◆ m_snapSize

int GRID_HELPER::m_snapSize
private

Sets the radius in screen units for snapping to items.

Definition at line 154 of file grid_helper.h.

Referenced by BestSnapAnchor(), and GRID_HELPER().

◆ m_viewAxis

KIGFX::ORIGIN_VIEWITEM GRID_HELPER::m_viewAxis
private

Definition at line 160 of file grid_helper.h.

Referenced by GRID_HELPER(), and SetAuxAxes().

◆ m_viewSnapLine

KIGFX::ORIGIN_VIEWITEM GRID_HELPER::m_viewSnapLine
private

Definition at line 159 of file grid_helper.h.

Referenced by BestSnapAnchor(), and GRID_HELPER().

◆ m_viewSnapPoint

KIGFX::ORIGIN_VIEWITEM GRID_HELPER::m_viewSnapPoint
private

Definition at line 158 of file grid_helper.h.

Referenced by BestSnapAnchor(), and GRID_HELPER().


The documentation for this class was generated from the following files: