|
|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
#include "nmPlotGraphicBinder.h"
|
|
|
|
|
#include "nmPlotGraphicBinder.h"
|
|
|
|
|
|
|
|
|
|
#include "nmObjLineFault.h"
|
|
|
|
|
#include "nmDataFault.h"
|
|
|
|
|
@ -30,10 +30,30 @@
|
|
|
|
|
#include "Defines.h"
|
|
|
|
|
#include "iDataTypes.h"
|
|
|
|
|
#include "zxSysUtils.h"
|
|
|
|
|
#include "IxPtyPano.h"
|
|
|
|
|
#include "IxPtyItem.h"
|
|
|
|
|
|
|
|
|
|
#include <QMetaObject>
|
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
// 参数面板回写图元后,同步当前选中对象的左侧属性项。
|
|
|
|
|
void refreshPropertyValue(nmObjBase* pGraphic, const QString& key, const QVariant& value)
|
|
|
|
|
{
|
|
|
|
|
if (pGraphic == nullptr || !pGraphic->isSelected()) return;
|
|
|
|
|
|
|
|
|
|
IxPtyPano* pPano = pGraphic->getPtyPano();
|
|
|
|
|
if (pPano == nullptr) return;
|
|
|
|
|
|
|
|
|
|
IxPtyItem* pItem = pPano->findPropertyItem(key);
|
|
|
|
|
if (pItem != nullptr && pItem->getValue() != value) {
|
|
|
|
|
pItem->setValue(value, pGraphic);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nmPlotGraphicBinder::WellRenderData::WellRenderData()
|
|
|
|
|
: valid(false)
|
|
|
|
|
, wellType(Vertical_Well)
|
|
|
|
|
@ -73,7 +93,7 @@ void nmPlotGraphicBinder::createFaultForGraphic(nmObjLineFault* pGraphic)
|
|
|
|
|
// 建立信号连接
|
|
|
|
|
_connectFault(pGraphic, pData);
|
|
|
|
|
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
m_pDataMgr->notifyGeometryListChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 从文件加载:绑定已有数据到已有图元
|
|
|
|
|
@ -84,6 +104,7 @@ void nmPlotGraphicBinder::bindFaultToGraphic(nmObjLineFault* pGraphic, nmDataFau
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 将数据值推到图元
|
|
|
|
|
pGraphic->setName(pData->getFaultName());
|
|
|
|
|
_pushFaultDataToGraphic(pGraphic, pData);
|
|
|
|
|
|
|
|
|
|
// 建立信号连接
|
|
|
|
|
@ -122,6 +143,9 @@ void nmPlotGraphicBinder::syncFaultName(nmObjLineFault* pGraphic)
|
|
|
|
|
nmDataFault* pData = m_mapFaultData.value(pGraphic, nullptr);
|
|
|
|
|
if (pData && pData->getFaultName() != pGraphic->getName()) {
|
|
|
|
|
pData->setFaultName(pGraphic->getName());
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyParameterObjectNameChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -149,16 +173,22 @@ void nmPlotGraphicBinder::updateDataMgr(nmDataAnalyzeManager* pDataMgr)
|
|
|
|
|
void nmPlotGraphicBinder::_pushFaultDataToGraphic(nmObjLineFault* pGraphic, nmDataFault* pData)
|
|
|
|
|
{
|
|
|
|
|
// 阻断信号,防止推送中触发反向同步
|
|
|
|
|
pGraphic->blockSignals(true);
|
|
|
|
|
bool bOldSignalsBlocked = pGraphic->blockSignals(true);
|
|
|
|
|
|
|
|
|
|
pGraphic->setName(pData->getFaultName());
|
|
|
|
|
pGraphic->setAllValues(pData->getFaultPoints());
|
|
|
|
|
|
|
|
|
|
int flowModel = (pData->getFaultFlowModel().getValue() == tr("Leaky")) ? 0 : 1;
|
|
|
|
|
pGraphic->setFaultFlowModel(flowModel);
|
|
|
|
|
|
|
|
|
|
pGraphic->setFaultLeakage(pData->getFaultLeakage().getValue().toDouble());
|
|
|
|
|
|
|
|
|
|
pGraphic->blockSignals(false);
|
|
|
|
|
pGraphic->blockSignals(bOldSignalsBlocked);
|
|
|
|
|
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjLineFaultStartPos.StartPointX", pData->getStartX().getValue());
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjLineFaultStartPos.StartPointY", pData->getStartY().getValue());
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjLineFaultEndPos.EndPointX", pData->getEndX().getValue());
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjLineFaultEndPos.EndPointY", pData->getEndY().getValue());
|
|
|
|
|
pGraphic->update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 建立图元与数据的双向信号连接
|
|
|
|
|
@ -175,6 +205,8 @@ void nmPlotGraphicBinder::_connectFault(nmObjLineFault* pGraphic, nmDataFault* p
|
|
|
|
|
|
|
|
|
|
QObject::connect(pGraphic, SIGNAL(sigObjVisibleChanged(bool)),
|
|
|
|
|
this, SLOT(onGraphicVisibleChanged(bool)));
|
|
|
|
|
QObject::connect(pData, SIGNAL(sigFaultDataChanged()),
|
|
|
|
|
this, SLOT(onFaultDataChanged()), Qt::UniqueConnection);
|
|
|
|
|
|
|
|
|
|
m_mapFaultData[pGraphic] = pData;
|
|
|
|
|
|
|
|
|
|
@ -198,6 +230,12 @@ void nmPlotGraphicBinder::_disconnectFault(nmObjLineFault* pGraphic)
|
|
|
|
|
QObject::disconnect(pGraphic, SIGNAL(sigObjVisibleChanged(bool)),
|
|
|
|
|
this, SLOT(onGraphicVisibleChanged(bool)));
|
|
|
|
|
|
|
|
|
|
nmDataFault* pData = m_mapFaultData.value(pGraphic, nullptr);
|
|
|
|
|
if (pData != nullptr) {
|
|
|
|
|
QObject::disconnect(pData, SIGNAL(sigFaultDataChanged()),
|
|
|
|
|
this, SLOT(onFaultDataChanged()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_setBoundGraphics.remove(pGraphic);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -241,7 +279,6 @@ void nmPlotGraphicBinder::onGraphicPointsChanged()
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
pData->setFaultPoints(pGraphic->getAllValues());
|
|
|
|
|
pData->setFaultName(pGraphic->getName());
|
|
|
|
|
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
@ -260,6 +297,18 @@ void nmPlotGraphicBinder::onGraphicVisibleChanged(bool bVisible)
|
|
|
|
|
pData->setPlotVisible(bVisible);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 数据参数变更 -> 同步到图元和左侧属性面板
|
|
|
|
|
void nmPlotGraphicBinder::onFaultDataChanged()
|
|
|
|
|
{
|
|
|
|
|
nmDataFault* pData = qobject_cast<nmDataFault*>(sender());
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
nmObjLineFault* pGraphic = m_mapFaultData.key(pData, nullptr);
|
|
|
|
|
if (pGraphic) {
|
|
|
|
|
_pushFaultDataToGraphic(pGraphic, pData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 数据变更(预留)
|
|
|
|
|
void nmPlotGraphicBinder::onDataChanged()
|
|
|
|
|
{
|
|
|
|
|
@ -269,6 +318,11 @@ void nmPlotGraphicBinder::onDataChanged()
|
|
|
|
|
|
|
|
|
|
// 用户画完裂缝后:创建数据对象并建立绑定
|
|
|
|
|
void nmPlotGraphicBinder::createCrackForGraphic(nmObjLineCrack* pGraphic)
|
|
|
|
|
{
|
|
|
|
|
createCrackForGraphic(pGraphic, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmPlotGraphicBinder::createCrackForGraphic(nmObjLineCrack* pGraphic, bool bNotifyGeometryList)
|
|
|
|
|
{
|
|
|
|
|
if (!pGraphic || !m_pDataMgr) {
|
|
|
|
|
return;
|
|
|
|
|
@ -293,7 +347,11 @@ void nmPlotGraphicBinder::createCrackForGraphic(nmObjLineCrack* pGraphic)
|
|
|
|
|
// 建立信号连接
|
|
|
|
|
_connectCrack(pGraphic, pData);
|
|
|
|
|
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
if (bNotifyGeometryList) {
|
|
|
|
|
m_pDataMgr->notifyGeometryListChanged();
|
|
|
|
|
} else {
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 从文件加载:绑定已有裂缝数据到已有图元
|
|
|
|
|
@ -304,6 +362,7 @@ void nmPlotGraphicBinder::bindCrackToGraphic(nmObjLineCrack* pGraphic, nmDataFra
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 将数据值推到图元
|
|
|
|
|
pGraphic->setName(pData->getFractureName());
|
|
|
|
|
_pushCrackDataToGraphic(pGraphic, pData);
|
|
|
|
|
|
|
|
|
|
// 建立信号连接
|
|
|
|
|
@ -342,6 +401,10 @@ void nmPlotGraphicBinder::syncCrackName(nmObjLineCrack* pGraphic)
|
|
|
|
|
nmDataFracture* pData = m_mapCrackData.value(pGraphic, nullptr);
|
|
|
|
|
if (pData && pData->getFractureName() != pGraphic->getName()) {
|
|
|
|
|
pData->setFractureName(pGraphic->getName());
|
|
|
|
|
// DFN 裂缝不在参数面板中显示,改名时无需重建面板。
|
|
|
|
|
if (m_pDataMgr && pData->getFractureType().getValue().toString() != "DFN") {
|
|
|
|
|
m_pDataMgr->notifyParameterObjectNameChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -349,9 +412,9 @@ void nmPlotGraphicBinder::syncCrackName(nmObjLineCrack* pGraphic)
|
|
|
|
|
void nmPlotGraphicBinder::_pushCrackDataToGraphic(nmObjLineCrack* pGraphic, nmDataFracture* pData)
|
|
|
|
|
{
|
|
|
|
|
// 阻断信号,防止推送中触发反向同步
|
|
|
|
|
pGraphic->blockSignals(true);
|
|
|
|
|
bool bOldSignalsBlocked = pGraphic->blockSignals(true);
|
|
|
|
|
|
|
|
|
|
pGraphic->setName(pData->getFractureName());
|
|
|
|
|
pGraphic->setAllValues(pData->getFracturePoints());
|
|
|
|
|
|
|
|
|
|
int flowModel = (pData->getFractureFlowModel().getValue() == tr("Infinite Conductivity")) ? 0 : 1;
|
|
|
|
|
pGraphic->setCrackFlowModel(flowModel);
|
|
|
|
|
@ -359,7 +422,14 @@ void nmPlotGraphicBinder::_pushCrackDataToGraphic(nmObjLineCrack* pGraphic, nmDa
|
|
|
|
|
pGraphic->setCrackDfc(pData->getFractureDfc().getValue().toDouble());
|
|
|
|
|
pGraphic->setCrackDw(pData->getFractureDw().getValue().toDouble());
|
|
|
|
|
|
|
|
|
|
pGraphic->blockSignals(false);
|
|
|
|
|
pGraphic->blockSignals(bOldSignalsBlocked);
|
|
|
|
|
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjLineCrackStartPos.StartPointX", pData->getStartX().getValue());
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjLineCrackStartPos.StartPointY", pData->getStartY().getValue());
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjLineCrackEndPos.EndPointX", pData->getEndX().getValue());
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjLineCrackEndPos.EndPointY", pData->getEndY().getValue());
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjLineFracture.dFc", pData->getFractureDfc().getValue());
|
|
|
|
|
pGraphic->update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 建立裂缝图元与数据的双向信号连接
|
|
|
|
|
@ -379,6 +449,8 @@ void nmPlotGraphicBinder::_connectCrack(nmObjLineCrack* pGraphic, nmDataFracture
|
|
|
|
|
|
|
|
|
|
QObject::connect(pGraphic, SIGNAL(sigObjVisibleChanged(bool)),
|
|
|
|
|
this, SLOT(onGraphicCrackVisibleChanged(bool)));
|
|
|
|
|
QObject::connect(pData, SIGNAL(sigFractureDataChanged()),
|
|
|
|
|
this, SLOT(onFractureDataChanged()), Qt::UniqueConnection);
|
|
|
|
|
|
|
|
|
|
m_mapCrackData[pGraphic] = pData;
|
|
|
|
|
|
|
|
|
|
@ -405,6 +477,12 @@ void nmPlotGraphicBinder::_disconnectCrack(nmObjLineCrack* pGraphic)
|
|
|
|
|
QObject::disconnect(pGraphic, SIGNAL(sigObjVisibleChanged(bool)),
|
|
|
|
|
this, SLOT(onGraphicCrackVisibleChanged(bool)));
|
|
|
|
|
|
|
|
|
|
nmDataFracture* pData = m_mapCrackData.value(pGraphic, nullptr);
|
|
|
|
|
if (pData != nullptr) {
|
|
|
|
|
QObject::disconnect(pData, SIGNAL(sigFractureDataChanged()),
|
|
|
|
|
this, SLOT(onFractureDataChanged()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_setBoundCrackGraphics.remove(pGraphic);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -431,9 +509,9 @@ void nmPlotGraphicBinder::onGraphicCrackDfcChanged(double dfc)
|
|
|
|
|
nmDataFracture* pData = m_mapCrackData.value(pGraphic, nullptr);
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
nmDataAttribute attr = pData->getFractureDfc();
|
|
|
|
|
attr.setValue(dfc);
|
|
|
|
|
pData->setFractureDfc(attr);
|
|
|
|
|
if (pData->getFractureDfc().getValue().toDouble() != dfc) {
|
|
|
|
|
pData->getFractureDfc().setValue(dfc);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 裂缝储能比变更
|
|
|
|
|
@ -460,7 +538,6 @@ void nmPlotGraphicBinder::onGraphicCrackPointsChanged()
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
pData->setFracturePoints(pGraphic->getAllValues());
|
|
|
|
|
pData->setFractureName(pGraphic->getName());
|
|
|
|
|
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
@ -479,6 +556,18 @@ void nmPlotGraphicBinder::onGraphicCrackVisibleChanged(bool bVisible)
|
|
|
|
|
pData->setPlotVisible(bVisible);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 数据参数变更 -> 同步到图元和左侧属性面板
|
|
|
|
|
void nmPlotGraphicBinder::onFractureDataChanged()
|
|
|
|
|
{
|
|
|
|
|
nmDataFracture* pData = qobject_cast<nmDataFracture*>(sender());
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
nmObjLineCrack* pGraphic = m_mapCrackData.key(pData, nullptr);
|
|
|
|
|
if (pGraphic) {
|
|
|
|
|
_pushCrackDataToGraphic(pGraphic, pData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ==================== 边界图元绑定 ====================
|
|
|
|
|
|
|
|
|
|
// 圆形边界:用户画完后创建数据并绑定
|
|
|
|
|
@ -508,7 +597,7 @@ void nmPlotGraphicBinder::createOutlineForGraphic(nmObjRoundOutline* pGraphic)
|
|
|
|
|
pData->setBackgrdAlpha(roundClr.alpha());
|
|
|
|
|
pData->setVisualPropsValid(true);
|
|
|
|
|
|
|
|
|
|
double qradius = pGraphic->getAllValues()[2].y() - pGraphic->getAllValues()[0].y();
|
|
|
|
|
double qradius = qAbs(pGraphic->getAllValues()[2].y() - pGraphic->getAllValues()[0].y());
|
|
|
|
|
pData->setRadius(qradius);
|
|
|
|
|
pData->setCenter(pGraphic->getAllValues()[0]);
|
|
|
|
|
|
|
|
|
|
@ -517,7 +606,7 @@ void nmPlotGraphicBinder::createOutlineForGraphic(nmObjRoundOutline* pGraphic)
|
|
|
|
|
_connectOutline(pGraphic, pData);
|
|
|
|
|
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
m_pDataMgr->notifyGeometryListChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -551,7 +640,7 @@ void nmPlotGraphicBinder::createOutlineForGraphic(nmObjRectOutline* pGraphic)
|
|
|
|
|
_connectOutline(pGraphic, pData);
|
|
|
|
|
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
m_pDataMgr->notifyGeometryListChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -585,7 +674,7 @@ void nmPlotGraphicBinder::createOutlineForGraphic(nmObjPolygonOutline* pGraphic)
|
|
|
|
|
_connectOutline(pGraphic, pData);
|
|
|
|
|
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
m_pDataMgr->notifyGeometryListChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -597,6 +686,7 @@ void nmPlotGraphicBinder::bindOutlineToGraphic(nmObjBase* pGraphic, nmDataOutlin
|
|
|
|
|
m_mapOutlineData[pGraphic] = pData;
|
|
|
|
|
m_setBoundOutlineGraphics.insert(pGraphic);
|
|
|
|
|
|
|
|
|
|
pGraphic->setName(pData->getName());
|
|
|
|
|
_pushOutlineDataToGraphic(pGraphic, pData);
|
|
|
|
|
_connectOutline(pGraphic, pData);
|
|
|
|
|
}
|
|
|
|
|
@ -606,12 +696,13 @@ void nmPlotGraphicBinder::removeOutlineBinding(nmObjBase* pGraphic)
|
|
|
|
|
{
|
|
|
|
|
if (!pGraphic) return;
|
|
|
|
|
|
|
|
|
|
nmDataOutline* pData = m_mapOutlineData.value(pGraphic, nullptr);
|
|
|
|
|
|
|
|
|
|
_disconnectOutline(pGraphic);
|
|
|
|
|
m_mapOutlineData.remove(pGraphic);
|
|
|
|
|
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
if (m_pDataMgr && pData != nullptr && m_pDataMgr->getOutlineData() == pData) {
|
|
|
|
|
m_pDataMgr->removeOutlineData();
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -628,6 +719,9 @@ void nmPlotGraphicBinder::syncOutlineName(nmObjBase* pGraphic)
|
|
|
|
|
nmDataOutline* pData = m_mapOutlineData.value(pGraphic, nullptr);
|
|
|
|
|
if (pData && pData->getName() != pGraphic->getName()) {
|
|
|
|
|
pData->setName(pGraphic->getName());
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyParameterObjectNameChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -669,17 +763,20 @@ void nmPlotGraphicBinder::syncOutlineVisual(nmObjBase* pGraphic)
|
|
|
|
|
pData->setVisualPropsValid(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 建立边界图元与数据的信号连接(三条信号)
|
|
|
|
|
// 建立边界图元与数据的信号连接
|
|
|
|
|
void nmPlotGraphicBinder::_connectOutline(nmObjBase* pGraphic, nmDataOutline* pData)
|
|
|
|
|
{
|
|
|
|
|
QObject::connect(pGraphic, SIGNAL(sigOutlinePointsChanged()),
|
|
|
|
|
this, SLOT(onGraphicOutlinePointsChanged()));
|
|
|
|
|
this, SLOT(onGraphicOutlinePointsChanged()), Qt::UniqueConnection);
|
|
|
|
|
|
|
|
|
|
QObject::connect(pGraphic, SIGNAL(sigOutlineFlowTypeChanged()),
|
|
|
|
|
this, SLOT(onGraphicOutlineFlowTypeChanged()));
|
|
|
|
|
this, SLOT(onGraphicOutlineFlowTypeChanged()), Qt::UniqueConnection);
|
|
|
|
|
|
|
|
|
|
QObject::connect(pGraphic, SIGNAL(sigObjVisibleChanged(bool)),
|
|
|
|
|
this, SLOT(onGraphicOutlineVisibleChanged(bool)));
|
|
|
|
|
this, SLOT(onGraphicOutlineVisibleChanged(bool)), Qt::UniqueConnection);
|
|
|
|
|
|
|
|
|
|
QObject::connect(pData, SIGNAL(sigOutlineDataChanged()),
|
|
|
|
|
this, SLOT(onOutlineDataChanged()), Qt::UniqueConnection);
|
|
|
|
|
|
|
|
|
|
m_setBoundOutlineGraphics.insert(pGraphic);
|
|
|
|
|
|
|
|
|
|
@ -705,15 +802,29 @@ void nmPlotGraphicBinder::_disconnectOutline(nmObjBase* pGraphic)
|
|
|
|
|
QObject::disconnect(pGraphic, SIGNAL(sigObjVisibleChanged(bool)),
|
|
|
|
|
this, SLOT(onGraphicOutlineVisibleChanged(bool)));
|
|
|
|
|
|
|
|
|
|
nmDataOutline* pData = m_mapOutlineData.value(pGraphic, nullptr);
|
|
|
|
|
if (pData != nullptr) {
|
|
|
|
|
QObject::disconnect(pData, SIGNAL(sigOutlineDataChanged()),
|
|
|
|
|
this, SLOT(onOutlineDataChanged()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (nmObjRoundOutline* pRound = dynamic_cast<nmObjRoundOutline*>(pGraphic)) {
|
|
|
|
|
pRound->setGraphicBinder(nullptr);
|
|
|
|
|
} else if (nmObjRectOutline* pRect = dynamic_cast<nmObjRectOutline*>(pGraphic)) {
|
|
|
|
|
pRect->setGraphicBinder(nullptr);
|
|
|
|
|
} else if (nmObjPolygonOutline* pPolygon = dynamic_cast<nmObjPolygonOutline*>(pGraphic)) {
|
|
|
|
|
pPolygon->setGraphicBinder(nullptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_setBoundOutlineGraphics.remove(pGraphic);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 从边界数据对象读取值,写入图元本地副本(加载时用)
|
|
|
|
|
// 从边界数据对象读取值,写入图元本地副本(加载及参数变更时用)
|
|
|
|
|
void nmPlotGraphicBinder::_pushOutlineDataToGraphic(nmObjBase* pGraphic, nmDataOutline* pData)
|
|
|
|
|
{
|
|
|
|
|
pGraphic->blockSignals(true);
|
|
|
|
|
bool bOldSignalsBlocked = pGraphic->blockSignals(true);
|
|
|
|
|
|
|
|
|
|
pGraphic->setName(pData->getName());
|
|
|
|
|
pGraphic->setAllValues(pData->getOutlinePoints());
|
|
|
|
|
|
|
|
|
|
QVector<int> flowTypes = pData->getFlowTypeList();
|
|
|
|
|
|
|
|
|
|
@ -749,7 +860,8 @@ void nmPlotGraphicBinder::_pushOutlineDataToGraphic(nmObjBase* pGraphic, nmDataO
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pGraphic->blockSignals(false);
|
|
|
|
|
pGraphic->blockSignals(bOldSignalsBlocked);
|
|
|
|
|
pGraphic->update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ==================== 边界图元信号 → 数据同步 ====================
|
|
|
|
|
@ -763,20 +875,38 @@ void nmPlotGraphicBinder::onGraphicOutlinePointsChanged()
|
|
|
|
|
nmDataOutline* pData = m_mapOutlineData.value(pGraphic, nullptr);
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
pData->setOutlinePoints(pGraphic->getAllValues());
|
|
|
|
|
const int nOldPointCount = pData->getOutlinePointCount();
|
|
|
|
|
const QVector<QPointF> points = pGraphic->getAllValues();
|
|
|
|
|
pData->setOutlinePoints(points);
|
|
|
|
|
|
|
|
|
|
// 圆形边界额外同步 radius 和 center
|
|
|
|
|
if (nmObjRoundOutline* pRound = dynamic_cast<nmObjRoundOutline*>(pGraphic)) {
|
|
|
|
|
QVector<QPointF> pts = pRound->getAllValues();
|
|
|
|
|
if (pts.count() >= 3) {
|
|
|
|
|
double radius = pts[2].y() - pts[0].y();
|
|
|
|
|
double radius = qAbs(pts[2].y() - pts[0].y());
|
|
|
|
|
pData->setRadius(radius);
|
|
|
|
|
pData->setCenter(pts[0]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
if (nOldPointCount != points.count()) {
|
|
|
|
|
m_pDataMgr->notifyGeometryListChanged();
|
|
|
|
|
} else {
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 数据参数变更 -> 同步到图元
|
|
|
|
|
void nmPlotGraphicBinder::onOutlineDataChanged()
|
|
|
|
|
{
|
|
|
|
|
nmDataOutline* pData = qobject_cast<nmDataOutline*>(sender());
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
nmObjBase* pGraphic = m_mapOutlineData.key(pData, nullptr);
|
|
|
|
|
if (pGraphic) {
|
|
|
|
|
_pushOutlineDataToGraphic(pGraphic, pData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -938,7 +1068,7 @@ void nmPlotGraphicBinder::createRegionMarkForGraphic(nmObjRegionMark* pGraphic)
|
|
|
|
|
// 建立信号连接
|
|
|
|
|
_connectRegionMark(pGraphic, pData);
|
|
|
|
|
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
m_pDataMgr->notifyGeometryListChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 从文件加载:绑定已有区域标记数据到已有图元
|
|
|
|
|
@ -980,7 +1110,12 @@ void nmPlotGraphicBinder::syncRegionMarkData(nmObjRegionMark* pGraphic)
|
|
|
|
|
nmDataRegionMark* pData = m_mapRegionMarkData.value(pGraphic, nullptr);
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
pData->setRegionMarkName(pGraphic->getName());
|
|
|
|
|
if (pData->getRegionMarkName() != pGraphic->getName()) {
|
|
|
|
|
pData->setRegionMarkName(pGraphic->getName());
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyParameterObjectNameChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pData->setBackgroundColor(pGraphic->getBackgrdColor());
|
|
|
|
|
pData->setSelectRegion(pGraphic->getSelectRegion());
|
|
|
|
|
|
|
|
|
|
@ -1026,9 +1161,9 @@ void nmPlotGraphicBinder::onGraphicRegionMarkComKrChanged(double comKr)
|
|
|
|
|
nmDataRegionMark* pData = m_mapRegionMarkData.value(pGraphic, nullptr);
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
nmDataAttribute attr = pData->getComKr();
|
|
|
|
|
attr.setValue(comKr);
|
|
|
|
|
pData->setComKr(attr);
|
|
|
|
|
if (pData->getComKr().getValue().toDouble() != comKr) {
|
|
|
|
|
pData->getComKr().setValue(comKr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
@ -1043,9 +1178,9 @@ void nmPlotGraphicBinder::onGraphicRegionMarkComWChanged(double comW)
|
|
|
|
|
nmDataRegionMark* pData = m_mapRegionMarkData.value(pGraphic, nullptr);
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
nmDataAttribute attr = pData->getComW();
|
|
|
|
|
attr.setValue(comW);
|
|
|
|
|
pData->setComW(attr);
|
|
|
|
|
if (pData->getComW().getValue().toDouble() != comW) {
|
|
|
|
|
pData->getComW().setValue(comW);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
@ -1060,9 +1195,9 @@ void nmPlotGraphicBinder::onGraphicRegionMarkNetToGrossChanged(double netToGross
|
|
|
|
|
nmDataRegionMark* pData = m_mapRegionMarkData.value(pGraphic, nullptr);
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
nmDataAttribute attr = pData->getNetToGross();
|
|
|
|
|
attr.setValue(netToGross);
|
|
|
|
|
pData->setNetToGross(attr);
|
|
|
|
|
if (pData->getNetToGross().getValue().toDouble() != netToGross) {
|
|
|
|
|
pData->getNetToGross().setValue(netToGross);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
@ -1106,6 +1241,8 @@ void nmPlotGraphicBinder::_connectRegionMark(nmObjRegionMark* pGraphic, nmDataRe
|
|
|
|
|
this, SLOT(onGraphicRegionMarkNetToGrossChanged(double)));
|
|
|
|
|
connect(pGraphic, SIGNAL(sigObjVisibleChanged(bool)),
|
|
|
|
|
this, SLOT(onGraphicRegionMarkVisibleChanged(bool)));
|
|
|
|
|
connect(pData, SIGNAL(sigRegionMarkDataChanged()),
|
|
|
|
|
this, SLOT(onRegionMarkDataChanged()), Qt::UniqueConnection);
|
|
|
|
|
|
|
|
|
|
m_setBoundRegionMarkGraphics.insert(pGraphic);
|
|
|
|
|
}
|
|
|
|
|
@ -1130,13 +1267,19 @@ void nmPlotGraphicBinder::_disconnectRegionMark(nmObjRegionMark* pGraphic)
|
|
|
|
|
disconnect(pGraphic, SIGNAL(sigObjVisibleChanged(bool)),
|
|
|
|
|
this, SLOT(onGraphicRegionMarkVisibleChanged(bool)));
|
|
|
|
|
|
|
|
|
|
nmDataRegionMark* pData = m_mapRegionMarkData.value(pGraphic, nullptr);
|
|
|
|
|
if (pData != nullptr) {
|
|
|
|
|
disconnect(pData, SIGNAL(sigRegionMarkDataChanged()),
|
|
|
|
|
this, SLOT(onRegionMarkDataChanged()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_setBoundRegionMarkGraphics.remove(pGraphic);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 从数据对象读取值,写入图元本地副本(加载时用)
|
|
|
|
|
// 从数据对象读取值,写入图元本地副本(加载及参数变更时用)
|
|
|
|
|
void nmPlotGraphicBinder::_pushRegionMarkDataToGraphic(nmObjRegionMark* pGraphic, nmDataRegionMark* pData)
|
|
|
|
|
{
|
|
|
|
|
pGraphic->blockSignals(true);
|
|
|
|
|
bool bOldSignalsBlocked = pGraphic->blockSignals(true);
|
|
|
|
|
|
|
|
|
|
// 储层类型:字符串 → int
|
|
|
|
|
if (pData->getReservoirType().getValue() == "Homogeneous") {
|
|
|
|
|
@ -1154,7 +1297,24 @@ void nmPlotGraphicBinder::_pushRegionMarkDataToGraphic(nmObjRegionMark* pGraphic
|
|
|
|
|
pts << pData->getPtPos();
|
|
|
|
|
pGraphic->setAllValues(pts);
|
|
|
|
|
|
|
|
|
|
pGraphic->blockSignals(false);
|
|
|
|
|
pGraphic->blockSignals(bOldSignalsBlocked);
|
|
|
|
|
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjRegionMark.dComW", pData->getComW().getValue());
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjRegionMark.dComKr", pData->getComKr().getValue());
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjRegionMark.NetToGross", pData->getNetToGross().getValue());
|
|
|
|
|
pGraphic->update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 数据参数变更 -> 同步到图元和左侧属性面板
|
|
|
|
|
void nmPlotGraphicBinder::onRegionMarkDataChanged()
|
|
|
|
|
{
|
|
|
|
|
nmDataRegionMark* pData = qobject_cast<nmDataRegionMark*>(sender());
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
nmObjRegionMark* pGraphic = m_mapRegionMarkData.key(pData, nullptr);
|
|
|
|
|
if (pGraphic) {
|
|
|
|
|
_pushRegionMarkDataToGraphic(pGraphic, pData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ==================== 复合区图元 ====================
|
|
|
|
|
@ -1197,7 +1357,7 @@ void nmPlotGraphicBinder::createRegionForGraphic(nmObjRegion* pGraphic)
|
|
|
|
|
// 建立信号连接
|
|
|
|
|
_connectRegion(pGraphic, pData);
|
|
|
|
|
|
|
|
|
|
m_pDataMgr->notifyDataChanged();
|
|
|
|
|
m_pDataMgr->notifyGeometryListChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 从文件加载:绑定已有数据到已有图元
|
|
|
|
|
@ -1240,7 +1400,12 @@ void nmPlotGraphicBinder::syncRegionData(nmObjRegion* pGraphic)
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
// 兜底同步:名称、位置
|
|
|
|
|
pData->setRegionName(pGraphic->getName());
|
|
|
|
|
if (pData->getRegoinName() != pGraphic->getName()) {
|
|
|
|
|
pData->setRegionName(pGraphic->getName());
|
|
|
|
|
if (m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyParameterObjectNameChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pData->setVecPts(pGraphic->getAllValues());
|
|
|
|
|
|
|
|
|
|
// 视觉属性兜底同步:画笔宽度、填充背景色
|
|
|
|
|
@ -1304,9 +1469,9 @@ void nmPlotGraphicBinder::onGraphicRegionLeakageChanged(double leakage)
|
|
|
|
|
nmDataRegion* pData = m_mapRegionData.value(pGraphic, nullptr);
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
nmDataAttribute attr = pData->getRegionLeakage();
|
|
|
|
|
attr.setValue(leakage);
|
|
|
|
|
pData->setRegionLeakage(attr);
|
|
|
|
|
if (pData->getRegionLeakage().getValue().toDouble() != leakage) {
|
|
|
|
|
pData->getRegionLeakage().setValue(leakage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmPlotGraphicBinder::onGraphicRegionVisibleChanged(bool bVisible)
|
|
|
|
|
@ -1332,6 +1497,8 @@ void nmPlotGraphicBinder::_connectRegion(nmObjRegion* pGraphic, nmDataRegion* pD
|
|
|
|
|
this, SLOT(onGraphicRegionLeakageChanged(double)));
|
|
|
|
|
connect(pGraphic, SIGNAL(sigObjVisibleChanged(bool)),
|
|
|
|
|
this, SLOT(onGraphicRegionVisibleChanged(bool)));
|
|
|
|
|
connect(pData, SIGNAL(sigRegionDataChanged()),
|
|
|
|
|
this, SLOT(onRegionDataChanged()), Qt::UniqueConnection);
|
|
|
|
|
|
|
|
|
|
m_setBoundRegionGraphics.insert(pGraphic);
|
|
|
|
|
}
|
|
|
|
|
@ -1349,15 +1516,21 @@ void nmPlotGraphicBinder::_disconnectRegion(nmObjRegion* pGraphic)
|
|
|
|
|
disconnect(pGraphic, SIGNAL(sigObjVisibleChanged(bool)),
|
|
|
|
|
this, SLOT(onGraphicRegionVisibleChanged(bool)));
|
|
|
|
|
|
|
|
|
|
nmDataRegion* pData = m_mapRegionData.value(pGraphic, nullptr);
|
|
|
|
|
if (pData != nullptr) {
|
|
|
|
|
disconnect(pData, SIGNAL(sigRegionDataChanged()),
|
|
|
|
|
this, SLOT(onRegionDataChanged()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_setBoundRegionGraphics.remove(pGraphic);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 从数据对象读取值,写入图元本地副本(加载时用)
|
|
|
|
|
// 从数据对象读取值,写入图元本地副本(加载及参数变更时用)
|
|
|
|
|
void nmPlotGraphicBinder::_pushRegionDataToGraphic(nmObjRegion* pGraphic, nmDataRegion* pData)
|
|
|
|
|
{
|
|
|
|
|
if (!pGraphic || !pData) return;
|
|
|
|
|
|
|
|
|
|
pGraphic->blockSignals(true);
|
|
|
|
|
bool bOldSignalsBlocked = pGraphic->blockSignals(true);
|
|
|
|
|
|
|
|
|
|
// 流动模型:字符串 → int
|
|
|
|
|
if (pData->getRegionFlowModel().getValue() == "Leaky") {
|
|
|
|
|
@ -1374,7 +1547,22 @@ void nmPlotGraphicBinder::_pushRegionDataToGraphic(nmObjRegion* pGraphic, nmData
|
|
|
|
|
pGraphic->setPen(pen);
|
|
|
|
|
pGraphic->setBackgrdColor(pData->getBackgrdColor());
|
|
|
|
|
|
|
|
|
|
pGraphic->blockSignals(false);
|
|
|
|
|
pGraphic->blockSignals(bOldSignalsBlocked);
|
|
|
|
|
|
|
|
|
|
refreshPropertyValue(pGraphic, "ObjRegion.Leakage", pData->getRegionLeakage().getValue());
|
|
|
|
|
pGraphic->update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 数据参数变更 -> 同步到图元和左侧属性面板
|
|
|
|
|
void nmPlotGraphicBinder::onRegionDataChanged()
|
|
|
|
|
{
|
|
|
|
|
nmDataRegion* pData = qobject_cast<nmDataRegion*>(sender());
|
|
|
|
|
if (!pData) return;
|
|
|
|
|
|
|
|
|
|
nmObjRegion* pGraphic = m_mapRegionData.key(pData, nullptr);
|
|
|
|
|
if (pGraphic) {
|
|
|
|
|
_pushRegionDataToGraphic(pGraphic, pData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ==================== 井图元 ====================
|
|
|
|
|
@ -1441,15 +1629,20 @@ void nmPlotGraphicBinder::syncWellData(nmObjPointWell* pGraphic)
|
|
|
|
|
|
|
|
|
|
// 同步名称(用户在属性面板改名后,同步到数据中心和框架数据)
|
|
|
|
|
QString sName = pGraphic->getName();
|
|
|
|
|
bool bNameChanged = false;
|
|
|
|
|
if (!sName.isEmpty()) {
|
|
|
|
|
if (pData->getWellName() != sName) {
|
|
|
|
|
pData->setWellName(sName);
|
|
|
|
|
bNameChanged = true;
|
|
|
|
|
}
|
|
|
|
|
if (pWellData && pWellData->getName() != sName) {
|
|
|
|
|
pWellData->setName(sName);
|
|
|
|
|
pWellData->save();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (bNameChanged && m_pDataMgr) {
|
|
|
|
|
m_pDataMgr->notifyParameterObjectNameChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (pWellData) {
|
|
|
|
|
// 数值井数据是分析侧的数据源,这里回写到框架井数据,保证保存工程树时一致。
|
|
|
|
|
|