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;
34 class DISPLAY_OPTIONS;
35 
36 namespace KIGFX
37 {
38  class VIEW;
39 };
40 
42 public:
45 
46  void SetRouter( PNS::ROUTER* aRouter ) override;
47  void SetHostFrame( PCB_EDIT_FRAME* aFrame );
48 
49  void SetBoard( BOARD* aBoard );
50  void SetView( KIGFX::VIEW* aView );
51  void SyncWorld( PNS::NODE* aWorld ) override;
52  void EraseView() override;
53  void HideItem( PNS::ITEM* aItem ) override;
54  void DisplayItem( const PNS::ITEM* aItem, int aColor = 0, int aClearance = 0 ) override;
55  void AddItem( PNS::ITEM* aItem ) override;
56  void RemoveItem( PNS::ITEM* aItem ) override;
57  void Commit() override;
58 
59  void UpdateNet( int aNetCode ) override;
60 
63 
64 private:
67 
68  std::unique_ptr<PNS::SOLID> syncPad( D_PAD* aPad );
69  std::unique_ptr<PNS::SEGMENT> syncTrack( TRACK* aTrack );
70  std::unique_ptr<PNS::VIA> syncVia( VIA* aVia );
71 
74  std::unordered_set<BOARD_CONNECTED_ITEM*> m_hiddenItems;
75 
80  std::unique_ptr<BOARD_COMMIT> m_commit;
82 };
83 
84 #endif
Class ITEM.
Definition: pns_item.h:53
void SetView(KIGFX::VIEW *aView)
PNS_PCBNEW_DEBUG_DECORATOR * m_debugDecorator
Class NODE.
Definition: pns_node.h:137
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
PNS::NODE * m_world
std::unordered_set< BOARD_CONNECTED_ITEM * > m_hiddenItems
std::unique_ptr< PNS::SOLID > syncPad(D_PAD *aPad)
void UpdateNet(int aNetCode) override
void SetRouter(PNS::ROUTER *aRouter) override
Class ROUTER.
Definition: pns_router.h:86
Class RULE_RESOLVER.
Definition: pns_node.h:56
std::unique_ptr< PNS::SEGMENT > syncTrack(TRACK *aTrack)
void HideItem(PNS::ITEM *aItem) override
PNS::DEBUG_DECORATOR * GetDebugDecorator() override
void SetHostFrame(PCB_EDIT_FRAME *aFrame)
std::unique_ptr< BOARD_COMMIT > m_commit
PCB_EDIT_FRAME * m_frame
PNS_PCBNEW_RULE_RESOLVER * m_ruleResolver
KIGFX::VIEW_GROUP * m_previewItems
PNS::ROUTER * m_router
void DisplayItem(const PNS::ITEM *aItem, int aColor=0, int aClearance=0) override
void Commit() override
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
PNS::RULE_RESOLVER * GetRuleResolver() override
void EraseView() override
KIGFX::VIEW * m_view
void SyncWorld(PNS::NODE *aWorld) override
DISPLAY_OPTIONS * m_dispOptions
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
void RemoveItem(PNS::ITEM *aItem) override
std::unique_ptr< PNS::VIA > syncVia(VIA *aVia)
void AddItem(PNS::ITEM *aItem) override
Class VIEW.
Definition: view.h:58
void SetBoard(BOARD *aBoard)