|
|
|
|
@ -75,6 +75,11 @@ bool nmGuiPlotCmdHelper::runAction(QString sAction) {
|
|
|
|
|
|
|
|
|
|
// 清除图元选中状态
|
|
|
|
|
nmGuiPlot* pNmPlot = static_cast<nmGuiPlot*>(m_pGuiPlot);
|
|
|
|
|
const bool isMeasureAction = _isSame(sAction, "nmInsertObjLineMeasure");
|
|
|
|
|
if (isMeasureAction && m_activeTools.contains(NMOT_Line_Measure)) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
stopMeasureTool(pNmPlot);
|
|
|
|
|
pNmPlot->clearPlotsSelectStates();
|
|
|
|
|
|
|
|
|
|
// 添加之前先激活所有图元对象的可见性
|
|
|
|
|
@ -272,12 +277,7 @@ bool nmGuiPlotCmdHelper::runAction(QString sAction) {
|
|
|
|
|
this, SLOT(slotObjPtsFinished(QVector<QPointF>&)));
|
|
|
|
|
m_activeTools.insert(NMOT_Line_MeasuringScale, pObjTool);
|
|
|
|
|
return true;
|
|
|
|
|
} else if (_isSame(sAction, "nmInsertObjLineMeasure")) {
|
|
|
|
|
nmObjToolBase* pExistingTool = m_activeTools.value(NMOT_Line_Measure, nullptr);
|
|
|
|
|
if(pExistingTool) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (isMeasureAction) {
|
|
|
|
|
nmObjLineMeasureTool* pMeasureTool = new nmObjLineMeasureTool();
|
|
|
|
|
nmObjToolBase* pObjTool = pMeasureTool;
|
|
|
|
|
nmDataLogFile::getInstance()->writeLog("in nmGuiPlotCmdHelper " + QString::number(pObjTool->getNOT()));
|
|
|
|
|
@ -286,6 +286,7 @@ bool nmGuiPlotCmdHelper::runAction(QString sAction) {
|
|
|
|
|
connect(pObjTool, SIGNAL(sigPtsFinished(QVector<QPointF>&)), \
|
|
|
|
|
this, SLOT(slotObjPtsFinished(QVector<QPointF>&)));
|
|
|
|
|
m_activeTools.insert(NMOT_Line_Measure, pObjTool);
|
|
|
|
|
pNmPlot->setMeasureEditingLocked(true);
|
|
|
|
|
pMeasureTool->beginCreationCursor();
|
|
|
|
|
return true;
|
|
|
|
|
} else if (_isSame(sAction, "nmDeleteOneObj")) {
|
|
|
|
|
@ -320,6 +321,7 @@ void nmGuiPlotCmdHelper::cancelActiveTools()
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stopMeasureTool(pWxPlot);
|
|
|
|
|
foreach (nmObjToolBase* activeTool, m_activeTools.values()) {
|
|
|
|
|
// 取消删除模式时同步清理视口上的自定义光标。
|
|
|
|
|
if (nmObjDeleteTool* deleteTool = dynamic_cast<nmObjDeleteTool*>(activeTool)) {
|
|
|
|
|
@ -522,17 +524,20 @@ void nmGuiPlotCmdHelper::finishMeasure()
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nmObjToolBase* pMeasureTool = m_activeTools.value(NMOT_Line_Measure, nullptr);
|
|
|
|
|
if(pMeasureTool) {
|
|
|
|
|
m_activeTools.remove(NMOT_Line_Measure);
|
|
|
|
|
pMeasureTool->cancelInteraction();
|
|
|
|
|
pMeasureTool->resetInteractionCursor();
|
|
|
|
|
pWxPlot->m_pPlot->removeTools(pMeasureTool);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stopMeasureTool(pWxPlot);
|
|
|
|
|
pWxPlot->deleteMeasureObjects();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmGuiPlotCmdHelper::stopMeasureTool(nmGuiPlot* plot)
|
|
|
|
|
{
|
|
|
|
|
if (nmObjToolBase* tool = m_activeTools.take(NMOT_Line_Measure)) {
|
|
|
|
|
tool->cancelInteraction();
|
|
|
|
|
tool->resetInteractionCursor();
|
|
|
|
|
plot->m_pPlot->removeTools(tool);
|
|
|
|
|
}
|
|
|
|
|
plot->setMeasureEditingLocked(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 插入背景
|
|
|
|
|
void nmGuiPlotCmdHelper::insertBkImg()
|
|
|
|
|
{
|
|
|
|
|
|