|
|
|
|
@ -1,8 +1,6 @@
|
|
|
|
|
#include <QPainter>
|
|
|
|
|
|
|
|
|
|
//#include "ZxBaseUtil.h"
|
|
|
|
|
|
|
|
|
|
#include "nmDefines.h"
|
|
|
|
|
#include "nmDataLogFile.h"
|
|
|
|
|
#include "nmObjPointWell.h"
|
|
|
|
|
#include "nmObjPointWellTool.h"
|
|
|
|
|
|
|
|
|
|
@ -10,23 +8,48 @@ nmObjPointWellTool::nmObjPointWellTool()
|
|
|
|
|
{
|
|
|
|
|
setText(tr("nObjPointWellTool"));
|
|
|
|
|
m_oNot = NMOT_Point_Well;
|
|
|
|
|
enableInteractionCursor();
|
|
|
|
|
enableEscapeCancellation();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool nmObjPointWellTool::onLeftDoubleClick(const QPointF &pt)
|
|
|
|
|
bool nmObjPointWellTool::onLeftDoubleClick(const QPointF& pt)
|
|
|
|
|
{
|
|
|
|
|
if (NULL != m_pObj) {
|
|
|
|
|
int nOption = -1;
|
|
|
|
|
int nIndex = -1;
|
|
|
|
|
if (m_pObj->_runHitTest(pt, nOption, nIndex)) {
|
|
|
|
|
// yours own codes
|
|
|
|
|
nmObjPointWell* pObj = dynamic_cast<nmObjPointWell*>(m_pObj);
|
|
|
|
|
if (pObj == nullptr) {
|
|
|
|
|
return nmObjToolBase::onLeftDoubleClick(pt);
|
|
|
|
|
}
|
|
|
|
|
NM_DATA_LOG_FILE(pObj->getWellID());
|
|
|
|
|
pObj->editWell();
|
|
|
|
|
return true;
|
|
|
|
|
nmObjPointWell* well = dynamic_cast<nmObjPointWell*>(m_pObj);
|
|
|
|
|
int option = -1;
|
|
|
|
|
int index = -1;
|
|
|
|
|
if (well != nullptr && well->_runHitTest(pt, option, index)) {
|
|
|
|
|
if (!well->isReadOnly()) {
|
|
|
|
|
NM_DATA_LOG_FILE(well->getWellID());
|
|
|
|
|
well->editWell();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return nmObjToolBase::onLeftDoubleClick(pt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmObjPointWellTool::onPaint(QPainter* painter, const ZxPaintParam& param)
|
|
|
|
|
{
|
|
|
|
|
if (m_pObj == nullptr) {
|
|
|
|
|
nmObjPointTool::onPaint(painter, param);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nmObjPointWell* well = dynamic_cast<nmObjPointWell*>(m_pObj);
|
|
|
|
|
if (well != nullptr && well->isSelected() && well->isVisible() &&
|
|
|
|
|
!well->isReadOnly() && !well->isLockPos() && m_oHitOption == OHO_Point &&
|
|
|
|
|
m_bTracking && isLeftDown() && !isClick()) {
|
|
|
|
|
paintMovePreview(painter, *well);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Qt::CursorShape nmObjPointWellTool::getCursorBy(const int& nOption, const int& nSubIndex)
|
|
|
|
|
{
|
|
|
|
|
return nmObjToolBase::getCursorBy(nOption, nSubIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Qt::CursorShape nmObjPointWellTool::interactionCursor(int nOption, int nSubIndex, bool dragging) const
|
|
|
|
|
{
|
|
|
|
|
// 拖井点是整体平移,复用位置锁定、只读和手形光标规则。
|
|
|
|
|
const ObjHitOption moveOption = nOption == OHO_Point ? OHO_Bound : OHO_None;
|
|
|
|
|
return nmObjToolBase::interactionCursor(moveOption, nSubIndex, dragging);
|
|
|
|
|
}
|
|
|
|
|
|