#include #include "stdafx.h" #include "SigmaDoc.h" #include "UndoManager/UndoManager.h" #include "ItemSelect.h" #include "ItemEllipse.h" #include "ItemCircle.h" #include "ItemProportion.h" #include "ItemPointAdd.h" #include "ItemCurveArc.h" #include "ItemGrid.h" #include "ItemText.h" #include "ItemRectangle.h" #include "ItemEquilateral.h" #include "ItemDelete.h" #include "ItemExtendCurve.h" #include "SigmaView.h" #include "ItemBreakCurve.h" #include "ItemTrimCurve.h" #include "ItemCutIn.h" #include "ItemCutOut.h" #include "ItemPointCrossAdd.h" #include "ItemCurveProcess.h" #include "ItemCurveEditDeleteMulNodes.h" #include "ItemEditCurveInName.H" #include "ItemLinkCurve.h" #include "DrawOperator/XyIO.h" #include "PublicParam.h" #include "ItemCopyAsImage.h" #include "ItemAlign.h" #include "ItemMesh.h" #include "FindReplacement.h" #include "StringManager.h" #include "ItemPointProcess.h" #include "ItemSaveToMark.h" #include "ItemSolid.h" #include "ItemSetContourName.h" #include "ItemCopyAsImageEx.h" #include "ItemCopyAsImagePolygon.h" #include "ItemWellGroup.h" #include "ItemWellGroupEdit.h" #include "ItemBranchCurveEdit.h" #include "ItemMeasure.h" #include "ItemEraser.h" #include "TinyXml/tinyxml.h" #include "Util.h" #include "SigmaStore.h" #include "DrawOperator\FileUtility.h" #include "StorageFactory.h" CSigmaDoc::CSigmaDoc() : m_bRedraw(true) , m_pXy(nullptr) , m_nUnitMode(0) , m_bSaveAllLayer(true) , m_bCapture(false) , m_bEnableMeshPackage(false) , m_crossPointStatus(-1) , m_pLastAction(nullptr) , m_EditLineState(0) { MoveSelect = NULL; DocInit(); m_pDrawer = std::make_unique(); } CSigmaDoc::~CSigmaDoc() { if (m_pXy != nullptr) { CSplitPath sp(""); CString path = sp.GetAbsolutePath(m_FileName); CSigmaStore::GetInstance().Clear(path); m_pActionMgr.reset(); delete m_pXy; m_pXy = nullptr; } } double CSigmaDoc::GetCurrentUnitScale(void) { CUnit ut; CSize szUnit = m_pXy->GetUnit(); double scale = ut.Millimetres(CUnit::UNIT_KM) / ut.Millimetres(szUnit.cx); return scale; } void CSigmaDoc::EnableMeshPackage(BOOL isEnable, BOOL force) { m_bEnableMeshPackage = isEnable; if (m_pXy != nullptr) { m_pXy->EnableMeshPackage(isEnable, force); } } void CSigmaDoc::SetFaultLayer(CString layer) { if (m_pXy != nullptr) { m_pXy->SetFaultLayer(layer); } } CString CSigmaDoc::GetFaultLayer() { return m_pXy->GetFaultLayer(); } void CSigmaDoc::SetBorderLayer(CString layer) { if (m_pXy != nullptr) { m_pXy->SetBorderLayer(layer); } } CString CSigmaDoc::GetBorderLayer() { return m_pXy->GetBorderLayer(); } void CSigmaDoc::SetFaultLayer3D(CString layer) { if (m_pXy != nullptr) { m_pXy->SetFaultLayer3D(layer); } } CString CSigmaDoc::GetFaultLayer3D() { return m_pXy->GetFaultLayer3D(); } void CSigmaDoc::SetBorderLayer3D(CString layer) { if (m_pXy != nullptr) { m_pXy->SetBorderLayer3D(layer); } } CString CSigmaDoc::GetBorderLayer3D() { return m_pXy->GetBorderLayer3D(); } void CSigmaDoc::SetWellLayer3D(CString layer) { if (m_pXy != nullptr) { m_pXy->SetWellLayer3D(layer); } } CString CSigmaDoc::GetWellLayer3D() { return m_pXy->GetWellLayer3D(); } void CSigmaDoc::SetMainMeshLayer3D(CString layer) { if (m_pXy != nullptr) { m_pXy->SetMeshLayer3D(layer); } } CString CSigmaDoc::GetMainMeshLayer3D() { return m_pXy->GetMeshLayer3D(); } void CSigmaDoc::SetMainMeshId3D(int64_t id) { if (m_pXy != nullptr) { m_pXy->SetMainMeshId3D(id); } } int64_t CSigmaDoc::GetMainMeshId3D() { return m_pXy->GetMainMeshId3D(); } void CSigmaDoc::DocInit(void) //建立m_pItemView、m_pItemPrint的对象生成 { if (m_pXy) delete m_pXy; m_pXy = NULL; m_pXy = new CXy(); m_pItemPrint = std::make_unique(this); m_pItemView = std::make_unique(this); m_pItemView->m_BackColor = this->mBackColor; m_pActionMgr = std::make_unique(this); m_pFindReplacement = make_unique(this); } CItemView* CSigmaDoc::GetItemView() { return m_pItemView.get(); } CXy* CSigmaDoc::GetDraw(void) { return m_pXy; } void CSigmaDoc::SetDraw(CXy * pXy) { m_pXy = pXy; } void CSigmaDoc::EnableRedraw(bool bRedraw) { m_bRedraw = bRedraw; } void CSigmaDoc::Serialize(CArchive& ar, CPositionList& list, CXy* pxy)//fbw { if (pxy == NULL) pxy = GetDraw(); short ver = CUR_VERSION; if (ar.IsStoring()) { //BeginProgress(IDS_STRING_WriteClipboard); pxy->DFB_Write(ar, list, ver); ar << (int)0; } else { //BeginProgress(IDS_STRING_ReadClipboard); if (pxy->DFB_Read(ar, list, ver) > 0) { //if (pxy == GetDraw()) //SetModifiedFlag(); } } //EndProgress(); } //void CSigmaDoc::SetModifiedFlag(BOOL bModified /*= TRUE*/) //{ // CDrawDoc::SetModifiedFlag(bModified); // ModifyTitle(bModified); //} void CSigmaDoc::Serialize(CArchive& ar, double leftMargin, double rightMargin, double topMargin, double bottomMargin, int paperSizeType, int pdfAHType, int pdfPapertDirectionType) { //CPublicFunction& pf = *AfxGetPublicFunction(); //CString name=ar.GetFile()->GetFileName(); //name.MakeLower(); //CSplitPath sp(name); if (ar.IsStoring()) { //pf.InitSaveCounter(); CXy* pxy = m_pXy; short ver = pxy->m_version; ////BeginProgress(IDS_STRING_WriteFile); CXyIO xy; xy.AttachInput(pxy, false); CRect rt = m_pView->GetClientRect(); pxy->m_display = GetDC().GetReal(rt); pxy->m_display.NormalizeRect(); GetDC().GetScale(pxy->m_scaleSize.cx, pxy->m_scaleSize.cy); switch (m_nDocTypeID) { default: //当前缺省版本 pxy->DFD_Write2(*(ar.GetFile()), ver, m_bSaveAllLayer); break; case DF_FORMAT_DFT: //双狐模板格式 case DF_FORMAT_BINARY: //双狐二进制格式 pxy->DFB_SerializeWrite(ar, ver, m_bSaveAllLayer); break; case DF_FORMAT_DML: pxy->DML_WriteAll(*(ar.GetFile()), ver, m_bSaveAllLayer); break; case DF_FORMAT_PCG: pxy->PCG_WriteAll(*(ar.GetFile()), 2, m_bSaveAllLayer); break; case DF_FORMAT_OLD_ASCII: //老版本 pxy->DFD_Write2(*(ar.GetFile()), ver, m_bSaveAllLayer); break; case DF_FORMAT_DXF: //pxy->ToDxf(&GetDC(), *(ar.GetFile())); xy.ToDxf(&GetDC(), *(ar.GetFile())); break; case DF_FORMAT_CGM: //pf.SetExportDPI(::GetPreferences().WorkaroundSave.m_nExportModeDPI, ::GetPreferences().WorkaroundSave.m_dExportDPI); pxy->ToCgm(&GetDC(), *(ar.GetFile())); //xy.ToCgm(&GetDC(), *(ar.GetFile())); break; case DF_FORMAT_EPS: //pf.SetExportDPI(::GetPreferences().WorkaroundSave.m_nExportModeDPI, ::GetPreferences().WorkaroundSave.m_dExportDPI); //pxy->ToEps(&GetDC(), *(ar.GetFile())); xy.ToEps(&GetDC(), *(ar.GetFile())); break; case DF_FORMAT_PDF: { //pf.SetExportDPI(::GetPreferences().WorkaroundSave.m_nExportModeDPI, ::GetPreferences().WorkaroundSave.m_dExportDPI); //pxy->ToPdf(&GetDC(), *(ar.GetFile())); CRect8 pRect(leftMargin, topMargin, rightMargin, bottomMargin); xy.ToPdf(&GetDC(), *(ar.GetFile()), pRect, paperSizeType, pdfAHType, pdfPapertDirectionType); break; } case DF_FORMAT_UMAP_ASC: //pxy->ToUmap(&GetDC(), *(ar.GetFile())); xy.ToUmap(&GetDC(), *(ar.GetFile())); break; case DF_FORMAT_MAPGIS_W: //pxy->ToMapGisAsc(&GetDC(), *(ar.GetFile()), FALSE); xy.ToMapGisAsc(&GetDC(), *(ar.GetFile()), FALSE); break; case DF_FORMAT_KML: //pxy->ToKML(*(ar.GetFile())); xy.ToKML(*(ar.GetFile())); break; case DF_FORMAT_GEOMAP: //pxy->ToGeoMap(&GetDC(), *(ar.GetFile())); xy.ToGeoMap(&GetDC(), *(ar.GetFile())); break; case DF_FORMAT_XYZ: pxy->DFD_WriteXYZ(*(ar.GetFile())); break; case DF_FORMAT_GDBX: pxy->ToGDBX(&GetDC(), *ar.GetFile()); break; } } else { if (m_pXy == NULL) m_pXy = new CXy; //BeginProgress(IDS_STRING_OpenFile); CString name = ar.GetFile()->GetFileName(); name.MakeLower(); CSplitPath sp(name); CString ext = sp.GetExtension(); //ar.m_pDocument = this; // set back-pointer in archive if (ext == _T(".dfb") || ext == _T(".dft")) { m_pXy->m_version = m_pXy->DFB_ReadVersion(ar); m_pXy->DFB_ReadEncrypt(ar, m_pXy->m_version); if (m_pXy->IsEncrypted()) { //if (!VerifyPassword(GetDraw())) //{ // m_bCancelRead = TRUE; // EndProgress(); // return; //} } m_pXy->DFB_Serialize(ar, m_pXy->m_version); } else if (ext == ".dml" || ext == ".xml") m_pXy->DML_Read2(*(ar.GetFile())); else if (ext == ".pcg") m_pXy->PCG_Read2(*(ar.GetFile())); else if(ext == ".kev") { m_pXy->DFD_Read2(*(ar.GetFile())); } else if (ext == ".dfd") { m_pXy->DFD_Read2(*(ar.GetFile())); } else if (ext == ".xyz") { m_pXy->DFD_Read2(*(ar.GetFile())); } //// 断层边缘补丁 //m_pXy->CreateMeshPackage(); if (this->m_recoverMode) { SaveRawFile(); } } //EndProgress(); } BOOL CSigmaDoc::ReloadFile() { if (m_FileName.IsEmpty()) { return FALSE; } OpenFile(m_FileName, FALSE); return TRUE; } //extern "C" __declspec(dllexport) BOOL CSigmaDoc::OpenFile(LPCTSTR lpszFileName, BOOL bMergeFile) { if (!bMergeFile) { if (m_pXy != NULL) { m_pXy->Clear(); } // GdfCloseFile(); } if (m_pXy == NULL) m_pXy = new CXy; // 如果是恢复模式,就用备份的数据和Action替换从文件获取内容 if (m_recoverMode) { if (CSigmaStore::GetInstance().Load(this, lpszFileName)) { return TRUE; } return FALSE; } AfxGetPublicFunction()->EnableJudgeRange(TRUE); if (m_pXy->ReadOtherWithExtension(lpszFileName)) { m_FileName = lpszFileName; return TRUE; } CString path(lpszFileName); m_TempFileName = PreprocessFile(path); if (m_TempFileName.IsEmpty()) { return FALSE; } CFile file; if (file.Open(m_TempFileName, CFile::modeRead)) { m_FileName = lpszFileName; // FIXME: 我们基础库暂时依赖这个来获取要保存的文件名 //AfxGetPublicFunction()->__CurrentSaveFilePath = lpszFileName; CArchive ar(&file, CArchive::load); Serialize(ar); ar.Close(); file.Close(); } if (m_pXy != nullptr) { m_pXy->EnableMeshPackage(m_bEnableMeshPackage); } if (!m_TempFileName.IsEmpty() && m_TempFileName != path) { CFile::Remove(m_TempFileName); m_TempFileName = ""; } return TRUE; } BOOL CSigmaDoc::CreateNew(LPCTSTR fileName) { if (m_pXy == NULL) m_pXy = new CXy; if (m_pXy != NULL) { m_pXy->Clear(); } m_FileName = fileName; return TRUE; } BOOL CSigmaDoc::SaveFile() { return SaveFile(m_FileName); } // 保存文件 BOOL CSigmaDoc::SaveFile(LPCTSTR lpszPathName) { CString newName = lpszPathName; if (newName.IsEmpty()) { if (newName.IsEmpty()) { //newName = m_strTitle; newName = "newFile.kev"; } m_nDocTypeID = DF_FORMAT_ASCII; return false; } else { CString ext = AfxGetPublicFunction()->GetSplitPath(newName, "ext"); if (ext.MakeLower() == _T(".xyz")) { m_nDocTypeID = NFormatType::DF_FORMAT_XYZ; } else if (ext.MakeLower() == _T(".gdbx")) { m_nDocTypeID = NFormatType::DF_FORMAT_GDBX; } else if (ext.MakeLower() == _T(".kml")) { m_nDocTypeID = NFormatType::DF_FORMAT_KML; } else { CDocType* pDocType = PARAM().GetDocType(); m_nDocTypeID = pDocType->GetIndexFromExt(AfxGetPublicFunction()->GetSplitPath(newName, "ext")); m_nDocTypeID = pDocType->GetIDFromIndex(m_nDocTypeID); } } m_FileName = newName; CFile file; if (file.Open(m_FileName, CFile::modeCreate | CFile::modeWrite)) { CArchive ar(&file, CArchive::store); Serialize(ar); ar.Close(); file.Close(); PostProcessFile(m_FileName); m_bModified = false; m_pActionMgr->SavePostion(); return TRUE; } return FALSE; // success } BOOL CSigmaDoc::SaveFile(LPCTSTR lpszPathName, double leftMargin, double rightMargin, double topMargin, double bottomMargin, int paperSizeType, int pdfAHType, int pdfPapertDirectionType) { CString newName = lpszPathName; if (newName.IsEmpty()) { if (newName.IsEmpty()) { newName = "newFile.kev"; } m_nDocTypeID = DF_FORMAT_ASCII; return false; } else { CString ext = AfxGetPublicFunction()->GetSplitPath(newName, "ext"); if (ext.MakeLower() == _T(".xyz")) { m_nDocTypeID = NFormatType::DF_FORMAT_XYZ; } else if (ext.MakeLower() == _T(".gdbx")) { m_nDocTypeID = NFormatType::DF_FORMAT_GDBX; } else if (ext.MakeLower() == _T(".kml")) { m_nDocTypeID = NFormatType::DF_FORMAT_KML; } else { CDocType* pDocType = PARAM().GetDocType(); m_nDocTypeID = pDocType->GetIndexFromExt(AfxGetPublicFunction()->GetSplitPath(newName, "ext")); m_nDocTypeID = pDocType->GetIDFromIndex(m_nDocTypeID); } } m_FileName = newName; CFile file; if (file.Open(m_FileName, CFile::modeCreate | CFile::modeWrite)) { CArchive ar(&file, CArchive::store); Serialize(ar, leftMargin, rightMargin, topMargin, bottomMargin, paperSizeType, pdfAHType, pdfPapertDirectionType); ar.Close(); file.Close(); PostProcessFile(m_FileName); m_bModified = false; m_pActionMgr->SavePostion(); return TRUE; } return FALSE; // success } void CSigmaDoc::SaveActionPosition() { m_bModified = false; m_pActionMgr->SavePostion(); } //extern "C" __declspec(dllexport) //void GdfCloseFile() //{ // if (m_pGdfXy != NULL) // { // delete m_pGdfXy; // m_pGdfXy = NULL; // } //} BOOL CSigmaDoc::GetDrawRange(CRect8& rect) { if (m_pXy->GetCount() == 0) return FALSE; //switch (::GetPreferences().WorkaroundDisplay.m_nRecountRange) switch(0) { default: case 0: { m_pXy->GetRange(rect, FALSE); } break; case 1: { m_pXy->GetRange(rect, FALSE); } break; } m_pXy->m_range = rect; return TRUE; } void CSigmaDoc::Invalidate() { this->EnableRedraw(true); // 暂时在C#端控制 //((CSigmaView*)this->GetView())->OnDrawMem(); //((CSigmaView*)this->GetView())->OnDrawDC(); //UpdateAllViews(NULL, HINT_UPDATE_VIEW, NULL); // ***MFC的方法。重点方法。需要找到实现替换此函数的函数。 //InvalidateEagleEye(); } void CSigmaDoc::OnDraw(CXyDC & dc) { if (m_pXy == NULL) { return; } //TRACE(_T("CDrawDoc::OnDraw(CXyDC&),count=%ld\n"), m_pXy->GetCount()); //BeginProgress(0); m_pXy->Draw(dc, false); //EndProgress(); } void CSigmaDoc::DrawHandle(double x, double y, DWORD nDrawMode, CDC* pDC) { CPoint pt = GetDC().GetScreen(x, y); CRect rt(pt, pt); //CSize sz = GetHandleSize(); CSize sz(8, 8); sz.cx /= 2; sz.cy /= 2; rt.InflateRect(sz); //m_Tracker.DrawHandle(GetDC().GetDC(), rt, nDrawMode); m_pDrawer->Draw(pDC, rt, nDrawMode); } CSize CSigmaDoc::GetHandleSize(void) { return CSize(2, 2); } std::vector CSigmaDoc::GetSelectedItems(const CPoint2D& point) { CRect8 r = GetSelectedRect(point); CPositionList select; std::vector result; GetDraw()->IsInRange(r, select, FALSE); CListForEach(pos, select) { POSITION pt = select.GetAt(pos); COne *pOne = m_pXy->GetAt(pt); if (pOne->IsView() && (!pOne->GetLayer()->IsNotViewNotEdit())) { result.push_back(pt); } } return result; } //当pos==NULL时,选择该点处的第一个元素,当不为空时,选择该位置处的下一个元素 POSITION CSigmaDoc::GetNextSelectedItem(const CPoint2D& point, POSITION pos) { if (pos == NULL) return GetSelectedItem(point); CRect8 r = GetSelectedRect(point); CPositionList select; //当只为一个时返回 //这一行不能注释,究其原因,我猜测是调用方有时候会给第一个 pos 传递一个脏数据 if (GetDraw()->IsInRange(r, select) == 1) { return select.GetTail(); } else if (select.GetCount() > 0) { POSITION ps = select.Find(pos); if (ps == NULL) { return NULL; } if (ps == select.GetHeadPosition()) { ps = select.GetTailPosition(); } else { select.GetPrev(ps); } return select.GetAt(ps); } return NULL; } POSITION CSigmaDoc::GetSelectedItem(const CPoint2D& point) { CXy *pDraw = GetDraw(); if (pDraw == NULL)return NULL; POSITION p = NULL; CRect8 r = GetSelectedRect(point); p = pDraw->IsInRange(r); return p; } CRect8 CSigmaDoc::GetSelectedRect(const CPoint2D& point) { CRect8 r(point.x0, point.y0, point.x0, point.y0); CSize8 sz = GetSelectSize(); CXyDC & dc = GetDC(); double sx = dc.GetRealWidth(sz.cx); //double sx = sz.cx; double sy = fabs(dc.GetRealHeight(sz.cy)); //double sy = sz.cy; r.InflateRect(sx, sy); return r; } void CSigmaDoc::InvalidateDelete(CPositionList& list) { MoveSelect = NULL;//fbw this->EnableRedraw(true); //UpdateAllViews(NULL, HINT_DELETE_SELECTION, &list); } CSize8 CSigmaDoc::GetSelectSize(void) { //double w = ::GetPreferences().Workaround.m_lSelectWidth; double w = 8.0; w *= 0.5; return CSize8(w, w); } CXyDC& CSigmaDoc::GetDC(void) { //return m_zoom; return m_xyDC; } void CSigmaDoc::SetDC(CXyDC& xydc) { m_xyDC = xydc; } void CSigmaDoc::SetCDC(CDC * pDC) { m_xyDC.Create(pDC); } CDC * CSigmaDoc::GetCDC() { return m_xyDC.GetDC(); } void CSigmaDoc::ClearSelection(void) { if (GetItemType() == ITEM_SELECT) GetSelectItem()->CancelSelection(); } void CSigmaDoc::InvalidateSelection(CPositionList& list) { this->EnableRedraw(true); //UpdateAllViews(NULL, HINT_UPDATE_SELECTION, &list); } CSigmaView * CSigmaDoc::GetView(void) { return m_pView; } void CSigmaDoc::SetView(CSigmaView * pActiveView) { m_pView = pActiveView; this->mBackColor = pActiveView->mBackColor; m_pItemView->m_BackColor = this->mBackColor; m_pItemPrint->m_BackColor = this->mBackColor;; } void CSigmaDoc::SetBackColor(COLORREF color) { this->mBackColor = color; m_pItemView->m_BackColor = this->mBackColor; m_pItemPrint->m_BackColor = this->mBackColor; CItem* pItem = this->GetItem(); if (pItem != nullptr) { pItem->m_BackColor = this->mBackColor; } } void CSigmaDoc::Invalidate(POSITION pos) { if (pos == NULL) return; this->EnableRedraw(true); //UpdateAllViews(NULL, HINT_UPDATE_POSITION, (CObject*)pos); //COne* pOne=(COne*)GetDraw()->GetAt(pos); //Invalidate(pOne); } int CSigmaDoc::Undo() { return m_pActionMgr->Undo(); } int CSigmaDoc::Redo() { return m_pActionMgr->Redo(); } bool CSigmaDoc::CanUndo() { return m_pActionMgr->CanUndo(); } bool CSigmaDoc::CanRedo() { return m_pActionMgr->CanRedo(); } int CSigmaDoc::GetItemType(void) { if (GetItem()) return GetItem()->GetType(); return 0; } NItem::CItemSelect * CSigmaDoc::GetLastSelectItem(void) { CItemSelect *result = new CItemSelect(this); CItemSelect *itemSelect = GetSelectItem(); result->SelectWithinRect(itemSelect->m_lastRect, FALSE); return result; } CItemSelect * CSigmaDoc::GetSelectItem(void) { if (GetItem() == NULL) return NULL; if (GetItem()->GetType() != ITEM_SELECT) return NULL; return (CItemSelect*)GetItem(); } BOOL CSigmaDoc::GetElementRect(POSITION pos, CRect8& range) { if (pos == NULL) return FALSE; range = GetDraw()->GetAt(pos)->GetRect(); return TRUE; } void CSigmaDoc::SetActionItem(CActionItem* pAction, bool bDo/*=true*/) { if (pAction == nullptr) { return; } m_pLastAction = nullptr; m_pActionMgr->SetLastAction(pAction); m_pLastAction = pAction; if (bDo) m_pLastAction->Do(); CSigmaStore::GetInstance().Save(this); } CItem * CSigmaDoc::GetItem(void) { return m_pItem.get(); } void CSigmaDoc::DeleteItem(void) { //CItemSelect * select = GetSelectItem(); //if (select != 0) //{ // m_selectionSet.RemoveAll(); // m_selectionSet.AddTail(&select->m_selection); //} if (GetSelectItem()) GetSelectItem()->CancelSelection(); m_pItem.reset(); } void CSigmaDoc::SetItem(CItem* pItem) { if (GetSelectItem()) GetSelectItem()->CancelSelection(); m_pItem.reset(pItem); //CMainFrame* pmf = (CMainFrame*)GetMainFrame(); //if (pmf) //pmf->UpdatePropertyGridContent(pItem); } CItem* CSigmaDoc::FindItem(int nType) { CItem* pit = NULL; switch (nType) { case ITEM_ERASER: pit = new CItemEraser(this); break; //橡皮 case ITEM_HYPERLINK: break; //超级联接 case ITEM_SELECT://元素选择 pit = new CItemSelect(this); break; case ITEM_RECTANGLE://画矩形 pit = new CItemRectangle(this); break; case ITEM_ELLIPSE://画椭圆 pit = new CItemEllipse(this); break; case ITEM_CIRCLE://画圆 pit = new CItemCircle(this); break; case ITEM_CURVE://画曲线 pit = new CItemCurveMerge(this); break; case ITEM_LINK_CURVE: pit = new CItemLinkCurve(this); break; //连接曲线 case ITEM_SOLID: pit = new CItemSolid(this); break; //填充区域,交点填充 case ITEM_SOLID_LINK: pit = new NItem::CItemSolidLink(this); break; //连接曲线形成填充区域 case ITEM_SOLID_AUTO: pit = new CItemSolidAuto(this); break; //自动充填 case ITEM_BREAK_CURVE://打断曲线 pit = new CItemBreakCurve(this); break; case ITEM_BREAK_CURVE_DIRECT: pit = new CItemBreakCurveDirect(this); break; //case ITEM_IMAGE_TRACE: pit = new CItemImageTrace(this); break; //矢量化 case ITEM_EXTEND_CURVE: pit = new CItemExtendCurve(this); break; case ITEM_TRIM_CURVE: pit = new CItemTrimCurve(this); break; case ITEM_PROPORTION: //比例尺 pit = new CItemProportion(this); break; case ITEM_COPY_AS_IMAGE: pit = new CItemCopyAsImage(this); break; case ITEM_COPY_AS_IMAGE_EX: pit = new CItemCopyAsImageEx(this); break; case ITEM_COPY_AS_IMAGE_POLYGON: pit = new CItemCopyAsImagePolygon(this); break; //case ITEM_LINK_POINT: pit = new CItemLinkPoint(this); break; //连接点成曲线 //case ITEM_CURVE_EDIT: pit = new CItemCurveEditDeleteMulNodes(this); break;//曲线编辑//pit=new CItemCurveEdit(this); //case ITEM_PUT_INTO_CURVE: pit = new CItemPutIntoCurve(this); break; //内插曲线 //case ITEM_2POINT_TO_RECT: pit = new CItem2PointToRect(this); break; //连接两点成矩形 //case ITEM_3POINT_TO_RGN: pit = new CItem3PointToRect(this); break; //连接三点成四边形 case ITEM_ARC://画弧、弦、饼 pit = new CItemArc(this); break; case ITEM_EQUILATERAL://等边多边形 pit = new CItemEquilateral(this); break; //case ITEM_IMAGE: pit = new CItemFileImage(this); break; //图像 //case ITEM_MATRIX_MARK: pit = new CItemMatrixMark(this); break; //矩阵符号 //case ITEM_INSERT_DRAW: pit = new CItemInsertDraw(this); break; //插入符号 //case ITEM_SECTION: pit = new CItemSection(this); break; //Section剖面 //case ITEM_MXN: pit = new CItemFileMxn(this); break; //MXN类数据 //case ITEM_POINT_EDIT: pit = new CItemPointEdit(this); break; //点编辑 case ITEM_POINT://点增加 pit = new CItemPointAdd(this); break; case ITEM_WELL_GROUP: pit = new CItemWellGroup(this); break; case ITEM_WELL_GROUP_EDIT: pit = new CItemWellGroupEdit(this); break; case ITEM_WELL_BRANCH_CURVE_EDIT: pit = new CItemBranchCurveEdit(this, m_selectionSet); break; case ITEM_TEXT://文本 pit = new CItemText(this); break; case ITEM_MESH: pit = new CItemMesh(this); break; //3DMESH ////case ITEM_DONUT: pit=new CItemDonut(this); break; //厚度圆 case ITEM_GRID://方里网 pit = new CItemEditGrid(this); break; //case ITEM_NET: pit = new CItemEditNet(this); break; //经纬度网 //case ITEM_FRAME: pit = new CItemEditFrame(this); break; //边框 //case ITEM_SCALE_OBJECT: pit = new CItemScaleObjects(this); break; //放缩元素 case ITEM_SAVE_TO_MARK: pit = new CItemSaveToMark(this); break; //保存为符号 case ITEM_DELETE: //删除 pit = new CItemDelete(this); break; //case ITEM_FIND: pit = new CItemFind(this); break; case ITEM_POINT_PROCESS: pit = new CItemPointProcess(this); break; case ITEM_CURVE_PROCESS: pit = new CItemCurveProcess(this); break; case ITEM_ALIGN: pit = new CItemAlign(this); break; //case ITEM_TEXT_EDIT: pit = new CItemTextMulEdit(this); break; //case ITEM_SELECT_GOTO: pit = new CItemSelectGoto(this); break; //case ITEM_CALIBRATE: pit = new CItemCalibrate(this); break; //case ITEM_OLE: pit = new CItemOle(this); break; //OLE元素 //case ITEM_INSERT_TABLE: pit = new CItemInsertTable(this); break; //插入表格 //case ITEM_SCALE_RULER: pit = new CItemScaleRuler(this); break; //case ITEM_CROSSPOINT_EDIT: pit = new CItemPointCrossEdit(this); break; case ITEM_CROSSPOINT: pit = new CItemPointCrossAdd(this); break; //case ITEM_ADD_WELL: pit = new CItemAddWell(this); break; //插入井对象 //case ITEM_WELL: pit = new CItemWell(this); break; //编辑井 //case ITEM_BLOCK: pit = new CItemBlock(this); break; //case ITEM_SCATTER: pit = new CItemChart(this,CCrossChart::scatter); break; //增加图表对象 //case ITEM_OILWATER: pit = new CItemChart(this,CCrossChart::oilwater); break; //选中图表对象 //case ITEM_HISTORGRAM: pit = new CItemChart(this,CCrossChart::histogram); break; //case ITEM_RTPORLOG: pit = new CItemChart(this,CCrossChart::rtporlog); break; //case ITEM_RWASP: pit = new CItemChart(this,CCrossChart::rwaspcross); break; //case ITEM_CROSS: pit = new CItemChart(this,CCrossChart::cross); break; //case ITEM_LIGASCROSS: pit = new CItemChart(this,CCrossChart::ligascross); break; //case ITEM_REGIONSELECT: pit = new CItemRegionSelect(this); break; //case ITEM_ADD_FACIES: pit = new CItemFacies(this); break; //case ITEM_WELLDATAGRAPH: pit = new CItemWellDataGraph(this); break; //case ITEM_CHARTEX: pit = new CItemChartEx(this); break; //case ITEM_CHARTEX_EDIT: pit = new CItemChartExEdit(this); break; //case ITEM_INSERT_LABEL_RECT: // pit = new CItemLabelRect(this); break; //case ITEM_LABEL_RECT_EDIT: // pit = new CItemLabelRect(this); break; //case ITEM_INSERT_FAULTLINE: pit = new CItemInsertFaultLine(this); break; case ITEM_CUT_IN: pit = new CItemCutIn(this); break; case ITEM_CUT_OUT: pit = new CItemCutOut(this); break; case ITEM_CURVE_EDIT: pit = new CItemCurveEditDeleteMulNodes(this, m_selectionSet); //TODO:测试 break; case ITEM_CURVE_INNAME: pit = new CItemEditCurveInName(this); break; case DOUBLEFOX_MESH: pit = new CItemMesh(this); break; case ITEM_SET_CONTOUR_NAME: pit = new CItemSetContourName(this); break; case ITEM_MEASURE: pit = new CItemMeasure(this); break; } if (pit != nullptr) { pit->m_BackColor = this->mBackColor; } return pit; } //QTransformTracker& CSigmaDoc::GetTracker(void) //{ // return m_Tracker; //} void CSigmaDoc::DrawItem(CXyDC& dc, int nModeX, int nModeY) { if (GetItem()) GetItem()->OnDraw(&dc); } void CSigmaDoc::ClearSelectionSet() { m_selectionSet.RemoveAll(); } void CSigmaDoc::AddToSelectionSet(POSITION pos) { m_selectionSet.AddTail(pos); } void CSigmaDoc::ReplaceSelectionSet(CPositionList & positionList) { m_selectionSet.RemoveAll(); m_selectionSet.AddTail(&positionList); } void CSigmaDoc::GetSelectionSet(CPositionList & positionListOut) { positionListOut.RemoveAll(); positionListOut.AddTail(&m_selectionSet); } bool CSigmaDoc::IsEmptySelectionSet() { return m_selectionSet.IsEmpty(); } CRect8 CSigmaDoc::GetRectOfSelectedSet() { CRect8 rect(0, 0, 0, 0); if (m_selectionSet.IsEmpty()) return rect; COne* pOne; rect.SetRect(1e100, -1e100, -1e100, 1e100); POSITION pos, pt; pos = m_selectionSet.GetHeadPosition(); while (pos != NULL) { pt = m_selectionSet.GetNext(pos); pOne = (COne*)GetDraw()->GetAt(pt); pOne->GetRange(rect); } return rect; } CRect8 CSigmaDoc::GetRectOfLastSelected() { CRect8 rect(0, 0, 0, 0); if (m_selectionSet.IsEmpty()) return rect; POSITION pos = m_selectionSet.GetTailPosition(); if (pos == nullptr) { return rect; } POSITION pt = m_selectionSet.GetAt(pos); COne* pOne = (COne*)GetDraw()->GetAt(pt); pOne->GetRange(rect); TRACE("top: %f, left, %f, bottom: %f, right: %f\n", rect.top, rect.left, rect.bottom, rect.right); return rect; } CFindReplacement * CSigmaDoc::GetFindReplacement() { return m_pFindReplacement.get(); } void CSigmaDoc::SetSelection(CPositionList& list) { if (GetItemType() != ITEM_SELECT) this->SetItem(FindItem(ITEM_SELECT)); GetSelectItem()->Select(list); } void CSigmaDoc::InsertParameterPair(CString & key, CString & value) { m_parametersMap[key] = value; } bool CSigmaDoc::GetParameter(CString & key, CString & valueOut) { auto ite = m_parametersMap.find(key); if (ite == m_parametersMap.end()) return false; valueOut = ite->second; return true; } void CSigmaDoc::Modified(BOOL isModified) { m_bModified = isModified; } bool CSigmaDoc::IsModified() { if (m_bModified) { return true; } return m_pActionMgr->IsModified(); } bool CSigmaDoc::IsCapturedScreen() { return m_bCapture; } void CSigmaDoc::SetCapturedScreenStatus(bool bCapture) { m_bCapture = bCapture; } //获得在屏幕坐标系下图纸的宽高 void CSigmaDoc::GetDrawingWithAndHeightInScreen(int & widthOut, int & heightOut) { widthOut = heightOut = 0; //获得总图的毫米长度 CRect8 rect(1e100, -1e100, -1e100, 1e100); GetDrawRange(rect); //widthOut = GetDC().GetScreenWidth8(rect.Width()) * GetDC().UnitX; //heightOut = GetDC().GetScreenHeight8(rect.Height()) * GetDC().UnitY; widthOut = GetDC().GetScreenWidth8(rect.Width()); heightOut = GetDC().GetScreenHeight8(rect.Height()); widthOut = fabs(widthOut); heightOut = fabs(heightOut); } void CSigmaDoc::SetSelection(POSITION pos) { if (pos == NULL) return; CPositionList list; list.AddHead(pos); SetSelection(list); } void CSigmaDoc::SaveRawFile() { // 注意: 打开文件之后,必须首先存储一下原始图件 // 否则如果全部放到设置 action 那里,由于 Action 有的操作被封装在了 Do 中,有的是在 Action 之前其它代码执行,会导致存储为一个已经修改过后的图件 CSplitPath sp(""); CString path = sp.GetAbsolutePath(m_FileName); CSigmaStore::GetInstance().Clear(path); // 必须清理,否则有可能存在原始图件数据而不保存 CSigmaStore::GetInstance().Save(this); } void CSigmaDoc::EnableRecoverMode(bool enable) { m_recoverMode = enable; } bool CSigmaDoc::IsSnapEnabled() const { return m_snapEnabled; } void CSigmaDoc::EnableSnap(bool enable) { m_snapEnabled = enable; } CString CSigmaDoc::GetElementTypeString(POSITION pSelect) { CString str = _T(""); if (pSelect == NULL || !::AfxIsValidAddress(pSelect, sizeof(POSITION))) return str; CStringManager stringManager; CXy *pDraw = GetDraw(); switch (pDraw->GetElementType(pSelect)) { case DOUBLEFOX_CURVE: str = stringManager.GetStringByIDS("IDS_STRING_CURVE"); break; case DOUBLEFOX_TEXT: str = stringManager.GetStringByIDS("IDS_STRING_Text"); break; case DOUBLEFOX_ELLIPSE: case DOUBLEFOX_CIRCLE: str = stringManager.GetStringByIDS("IDS_STRING_Circle"); break; case DOUBLEFOX_IMAGE: str = stringManager.GetStringByIDS("IDS_STRING_Image"); break; case DOUBLEFOX_WMF: str = stringManager.GetStringByIDS("IDS_STRING_WMF"); break; case DOUBLEFOX_PROPORTION: str = stringManager.GetStringByIDS("IDS_STRING_Proportion"); break; case DOUBLEFOX_DRAW_RECT: str = stringManager.GetStringByIDS("IDS_STRING_DrawRect"); break; case DOUBLEFOX_INSERT: case DOUBLEFOX_DRAW: str = stringManager.GetStringByIDS("IDS_STRING_Draw"); break; case DOUBLEFOX_MESH: str = stringManager.GetStringByIDS("IDS_STRING_MESH"); break; case DOUBLEFOX_XYZ: str = stringManager.GetStringByIDS("IDS_STRING_XYZ"); break; case DOUBLEFOX_POINT: str = stringManager.GetStringByIDS("IDS_STRING_Point"); break; case DOUBLEFOX_FRAME: str = stringManager.GetStringByIDS("IDS_STRING_Frame"); break; case DOUBLEFOX_MXN: str = stringManager.GetStringByIDS("IDS_STRING_MXN"); break; case DOUBLEFOX_GRID: str = stringManager.GetStringByIDS("IDS_STRING_GRID"); break; case DOUBLEFOX_NET: str = stringManager.GetStringByIDS("IDS_STRING_NET"); break; default: str = stringManager.GetStringByIDS("IDS_STRING_Other"); break; } return str; } void CSigmaDoc::PushActionDC(UINT nTypeID) { PushDC(); } void CSigmaDoc::PushDC(void) { CXyDC *pDC = new CXyDC; *pDC = GetDC(); if (!IsPreview()) ZoomStack.Push(pDC, DOUBLEFOX_XYDC); else ZoomStackPreview.Push(pDC, DOUBLEFOX_XYDC); } void CSigmaDoc::EnablePreview(bool bEnable) { m_bIsPreview = bEnable; } BOOL CSigmaDoc::IsPreview(void) { return m_bIsPreview; } int CSigmaDoc::GetZoomStackCount(void) { if (!IsPreview()) return ZoomStack.GetCount(); else return ZoomStackPreview.GetCount(); } void CSigmaDoc::PopDC(void) { COne* pOne = NULL; if (!IsPreview()) pOne = ZoomStack.Pop(); else pOne = ZoomStackPreview.Pop(); if (pOne == NULL)return; SetDC(*((CXyDC*)(pOne->GetValue()))); delete pOne; } static CString ElementStringToXml(const CString& base, const CString& details) { TiXmlDocument doc; auto* rootElement = new TiXmlElement("root"); auto* baseElement = new TiXmlElement("base"); auto* detailsElement = new TiXmlElement("detail"); baseElement->LinkEndChild(new TiXmlText(base)); detailsElement->LinkEndChild(new TiXmlText(details)); rootElement->LinkEndChild(baseElement); rootElement->LinkEndChild(detailsElement); doc.LinkEndChild(rootElement); TiXmlPrinter printer; doc.Accept(&printer); return CString(printer.CStr()); } CString CSigmaDoc::GetElementString(POSITION pSelect, CPoint2D* pPoint) { CString str, string, detailString; if (pSelect == NULL || !::AfxIsValidAddress(pSelect, sizeof(POSITION))) { //string.LoadString(IDS_STRING_DoubleFox); //return string; return ""; } CXy *pDraw = GetDraw(); CLayer* pLayer = pDraw->GetElementLayer(pSelect); CString layerName; if (pLayer != nullptr) { layerName = pLayer->GetPathName(); } switch (pDraw->GetElementType(pSelect)) { case DOUBLEFOX_CURVE_STATION: case DOUBLEFOX_TV: case DOUBLEFOX_CURVE: { CCurveEx* curve; curve = (CCurveEx*)pDraw->GetAtValue(pSelect); if (curve == NULL)break; if (curve->name == NULL) //string.Format("Type=Pline,Name=,area=%lf,Length=%lf", curve->Area(), curve->Length()); //string.Format("线:"); ; else string.Format("%s", curve->name); detailString.Format("图层: %s, 名称: %s, 长度=%lf, 面积=%lf", layerName, curve->name, curve->Length(), curve->Area()); } break; case DOUBLEFOX_TEXT: /*string.Format("Type=文本,Name=%s", ((CText*)pDraw->GetAtValue(pSelect))->GetName());*/ string.Format("文本:%s", ((CText*)pDraw->GetAtValue(pSelect))->GetName()); detailString.Format("图层: %s, 文本: %s", layerName, ((CText*)pDraw->GetAtValue(pSelect))->GetName()); break; case DOUBLEFOX_ELLIPSE: case DOUBLEFOX_CIRCLE://Format("Circle(圆)"); //string = "Type=圆"; { string = "圆"; CCircle* pCircle = (CCircle*)pDraw->GetAtValue(pSelect); detailString.Format("图层: %s, 圆心: %lf, %lf, 半径: %lf", layerName, pCircle->x0, pCircle->y0, pCircle->GetRadius()); } break; case DOUBLEFOX_IMAGE: // string.Format("Type=图像,Name=%s", ((CImageInsert*)pDraw->GetAtValue(pSelect))->GetName()); string.Format("图像:%s", ((CImageInsert*)pDraw->GetAtValue(pSelect))->GetName()); if (pPoint) { CPoint pt = ((CImageInsert*)pDraw->GetAtValue(pSelect))->RealToImagePoint(pPoint->x0, pPoint->y0); if (((CImageInsert*)pDraw->GetAtValue(pSelect))->GetImage()) { COLORREF col = ((CImageInsert*)pDraw->GetAtValue(pSelect))->GetImage()->GetPixel(pt.x, pt.y); str.Format(",RGB=(%ld,%ld,%ld)", GetRValue(col), GetGValue(col), GetBValue(col)); string += str; } detailString.Format("图层: %s, %s", layerName, string); } break; case DOUBLEFOX_PROPORTION://Format("Proportion(线段比例尺)"); //string = "Type=比例尺"; string = "比例尺"; detailString.Format("图层: %s, %s", layerName, string); break; case DOUBLEFOX_DRAW_RECT://Format("Rect(矩形阵列新实体)"); //string = "Type=矩阵符号"; string = "矩阵符号"; detailString.Format("图层: %s, %s", layerName, string); break; case DOUBLEFOX_STATION: case DOUBLEFOX_DRAW: case DOUBLEFOX_INSERT: //string.Format("Type=符号,Name=%s", ((CInsertDraw*)pDraw->GetAtValue(pSelect))->GetName()); string.Format("符号:%s", ((CInsertDraw*)pDraw->GetAtValue(pSelect))->GetName()); detailString.Format("图层: %s, %s", layerName, string); break; case DOUBLEFOX_MESH://Format("Mesh(3DMESH实体)");//string = "Type=曲面"; { double v = ((CMesh*)pDraw->GetAtValue(pSelect))->GetValue(pPoint->x0, pPoint->y0); if (fabs(v) < 1e9) AfxGetPublicFunction()->FloatToString(string, v, 6); else string.Format("%.4e", v); detailString.Format("图层: %s, %s", layerName, string); } break; case DOUBLEFOX_XYZ: case DOUBLEFOX_POINT: { CPointNameEx* cp; cp = (CPointNameEx*)pDraw->GetAtValue(pSelect); //str.LoadString(IDS_STRING_Point); //string.Format("Type=点,Name=%s", cp->GetName()); string.Format("%s", cp->GetName()); //if (cp->IsXYZ()) //{ // CPointXyz* pp = (CPointXyz*)cp; // if (pp->m_pXyzValue) // { // char sss[256]; // AfxGetPublicFunction()->FloatToString(sss, pp->m_pXyzValue[0], 10); // string += ",Z=" + CString(sss); // } //} detailString.Format("图层: %s, %s", layerName, string); } break; case DOUBLEFOX_FRAME: //string = "Type=边框"; string = "边框"; detailString.Format("图层: %s, %s", layerName, string); break; case DOUBLEFOX_MXN: //string.Format("Type=矩阵数据,Name=%s", ((CMxn*)pDraw->GetAtValue(pSelect))->GetName()); string.Format("矩阵数据:%s", ((CMxn*)pDraw->GetAtValue(pSelect))->GetName()); detailString.Format("图层: %s, %s", layerName, string); break; case DOUBLEFOX_GRID: //string = "Type=直角网"; string = "直角网"; detailString.Format("图层: %s, %s", layerName, string); break; case DOUBLEFOX_NET: string = "Type=经纬网"; string = "经纬网"; detailString.Format("图层: %s, %s", layerName, string); break; case DOUBLEFOX_WMF: // string = "Type=元文件"; string = "图元文件"; detailString.Format("图层: %s, %s", layerName, string); break; default: // Format("Other(其他图形元素)"); // string = "Type=其他图形元素"; string = "其他图形元素"; detailString.Format("图层: %s, %s", layerName, string); break; } //str.Format("Layer=%s,%s", ((CLayer*)pDraw->GetElementLayer(pSelect))->GetPathName(), string); //str.Format("Layer=%s,%s", ((CLayer*)pDraw->GetElementLayer(pSelect))->GetPathName(), string); return ElementStringToXml(string, detailString); } CString CSigmaDoc::GetSelectedElementLayer(CPositionList& list) { CString layer = _T(""); CString txt; POSITION pos, pt; pos = list.GetHeadPosition(); while (pos) { pt = list.GetNext(pos); txt = GetDraw()->GetElementLayer(pt)->GetPathName(); if (layer.Find(txt) < 0) { if (!layer.IsEmpty()) layer += _T(";"); layer += txt; } } return layer; } BOOL CSigmaDoc::VerifyPassword(CXy* pxy) { if (pxy->GetFileEncrypt() == NULL) return TRUE; if (!pxy->IsEncrypted()) return TRUE; // no password to check while (TRUE) { //CDlgPasswordRetrieve dlg; //if (IDOK == dlg.DoModal()) //{ // if (pxy->GetFileEncrypt()->VerifyPassword(dlg.GetPassword())) // return TRUE; // else if (::AfxMessageBox(IDS_ENABLE_ENCRYPTION, MB_YESNO) == IDNO) // break; //} //else // break; // user cancelled } return FALSE; } int CSigmaDoc::SerializeRead(CXy* pxy, CArchive& ar) { if (pxy == NULL) return 0; TRY { pxy->m_version = pxy->DFB_ReadVersion(ar); pxy->DFB_ReadEncrypt(ar, pxy->m_version); if (pxy->IsEncrypted()) { if (!VerifyPassword(pxy)) return 0; } pxy->DFB_Serialize(ar, pxy->m_version); } CATCH_ALL(e) { THROW_LAST(); return 0; } END_CATCH_ALL return 1; } int CSigmaDoc::SerializeRead(CXy* pxy, CString strInput) { int rt = 0; CFileMapping fm; CString mapName = fm.CreateMappingName(strInput); if (fm.Open(strInput, mapName)) { CMemFile mf((BYTE*)fm.GetData(), (UINT)fm.GetMappingSize()); CArchive ar((CFile*)&mf, CArchive::load | CArchive::bNoFlushOnDelete); rt = SerializeRead(pxy, ar); ar.Close(); mf.Close(); fm.CloseAll(); } else { CFile file; if (!file.Open(strInput, CFile::modeRead | CFile::shareDenyWrite)) return 0; CArchive ar(&file, CArchive::load | CArchive::bNoFlushOnDelete); rt = SerializeRead(pxy, ar); ar.Close(); file.Close(); } return rt; } CItem* CSigmaDoc::GetOtherItem(void) { return m_pOtherItem.get(); } void CSigmaDoc::ClearItems(void) { DeleteItem(); DeleteOtherItem(); } void CSigmaDoc::DeleteOtherItem(void) { /*CMainFrame* pmf = (CMainFrame*)GetMainFrame(); if (pmf) pmf->SetFocus();*/ if (GetSelectItem()) GetSelectItem()->CancelSelection(); if (m_pOtherItem) m_pOtherItem.reset(); /*if (pmf) pmf->UpdatePropertyGridContent(NULL);*/ } BOOL CSigmaDoc::SetDefaultCursor(void) { /*CItemView* itemView = new CItemView(); if (itemView->IsViewState()) return CDrawDoc::SetDefaultCursor(); if (GetItem()) return GetItem()->OnSetCursor(NULL, HTCLIENT, 0);*/ return FALSE; } void CSigmaDoc::SetStatusOfCrossPoint(int status) { m_crossPointStatus = status; } int CSigmaDoc::GetStatusOfCrossPoint() { return m_crossPointStatus; } int CSigmaDoc::GetEditLineStatus() { return this->m_EditLineState; } void CSigmaDoc::SetEditLineStatus(int status) { this->m_EditLineState = status; } NAction::CActionManager* CSigmaDoc::GetActionManager() { return m_pActionMgr.get(); }