|
KiCad PCB EDA Suite
|
Helper responsible for tracking the original net assignments of items involved in a drag operation and providing approximate local merge and broken-contact warnings. More...
#include <sch_drag_net_collision.h>
Classes | |
| struct | COLLISION_MARKER |
| struct | DISCONNECTION_MARKER |
| struct | ORIGINAL_CONNECTION |
Public Member Functions | |
| SCH_DRAG_NET_COLLISION_MONITOR (SCH_EDIT_FRAME *aFrame, KIGFX::VIEW *aView) | |
| ~SCH_DRAG_NET_COLLISION_MONITOR () | |
| void | Initialize (const SCH_SELECTION &aSelection) |
| bool | Update (const std::vector< SCH_JUNCTION * > &aJunctions, const SCH_SELECTION &aSelection) |
| void | Reset () |
| KICURSOR | AdjustCursor (KICURSOR aBaseCursor) const |
Private Member Functions | |
| std::optional< COLLISION_MARKER > | analyzeJunction (SCH_JUNCTION *aJunction, const SCH_SELECTION &aSelection) const |
| void | recordItemNet (SCH_ITEM *aItem) |
| void | recordOriginalConnections (const SCH_SELECTION &aSelection) |
| std::vector< DISCONNECTION_MARKER > | collectDisconnectedMarkers (const SCH_SELECTION &aSelection) const |
| void | ensureOverlay () |
| void | clearOverlay () const |
Private Attributes | |
| SCH_EDIT_FRAME * | m_frame |
| KIGFX::VIEW * | m_view |
| std::shared_ptr< KIGFX::VIEW_OVERLAY > | m_overlay |
| std::unordered_map< const SCH_ITEM *, std::optional< int > > | m_itemNetCodes |
| SCH_SHEET_PATH | m_sheetPath |
| std::vector< ORIGINAL_CONNECTION > | m_originalConnections |
| bool | m_hasCollision |
Helper responsible for tracking the original net assignments of items involved in a drag operation and providing approximate local merge and broken-contact warnings.
Net assignments are frozen at startup; dragging never rebuilds the connectivity graph.
Definition at line 50 of file sch_drag_net_collision.h.
| SCH_DRAG_NET_COLLISION_MONITOR::SCH_DRAG_NET_COLLISION_MONITOR | ( | SCH_EDIT_FRAME * | aFrame, |
| KIGFX::VIEW * | aView ) |
Definition at line 45 of file sch_drag_net_collision.cpp.
References m_frame, m_hasCollision, m_itemNetCodes, m_originalConnections, m_overlay, m_sheetPath, and m_view.
| SCH_DRAG_NET_COLLISION_MONITOR::~SCH_DRAG_NET_COLLISION_MONITOR | ( | ) |
Definition at line 58 of file sch_drag_net_collision.cpp.
References Reset().
Definition at line 175 of file sch_drag_net_collision.cpp.
References m_hasCollision, and WARNING.
|
private |
Definition at line 185 of file sch_drag_net_collision.cpp.
References SELECTION::Contains(), SCH_JUNCTION::GetEffectiveDiameter(), SCH_JUNCTION::GetPosition(), m_frame, m_itemNetCodes, NO_RECURSE, and SCH_LINE_T.
Referenced by Update().
|
private |
|
private |
Definition at line 362 of file sch_drag_net_collision.cpp.
References SELECTION::Contains(), SCH_ITEM::GetConnectionPoints(), SCH_ITEM::GetPenWidth(), EDA_ITEM::HitTest(), SCH_ITEM::IsConnectable(), EDA_ITEM::IsSelected(), SCH_ITEM::IsType(), m_originalConnections, SCH_DRAG_NET_COLLISION_MONITOR::DISCONNECTION_MARKER::pointA, radius, and traceSchDragNetCollision.
Referenced by Update().
|
private |
Definition at line 426 of file sch_drag_net_collision.cpp.
References m_overlay, and m_view.
Referenced by Update().
| void SCH_DRAG_NET_COLLISION_MONITOR::Initialize | ( | const SCH_SELECTION & | aSelection | ) |
Definition at line 64 of file sch_drag_net_collision.cpp.
References m_frame, m_hasCollision, m_itemNetCodes, m_originalConnections, m_sheetPath, NO_RECURSE, recordItemNet(), recordOriginalConnections(), and traceSchDragNetCollision.
|
private |
Definition at line 235 of file sch_drag_net_collision.cpp.
References SCH_ITEM::Connection(), SCH_ITEM::IsConnectable(), m_itemNetCodes, and m_sheetPath.
Referenced by Initialize().
|
private |
Definition at line 252 of file sch_drag_net_collision.cpp.
References SELECTION::Contains(), SCH_ITEM::GetConnectionPoints(), SELECTION::GetSize(), index, IS_PASTED, SCH_ITEM::IsConnectable(), EDA_ITEM::IsSelected(), m_frame, m_originalConnections, EE_RTREE::Overlapping(), and traceSchDragNetCollision.
Referenced by Initialize().
| void SCH_DRAG_NET_COLLISION_MONITOR::Reset | ( | ) |
Definition at line 166 of file sch_drag_net_collision.cpp.
References clearOverlay(), m_hasCollision, m_itemNetCodes, and m_originalConnections.
Referenced by ~SCH_DRAG_NET_COLLISION_MONITOR().
| bool SCH_DRAG_NET_COLLISION_MONITOR::Update | ( | const std::vector< SCH_JUNCTION * > & | aJunctions, |
| const SCH_SELECTION & | aSelection ) |
Definition at line 89 of file sch_drag_net_collision.cpp.
References KIGFX::COLOR4D::a, analyzeJunction(), clearOverlay(), collectDisconnectedMarkers(), ensureOverlay(), LAYER_DRAG_NET_COLLISION, m_frame, m_hasCollision, m_overlay, m_view, traceSchDragNetCollision, COLOR4D::UNSPECIFIED, and KIGFX::COLOR4D::WithAlpha().
|
private |
Definition at line 97 of file sch_drag_net_collision.h.
Referenced by analyzeJunction(), Initialize(), recordOriginalConnections(), SCH_DRAG_NET_COLLISION_MONITOR(), and Update().
|
private |
Definition at line 103 of file sch_drag_net_collision.h.
Referenced by AdjustCursor(), Initialize(), Reset(), SCH_DRAG_NET_COLLISION_MONITOR(), and Update().
|
private |
Definition at line 100 of file sch_drag_net_collision.h.
Referenced by analyzeJunction(), Initialize(), recordItemNet(), Reset(), and SCH_DRAG_NET_COLLISION_MONITOR().
|
private |
Definition at line 102 of file sch_drag_net_collision.h.
Referenced by collectDisconnectedMarkers(), Initialize(), recordOriginalConnections(), Reset(), and SCH_DRAG_NET_COLLISION_MONITOR().
|
private |
Definition at line 99 of file sch_drag_net_collision.h.
Referenced by clearOverlay(), ensureOverlay(), SCH_DRAG_NET_COLLISION_MONITOR(), and Update().
|
private |
Definition at line 101 of file sch_drag_net_collision.h.
Referenced by Initialize(), recordItemNet(), and SCH_DRAG_NET_COLLISION_MONITOR().
|
private |
Definition at line 98 of file sch_drag_net_collision.h.
Referenced by clearOverlay(), ensureOverlay(), SCH_DRAG_NET_COLLISION_MONITOR(), and Update().