You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kev/Drawer/SSBase/WellPoleLib/InTrackDepthSegment.h

125 lines
5.3 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
class CWellBaseObj;
class AFX_EXT_CLASS CInTrackDepthSegment : public CWellBaseObj
{
public:
CInTrackDepthSegment();
CInTrackDepthSegment(const CRect8& position);
virtual ~CInTrackDepthSegment();
CLONE_WELLOBJECT(CInTrackDepthSegment)
virtual void operator=(CInTrackDepthSegment& object);
public:
double m_fSdep; //顶深
double m_fEdep; //底深
double m_fLeftSpace; //左边空
double m_fRightSpace; //右边空
CString m_strType; //类型
WELLOBJLIST m_BendLeftList; //地层的左侧bend链表,在多井剖面模块中, CWellSection::BuildBendsRelation函数建立层与bend的联系
WELLOBJLIST m_BendRightList;//地层的右侧bend链表
public:
virtual int HitTest(CPoint2D point, double dHandleSize, BOOL bSelected);
virtual void MoveHandleTo(int nHandle, CPoint2D point);
virtual void MoveTo(CRect8& position);
virtual void Serialize(CArchive& ar, const short &ver);
virtual BOOL Intersects(const CRect8& rect, double dHandleSize);
//获取斜井状态下岩性符号对应的左右井边界,供TrackLithObj computedata(),BuidChildObject()调用 2015-10-19
virtual bool CalcInclinedBorder();
virtual BOOL IsTrackChildTopEnd() { return TRUE; };
//void DrawSelectRange(CXyDC *pDC); //绘制选中的区域
virtual void GetSelectRange(std::vector<CPoint2D>& PtsVec);//斜井的道内对象需要得到一个多边形的选中区域
virtual void GetRange(CRect8& range);
virtual CRect8 GetRect(void);
void SetTop(double dep);
void SetBottom(double dep);
void SetDepth(double dep);
void SetRectInTrack(CRect8 TrackRect, LPVOID pWell);
void SetUnViewState();//在多井段情况下,设置是否显示
virtual void SetViewState(int state);
virtual CPoint2D GetHandle(int nHandle);
virtual int GetHandleCount();
CCurveEx& GetLeftBorderCurve() { return m_curveLeft; };
CCurveEx& GetRightBorderCurve() { return m_curveRight; };
double GetHeight(); //获得本数据对象的高度
CPoint2D GetCenterPoint();
protected:
//计算左右边界 bEqualPoints为true表示左右边界点一一对应false则无此对应
bool CalcLeftAndRightBorders(bool bEqualPoints = false);
//由左右两条线生成范围多边形
void LinkPoints(CCurve& outline);
//由左右两条线生成范围多边形,最后一点不闭合
void LinkPoints(CCurve& newPoly, vector<dfPoint>& ptsLeft, vector<dfPoint>& ptsRight);
//根据根据左右井道散点m_borderLeftm_borderRight和左右点处的两个两个比例因子获取闭合多边形.前提是左右边界点相同并一一对应
bool CreatePolygon(CCurve& destCurve, double ratioL, double ratioR);
//根据左右井道散点m_borderLeftm_borderRight和比例因子获取相应比例处的曲线
bool CreatePolyline(CCurve& destCurve, double ratio);
//由深度段左右散点生成原始边界线
bool CreateBorderCurve(void);
void MoveShowRects(double x, double y);
//当前岩性符号对应的左右井道点
vector<dfPoint> m_borderLeft;
vector<dfPoint> m_borderRight;
//原始边界
CCurveEx m_curveLeft;
CCurveEx m_curveRight;
///////////////为了得到最大内部矩形///////////
//由左右两条边界线获取内部最大矩形
void GetMaxRectangle(void);
//由左右两条边界线获取内部最大矩形rect,并得到该矩形的旋转角度angle,矩形中心点ptC
void GetMaxRectangle(CCurve& curveLeft, CCurve& curveRight, CRect8& rect, dfPoint& ptC, double& angle);
//指定中心点和宽获取矩形rect
void CreateRectangle(CPoint2D& ptC, double w, double h, CRect8& rect);
dfPoint m_cPt; // 矩形中心点
CRect8 m_maxRect; // 最大矩形
double m_angle; // 矩形倾角
CCurveEx m_polyCurve; //在斜井状态下,本对象的范围多边形(首尾的点不重合)
std::vector<CRect8> m_ShowRectsVec; //在直井多井段的情况下,这个结构用来保存深度段数据对象的显示矩形,因为有时有的深度段数据会被井段分为多个不同部分.
void SetTopBottomDepth(CRect8 rect);
BOOL GetMaxShowRect(CRect8& showrect); //对于某些分为几段显示的数据对象,挑出一个最大的现实矩形
public:
virtual int ReadPCG_SelfData(CKXmlParse& xp, const short& ver , CTrackObj* pTrack) { return 0; };
virtual void WritePCG_SelfData(CFile &fw, int nBaseTabNum) {};
public:
VARINTARR *m_pRowData; //该道内对象对应的数据条
int m_dataRowID; //对于二维表数据生成的道内数据对象对应的数据行ID(注意这个ID不是数据库中的数据ID只是用来标识当前道内数据对象与井管理的数据中的对应关系)
virtual void SetObjDataToRow(VARINTARR*pRow) {}; //将本对象的数据设置到对应的数据行中(主要是顶底深)
virtual void RecieveTopBottomChange(CWellBaseObj* pChangeObj, double top, double bottom);
virtual CString GetLayerName() { return ""; }
protected:
/*pMarkXy是初始符号
markRange是符号本身的范围一般是-0.5,0.5,0.5,-0.5)
drawRect是符号在其矩形范围内应该绘制的范围比例比如一个符号不一定占据整个符号区域可能在其区域的中心点尺寸小一半等等
*/
void transformMarkForIncliendTrack(CXy* pMarkXy,CCurveEx& leftBorder,CCurveEx& rightBorder,CRect8 markRange,CRect8 drawRect,CXy*& pIncliendMark);
CPoint2D getDepthMarkPoint(double x, double y, CRect8& markRange, double sDep, double eDep, CRect8& drawRect);/*返回的点中包含x0是点距离左道边界的比例y0是深度是数据转换的中间点数据*/
CPoint2D getMarkPointInTrack(CPoint2D midPoint); //使用上一个函数获得中间数据点转换为最终的井道内点
void getPtsFromMidMarkPoint(std::vector<CPoint2D>& pts,CPoint2D spt,CPoint2D ept );//获得正矩形情况下的直线变形后的点
void transformCurve(CCurveEx* pNew, CCurveEx* pOldCurve, CRect8& markRange, CRect8& drawRect, double sDep, double eDep,BOOL bMorePoint = TRUE);
void transformText(CText* pNew, CText* pOldText, CRect8& markRange, CRect8& drawRect, double sDep, double eDep);
CXy* m_pIncliendMark;
void DrawIncliedMark(CXyDC* pDC);
void DrawIncliedMark(CXyDC* pDC, CXy* pIncliendMark);
};