2016-08-15 15:16:47 +00:00
|
|
|
/*
|
|
|
|
* KiRouter - a push-and-(sometimes-)shove PCB router
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013-2016 CERN
|
2016-08-29 17:31:13 +00:00
|
|
|
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
|
2016-08-15 15:16:47 +00:00
|
|
|
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2016-08-15 15:16:48 +00:00
|
|
|
|
2016-08-15 15:16:47 +00:00
|
|
|
#ifndef __PNS_KICAD_IFACE_H
|
|
|
|
#define __PNS_KICAD_IFACE_H
|
|
|
|
|
|
|
|
#include <unordered_set>
|
|
|
|
|
|
|
|
#include "pns_router.h"
|
|
|
|
|
|
|
|
class PNS_PCBNEW_RULE_RESOLVER;
|
2016-08-15 15:16:48 +00:00
|
|
|
class PNS_PCBNEW_DEBUG_DECORATOR;
|
2016-08-15 15:16:47 +00:00
|
|
|
|
|
|
|
class BOARD;
|
2016-06-21 15:06:28 +00:00
|
|
|
class BOARD_COMMIT;
|
2017-10-30 17:21:07 +00:00
|
|
|
class PCB_DISPLAY_OPTIONS;
|
2017-10-31 11:03:58 +00:00
|
|
|
class PCB_TOOL;
|
2017-01-25 09:33:49 +00:00
|
|
|
|
2016-08-15 15:16:53 +00:00
|
|
|
namespace KIGFX
|
|
|
|
{
|
2016-08-15 15:16:47 +00:00
|
|
|
class VIEW;
|
2017-11-02 20:41:29 +00:00
|
|
|
}
|
2016-08-15 15:16:47 +00:00
|
|
|
|
2016-08-29 17:31:13 +00:00
|
|
|
class PNS_KICAD_IFACE : public PNS::ROUTER_IFACE {
|
2016-08-15 15:16:47 +00:00
|
|
|
public:
|
2016-08-15 15:16:53 +00:00
|
|
|
PNS_KICAD_IFACE();
|
|
|
|
~PNS_KICAD_IFACE();
|
2016-08-15 15:16:47 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void SetRouter( PNS::ROUTER* aRouter ) override;
|
2017-10-31 11:03:58 +00:00
|
|
|
void SetHostTool( PCB_TOOL* aTool );
|
|
|
|
void SetDisplayOptions( PCB_DISPLAY_OPTIONS* aDispOptions );
|
2016-08-15 15:16:47 +00:00
|
|
|
|
|
|
|
void SetBoard( BOARD* aBoard );
|
2016-08-15 15:16:53 +00:00
|
|
|
void SetView( KIGFX::VIEW* aView );
|
2016-09-24 18:53:15 +00:00
|
|
|
void SyncWorld( PNS::NODE* aWorld ) override;
|
|
|
|
void EraseView() override;
|
|
|
|
void HideItem( PNS::ITEM* aItem ) override;
|
2019-04-08 04:24:30 +00:00
|
|
|
void DisplayItem( const PNS::ITEM* aItem, int aColor = 0, int aClearance = 0, bool aEdit = false ) override;
|
2016-09-24 18:53:15 +00:00
|
|
|
void AddItem( PNS::ITEM* aItem ) override;
|
|
|
|
void RemoveItem( PNS::ITEM* aItem ) override;
|
|
|
|
void Commit() override;
|
2016-08-15 15:16:47 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void UpdateNet( int aNetCode ) override;
|
2016-08-15 15:16:47 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
PNS::RULE_RESOLVER* GetRuleResolver() override;
|
|
|
|
PNS::DEBUG_DECORATOR* GetDebugDecorator() override;
|
2016-08-15 15:16:47 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
PNS_PCBNEW_RULE_RESOLVER* m_ruleResolver;
|
2016-08-15 15:16:48 +00:00
|
|
|
PNS_PCBNEW_DEBUG_DECORATOR* m_debugDecorator;
|
2016-08-15 15:16:47 +00:00
|
|
|
|
2018-02-03 09:39:46 +00:00
|
|
|
std::unique_ptr<PNS::SOLID> syncPad( D_PAD* aPad );
|
2017-01-25 09:33:49 +00:00
|
|
|
std::unique_ptr<PNS::SEGMENT> syncTrack( TRACK* aTrack );
|
2018-02-03 09:39:46 +00:00
|
|
|
std::unique_ptr<PNS::VIA> syncVia( VIA* aVia );
|
2018-08-27 13:51:37 +00:00
|
|
|
bool syncTextItem( PNS::NODE* aWorld, EDA_TEXT* aText, PCB_LAYER_ID aLayer );
|
2018-02-04 12:09:30 +00:00
|
|
|
bool syncGraphicalItem( PNS::NODE* aWorld, DRAWSEGMENT* aItem );
|
2018-02-03 09:39:46 +00:00
|
|
|
bool syncZone( PNS::NODE* aWorld, ZONE_CONTAINER* aZone );
|
2016-08-15 15:16:47 +00:00
|
|
|
|
2016-08-15 15:16:53 +00:00
|
|
|
KIGFX::VIEW* m_view;
|
2016-08-15 15:16:47 +00:00
|
|
|
KIGFX::VIEW_GROUP* m_previewItems;
|
|
|
|
std::unordered_set<BOARD_CONNECTED_ITEM*> m_hiddenItems;
|
|
|
|
|
2016-08-29 17:31:13 +00:00
|
|
|
PNS::ROUTER* m_router;
|
2016-08-15 15:16:53 +00:00
|
|
|
BOARD* m_board;
|
2017-10-31 11:03:58 +00:00
|
|
|
PCB_TOOL* m_tool;
|
2016-09-29 16:58:22 +00:00
|
|
|
std::unique_ptr<BOARD_COMMIT> m_commit;
|
2017-10-30 17:21:07 +00:00
|
|
|
PCB_DISPLAY_OPTIONS* m_dispOptions;
|
2016-08-15 15:16:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|