KiCad PCB EDA Suite
pns_kicad_iface.h
Go to the documentation of this file.
1 /*
2  * KiRouter - a push-and-(sometimes-)shove PCB router
3  *
4  * Copyright (C) 2013-2016 CERN
5  * Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
6  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
7  *
8  * This program is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation, either version 3 of the License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef __PNS_KICAD_IFACE_H
23 #define __PNS_KICAD_IFACE_H
24 
25 #include <unordered_set>
26 
27 #include "pns_router.h"
28 
31 
32 class BOARD;
33 class BOARD_COMMIT;
35 class PCB_TOOL;
36 
37 namespace KIGFX
38 {
39  class VIEW;
40 }
41 
43 public:
45  ~PNS_KICAD_IFACE();
46 
47  void SetRouter( PNS::ROUTER* aRouter ) override;
48  void SetHostTool( PCB_TOOL* aTool );
49  void SetDisplayOptions( PCB_DISPLAY_OPTIONS* aDispOptions );
50 
51  void SetBoard( BOARD* aBoard );
52  void SetView( KIGFX::VIEW* aView );
53  void SyncWorld( PNS::NODE* aWorld ) override;
54  void EraseView() override;
55  void HideItem( PNS::ITEM* aItem ) override;
56  void DisplayItem( const PNS::ITEM* aItem, int aColor = 0, int aClearance = 0 ) override;
57  void AddItem( PNS::ITEM* aItem ) override;
58  void RemoveItem( PNS::ITEM* aItem ) override;
59  void Commit() override;
60 
61  void UpdateNet( int aNetCode ) override;
62 
63  PNS::RULE_RESOLVER* GetRuleResolver() override;
64  PNS::DEBUG_DECORATOR* GetDebugDecorator() override;
65 
66 private:
69 
70  std::unique_ptr<PNS::SOLID> syncPad( D_PAD* aPad );
71  std::unique_ptr<PNS::SEGMENT> syncTrack( TRACK* aTrack );
72  std::unique_ptr<PNS::VIA> syncVia( VIA* aVia );
73  bool syncTextItem( PNS::NODE* aWorld, EDA_TEXT* aText, PCB_LAYER_ID aLayer );
74  bool syncGraphicalItem( PNS::NODE* aWorld, DRAWSEGMENT* aItem );
75  bool syncZone( PNS::NODE* aWorld, ZONE_CONTAINER* aZone );
76 
79  std::unordered_set<BOARD_CONNECTED_ITEM*> m_hiddenItems;
80 
84  std::unique_ptr<BOARD_COMMIT> m_commit;
86 };
87 
88 #endif
Class ITEM.
Definition: pns_item.h:53
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
PNS_PCBNEW_DEBUG_DECORATOR * m_debugDecorator
Class NODE.
Definition: pns_node.h:136
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
std::unordered_set< BOARD_CONNECTED_ITEM * > m_hiddenItems
Class ROUTER.
Definition: pns_router.h:86
Class RULE_RESOLVER.
Definition: pns_node.h:56
PCB_DISPLAY_OPTIONS * m_dispOptions
Class EDA_TEXT is a mix-in class (via multiple inheritance) that handles texts such as labels...
Definition: eda_text.h:127
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings...
PCB_LAYER_ID
A quick note on layer IDs:
std::unique_ptr< BOARD_COMMIT > m_commit
PNS_PCBNEW_RULE_RESOLVER * m_ruleResolver
KIGFX::VIEW_GROUP * m_previewItems
PNS::ROUTER * m_router
KIGFX::VIEW * m_view
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
Class VIEW.
Definition: view.h:61
PCB_TOOL * m_tool