KiCad PCB EDA Suite
ratsnest_data.h
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) 2013-2015 CERN
5  * @author Maciej Suminski <maciej.suminski@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 
30 #ifndef RATSNEST_DATA_H
31 #define RATSNEST_DATA_H
32 
33 #include <ttl/halfedge/hetriang.h>
34 #include <ttl/halfedge/hetraits.h>
35 
36 #include <math/box2.h>
37 
38 #include <deque>
39 #include <unordered_set>
40 #include <unordered_map>
41 
42 class BOARD;
43 class BOARD_ITEM;
45 class MODULE;
46 class D_PAD;
47 class VIA;
48 class TRACK;
49 class ZONE_CONTAINER;
50 class SHAPE_POLY_SET;
51 
54 {
55  RN_PADS = 0x01,
56  RN_VIAS = 0x02,
57  RN_TRACKS = 0x04,
58  RN_ZONES = 0x08,
59  RN_ALL = 0xFF
60 };
61 
62 // Preserve KiCad coding style policy
69 typedef std::shared_ptr<hed::EDGE_MST> RN_EDGE_MST_PTR;
70 
71 bool operator==( const RN_NODE_PTR& aFirst, const RN_NODE_PTR& aSecond );
72 bool operator!=( const RN_NODE_PTR& aFirst, const RN_NODE_PTR& aSecond );
73 
74 struct RN_NODE_OR_FILTER;
75 struct RN_NODE_AND_FILTER;
76 
78 struct RN_NODE_FILTER : public std::unary_function<const RN_NODE_PTR&, bool>
79 {
80  virtual ~RN_NODE_FILTER() {}
81 
82  virtual bool operator()( const RN_NODE_PTR& aNode ) const
83  {
84  return true; // By default everything passes
85  }
86 
87  friend RN_NODE_AND_FILTER operator&&( const RN_NODE_FILTER& aFilter1, const RN_NODE_FILTER& aFilter2 );
88  friend RN_NODE_OR_FILTER operator||( const RN_NODE_FILTER& aFilter1, const RN_NODE_FILTER& aFilter2 );
89 };
90 
91 RN_NODE_AND_FILTER operator&&( const RN_NODE_FILTER& aFilter1, const RN_NODE_FILTER& aFilter2 );
92 RN_NODE_OR_FILTER operator||( const RN_NODE_FILTER& aFilter1, const RN_NODE_FILTER& aFilter2 );
93 
95 struct LINE_TARGET : public RN_NODE_FILTER
96 {
97  bool operator()( const RN_NODE_PTR& aNode ) const override
98  {
99  return !aNode->GetNoLine();
100  }
101 };
102 
105 {
106  LINE_TARGET_SAME_TAG( int aTag ) :
107  m_tag( aTag )
108  {}
109 
110  bool operator()( const RN_NODE_PTR& aNode ) const override
111  {
112  return !aNode->GetNoLine() && aNode->GetTag() == m_tag;
113  }
114 
115 private:
116  int m_tag;
117 };
118 
120 {
121  LINE_TARGET_DIFF_TAG( int aTag ) :
122  m_tag( aTag )
123  {}
124 
125  bool operator()( const RN_NODE_PTR& aNode ) const override
126  {
127  return !aNode->GetNoLine() && aNode->GetTag() == m_tag;
128  }
129 
130 private:
131  int m_tag;
132 };
133 
135 {
136  RN_NODE_AND_FILTER( const RN_NODE_FILTER& aFilter1, const RN_NODE_FILTER& aFilter2 ) :
137  m_filter1( aFilter1 ), m_filter2( aFilter2 )
138  {}
139 
140  bool operator()( const RN_NODE_PTR& aNode ) const override
141  {
142  return m_filter1( aNode ) && m_filter2( aNode );
143  }
144 
145  private:
148 };
149 
151 {
152  RN_NODE_OR_FILTER( const RN_NODE_FILTER& aFilter1, const RN_NODE_FILTER& aFilter2 ) :
153  m_filter1( aFilter1 ), m_filter2( aFilter2 )
154  {}
155 
156  bool operator()( const RN_NODE_PTR& aNode ) const override
157  {
158  return m_filter1( aNode ) || m_filter2( aNode );
159  }
160 
161  private:
164 };
165 
166 
169 struct RN_NODE_COMPARE : std::binary_function<RN_NODE_PTR, RN_NODE_PTR, bool>
170 {
171  bool operator()( const RN_NODE_PTR& aNode1, const RN_NODE_PTR& aNode2 ) const
172  {
173  return aNode1 == aNode2;
174  }
175 };
176 
179 struct RN_NODE_HASH : std::unary_function<RN_NODE_PTR, std::size_t>
180 {
181  std::size_t operator()( const RN_NODE_PTR& aNode ) const
182  {
183  std::size_t hash = 2166136261u;
184 
185  hash ^= aNode->GetX();
186  hash *= 16777619;
187  hash ^= aNode->GetY();
188 
189  return hash;
190  }
191 };
192 
193 
198 class RN_LINKS
199 {
200 public:
201  // Helper typedefs
202  typedef std::unordered_set<RN_NODE_PTR, RN_NODE_HASH, RN_NODE_COMPARE> RN_NODE_SET;
203  typedef std::list<RN_EDGE_PTR> RN_EDGE_LIST;
204 
213  const RN_NODE_PTR& AddNode( int aX, int aY );
214 
221  bool RemoveNode( const RN_NODE_PTR& aNode );
222 
228  const RN_NODE_SET& GetNodes() const
229  {
230  return m_nodes;
231  }
232 
243  RN_EDGE_MST_PTR AddConnection( const RN_NODE_PTR& aNode1, const RN_NODE_PTR& aNode2,
244  unsigned int aDistance = 0 );
245 
251  void RemoveConnection( const RN_EDGE_PTR& aEdge )
252  {
253  m_edges.remove( aEdge );
254  }
255 
261  const RN_EDGE_LIST& GetConnections() const
262  {
263  return m_edges;
264  }
265 
266 protected:
268  RN_NODE_SET m_nodes;
269 
271  RN_EDGE_LIST m_edges;
272 };
273 
274 
280 class RN_POLY
281 {
282 public:
283  RN_POLY( const SHAPE_POLY_SET* aParent,
284  int aSubpolygonIndex,
285  RN_LINKS& aConnections, const BOX2I& aBBox );
286 
292  inline const RN_NODE_PTR& GetNode() const
293  {
294  return m_node;
295  }
296 
298  {
299  return m_node;
300  }
301 
308  bool HitTest( const RN_NODE_PTR& aNode ) const;
309 
310 private:
311 
314 
317 
320 
324 
325  friend bool sortArea( const RN_POLY& aP1, const RN_POLY& aP2 );
326 };
327 
328 
333 class RN_NET
334 {
335 public:
337  RN_NET() : m_dirty( true ), m_visible( true )
338  {}
339 
346  void SetVisible( bool aEnabled )
347  {
348  m_visible = aEnabled;
349  }
350 
356  bool IsVisible() const
357  {
358  return m_visible;
359  }
360 
365  void MarkDirty()
366  {
367  m_dirty = true;
368  }
369 
376  bool IsDirty() const
377  {
378  return m_dirty;
379  }
380 
386  const std::vector<RN_EDGE_MST_PTR>* GetUnconnected() const
387  {
388  return m_rnEdges.get();
389  }
390 
395  void Update();
396 
403  bool AddItem( const D_PAD* aPad );
404 
411  bool AddItem( const VIA* aVia );
412 
419  bool AddItem( const TRACK* aTrack );
420 
427  bool AddItem( const ZONE_CONTAINER* aZone );
428 
435  bool RemoveItem( const D_PAD* aPad );
436 
443  bool RemoveItem( const VIA* aVia );
444 
451  bool RemoveItem( const TRACK* aTrack );
452 
459  bool RemoveItem( const ZONE_CONTAINER* aZone );
460 
467  std::list<RN_NODE_PTR> GetNodes( const BOARD_CONNECTED_ITEM* aItem ) const;
468 
475  void GetAllItems( std::list<BOARD_CONNECTED_ITEM*>& aOutput, RN_ITEM_TYPE aType = RN_ALL ) const;
476 
482  const RN_NODE_PTR GetClosestNode( const RN_NODE_PTR& aNode ) const;
483 
491  const RN_NODE_PTR GetClosestNode( const RN_NODE_PTR& aNode,
492  const RN_NODE_FILTER& aFilter ) const;
493 
502  std::list<RN_NODE_PTR> GetClosestNodes( const RN_NODE_PTR& aNode, int aNumber = -1 ) const;
503 
513  std::list<RN_NODE_PTR> GetClosestNodes( const RN_NODE_PTR& aNode,
514  const RN_NODE_FILTER& aFilter, int aNumber = -1 ) const;
515 
521  void AddSimple( const BOARD_CONNECTED_ITEM* aItem );
522 
529  inline void AddBlockedNode( RN_NODE_PTR& aNode )
530  {
531  m_blockedNodes.insert( aNode );
532  aNode->SetNoLine( true );
533  }
534 
541  inline const std::unordered_set<RN_NODE_PTR>& GetSimpleNodes() const
542  {
543  return m_simpleNodes;
544  }
545 
550  void ClearSimple();
551 
559  void GetConnectedItems( const BOARD_CONNECTED_ITEM* aItem,
560  std::list<BOARD_CONNECTED_ITEM*>& aOutput,
561  RN_ITEM_TYPE aTypes = RN_ALL ) const;
562 
563 protected:
566  void validateEdge( RN_EDGE_MST_PTR& aEdge );
567 
570  void removeNode( RN_NODE_PTR& aNode, const BOARD_CONNECTED_ITEM* aParent );
571 
574  void removeEdge( RN_EDGE_MST_PTR& aEdge, const BOARD_CONNECTED_ITEM* aParent );
575 
577  void clearNode( const RN_NODE_PTR& aNode );
578 
580  void processZones();
581 
583  void processPads();
584 
586  void compute();
587 
590 
592  std::shared_ptr< std::vector<RN_EDGE_MST_PTR> > m_rnEdges;
593 
595  std::unordered_set<RN_NODE_PTR> m_blockedNodes;
596 
598  std::unordered_set<RN_NODE_PTR> m_simpleNodes;
599 
601  bool m_dirty;
602 
604  typedef struct
605  {
607  std::deque<RN_POLY> m_Polygons;
608 
610  std::deque<RN_EDGE_MST_PTR> m_Edges;
611  } RN_ZONE_DATA;
612 
614  typedef struct
615  {
618 
620  std::deque<RN_EDGE_MST_PTR> m_Edges;
621  } RN_PAD_DATA;
622 
624  typedef std::unordered_map<const D_PAD*, RN_PAD_DATA> PAD_NODE_MAP;
625  typedef std::unordered_map<const VIA*, RN_NODE_PTR> VIA_NODE_MAP;
626  typedef std::unordered_map<const TRACK*, RN_EDGE_MST_PTR> TRACK_EDGE_MAP;
627  typedef std::unordered_map<const ZONE_CONTAINER*, RN_ZONE_DATA> ZONE_DATA_MAP;
628 
630  PAD_NODE_MAP m_pads;
631 
633  VIA_NODE_MAP m_vias;
634 
636  TRACK_EDGE_MAP m_tracks;
637 
639  ZONE_DATA_MAP m_zones;
640 
642  bool m_visible;
643 };
644 
645 
651 class RN_DATA
652 {
653 public:
658  RN_DATA( const BOARD* aBoard ) : m_board( aBoard ) {}
659 
666  bool Add( const BOARD_ITEM* aItem );
667 
674  bool Remove( const BOARD_ITEM* aItem );
675 
683  bool Update( const BOARD_ITEM* aItem );
684 
691  void AddSimple( const BOARD_ITEM* aItem );
692 
699  void AddBlocked( const BOARD_ITEM* aItem );
700 
705  void ClearSimple()
706  {
707  for( RN_NET& net : m_nets )
708  net.ClearSimple();
709  }
710 
716  void ProcessBoard();
717 
723  void Recalculate( int aNet = -1 );
724 
730  int GetNetCount() const
731  {
732  return m_nets.size();
733  }
734 
741  RN_NET& GetNet( int aNetCode )
742  {
743  assert( aNetCode > 0 ); // ratsnest does not handle the unconnected net
744 
745  return m_nets[aNetCode];
746  }
747 
755  void GetConnectedItems( const BOARD_CONNECTED_ITEM* aItem,
756  std::list<BOARD_CONNECTED_ITEM*>& aOutput,
757  RN_ITEM_TYPE aTypes = RN_ALL ) const;
758 
766  void GetNetItems( int aNetCode, std::list<BOARD_CONNECTED_ITEM*>& aOutput,
767  RN_ITEM_TYPE aTypes = RN_ALL ) const;
768 
776  bool AreConnected( const BOARD_CONNECTED_ITEM* aItem, const BOARD_CONNECTED_ITEM* aOther );
777 
783  int GetUnconnectedCount() const;
784 
785 protected:
791  void updateNet( int aNetCode );
792 
794  const BOARD* m_board;
795 
797  std::vector<RN_NET> m_nets;
798 };
799 
800 #endif /* RATSNEST_DATA_H */
void removeNode(RN_NODE_PTR &aNode, const BOARD_CONNECTED_ITEM *aParent)
Removes a link between a node and a parent, and clears linked edges if it was the last parent...
bool operator()(const RN_NODE_PTR &aNode) const override
const SHAPE_POLY_SET * m_parentPolyset
Polygon set containing the geometry
bool operator()(const RN_NODE_PTR &aNode) const override
RN_NODE_PTR & GetNode()
bool operator()(const RN_NODE_PTR &aNode) const override
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:78
void GetConnectedItems(const BOARD_CONNECTED_ITEM *aItem, std::list< BOARD_CONNECTED_ITEM * > &aOutput, RN_ITEM_TYPE aTypes=RN_ALL) const
Function GetConnectedItems() Adds items that are connected together to a list.
hed::EDGE_PTR RN_EDGE_PTR
Definition: ratsnest_data.h:66
RN_NODE_OR_FILTER(const RN_NODE_FILTER &aFilter1, const RN_NODE_FILTER &aFilter2)
void Update()
Function Update() Recomputes ratsnest for a net.
RN_NODE_AND_FILTER(const RN_NODE_FILTER &aFilter1, const RN_NODE_FILTER &aFilter2)
std::deque< RN_POLY > m_Polygons
Subpolygons belonging to a zone
void ClearSimple()
Function ClearSimple() Removes all nodes and edges that are used for displaying ratsnest in simple mo...
Functor calculating hash for a given node.
void processPads()
Adds additional edges to account for connections made by items located in pads areas.
Leaves nodes that can be a ratsnest line target and have a specific tag
Class RN_DATA.
RN_NODE_OR_FILTER operator||(const RN_NODE_FILTER &aFilter1, const RN_NODE_FILTER &aFilter2)
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
hed::NODE_PTR RN_NODE_PTR
Definition: ratsnest_data.h:64
RN_DATA(const BOARD *aBoard)
Default constructor.
ZONE_DATA_MAP m_zones
Map that associates groups of subpolygons in the ratsnest model to respective zones.
const RN_NODE_FILTER & m_filter2
bool m_dirty
Flag indicating necessity of recalculation of ratsnest for a net.
Structure to hold ratsnest data for ZONE_CONTAINER objects.
bool RemoveItem(const D_PAD *aPad)
Function RemoveItem() Removes all nodes and edges associated with selected pad, so they are not taken...
virtual bool operator()(const RN_NODE_PTR &aNode) const
Definition: ratsnest_data.h:82
RN_LINKS m_links
int m_subpolygonIndex
Index of the outline in the parent polygon set
bool IsVisible() const
Function IsVisible() Returns the visibility flag state.
const std::vector< RN_EDGE_MST_PTR > * GetUnconnected() const
Function GetUnconnected() Returns pointer to a vector of edges that makes ratsnest for a given net...
Leaves nodes that can be a ratsnest line target
Definition: ratsnest_data.h:95
bool Update(const BOARD_ITEM *aItem)
Function Update() Updates the ratsnest data for an item.
void compute()
Recomputes ratsnset from scratch.
void MarkDirty()
Function MarkDirty() Marks ratsnest for given net as 'dirty', i.e.
void GetAllItems(std::list< BOARD_CONNECTED_ITEM * > &aOutput, RN_ITEM_TYPE aType=RN_ALL) const
Function GetAllItems() Adds all stored items to a list.
PAD_NODE_MAP m_pads
Map that associates nodes in the ratsnest model to respective nodes.
std::unordered_map< const VIA *, RN_NODE_PTR > VIA_NODE_MAP
Class BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected an...
LINE_TARGET_DIFF_TAG(int aTag)
friend RN_NODE_AND_FILTER operator&&(const RN_NODE_FILTER &aFilter1, const RN_NODE_FILTER &aFilter2)
Functor comparing if two nodes are equal by their coordinates.
Structureo to hold ratsnest data for D_PAD objects.
std::deque< RN_EDGE_MST_PTR > m_Edges
Connections to other nodes
bool Remove(const BOARD_ITEM *aItem)
Function Remove() Removes an item from the ratsnest data.
void AddSimple(const BOARD_CONNECTED_ITEM *aItem)
Function AddSimple() Changes drawing mode for an item to simple (i.e.
void validateEdge(RN_EDGE_MST_PTR &aEdge)
Validates edge, i.e.
bool HitTest(const RN_NODE_PTR &aNode) const
Function HitTest() Tests if selected node is located within polygon boundaries.
const BOARD * m_board
Board to be processed.
const RN_NODE_FILTER & m_filter1
TRACK_EDGE_MAP m_tracks
Map that associates edges in the ratsnest model to respective tracks.
friend bool sortArea(const RN_POLY &aP1, const RN_POLY &aP2)
Edge class in the in the half-edge data structure.
Definition: hetriang.h:235
RN_NET()
Default constructor.
const std::unordered_set< RN_NODE_PTR > & GetSimpleNodes() const
Function GetSimpleNodes() Returns list of nodes for which ratsnest is drawn in simple mode (i...
Class RN_POLY Describes a single subpolygon (ZONE_CONTAINER is supposed to contain one or more of tho...
const RN_NODE_PTR GetClosestNode(const RN_NODE_PTR &aNode) const
Function GetClosestNode() Returns a single node that lies in the shortest distance from a specific no...
bool AreConnected(const BOARD_CONNECTED_ITEM *aItem, const BOARD_CONNECTED_ITEM *aOther)
Function AreConnected() Checks if two items are connected with copper.
std::shared_ptr< EDGE > EDGE_PTR
Definition: hetriang.h:73
hed::TRIANGULATION TRIANGULATOR
Definition: ratsnest_data.h:68
Class SHAPE_POLY_SET.
bool AddItem(const D_PAD *aPad)
Function AddItem() Adds an appropriate node associated with selected pad, so it is taken into account...
std::shared_ptr< hed::EDGE_MST > RN_EDGE_MST_PTR
Definition: ratsnest_data.h:69
void ProcessBoard()
Function ProcessBoard() Prepares data for computing (computes a list of current nodes and connections...
void GetNetItems(int aNetCode, std::list< BOARD_CONNECTED_ITEM * > &aOutput, RN_ITEM_TYPE aTypes=RN_ALL) const
Function GetNetItems() Adds all items that belong to a certain net to a list.
bool operator==(const RN_NODE_PTR &aFirst, const RN_NODE_PTR &aSecond)
std::unordered_set< RN_NODE_PTR > m_simpleNodes
Nodes to be displayed using the simplified ratsnest algorithm.
Specialization of EDGE class to be used for Minimum Spanning Tree algorithm.
Definition: hetriang.h:352
void clearNode(const RN_NODE_PTR &aNode)
Removes all ratsnest edges for a given node.
std::shared_ptr< std::vector< RN_EDGE_MST_PTR > > m_rnEdges
Vector of edges that makes ratsnest for a given net.
hed::EDGE_MST RN_EDGE_MST
Definition: ratsnest_data.h:67
RN_ITEM_TYPE
Types of items that are handled by the class
Definition: ratsnest_data.h:53
std::unordered_map< const D_PAD *, RN_PAD_DATA > PAD_NODE_MAP
Helper typedefs
void updateNet(int aNetCode)
Function updateNet() Recomputes ratsnest for a single net.
void SetVisible(bool aEnabled)
Function SetVisible() Sets state of the visibility flag.
friend RN_NODE_OR_FILTER operator||(const RN_NODE_FILTER &aFilter1, const RN_NODE_FILTER &aFilter2)
std::vector< RN_NET > m_nets
Stores information about ratsnest grouped by net numbers.
std::shared_ptr< NODE > NODE_PTR
Definition: hetriang.h:71
bool operator!=(const RN_NODE_PTR &aFirst, const RN_NODE_PTR &aSecond)
RN_NODE_AND_FILTER operator&&(const RN_NODE_FILTER &aFilter1, const RN_NODE_FILTER &aFilter2)
RN_POLY(const SHAPE_POLY_SET *aParent, int aSubpolygonIndex, RN_LINKS &aConnections, const BOX2I &aBBox)
bool operator()(const RN_NODE_PTR &aNode) const override
void Recalculate(int aNet=-1)
Function Recalculate() Recomputes ratsnest for selected net number or all nets that need updating...
const RN_NODE_PTR & GetNode() const
Function GetNode() Returns node representing a polygon (it has the same coordinates as the first poin...
void processZones()
Adds appropriate edges for nodes that are connected by zones.
std::size_t operator()(const RN_NODE_PTR &aNode) const
const RN_NODE_FILTER & m_filter1
bool m_visible
Visibility flag.
BOX2I m_bbox
Bounding box of the polygon.
RN_NODE_PTR m_Node
Node representing the pad.
int GetNetCount() const
Function GetNetCount() Returns the number of nets handled by the ratsnest.
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
std::list< RN_NODE_PTR > GetClosestNodes(const RN_NODE_PTR &aNode, int aNumber=-1) const
Function GetClosestNodes() Returns list of nodes sorted by the distance from a specific node...
void removeEdge(RN_EDGE_MST_PTR &aEdge, const BOARD_CONNECTED_ITEM *aParent)
Removes a link between an edge and a parent, and clears its node data if it was the last parent...
bool operator()(const RN_NODE_PTR &aNode) const override
Definition: ratsnest_data.h:97
virtual ~RN_NODE_FILTER()
Definition: ratsnest_data.h:80
const RN_NODE_FILTER & m_filter2
bool Add(const BOARD_ITEM *aItem)
Function Add() Adds an item to the ratsnest data.
std::unordered_map< const TRACK *, RN_EDGE_MST_PTR > TRACK_EDGE_MAP
bool IsDirty() const
Function IsDirty() Returns state of the 'dirty' flag, indicating that ratsnest for a given net is inv...
Class RN_NET Describes ratsnest for a single net.
std::list< RN_NODE_PTR > GetNodes(const BOARD_CONNECTED_ITEM *aItem) const
Function GetNodes() Returns list of nodes that are associated with a given item.
hed::NODE RN_NODE
Definition: ratsnest_data.h:63
Node class for data structures (Inherits from HandleId)
Definition: hetriang.h:87
void AddBlocked(const BOARD_ITEM *aItem)
Function AddBlocked() Specifies an item as not suitable as a ratsnest line target (i...
std::deque< RN_EDGE_MST_PTR > m_Edges
Helper nodes that make for connections to items located in the pad area.
LINE_TARGET_SAME_TAG(int aTag)
std::unordered_set< RN_NODE_PTR > m_blockedNodes
List of nodes which will not be used as ratsnest target nodes.
hed::EDGE RN_EDGE
Definition: ratsnest_data.h:65
bool operator()(const RN_NODE_PTR &aNode1, const RN_NODE_PTR &aNode2) const
void GetConnectedItems(const BOARD_CONNECTED_ITEM *aItem, std::list< BOARD_CONNECTED_ITEM * > &aOutput, RN_ITEM_TYPE aTypes=RN_ALL) const
Function GetConnectedItems() Adds items that are connected together to a list.
RN_NODE_PTR m_node
Node representing a polygon (it has the same coordinates as the first point of its bounding polyline...
void AddSimple(const BOARD_ITEM *aItem)
Function AddSimple() Sets an item to be drawn in simple mode (i.e.
VIA_NODE_MAP m_vias
Map that associates nodes in the ratsnest model to respective vias.
RN_NET & GetNet(int aNetCode)
Function GetNet() Returns ratsnest grouped by net numbers.
void AddBlockedNode(RN_NODE_PTR &aNode)
Function AddBlockedNode() Specifies a node as not suitable as a ratsnest line target (i...
std::unordered_map< const ZONE_CONTAINER *, RN_ZONE_DATA > ZONE_DATA_MAP
Triangulation class for the half-edge data structure with adaption to TTL.
Definition: hetriang.h:384
General interface for filtering out nodes in search functions.
Definition: ratsnest_data.h:78
void ClearSimple()
Function ClearSimple() Clears the list of nodes for which ratsnest is drawn in simple mode (one line ...
int GetUnconnectedCount() const
Function GetUnconnectedCount() Returns the number of missing connections.