| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #include "lc_actionentitylayerbase.h" |
| |
|
| | #include "lc_actioncontext.h" |
| | #include "rs_entity.h" |
| | #include "rs_graphicview.h" |
| |
|
| | LC_ActionLayerBase::LC_ActionLayerBase(const char* name, LC_ActionContext* actionContext, RS2::ActionType actionType) |
| | : LC_ActionPreSelectionAwareBase{name, actionContext, actionType} { |
| | } |
| |
|
| | void LC_ActionLayerBase::onSelectionCompleted([[maybe_unused]]bool singleEntity, bool fromInit) { |
| | setSelectionComplete(isAllowTriggerOnEmptySelection(), fromInit); |
| | updateMouseButtonHints(); |
| | if (m_selectionComplete) { |
| | trigger(); |
| | } |
| | } |
| |
|
| | void LC_ActionLayerBase::doTrigger([[maybe_unused]]bool keepSelected) { |
| | if (!m_selectedEntities.empty()) { |
| | auto firstEntity = m_selectedEntities.front(); |
| | RS_Layer* layer = firstEntity->getLayer(); |
| |
|
| | if (layer != nullptr) { |
| | doProceedLayer(layer); |
| | deselectAll(); |
| | init(-1); |
| | } |
| | } |
| | else { |
| | |
| | } |
| | } |
| |
|
| | void LC_ActionLayerBase::applyBoxSelectionModeIfNeeded([[maybe_unused]]RS_Vector mouse) { |
| | m_inBoxSelectionMode = false; |
| | } |
| |
|
| | void LC_ActionLayerBase::proceedSelectedEntity([[maybe_unused]]LC_MouseEvent* e) { |
| | onSelectionCompleted(true, false); |
| | } |
| |
|
| | void LC_ActionLayerBase::doProceedLayer(RS_Layer* layer) { |
| | auto graphicView = m_actionContext->getGraphicView(); |
| | auto graphic = graphicView->getGraphic(); |
| | if (graphic != nullptr) { |
| | doWithLayer(graphic, layer); |
| | } |
| | } |
| |
|