// Medium.h: interface for the CMedium class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_MEDIUM_H__5A7AB0BF_F8BE_42FE_963D_B1EFAAD3055E__INCLUDED_) #define AFX_MEDIUM_H__5A7AB0BF_F8BE_42FE_963D_B1EFAAD3055E__INCLUDED_ #include "stdafx.h" #include "geomative.h" #include "SptRecord.h" #include "RSP2DTdRecord.h" #include "SptPtSort.h" #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CSptRecord; typedef struct tagSTInt2KeyInfo { int iKey1; int iKey2; tagSTInt2KeyInfo() { iKey1 = 0; iKey2 = 0; } bool operator <(const struct tagSTInt2KeyInfo& Obj) const { if (iKey1 < Obj.iKey1) { return true; } else if(iKey1 == Obj.iKey1) { if (iKey2 < Obj.iKey2) { return true; } } return false; } }STInt2KeyInfo; enum EN_SPT_RUN_METHOD { EnSptRunByDisorder = 0, EnSptRunByLayer, EnSptRunByRoll }; typedef struct ST_SPT_RECORD_INFO { //int iTsn; //排序后自动分配 BOOL bIsSel; //是否选中 UINT32 uiAElecID; //测点A电极编号 UINT32 uiMElecID; //测点M电极编号 UINT32 uiNElecID; //测点N电极编号 UINT32 uiBElecID; //测点B电极编号 int iPtNum; int iLayer; //层数; COLORREF colorREF; float fK; //K值 int iN; //迭代次数 float fSptXPos; ST_SPT_RECORD_INFO() { memset(this, 0, sizeof(ST_SPT_RECORD_INFO)); } }STSptRecordInfo; class CMedium { public: CMedium(); CMedium(int iAR); virtual ~CMedium(); virtual bool GenerateSptRecElecVal(int iEAmount, int* pMaxLevel, int* pPtAmount, CPtrArray* pSptRecArray) = NULL; //生成脚本记录电极值(iEAmount---in:电极总数,pMaxLevel---in:最大层数,pPtAmount---in:测点总数,pSptRecArray---in:脚本记录数组) virtual void CalculateSptPtLoc(int iMul, CSptRecord* pSptRecord) = NULL; //计算脚本测点位置(iMul---in:倍数,pSptRecord---in:脚本记录) virtual int GenSptRecLevel(int iA, int iB, int iM, int iN) = NULL; //计算脚本记录层数(iA---in:A,iB---in:B,iM---in:M,iN----in:N) virtual int GenSptRecPosInLevel(int iA, int iB, int iM, int iN) = NULL; //计算每层脚本记录位置(iA---in:A,iB---in:B,iM---in:M,iN----in:N) //计算每个点的实际位置,比如有的装置在A/B/M/N之间的中间位置,用于画图中表达的某个点 virtual int GetMaxLevelByEAmount(int iEAmount) = NULL; //通过电极总数取最大层数(iEAmount---in:电极总数) virtual float CalculateCESptKVal(float fA, float fB, float fX, float fY) = NULL; //计算1D脚本K值(fA---in:A,fB---in:B,fM---in:M,fN----in:N) virtual float CalculateDepth(float fA, float fFactor = 0.5); //计算深度(fA---in:A,fFactor---in:深度因子) virtual void CalculateTdPtLoc(const CRect& vRect, const int& iEAmount, int& iMaxLevel, CRect& lRect, int& iSmWidth, int& iSmHeight, CPtrArray* pTdRecArray); virtual void ReSortPoint(CPtrArray *f_ptr); //计算数据测点位置(vRect---in:矩形测点,iEAmount---in:电极总数,iMaxLevel---in:最大层数,lRect---in:测点范围矩形,iSmWidth---in:最小宽度,iSmHeight---in:最小高度,pTdRecArray---in:测点记录数组) virtual void SetParamVal(const void* pVal){return;} virtual void GetParamVal(void *pOutVal){return;} void SetValidPoleInfo(int iStartPole, int iEndPole); virtual void ReSortPoint(CPtrArray *f_ptr, int iRunMethod); virtual void ResirtPointAgainByLevel(CPtrArray *f_ptr); virtual void ClearUniversalLayer(){m_mapUniversalLayer.clear();} virtual bool AddSptToUniLayer(int iA, int iB, int iM, int iN); virtual void AddSptToUniLayerFinish(); virtual int QuerySptLayerFromUni(int iA, int iB, int iM, int iN); virtual int QueryMaxLayerFromUni(){return m_mapUniversalLayer.size();} virtual float GetUniSptXPos(int iA, int iB, int iM, int iN); virtual bool GeneralUniSptInfo(int& iMaxLevel,CPtrArray* pSptRecArr); virtual bool SortMulChannelSpt(CPtrArray* pSptRecArr); int m_iAR; float m_fEOffsetR; float m_fLOffsetR; int m_iStartPole; int m_iEndPole; protected: std::map m_mapUniversalLayer; CSptPtSort m_sortMulChannelSpt; }; #endif // !defined(AFX_MEDIUM_H__5A7AB0BF_F8BE_42FE_963D_B1EFAAD3055E__INCLUDED_)