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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef SCH_ITEM_ALIGNMENT_H
25#define SCH_ITEM_ALIGNMENT_H
26
27#include <functional>
28#include <vector>
29#include <math/vector2d.h>
30#include <tool/grid_helper.h>
31
32class EDA_ITEM;
33class SCH_ITEM;
34class SCH_SCREEN;
35class EE_GRID_HELPER;
36
37using EDA_ITEMS = std::vector<EDA_ITEM*>;
38
39
47{
52 std::function<void( EDA_ITEM* aItem, const VECTOR2I& aDelta )> m_doMoveItem;
53
58 std::function<void( SCH_ITEM* aItem, const VECTOR2I& aPoint, EDA_ITEMS& aList )> m_getConnectedDragItems;
59
64 std::function<void( EDA_ITEM* aItem )> m_updateItem;
65};
66
67
80void MoveSchematicItem( EDA_ITEM* aItem, const VECTOR2I& aDelta );
81
82
98 const std::vector<EDA_ITEM*>& aItems,
99 EE_GRID_HELPER& aGrid,
100 GRID_HELPER_GRIDS aSelectionGrid,
101 const SCH_ALIGNMENT_CALLBACKS& aCallbacks );
102
103
104#endif // SCH_ITEM_ALIGNMENT_H
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:167
GRID_HELPER_GRIDS
Definition grid_helper.h:44
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:695