KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pns_component_dragger.h
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2013-2020 CERN
5 * Copyright (C) 2013-2024 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_COMPONENT_DRAGGER_H
23#define __PNS_COMPONENT_DRAGGER_H
24
25#include <math/vector2d.h>
26
27#include "pns_drag_algo.h"
28
29namespace PNS
30{
31class ROUTER;
32class OPTIMIZER;
33
40{
41public:
42 COMPONENT_DRAGGER( ROUTER* aRouter );
44
45
52 bool Start( const VECTOR2I& aP, ITEM_SET& aPrimitives ) override;
53
60 bool Drag( const VECTOR2I& aP ) override;
61
69 bool FixRoute( bool aForceCommit ) override;
70
77 NODE* CurrentNode() const override;
78
85 const std::vector<NET_HANDLE> CurrentNets() const override
86 {
87 return std::vector<NET_HANDLE>();
88 }
89
96 virtual int CurrentLayer() const override
97 {
98 return UNDEFINED_LAYER;
99 }
100
106 const ITEM_SET Traces() override;
107
108 virtual PNS::DRAG_MODE Mode() const override
109 {
110 return PNS::DM_COMPONENT;
111 }
112
113 bool GetForceMarkObstaclesMode( bool* aDragStatus ) const override
114 {
115 *aDragStatus = m_dragStatus;
116 return false;
117 }
118
119private:
121 {
126 };
127
128 std::set<SOLID*> m_solids; // Pads being dragged
129 std::set<ITEM*> m_fixedItems; // Items being moved along with pads
130 std::vector<DRAGGED_CONNECTION> m_conns; // Lines being dragged with pads
131
137};
138
139}; // namespace PNS
140
141#endif
const ITEM_SET Traces() override
Function Traces()
NODE * CurrentNode() const override
Function CurrentNode()
std::set< ITEM * > m_fixedItems
virtual PNS::DRAG_MODE Mode() const override
bool FixRoute(bool aForceCommit) override
Function FixRoute()
bool GetForceMarkObstaclesMode(bool *aDragStatus) const override
const std::vector< NET_HANDLE > CurrentNets() const override
Function CurrentNets()
std::vector< DRAGGED_CONNECTION > m_conns
bool Start(const VECTOR2I &aP, ITEM_SET &aPrimitives) override
Function Start()
virtual int CurrentLayer() const override
Function CurrentLayer()
std::set< SOLID * > m_solids
bool Drag(const VECTOR2I &aP) override
Function Drag()
DRAG_ALGO.
Definition: pns_drag_algo.h:44
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Definition: pns_line.h:61
Keep the router "world" - i.e.
Definition: pns_node.h:207
@ UNDEFINED_LAYER
Definition: layer_ids.h:61
Push and Shove diff pair dimensions (gap) settings dialog.
DRAG_MODE
Definition: pns_router.h:71
@ DM_COMPONENT
Definition: pns_router.h:78