#pragma once #include "DrawModel/Point2D.h" #include "TrackObj.h" //斜井道基类 class AFX_EXT_CLASS CInclinedTrack : public CTrackObj { protected: //DECLARE_SERIAL(CInclinedTrack); public: CInclinedTrack(); CInclinedTrack(const CRect8& position); virtual ~CInclinedTrack(); CLONE_WELLOBJECT(CInclinedTrack) virtual void operator=(CInclinedTrack& object); protected: virtual void Init(); //初始化参数 public: CCurveEx m_trajectoryLeft; //道左轨迹 CCurveEx m_trajectoryRight; //道右轨迹 //根据输入斜深计算左右边界点 bool GetBorderPoint(double inc_depth, CPoint2D& ptLeft, CPoint2D& ptRight); //根据输入斜深s_depth到e_depth 获取边界散点 bLeftBorder true为左边界 false为右边界 bool GetBorderPoints(double s_depth, double e_depth, vector& pts, bool bLeftBorder); bool GetTrajLocation(void); //获取左右轨迹桩号 //由桩号比例获取左右道边界上的点 bool GetTrajPoint(double lratio, int& leftStart, int& rightStart, CPoint2D& ptLeft, CPoint2D& ptRight); // 由给定桩号比例范围获取计算边界上某一段,得到的左右子边界点数相同,widthRatio为该段宽度占道宽的比例,若>=1,右边界直接从道右边界截取 bool GetCalcBorderSection(double ratio_start, double ratio_end, vector& leftBorder, vector& rightBorder, double widthRatio = 1); //给定起止点桩号,获取包含起止点在内的所有点桩号,factor 为比例系数 int GetLocations(CCurve& curve, double lstart, double lend, list& lstLocs, double factor = 1); // 由给定桩号比例范围获取曲线段上的点,存入vector中 bool GetSubCurvePoints(CCurve& scrCurve, double ratio_start, double ratio_end, vector& vecPoints); //输入桩号和横向比例因子,获取两条曲线间的某点 static bool GetPoint(CCurve& leftCurve, CCurve& rightCurve, double ll, double lr, double wratio, CPoint2D& destPt); double GetDepthInWellTrace(CPoint2D pt); //根据左右井道散点m_borderLeft,m_borderRight和比例因子,获取相应比例处的曲线 bool CreatePolyline(CCurve& destCurve, double ratio); // Implementation public: virtual BOOL IsInRange(CRect8& range);//ggff virtual void CalculateSize(CPoint2D point); virtual void ComputeDisplayTrajectory(); //计算道轨迹 virtual void CalculateLeftBorder(CCurve* pIncurve, double dist); //由给定的曲线生成道左边界 virtual void CalculateRightBorder(CCurve* pIncurve, double dist); //由给定曲线和距离生成道右边界 virtual void DrawTrajectory(CXyDC* pDC); //virtual void DrawTrackHeadLine(CXyDC* pDC, BOOL bFirst=FALSE); //ggff //virtual void DrawTrackHead(CXyDC*pDC); //ggff virtual void MoveTo(CRect8& position); virtual void MoveHandleTo(int nHandle, CPoint2D point); virtual BOOL Intersects(const CRect8& rect, double dHandleSize); virtual void Serialize(CArchive& ar, const short &ver); virtual void Draw(CXyDC* pDC); // 画道背景 virtual void DrawFill(CXyDC* pDC); // 计算道边界 virtual void CalcBorders(); //计算用到的左右边界 CCurveEx m_calcBorderLeft; //同 m_trajectoryLeft区别是,m_trajectoryLeft中的l是桩号,m_calcBorderLeft中的l记载的是深度 CCurveEx m_calcBorderRight; protected: //计算中用到 //计算直线与CCurve的交点,startIndex为起点序号,若无,返回false bool GetCrossPoint(double a, double b, double x0, double y0, CCurve& pCur, int& startIndex, CPoint3D& cpt, double max_dist2); //生成新的曲线 m_verticalPoints坐标在pSub上,顺序与pOrig一一对应 void CreateNewCurve(CCurve& newCur); //提取两点间结点,重置桩号存入vec void CreateSubNewCurve(int& startIndex, dfPoint& pt1, dfPoint& pt2, vector& newPts); //深度转换为计算边界的桩号 double DepthToLocation(double dep); double DepthToLocation(double dep, double locdepFactor); //获取相应比例处的分割曲线 bool CreateSliptterline(CCurve& destCurve, double ratio); //道内元素计算用到的左右边界,两条线具有相同桩号 CCurveEx* m_pOrigBorder; //基准边界 CCurveEx* m_pSubjBorder; //对侧边界 vector m_verticalPoints; //基准边界在对侧边界上对应垂直,CPoint3D 存储 x,y,lsub, lorig vector m_CurveRightPtVec, m_CurveLeftPtVec; //曲线点对应的左右边界点,画杆状图时有用。 int CCurve_GetCoordinate(CCurveEx& curve, double m_location, double& x, double& y, double& z); };