KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_item_alignment.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef SCH_ITEM_ALIGNMENT_H
21#define SCH_ITEM_ALIGNMENT_H
22
23#include <functional>
24#include <vector>
25#include <math/vector2d.h>
26#include <tool/grid_helper.h>
27
28class EDA_ITEM;
29class SCH_ITEM;
30class SCH_SCREEN;
31class EE_GRID_HELPER;
32
33using EDA_ITEMS = std::vector<EDA_ITEM*>;
34
35
43{
48 std::function<void( EDA_ITEM* aItem, const VECTOR2I& aDelta )> m_doMoveItem;
49
54 std::function<void( SCH_ITEM* aItem, const VECTOR2I& aPoint, EDA_ITEMS& aList )> m_getConnectedDragItems;
55
60 std::function<void( EDA_ITEM* aItem )> m_updateItem;
61};
62
63
76void MoveSchematicItem( EDA_ITEM* aItem, const VECTOR2I& aDelta );
77
78
94 const std::vector<EDA_ITEM*>& aItems,
95 EE_GRID_HELPER& aGrid,
96 GRID_HELPER_GRIDS aSelectionGrid,
97 const SCH_ALIGNMENT_CALLBACKS& aCallbacks );
98
99
100#endif // SCH_ITEM_ALIGNMENT_H
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:96
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:162
GRID_HELPER_GRIDS
Definition grid_helper.h:40
std::vector< EDA_ITEM * > EDA_ITEMS
void MoveSchematicItem(EDA_ITEM *aItem, const VECTOR2I &aDelta)
Move a schematic item by a delta.
void AlignSchematicItemsToGrid(SCH_SCREEN *aScreen, const std::vector< EDA_ITEM * > &aItems, EE_GRID_HELPER &aGrid, GRID_HELPER_GRIDS aSelectionGrid, const SCH_ALIGNMENT_CALLBACKS &aCallbacks)
Align a set of schematic items to the grid.
Callbacks for alignment operations.
std::function< void(SCH_ITEM *aItem, const VECTOR2I &aPoint, EDA_ITEMS &aList)> m_getConnectedDragItems
Callback to get items connected to a given item at a specific point.
std::function< void(EDA_ITEM *aItem, const VECTOR2I &aDelta)> m_doMoveItem
Callback to move an item by a delta.
std::function< void(EDA_ITEM *aItem)> m_updateItem
Optional callback to update an item's display after modification.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683