|
KiCad PCB EDA Suite
|
Lasting name for one handle in an EDIT_POINTS collection. More...
#include <pcb_handle_key.h>
Public Member Functions | |
| EDIT_POINT * | Resolve (EDIT_POINTS &aPoints) const |
| Find this key's handle in a collection, usually after it was rebuilt. | |
| const KIID & | Parent () const |
| bool | IsLine () const |
| int | Index () const |
| bool | operator== (const PCB_HANDLE_KEY &aOther) const |
| bool | operator< (const PCB_HANDLE_KEY &aOther) const |
Static Public Member Functions | |
| static std::optional< PCB_HANDLE_KEY > | Make (const EDIT_POINTS &aPoints, const EDIT_POINT *aPoint) |
| Build the key for a handle in a collection. | |
Private Member Functions | |
| PCB_HANDLE_KEY (const KIID &aParent, bool aIsLine, int aIndex, unsigned aPointCount, unsigned aLineCount) | |
Private Attributes | |
| KIID | m_parent |
| bool | m_isLine |
| int | m_index |
| unsigned | m_pointCount |
| unsigned | m_lineCount |
Lasting name for one handle in an EDIT_POINTS collection.
Point collections are rebuilt while editing, so an EDIT_POINT pointer goes stale. A key names the handle by the parent item's KIID, whether the handle is a point or a line, and the handle's index. Two keys for the same handle are the same key, so a picked set holds each handle once.
It also stores the collection's point and line counts, which Resolve() checks. If the parent gained or lost handles the index could now name a different handle, so the key stops resolving and the caller drops it.
Definition at line 42 of file pcb_handle_key.h.
|
private |
Definition at line 25 of file pcb_handle_key.cpp.
References m_index, m_isLine, m_lineCount, m_parent, and m_pointCount.
Referenced by Make(), operator<(), and operator==().
|
inline |
Definition at line 65 of file pcb_handle_key.h.
References m_index.
|
inline |
Definition at line 64 of file pcb_handle_key.h.
References m_isLine.
|
static |
Build the key for a handle in a collection.
| aPoints | the collection holding the handle. |
| aPoint | the handle, looked up by address among the collection's points and lines. |
Definition at line 36 of file pcb_handle_key.cpp.
References EDIT_POINTS::GetParent(), EDIT_POINTS::Line(), EDIT_POINTS::LinesSize(), EDA_ITEM::m_Uuid, PCB_HANDLE_KEY(), EDIT_POINTS::Point(), and EDIT_POINTS::PointsSize().
Referenced by BLOCK_DRAG_SESSION::Begin(), BlockDragLassoPick(), BlockDragMoveOrigins(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and PCB_POINT_EDITOR::pickHandleAt().
| bool PCB_HANDLE_KEY::operator< | ( | const PCB_HANDLE_KEY & | aOther | ) | const |
Definition at line 94 of file pcb_handle_key.cpp.
References m_index, m_isLine, m_parent, and PCB_HANDLE_KEY().
| bool PCB_HANDLE_KEY::operator== | ( | const PCB_HANDLE_KEY & | aOther | ) | const |
Definition at line 88 of file pcb_handle_key.cpp.
References m_index, m_isLine, m_parent, and PCB_HANDLE_KEY().
|
inline |
Definition at line 63 of file pcb_handle_key.h.
References m_parent.
| EDIT_POINT * PCB_HANDLE_KEY::Resolve | ( | EDIT_POINTS & | aPoints | ) | const |
Find this key's handle in a collection, usually after it was rebuilt.
Definition at line 63 of file pcb_handle_key.cpp.
References EDIT_POINTS::GetParent(), EDIT_POINTS::Line(), EDIT_POINTS::LinesSize(), m_index, m_isLine, m_lineCount, m_parent, m_pointCount, EDA_ITEM::m_Uuid, EDIT_POINTS::Point(), and EDIT_POINTS::PointsSize().
Referenced by resolveInCollections().
|
private |
Definition at line 75 of file pcb_handle_key.h.
Referenced by Index(), operator<(), operator==(), PCB_HANDLE_KEY(), and Resolve().
|
private |
Definition at line 74 of file pcb_handle_key.h.
Referenced by IsLine(), operator<(), operator==(), PCB_HANDLE_KEY(), and Resolve().
|
private |
Definition at line 77 of file pcb_handle_key.h.
Referenced by PCB_HANDLE_KEY(), and Resolve().
|
private |
Definition at line 73 of file pcb_handle_key.h.
Referenced by operator<(), operator==(), Parent(), PCB_HANDLE_KEY(), and Resolve().
|
private |
Definition at line 76 of file pcb_handle_key.h.
Referenced by PCB_HANDLE_KEY(), and Resolve().