KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pns_placement_algo.h
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2013-2014 CERN
5 * Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 * Author: Tomasz Wlostowski <[email protected]>
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_PLACEMENT_ALGO_H
23#define __PNS_PLACEMENT_ALGO_H
24
25#include <math/vector2d.h>
26
27#include "pns_algo_base.h"
28#include "pns_sizes_settings.h"
29#include "pns_itemset.h"
30
31namespace PNS {
32
33class ROUTER;
34class ITEM;
35class NODE;
36
46{
47public:
48 PLACEMENT_ALGO( ROUTER* aRouter ) :
49 ALGO_BASE( aRouter ) {};
50
51 virtual ~PLACEMENT_ALGO () {};
52
59 virtual bool Start( const VECTOR2I& aP, ITEM* aStartItem ) = 0;
60
68 virtual bool Move( const VECTOR2I& aP, ITEM* aEndItem ) = 0;
69
79 virtual bool FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinish = false ) = 0;
80
81 virtual std::optional<VECTOR2I> UnfixRoute() { return std::nullopt; };
82
83 virtual bool CommitPlacement() { return false; };
84
85 virtual bool AbortPlacement() { return false; };
86
87 virtual bool HasPlacedAnything() const { return false; }
88
94 virtual bool ToggleVia( bool aEnabled )
95 {
96 return false;
97 }
98
104 virtual bool IsPlacingVia() const
105 {
106 return false;
107 }
108
114 virtual bool SetLayer( int aLayer )
115 {
116 return false;
117 }
118
124 virtual const ITEM_SET Traces() = 0;
125
131 virtual const VECTOR2I& CurrentStart() const = 0;
132
139 virtual const VECTOR2I& CurrentEnd() const = 0;
140
146 virtual const std::vector<NET_HANDLE> CurrentNets() const = 0;
147
153 virtual int CurrentLayer() const = 0;
154
160 virtual NODE* CurrentNode( bool aLoopsRemoved = false ) const = 0;
161
167 virtual void FlipPosture()
168 {
169 }
170
178 virtual void UpdateSizes( const SIZES_SETTINGS& aSizes )
179 {
180 }
181
189 virtual void SetOrthoMode ( bool aOrthoMode )
190 {
191 }
192
198 virtual void GetModifiedNets( std::vector<NET_HANDLE> &aNets ) const
199 {
200 }
201};
202
203}
204
205#endif
Base class for all P&S algorithms (shoving, walkaround, line placement, dragging, etc....
Definition: pns_algo_base.h:43
Base class for PNS router board items.
Definition: pns_item.h:97
Keep the router "world" - i.e.
Definition: pns_node.h:207
virtual NODE * CurrentNode(bool aLoopsRemoved=false) const =0
Function CurrentNode()
virtual bool IsPlacingVia() const
Function IsPlacingVia()
virtual bool CommitPlacement()
virtual void FlipPosture()
Function FlipPosture()
virtual const VECTOR2I & CurrentEnd() const =0
Function CurrentEnd()
virtual const ITEM_SET Traces()=0
Function Traces()
virtual bool Start(const VECTOR2I &aP, ITEM *aStartItem)=0
Function Start()
virtual bool HasPlacedAnything() const
PLACEMENT_ALGO(ROUTER *aRouter)
virtual bool AbortPlacement()
virtual bool Move(const VECTOR2I &aP, ITEM *aEndItem)=0
Function Move()
virtual const VECTOR2I & CurrentStart() const =0
Function CurrentStart()
virtual int CurrentLayer() const =0
Function CurrentLayer()
virtual void SetOrthoMode(bool aOrthoMode)
Function SetOrthoMode()
virtual void GetModifiedNets(std::vector< NET_HANDLE > &aNets) const
Function GetModifiedNets.
virtual const std::vector< NET_HANDLE > CurrentNets() const =0
Function CurrentNets()
virtual bool ToggleVia(bool aEnabled)
Function ToggleVia()
virtual std::optional< VECTOR2I > UnfixRoute()
virtual bool SetLayer(int aLayer)
Function SetLayer()
virtual void UpdateSizes(const SIZES_SETTINGS &aSizes)
Function UpdateSizes()
virtual bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false)=0
Function FixRoute()
Push and Shove diff pair dimensions (gap) settings dialog.