|
KiCad PCB EDA Suite
|
#include <map>#include <set>#include <vector>#include <math/vector2d.h>#include <tools/pcb_handle_key.h>Go to the source code of this file.
Functions | |
| std::map< PCB_HANDLE_KEY, VECTOR2I > | BlockDragMoveOrigins (const std::vector< EDIT_POINTS * > &aCollections, const std::set< PCB_HANDLE_KEY > &aPicked) |
| Note every handle the drag will move, and where each one started. | |
| bool | BlockDragApplyDisplacement (const std::vector< EDIT_POINTS * > &aCollections, const std::map< PCB_HANDLE_KEY, VECTOR2I > &aOrigins, const VECTOR2I &aDelta, const GRID_HELPER &aGrid) |
| Put every handle at its starting position plus the drag's offset. | |
| bool BlockDragApplyDisplacement | ( | const std::vector< EDIT_POINTS * > & | aCollections, |
| const std::map< PCB_HANDLE_KEY, VECTOR2I > & | aOrigins, | ||
| const VECTOR2I & | aDelta, | ||
| const GRID_HELPER & | aGrid ) |
Put every handle at its starting position plus the drag's offset.
Each position comes from the stored starting point, so a long drag with many mouse events cannot drift. The offset is already snapped to the grid by the caller. A picked edge's corners are placed like any other handle and the edge is then asked to follow them, which is what holds a zone edge square to its neighbours.
Definition at line 83 of file block_drag_displacement.cpp.
References EDIT_POINT::ApplyRelation(), resolveInCollections(), and EDIT_POINT::SetPosition().
Referenced by BLOCK_DRAG_SESSION::applyFrame(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| std::map< PCB_HANDLE_KEY, VECTOR2I > BlockDragMoveOrigins | ( | const std::vector< EDIT_POINTS * > & | aCollections, |
| const std::set< PCB_HANDLE_KEY > & | aPicked ) |
Note every handle the drag will move, and where each one started.
A picked edge adds itself and its two corners. Each frame places the corners first and then drives the edge, so the edge follows the same rule it would follow if the user dragged it on its own. A corner picked both directly and through an edge is listed once, so it moves once.
Definition at line 43 of file block_drag_displacement.cpp.
References EDIT_LINE::GetEnd(), EDIT_LINE::GetOrigin(), EDIT_LINE::GetPosition(), EDIT_POINT::GetPosition(), PCB_HANDLE_KEY::Make(), and resolveInCollections().
Referenced by BLOCK_DRAG_SESSION::Begin(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().