KiCad PCB EDA Suite
|
A SNAP_MANAGER glues together the snap line manager and construction manager., along with some other state. More...
#include <construction_manager.h>
Public Types | |
using | GFX_UPDATE_CALLBACK = std::function< void(bool aShowAnything)> |
Public Member Functions | |
SNAP_MANAGER (KIGFX::CONSTRUCTION_GEOM &aHelper) | |
void | SetUpdateCallback (GFX_UPDATE_CALLBACK aCallback) |
Set the callback to call when the construction geometry changes and a view may need updating. | |
SNAP_LINE_MANAGER & | GetSnapLineManager () |
CONSTRUCTION_MANAGER & | GetConstructionManager () |
void | SetReferenceOnlyPoints (std::vector< VECTOR2I > aPoints) |
Set the reference-only points - these are points that are not snapped to, but can still be used for connection to the snap line. | |
const std::vector< VECTOR2I > & | GetReferenceOnlyPoints () const |
std::vector< CONSTRUCTION_MANAGER::CONSTRUCTION_ITEM_BATCH > | GetConstructionItems () const |
Get a list of all the active construction geometry, computed from the combined state of the snap line and construction manager. | |
void | updateView () override |
KIGFX::CONSTRUCTION_GEOM & | GetViewItem () |
Public Attributes | |
GFX_UPDATE_CALLBACK | m_updateCallback |
SNAP_LINE_MANAGER | m_snapLineManager |
CONSTRUCTION_MANAGER | m_constructionManager |
std::vector< VECTOR2I > | m_referenceOnlyPoints |
Private Attributes | |
KIGFX::CONSTRUCTION_GEOM & | m_constructionGeomPreview |
A SNAP_MANAGER glues together the snap line manager and construction manager., along with some other state.
It provides information for generating snap anchors based on this state, as well as keeping the state of visible construction geometry involved in that process.
Probably only used by GRID_HELPERs, but it's neater to keep it separate, as there's quite a bit of state to manage.
This is also where you may wish to add other 'virtual' snapping state, such as 'equal-space' snapping, etc.
Definition at line 236 of file construction_manager.h.
using SNAP_MANAGER::GFX_UPDATE_CALLBACK = std::function<void( bool aShowAnything )> |
Definition at line 239 of file construction_manager.h.
SNAP_MANAGER::SNAP_MANAGER | ( | KIGFX::CONSTRUCTION_GEOM & | aHelper | ) |
Definition at line 521 of file construction_manager.cpp.
std::vector< CONSTRUCTION_MANAGER::CONSTRUCTION_ITEM_BATCH > SNAP_MANAGER::GetConstructionItems | ( | ) | const |
Get a list of all the active construction geometry, computed from the combined state of the snap line and construction manager.
This can be combined with other external geometry to compute snap anchors.
Definition at line 541 of file construction_manager.cpp.
References CONSTRUCTION_MANAGER::CONSTRUCTION_ITEM::Constructions, CONSTRUCTION_MANAGER::FROM_SNAP_LINE, CONSTRUCTION_MANAGER::GetConstructionItems(), SNAP_LINE_MANAGER::GetSnapLineOrigin(), m_constructionManager, and m_snapLineManager.
|
inline |
Definition at line 250 of file construction_manager.h.
References m_constructionManager.
Referenced by PCB_GRID_HELPER::AddConstructionItems(), and PCB_GRID_HELPER::BestSnapAnchor().
|
inline |
Definition at line 261 of file construction_manager.h.
References m_referenceOnlyPoints.
Referenced by PCB_GRID_HELPER::BestSnapAnchor().
|
inline |
Definition at line 248 of file construction_manager.h.
References m_snapLineManager.
Referenced by PCB_GRID_HELPER::BestSnapAnchor(), and EE_GRID_HELPER::BestSnapAnchor().
|
inlineinherited |
Definition at line 53 of file construction_manager.h.
References CONSTRUCTION_VIEW_HANDLER::m_constructionGeomPreview.
Referenced by CONSTRUCTION_MANAGER::acceptConstructionItems(), SNAP_LINE_MANAGER::ClearSnapLine(), and SNAP_LINE_MANAGER::SetSnapLineEnd().
|
inline |
Set the reference-only points - these are points that are not snapped to, but can still be used for connection to the snap line.
Definition at line 256 of file construction_manager.h.
References m_referenceOnlyPoints.
Referenced by PCB_GRID_HELPER::AddConstructionItems().
|
inline |
Set the callback to call when the construction geometry changes and a view may need updating.
Definition at line 246 of file construction_manager.h.
References m_updateCallback.
Referenced by GRID_HELPER::GRID_HELPER().
|
overridevirtual |
Implements CONSTRUCTION_VIEW_HANDLER.
Definition at line 528 of file construction_manager.cpp.
References CONSTRUCTION_MANAGER::HasActiveConstruction(), SNAP_LINE_MANAGER::HasCompleteSnapLine(), m_constructionManager, m_snapLineManager, and m_updateCallback.
|
privateinherited |
Definition at line 58 of file construction_manager.h.
Referenced by CONSTRUCTION_VIEW_HANDLER::GetViewItem().
CONSTRUCTION_MANAGER SNAP_MANAGER::m_constructionManager |
Definition at line 277 of file construction_manager.h.
Referenced by GetConstructionItems(), GetConstructionManager(), and updateView().
std::vector<VECTOR2I> SNAP_MANAGER::m_referenceOnlyPoints |
Definition at line 279 of file construction_manager.h.
Referenced by GetReferenceOnlyPoints(), and SetReferenceOnlyPoints().
SNAP_LINE_MANAGER SNAP_MANAGER::m_snapLineManager |
Definition at line 276 of file construction_manager.h.
Referenced by GetConstructionItems(), GetSnapLineManager(), and updateView().
GFX_UPDATE_CALLBACK SNAP_MANAGER::m_updateCallback |
Definition at line 274 of file construction_manager.h.
Referenced by SetUpdateCallback(), and updateView().